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