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