You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/how-to/fine-tuning.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,58 @@ Images containing the following will be excluded from your dataset and not used
97
97
98
98
Azure OpenAI fine-tuning supports prompt caching with select models. Prompt caching allows you to reduce overall request latency and cost for longer prompts that have identical content at the beginning of the prompt. To learn more about prompt caching, see [getting started with prompt caching](./prompt-caching.md).
99
99
100
+
## Direct preference optimization (DPO) (preview)
101
+
102
+
Direct preference optimization (DPO) is an alignment technique for large language models, used to adjust model weights based on human preferences. It differs from reinforcement learning from human feedback (RLHF) in that it does not require fitting a reward model and uses simpler binary data preferences for training. It is computationally lighter weight and faster than RLHF, while being equally effective at alignment.
103
+
104
+
### Why is DPO useful?
105
+
106
+
DPO is especially useful in scenarios where there's no clear-cut correct answer, and subjective elements like tone, style, or specific content preferences are important. This approach also enables the model to learn from both positive examples (what's considered correct or ideal) and negative examples (what's less desired or incorrect).
107
+
108
+
DPO is believed to be a technique that will make it easier for customers to generate high-quality training data sets. While many customers struggle to generate sufficient large data sets for supervised fine-tuning, they often have preference data already collected based on user logs, A/B tests, or smaller manual annotation efforts.
109
+
110
+
### Direct preference optimization dataset format
111
+
112
+
Direct preference optimization files have a different format than supervised fine-tuning. Customers provide a "conversation" containing the system message and the initial user message, and then "completions" with paired preference data. Users can only provide two completions.
113
+
114
+
Three top-level fields: `input`, `preferred_output` and `non_preferred_output`
115
+
116
+
- Each element in the preferred_output/non_preferred_output must contain at least one assistant message
117
+
- Each element in the preferred_output/non_preferred_output can only have roles in (assistant, tool)
{{"input": {"messages": [{"role": "system", "content": "You are a chatbot assistant. Given a user question with multiple choice answers, provide the correct answer."}, {"role": "user", "content": "Question: Janette conducts an investigation to see which foods make her feel more fatigued. She eats one of four different foods each day at the same time for four days and then records how she feels. She asks her friend Carmen to do the same investigation to see if she gets similar results. Which would make the investigation most difficult to replicate? Answer choices: A: measuring the amount of fatigue, B: making sure the same foods are eaten, C: recording observations in the same chart, D: making sure the foods are at the same temperature"}]}, "preferred_output": [{"role": "assistant", "content": "A: Measuring The Amount Of Fatigue"}], "non_preferred_output": [{"role": "assistant", "content": "D: making sure the foods are at the same temperature"}]}
135
+
}
136
+
```
137
+
138
+
### Direct preference optimization model support
139
+
140
+
-`gpt-4o-2024-08-06` supports direct preference optimization in its respective fine-tuning regions. Latest region availability is updated in the [models page](../concepts/models.md#fine-tuning-models)
141
+
142
+
Users can use preference fine tuning with base models as well as models that have already been fine-tuned using supervised fine-tuning as long as they are of a supported model/version.
143
+
144
+
### How to use direct preference optimization fine-tuning?
145
+
146
+
1. Prepare `jsonl` datasets in the [preference format](#direct-preference-optimization-dataset-format).
147
+
2. Select the model and then select the method of customization **Direct Preference Optimization**.
148
+
3. Upload datasets – training and validation. Preview as needed.
149
+
4. Select hyperparameters, defaults are recommended for initial experimentation.
150
+
5. Review the selections and create a fine tuning job.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/fine-tuning-openai-in-ai-studio.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,7 @@ Optionally, configure parameters for your fine-tuning job. The following are ava
221
221
|`learning_rate_multiplier`| number | The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this value. Larger learning rates tend to perform better with larger batch sizes. We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results. A smaller learning rate may be useful to avoid overfitting. |
222
222
|`n_epochs`| integer | The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. If set to -1, the number of epochs is determined dynamically based on the input data. |
223
223
|`seed`| integer | The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed isn't specified, one will be generated for you. |
224
+
|`Beta`| integer | Temperature parameter for the dpo loss, typically in the range 0.1 to 0.5. This controls how much attention we pay to the reference model. The smaller the beta, the more we allow the model to drift away from the reference model. As beta gets smaller the more, we ignore the reference model. |
224
225
225
226
You can choose to leave the default configuration or customize the values to your preference. After you finish making your configurations, select **Next**.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/includes/fine-tuning-studio.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,6 +288,9 @@ The **Create custom model** wizard shows the parameters for training your fine-t
288
288
|`learning_rate_multiplier`| number | The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this value. Larger learning rates tend to perform better with larger batch sizes. We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results. A smaller learning rate may be useful to avoid overfitting. |
289
289
|`n_epochs`| integer | The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. |
290
290
|`seed`| integer | The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed isn't specified, one will be generated for you|
291
+
|`Beta`| integer | Temperature parameter for the dpo loss, typically in the range 0.1 to 0.5. This controls how much attention we pay to the reference model. The smaller the beta, the more we allow the model to drift away from the reference model. As beta gets smaller the more, we ignore the reference model. |
292
+
293
+
291
294
292
295
:::image type="content" source="../media/fine-tuning/studio-advanced-options.png" alt-text="Screenshot of the Advanced options pane for the Create custom model wizard, with default options selected." lightbox="../media/fine-tuning/studio-advanced-options.png":::
Copy file name to clipboardExpand all lines: articles/ai-services/openai/whats-new.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.custom:
11
11
- references_regions
12
12
- ignite-2024
13
13
ms.topic: whats-new
14
-
ms.date: 11/16/2024
14
+
ms.date: 11/17/2024
15
15
recommendations: false
16
16
---
17
17
@@ -21,6 +21,13 @@ This article provides a summary of the latest releases and major documentation u
21
21
22
22
## December 2024
23
23
24
+
### Preference fine-tuning (preview)
25
+
26
+
[Direct preference optimization (DPO)](./how-to/fine-tuning.md#direct-preference-optimization-dpo-preview) is a new alignment technique for large language models, designed to adjust model weights based on human preferences. Unlike reinforcement learning from human feedback (RLHF), DPO does not require fitting a reward model and uses simpler data (binary preferences) for training. This method is computationally lighter and faster, making it equally effective at alignment while being more efficient. DPO is especially useful in scenarios where subjective elements like tone, style, or specific content preferences are important. We’re excited to announce the public preview of DPO in Azure OpenAI Service, starting with the `gpt-4o-2024-08-06` model.
27
+
28
+
For fine-tuning model region availability, see the [models page](./concepts/models.md#fine-tuning-models).
29
+
30
+
24
31
### GPT-4o 2024-11-20
25
32
26
33
`gpt-4o-2024-11-20` is now available for [global standard deployment](./how-to/deployment-types.md) in:
0 commit comments