java/resources/fine_tuning/subresources/methods/index.md +0 −809 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 - `Optional<PromptCacheBreakpoint> promptCacheBreakpoint`
324
325 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.
326
327 - `JsonValue; mode "explicit"constant`
328
329 The breakpoint mode. Always `explicit`.
330
331 - `EXPLICIT("explicit")`
332
333 - `class OutputText:`
334
335 A text output from the model.
336
337 - `String text`
338
339 The text output from the model.
340
341 - `JsonValue; type "output_text"constant`
342
343 The type of the output text. Always `output_text`.
344
345 - `OUTPUT_TEXT("output_text")`
346
347 - `class InputImage:`
348
349 An image input block used within EvalItem content arrays.
350
351 - `String imageUrl`
352
353 The URL of the image input.
354
355 - `JsonValue; type "input_image"constant`
356
357 The type of the image input. Always `input_image`.
358
359 - `INPUT_IMAGE("input_image")`
360
361 - `Optional<String> detail`
362
363 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
364
365 - `class ResponseInputAudio:`
366
367 An audio input to the model.
368
369 - `InputAudio inputAudio`
370
371 - `String data`
372
373 Base64-encoded audio data.
374
375 - `Format format`
376
377 The format of the audio data. Currently supported formats are `mp3` and
378 `wav`.
379
380 - `MP3("mp3")`
381
382 - `WAV("wav")`
383
384 - `JsonValue; type "input_audio"constant`
385
386 The type of the input item. Always `input_audio`.
387
388 - `INPUT_AUDIO("input_audio")`
389
390 - `List<EvalContentItem>`
391
392 - `String`
393
394 - `class ResponseInputText:`
395
396 A text input to the model.
397
398 - `OutputText`
399
400 - `String text`
401
402 The text output from the model.
403
404 - `JsonValue; type "output_text"constant`
405
406 The type of the output text. Always `output_text`.
407
408 - `OUTPUT_TEXT("output_text")`
409
410 - `InputImage`
411
412 - `String imageUrl`
413
414 The URL of the image input.
415
416 - `JsonValue; type "input_image"constant`
417
418 The type of the image input. Always `input_image`.
419
420 - `INPUT_IMAGE("input_image")`
421
422 - `Optional<String> detail`
423
424 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
425
426 - `class ResponseInputAudio:`
427
428 An audio input to the model.
429
430 - `Role role`
431
432 The role of the message input. One of `user`, `assistant`, `system`, or
433 `developer`.
434
435 - `USER("user")`
436
437 - `ASSISTANT("assistant")`
438
439 - `SYSTEM("system")`
440
441 - `DEVELOPER("developer")`
442
443 - `Optional<Type> type`
444
445 The type of the message input. Always `message`.
446
447 - `MESSAGE("message")`
448
449 - `String model`
450
451 The model to use for the evaluation.
452
453 - `String name`
454
455 The name of the grader.
456
457 - `JsonValue; type "score_model"constant`
458
459 The object type, which is always `score_model`.
460
461 - `SCORE_MODEL("score_model")`
462
463 - `Optional<List<Double>> range`
464
465 The range of the score. Defaults to `[0, 1]`.
466
467 - `Optional<SamplingParams> samplingParams`
468
469 The sampling parameters for the model.
470
471 - `Optional<Long> maxCompletionsTokens`
472
473 The maximum number of tokens the grader model may generate in its response.
474
475 - `Optional<ReasoningEffort> reasoningEffort`
476
477 Constrains effort on reasoning for reasoning models. Currently supported
478 values are `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`.
479 Reducing reasoning effort can result in faster responses and fewer tokens
480 used on reasoning in a response. Not all reasoning models support every
481 value. See the
482 [reasoning guide](https://platform.openai.com/docs/guides/reasoning)
483 for model-specific support.
484
485 - `NONE("none")`
486
487 - `MINIMAL("minimal")`
488
489 - `LOW("low")`
490
491 - `MEDIUM("medium")`
492
493 - `HIGH("high")`
494
495 - `XHIGH("xhigh")`
496
497 - `MAX("max")`
498
499 - `Optional<Long> seed`
500
501 A seed value to initialize the randomness, during sampling.
502
503 - `Optional<Double> temperature`
504
505 A higher temperature increases randomness in the outputs.
506
507 - `Optional<Double> topP`
508
509 An alternative to temperature for nucleus sampling; 1.0 includes all tokens.
510
511 - `class MultiGrader:`
512
513 A MultiGrader object combines the output of multiple graders to produce a single score.
514
515 - `String calculateOutput`
516
517 A formula to calculate the output based on grader results.
518
519 - `Graders graders`
520
521 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
522
523 - `class StringCheckGrader:`
524
525 A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.
526
527 - `class TextSimilarityGrader:`
528
529 A TextSimilarityGrader object which grades text based on similarity metrics.
530
531 - `class PythonGrader:`
532
533 A PythonGrader object that runs a python script on the input.
534
535 - `class ScoreModelGrader:`
536
537 A ScoreModelGrader object that uses a model to assign a score to the input.
538
539 - `class LabelModelGrader:`
540
541 A LabelModelGrader object which uses a model to assign labels to each item
542 in the evaluation.
543
544 - `List<Input> input`
545
546 - `Content content`
547
548 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.
549
550 - `String`
551
552 - `class ResponseInputText:`
553
554 A text input to the model.
555
556 - `class OutputText:`
557
558 A text output from the model.
559
560 - `String text`
561
562 The text output from the model.
563
564 - `JsonValue; type "output_text"constant`
565
566 The type of the output text. Always `output_text`.
567
568 - `OUTPUT_TEXT("output_text")`
569
570 - `class InputImage:`
571
572 An image input block used within EvalItem content arrays.
573
574 - `String imageUrl`
575
576 The URL of the image input.
577
578 - `JsonValue; type "input_image"constant`
579
580 The type of the image input. Always `input_image`.
581
582 - `INPUT_IMAGE("input_image")`
583
584 - `Optional<String> detail`
585
586 The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.
587
588 - `class ResponseInputAudio:`
589
590 An audio input to the model.
591
592 - `List<EvalContentItem>`
593
594 - `String`
595
596 - `class ResponseInputText:`
597
598 A text input to the model.
599
600 - `OutputText`
601
602 - `InputImage`
603
604 - `class ResponseInputAudio:`
605
606 An audio input to the model.
607
608 - `Role role`
609
610 The role of the message input. One of `user`, `assistant`, `system`, or
611 `developer`.
612
613 - `USER("user")`
614
615 - `ASSISTANT("assistant")`
616
617 - `SYSTEM("system")`
618
619 - `DEVELOPER("developer")`
620
621 - `Optional<Type> type`
622
623 The type of the message input. Always `message`.
624
625 - `MESSAGE("message")`
626
627 - `List<String> labels`
628
629 The labels to assign to each item in the evaluation.
630
631 - `String model`
632
633 The model to use for the evaluation. Must support structured outputs.
634
635 - `String name`
636
637 The name of the grader.
638
639 - `List<String> passingLabels`
640
641 The labels that indicate a passing result. Must be a subset of labels.
642
643 - `JsonValue; type "label_model"constant`
644
645 The object type, which is always `label_model`.
646
647 - `LABEL_MODEL("label_model")`
648
649 - `String name`
650
651 The name of the grader.
652
653 - `JsonValue; type "multi"constant`
654
655 The object type, which is always `multi`.
656
657 - `MULTI("multi")`
658
659 - `Optional<ReinforcementHyperparameters> hyperparameters`
660
661 The hyperparameters used for the reinforcement fine-tuning job.
662
663 - `Optional<BatchSize> batchSize`
664
665 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
666
667 - `JsonValue;`
668
669 - `AUTO("auto")`
670
671 - `long`
672
673 - `Optional<ComputeMultiplier> computeMultiplier`
674
675 Multiplier on amount of compute used for exploring search space during training.
676
677 - `JsonValue;`
678
679 - `AUTO("auto")`
680
681 - `double`
682
683 - `Optional<EvalInterval> evalInterval`
684
685 The number of training steps between evaluation runs.
686
687 - `JsonValue;`
688
689 - `AUTO("auto")`
690
691 - `long`
692
693 - `Optional<EvalSamples> evalSamples`
694
695 Number of evaluation samples to generate per training step.
696
697 - `JsonValue;`
698
699 - `AUTO("auto")`
700
701 - `long`
702
703 - `Optional<LearningRateMultiplier> learningRateMultiplier`
704
705 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
706
707 - `JsonValue;`
708
709 - `AUTO("auto")`
710
711 - `double`
712
713 - `Optional<NEpochs> nEpochs`
714
715 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
716
717 - `JsonValue;`
718
719 - `AUTO("auto")`
720
721 - `long`
722
723 - `Optional<ReasoningEffort> reasoningEffort`
724
725 Level of reasoning effort.
726
727 - `DEFAULT("default")`
728
729 - `LOW("low")`
730
731 - `MEDIUM("medium")`
732
733 - `HIGH("high")`
734
735### Supervised Hyperparameters
736
737- `class SupervisedHyperparameters:`
738
739 The hyperparameters used for the fine-tuning job.
740
741 - `Optional<BatchSize> batchSize`
742
743 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
744
745 - `JsonValue;`
746
747 - `AUTO("auto")`
748
749 - `long`
750
751 - `Optional<LearningRateMultiplier> learningRateMultiplier`
752
753 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
754
755 - `JsonValue;`
756
757 - `AUTO("auto")`
758
759 - `double`
760
761 - `Optional<NEpochs> nEpochs`
762
763 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
764
765 - `JsonValue;`
766
767 - `AUTO("auto")`
768
769 - `long`
770
771### Supervised Method
772
773- `class SupervisedMethod:`
774
775 Configuration for the supervised fine-tuning method.
776
777 - `Optional<SupervisedHyperparameters> hyperparameters`
778
779 The hyperparameters used for the fine-tuning job.
780
781 - `Optional<BatchSize> batchSize`
782
783 Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.
784
785 - `JsonValue;`
786
787 - `AUTO("auto")`
788
789 - `long`
790
791 - `Optional<LearningRateMultiplier> learningRateMultiplier`
792
793 Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting.
794
795 - `JsonValue;`
796
797 - `AUTO("auto")`
798
799 - `double`
800
801 - `Optional<NEpochs> nEpochs`
802
803 The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.
804
805 - `JsonValue;`
806
807 - `AUTO("auto")`
808
809 - `long`