cli/resources/fine_tuning/subresources/methods/index.md +0 −729 deleted
File Deleted View Diff
1# Methods
2
3## Domain Types
4
5### Dpo Hyperparameters
6
7- `dpo_hyperparameters: object { batch_size, beta, learning_rate_multiplier, n_epochs }`
8
9 The hyperparameters used for the DPO fine-tuning job.
10
11 - `batch_size: optional "auto" or number`
12
13 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
14
15 - `union_member_0: "auto"`
16
17 - `union_member_1: number`
18
19 - `beta: optional "auto" or number`
20
21 The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
22
23 - `union_member_0: "auto"`
24
25 - `union_member_1: number`
26
27 - `learning_rate_multiplier: optional "auto" or number`
28
29 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
30
31 - `union_member_0: "auto"`
32
33 - `union_member_1: number`
34
35 - `n_epochs: optional "auto" or number`
36
37 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
38
39 - `union_member_0: "auto"`
40
41 - `union_member_1: number`
42
43### Dpo Method
44
45- `dpo_method: object { hyperparameters }`
46
47 Configuration for the DPO fine-tuning method.
48
49 - `hyperparameters: optional object { batch_size, beta, learning_rate_multiplier, n_epochs }`
50
51 The hyperparameters used for the DPO fine-tuning job.
52
53 - `batch_size: optional "auto" or number`
54
55 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
56
57 - `union_member_0: "auto"`
58
59 - `union_member_1: number`
60
61 - `beta: optional "auto" or number`
62
63 The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model.
64
65 - `union_member_0: "auto"`
66
67 - `union_member_1: number`
68
69 - `learning_rate_multiplier: optional "auto" or number`
70
71 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
72
73 - `union_member_0: "auto"`
74
75 - `union_member_1: number`
76
77 - `n_epochs: optional "auto" or number`
78
79 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
80
81 - `union_member_0: "auto"`
82
83 - `union_member_1: number`
84
85### Reinforcement Hyperparameters
86
87- `reinforcement_hyperparameters: object { batch_size, compute_multiplier, eval_interval, 4 more }`
88
89 The hyperparameters used for the reinforcement fine-tuning job.
90
91 - `batch_size: optional "auto" or number`
92
93 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
94
95 - `union_member_0: "auto"`
96
97 - `union_member_1: number`
98
99 - `compute_multiplier: optional "auto" or number`
100
101 Multiplier on amount of compute used for exploring search space during training.
102
103 - `union_member_0: "auto"`
104
105 - `union_member_1: number`
106
107 - `eval_interval: optional "auto" or number`
108
109 The number of training steps between evaluation runs.
110
111 - `union_member_0: "auto"`
112
113 - `union_member_1: number`
114
115 - `eval_samples: optional "auto" or number`
116
117 Number of evaluation samples to generate per training step.
118
119 - `union_member_0: "auto"`
120
121 - `union_member_1: number`
122
123 - `learning_rate_multiplier: optional "auto" or number`
124
125 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
126
127 - `union_member_0: "auto"`
128
129 - `union_member_1: number`
130
131 - `n_epochs: optional "auto" or number`
132
133 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
134
135 - `union_member_0: "auto"`
136
137 - `union_member_1: number`
138
139 - `reasoning_effort: optional "default" or "low" or "medium" or "high"`
140
141 Level of reasoning effort.
142
143 - `"default"`
144
145 - `"low"`
146
147 - `"medium"`
148
149 - `"high"`
150
151### Reinforcement Method
152
153- `reinforcement_method: object { grader, hyperparameters }`
154
155 Configuration for the reinforcement fine-tuning method.
156
157 - `grader: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`
158
159 The grader used for the fine-tuning job.
160
161 - `string_check_grader: object { input, name, operation, 2 more }`
162
163 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
164
165 - `input: string`
166
167 The input text. This may include template strings.
168
169 - `name: string`
170
171 The name of the grader.
172
173 - `operation: "eq" or "ne" or "like" or "ilike"`
174
175 The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`.
176
177 - `"eq"`
178
179 - `"ne"`
180
181 - `"like"`
182
183 - `"ilike"`
184
185 - `reference: string`
186
187 The reference text. This may include template strings.
188
189 - `type: "string_check"`
190
191 The object type, which is always `string_check`.
192
193 - `text_similarity_grader: object { evaluation_metric, input, name, 2 more }`
194
195 A TextSimilarityGrader object which grades text based on similarity metrics.
196
197 - `evaluation_metric: "cosine" or "fuzzy_match" or "bleu" or 8 more`
198
199 The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,
200 `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,
201 or `rouge_l`.
202
203 - `"cosine"`
204
205 - `"fuzzy_match"`
206
207 - `"bleu"`
208
209 - `"gleu"`
210
211 - `"meteor"`
212
213 - `"rouge_1"`
214
215 - `"rouge_2"`
216
217 - `"rouge_3"`
218
219 - `"rouge_4"`
220
221 - `"rouge_5"`
222
223 - `"rouge_l"`
224
225 - `input: string`
226
227 The text being graded.
228
229 - `name: string`
230
231 The name of the grader.
232
233 - `reference: string`
234
235 The text being graded against.
236
237 - `type: "text_similarity"`
238
239 The type of grader.
240
241 - `python_grader: object { name, source, type, image_tag }`
242
243 A PythonGrader object that runs a python script on the input.
244
245 - `name: string`
246
247 The name of the grader.
248
249 - `source: string`
250
251 The source code of the python script.
252
253 - `type: "python"`
254
255 The object type, which is always `python`.
256
257 - `image_tag: optional string`
258
259 The image tag to use for the python script.
260
261 - `score_model_grader: object { input, model, name, 3 more }`
262
263 A ScoreModelGrader object that uses a model to assign a score to the input.
264
265 - `input: array of object { content, role, type }`
266
267 The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings.
268
269 - `content: string or ResponseInputText or object { text, type } or 3 more`
270
271 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
272
273 - `Text input: string`
274
275 A text input to the model.
276
277 - `response_input_text: object { text, type, prompt_cache_breakpoint }`
278
279 A text input to the model.
280
281 - `text: string`
282
283 The text input to the model.
284
285 - `type: "input_text"`
286
287 The type of the input item. Always `input_text`.
288
289 - `prompt_cache_breakpoint: optional object { mode }`
290
291 Marks the exact end of a reusable prompt prefix. The breakpoint inherits its TTL from the request's `prompt_cache_options.ttl`; the boundary is not rounded to a token block.
292
293 - `mode: "explicit"`
294
295 The breakpoint mode. Always `explicit`.
296
297 - `Output text: object { text, type }`
298
299 A text output from the model.
300
301 - `text: string`
302
303 The text output from the model.
304
305 - `type: "output_text"`
306
307 The type of the output text. Always `output_text`.
308
309 - `Input image: object { image_url, type, detail }`
310
311 An image input block used within EvalItem content arrays.
312
313 - `image_url: string`
314
315 The URL of the image input.
316
317 - `type: "input_image"`
318
319 The type of the image input. Always `input_image`.
320
321 - `detail: optional string`
322
323 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
324
325 - `response_input_audio: object { input_audio, type }`
326
327 An audio input to the model.
328
329 - `input_audio: object { data, format }`
330
331 - `data: string`
332
333 Base64-encoded audio data.
334
335 - `format: "mp3" or "wav"`
336
337 The format of the audio data. Currently supported formats are `mp3` and
338 `wav`.
339
340 - `"mp3"`
341
342 - `"wav"`
343
344 - `type: "input_audio"`
345
346 The type of the input item. Always `input_audio`.
347
348 - `grader_inputs: array of string or ResponseInputText or object { text, type } or 2 more`
349
350 A list of inputs, each of which may be either an input text, output text, input
351 image, or input audio object.
352
353 - `Text input: string`
354
355 A text input to the model.
356
357 - `response_input_text: object { text, type, prompt_cache_breakpoint }`
358
359 A text input to the model.
360
361 - `Output text: object { text, type }`
362
363 A text output from the model.
364
365 - `text: string`
366
367 The text output from the model.
368
369 - `type: "output_text"`
370
371 The type of the output text. Always `output_text`.
372
373 - `Input image: object { image_url, type, detail }`
374
375 An image input block used within EvalItem content arrays.
376
377 - `image_url: string`
378
379 The URL of the image input.
380
381 - `type: "input_image"`
382
383 The type of the image input. Always `input_image`.
384
385 - `detail: optional string`
386
387 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
388
389 - `response_input_audio: object { input_audio, type }`
390
391 An audio input to the model.
392
393 - `role: "user" or "assistant" or "system" or "developer"`
394
395 The role of the message input. One of `user`, `assistant`, `system`, or
396 `developer`.
397
398 - `"user"`
399
400 - `"assistant"`
401
402 - `"system"`
403
404 - `"developer"`
405
406 - `type: optional "message"`
407
408 The type of the message input. Always `message`.
409
410 - `"message"`
411
412 - `model: string`
413
414 The model to use for the evaluation.
415
416 - `name: string`
417
418 The name of the grader.
419
420 - `type: "score_model"`
421
422 The object type, which is always `score_model`.
423
424 - `range: optional array of number`
425
426 The range of the score. Defaults to `[0, 1]`.
427
428 - `sampling_params: optional object { max_completions_tokens, reasoning_effort, seed, 2 more }`
429
430 The sampling parameters for the model.
431
432 - `max_completions_tokens: optional number`
433
434 The maximum number of tokens the grader model may generate in its response.
435
436 - `reasoning_effort: optional "none" or "minimal" or "low" or 4 more`
437
438 Constrains effort on reasoning for reasoning models. Currently supported
439 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
440 Reducing reasoning effort can result in faster responses and fewer tokens
441 used on reasoning in a response. Not all reasoning models support every
442 value. See the
443 [reasoning guide](https://platform.openai.com/docs/guides/reasoning)
444 for model-specific support.
445
446 - `"none"`
447
448 - `"minimal"`
449
450 - `"low"`
451
452 - `"medium"`
453
454 - `"high"`
455
456 - `"xhigh"`
457
458 - `"max"`
459
460 - `seed: optional number`
461
462 A seed value to initialize the randomness, during sampling.
463
464 - `temperature: optional number`
465
466 A higher temperature increases randomness in the outputs.
467
468 - `top_p: optional number`
469
470 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
471
472 - `multi_grader: object { calculate_output, graders, name, type }`
473
474 A MultiGrader object combines the output of multiple graders to produce a single score.
475
476 - `calculate_output: string`
477
478 A formula to calculate the output based on grader results.
479
480 - `graders: StringCheckGrader or TextSimilarityGrader or PythonGrader or 2 more`
481
482 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
483
484 - `string_check_grader: object { input, name, operation, 2 more }`
485
486 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
487
488 - `text_similarity_grader: object { evaluation_metric, input, name, 2 more }`
489
490 A TextSimilarityGrader object which grades text based on similarity metrics.
491
492 - `python_grader: object { name, source, type, image_tag }`
493
494 A PythonGrader object that runs a python script on the input.
495
496 - `score_model_grader: object { input, model, name, 3 more }`
497
498 A ScoreModelGrader object that uses a model to assign a score to the input.
499
500 - `label_model_grader: object { input, labels, model, 3 more }`
501
502 A LabelModelGrader object which uses a model to assign labels to each item
503 in the evaluation.
504
505 - `input: array of object { content, role, type }`
506
507 - `content: string or ResponseInputText or object { text, type } or 3 more`
508
509 Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.
510
511 - `Text input: string`
512
513 A text input to the model.
514
515 - `response_input_text: object { text, type, prompt_cache_breakpoint }`
516
517 A text input to the model.
518
519 - `Output text: object { text, type }`
520
521 A text output from the model.
522
523 - `text: string`
524
525 The text output from the model.
526
527 - `type: "output_text"`
528
529 The type of the output text. Always `output_text`.
530
531 - `Input image: object { image_url, type, detail }`
532
533 An image input block used within EvalItem content arrays.
534
535 - `image_url: string`
536
537 The URL of the image input.
538
539 - `type: "input_image"`
540
541 The type of the image input. Always `input_image`.
542
543 - `detail: optional string`
544
545 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
546
547 - `response_input_audio: object { input_audio, type }`
548
549 An audio input to the model.
550
551 - `grader_inputs: array of string or ResponseInputText or object { text, type } or 2 more`
552
553 A list of inputs, each of which may be either an input text, output text, input
554 image, or input audio object.
555
556 - `role: "user" or "assistant" or "system" or "developer"`
557
558 The role of the message input. One of `user`, `assistant`, `system`, or
559 `developer`.
560
561 - `"user"`
562
563 - `"assistant"`
564
565 - `"system"`
566
567 - `"developer"`
568
569 - `type: optional "message"`
570
571 The type of the message input. Always `message`.
572
573 - `"message"`
574
575 - `labels: array of string`
576
577 The labels to assign to each item in the evaluation.
578
579 - `model: string`
580
581 The model to use for the evaluation. Must support structured outputs.
582
583 - `name: string`
584
585 The name of the grader.
586
587 - `passing_labels: array of string`
588
589 The labels that indicate a passing result. Must be a subset of labels.
590
591 - `type: "label_model"`
592
593 The object type, which is always `label_model`.
594
595 - `name: string`
596
597 The name of the grader.
598
599 - `type: "multi"`
600
601 The object type, which is always `multi`.
602
603 - `hyperparameters: optional object { batch_size, compute_multiplier, eval_interval, 4 more }`
604
605 The hyperparameters used for the reinforcement fine-tuning job.
606
607 - `batch_size: optional "auto" or number`
608
609 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
610
611 - `union_member_0: "auto"`
612
613 - `union_member_1: number`
614
615 - `compute_multiplier: optional "auto" or number`
616
617 Multiplier on amount of compute used for exploring search space during training.
618
619 - `union_member_0: "auto"`
620
621 - `union_member_1: number`
622
623 - `eval_interval: optional "auto" or number`
624
625 The number of training steps between evaluation runs.
626
627 - `union_member_0: "auto"`
628
629 - `union_member_1: number`
630
631 - `eval_samples: optional "auto" or number`
632
633 Number of evaluation samples to generate per training step.
634
635 - `union_member_0: "auto"`
636
637 - `union_member_1: number`
638
639 - `learning_rate_multiplier: optional "auto" or number`
640
641 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
642
643 - `union_member_0: "auto"`
644
645 - `union_member_1: number`
646
647 - `n_epochs: optional "auto" or number`
648
649 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
650
651 - `union_member_0: "auto"`
652
653 - `union_member_1: number`
654
655 - `reasoning_effort: optional "default" or "low" or "medium" or "high"`
656
657 Level of reasoning effort.
658
659 - `"default"`
660
661 - `"low"`
662
663 - `"medium"`
664
665 - `"high"`
666
667### Supervised Hyperparameters
668
669- `supervised_hyperparameters: object { batch_size, learning_rate_multiplier, n_epochs }`
670
671 The hyperparameters used for the fine-tuning job.
672
673 - `batch_size: optional "auto" or number`
674
675 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
676
677 - `union_member_0: "auto"`
678
679 - `union_member_1: number`
680
681 - `learning_rate_multiplier: optional "auto" or number`
682
683 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
684
685 - `union_member_0: "auto"`
686
687 - `union_member_1: number`
688
689 - `n_epochs: optional "auto" or number`
690
691 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
692
693 - `union_member_0: "auto"`
694
695 - `union_member_1: number`
696
697### Supervised Method
698
699- `supervised_method: object { hyperparameters }`
700
701 Configuration for the supervised fine-tuning method.
702
703 - `hyperparameters: optional object { batch_size, learning_rate_multiplier, n_epochs }`
704
705 The hyperparameters used for the fine-tuning job.
706
707 - `batch_size: optional "auto" or number`
708
709 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
710
711 - `union_member_0: "auto"`
712
713 - `union_member_1: number`
714
715 - `learning_rate_multiplier: optional "auto" or number`
716
717 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
718
719 - `union_member_0: "auto"`
720
721 - `union_member_1: number`
722
723 - `n_epochs: optional "auto" or number`
724
725 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
726
727 - `union_member_0: "auto"`
728
729 - `union_member_1: number`