Skip to content

Commit cae7dc0

Browse files
Merge pull request #272517 from mrbullwinkle/mrb_04_17_2024_fine_tuning
[Azure OpenAI] Fine-tuning updates
2 parents 419a800 + 7e39ad7 commit cae7dc0

File tree

6 files changed

+68
-26
lines changed

6 files changed

+68
-26
lines changed

articles/ai-services/openai/concepts/models.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure OpenAI
44
description: Learn about the different model capabilities that are available with Azure OpenAI.
55
ms.service: azure-ai-openai
66
ms.topic: conceptual
7-
ms.date: 04/15/2024
7+
ms.date: 04/17/2024
88
ms.custom: references_regions, build-2023, build-2023-dataai, refefences_regions
99
manager: nitinme
1010
author: mrbullwinkle #ChrisHMSFT
@@ -92,6 +92,8 @@ You can also use the OpenAI text to speech voices via Azure AI Speech. To learn
9292

9393
[!INCLUDE [Standard Models](../includes/model-matrix/standard-models.md)]
9494

95+
This table does not include fine-tuning regional availability, consult the dedicated [fine-tuning section](#fine-tuning-models) for this information.
96+
9597
### Standard deployment model quota
9698

9799
[!INCLUDE [Quota](../includes/model-matrix/quota.md)]
@@ -237,15 +239,15 @@ The following Embeddings models are available with [Azure Government](/azure/azu
237239

238240
`babbage-002` and `davinci-002` are not trained to follow instructions. Querying these base models should only be done as a point of reference to a fine-tuned version to evaluate the progress of your training.
239241

240-
`gpt-35-turbo-0613` - fine-tuning of this model is limited to a subset of regions, and is not available in every region the base model is available.
242+
`gpt-35-turbo` - fine-tuning of this model is limited to a subset of regions, and is not available in every region the base model is available.
241243

242244
| Model ID | Fine-Tuning Regions | Max Request (tokens) | Training Data (up to) |
243245
| --- | --- | :---: | :---: |
244-
| `babbage-002` | North Central US <br> Sweden Central | 16,384 | Sep 2021 |
245-
| `davinci-002` | North Central US <br> Sweden Central | 16,384 | Sep 2021 |
246-
| `gpt-35-turbo` (0613) | East US2 <br> North Central US <br> Sweden Central | 4,096 | Sep 2021 |
247-
| `gpt-35-turbo` (1106) | East US2 <br> North Central US <br> Sweden Central | Input: 16,385<br> Output: 4,096 | Sep 2021|
248-
| `gpt-35-turbo` (0125) | East US2 <br> North Central US <br> Sweden Central | 16,385 | Sep 2021 |
246+
| `babbage-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
247+
| `davinci-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
248+
| `gpt-35-turbo` (0613) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 4,096 | Sep 2021 |
249+
| `gpt-35-turbo` (1106) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | Input: 16,385<br> Output: 4,096 | Sep 2021|
250+
| `gpt-35-turbo` (0125) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 16,385 | Sep 2021 |
249251

250252
### Whisper models
251253

articles/ai-services/openai/includes/fine-tuning-python.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,17 @@ If you would like a step-by-step walk-through of fine-tuning a `gpt-35-turbo-061
7575
{"messages": [{"role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."}, {"role": "user", "content": "I'm having trouble connecting my Xbox to the Wi-Fi."}, {"role": "assistant", "content": "No worries, let's go through the network settings on your Xbox. Can you please tell me what happens when you try to connect it to the Wi-Fi?"}]}
7676
```
7777

78-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
78+
### Multi-turn chat file format
79+
80+
Multiple turns of a conversation in a single line of your jsonl training file is also supported. To skip fine-tuning on specific assistant messages add the optional `weight` key value pair. Currently `weight` can be set to 0 or 1.
81+
82+
```json
83+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already.", "weight": 1}]}
84+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "William Shakespeare", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?", "weight": 1}]}
85+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "384,400 kilometers", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters.", "weight": 1}]}
86+
```
87+
88+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
7989

8090
### Create your training and validation datasets
8191

@@ -93,7 +103,7 @@ The training and validation data you use **must** be formatted as a JSON Lines (
93103
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
94104
```
95105

96-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
106+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
97107

98108
### Create your training and validation datasets
99109

@@ -263,7 +273,7 @@ print(response)
263273

264274
---
265275

266-
You can also pass additional optional parameters like hyperparameters to take greater control of the fine-tuning process. For initial training we recommend using the automatic defaults that are present without specifying these parameters.
276+
You can also pass additional optional parameters like hyperparameters to take greater control of the fine-tuning process. For initial training we recommend using the automatic defaults that are present without specifying these parameters.
267277

268278
The current supported hyperparameters for fine-tuning are:
269279

articles/ai-services/openai/includes/fine-tuning-rest.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Different model types require a different format of training data.
5757

5858
# [chat completion models](#tab/turbo)
5959

60-
The training and validation data you use **must** be formatted as a JSON Lines (JSONL) document. For `gpt-35-turbo-0613` the fine-tuning dataset must be formatted in the conversational format that is used by the [Chat completions](../how-to/chatgpt.md) API.
60+
The training and validation data you use **must** be formatted as a JSON Lines (JSONL) document. For `gpt-35-turbo-0613` and other related models, the fine-tuning dataset must be formatted in the conversational format that is used by the [Chat completions](../how-to/chatgpt.md) API.
6161

6262
If you would like a step-by-step walk-through of fine-tuning a `gpt-35-turbo-0613` please refer to the [Azure OpenAI fine-tuning tutorial](../tutorials/fine-tune.md)
6363

@@ -69,7 +69,18 @@ If you would like a step-by-step walk-through of fine-tuning a `gpt-35-turbo-061
6969
{"messages": [{"role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."}, {"role": "user", "content": "I'm having trouble connecting my Xbox to the Wi-Fi."}, {"role": "assistant", "content": "No worries, let's go through the network settings on your Xbox. Can you please tell me what happens when you try to connect it to the Wi-Fi?"}]}
7070
```
7171

72-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
72+
### Multi-turn chat file format
73+
74+
Multiple turns of a conversation in a single line of your jsonl training file is also supported. To skip fine-tuning on specific assistant messages add the optional `weight` key value pair. Currently `weight` can be set to 0 or 1.
75+
76+
```json
77+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already.", "weight": 1}]}
78+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "William Shakespeare", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?", "weight": 1}]}
79+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "384,400 kilometers", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters.", "weight": 1}]}
80+
```
81+
82+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
83+
7384

7485
### Create your training and validation datasets
7586

@@ -87,7 +98,7 @@ The training and validation data you use **must** be formatted as a JSON Lines (
8798
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
8899
```
89100

90-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
101+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
91102

92103
### Create your training and validation datasets
93104

articles/ai-services/openai/includes/fine-tuning-studio.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,17 @@ If you would like a step-by-step walk-through of fine-tuning a `gpt-35-turbo-061
7171
{"messages": [{"role": "system", "content": "You are an Xbox customer support agent whose primary goal is to help users with issues they are experiencing with their Xbox devices. You are friendly and concise. You only provide factual answers to queries, and do not provide answers that are not related to Xbox."}, {"role": "user", "content": "I'm having trouble connecting my Xbox to the Wi-Fi."}, {"role": "assistant", "content": "No worries, let's go through the network settings on your Xbox. Can you please tell me what happens when you try to connect it to the Wi-Fi?"}]}
7272
```
7373

74-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
74+
## Multi-turn chat file format
75+
76+
Multiple turns of a conversation in a single line of your jsonl training file is also supported. To skip fine-tuning on specific assistant messages add the optional `weight` key value pair. Currently `weight` can be set to 0 or 1.
77+
78+
```json
79+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already.", "weight": 1}]}
80+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "Who wrote 'Romeo and Juliet'?"}, {"role": "assistant", "content": "William Shakespeare", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Oh, just some guy named William Shakespeare. Ever heard of him?", "weight": 1}]}
81+
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "How far is the Moon from Earth?"}, {"role": "assistant", "content": "384,400 kilometers", "weight": 0}, {"role": "user", "content": "Can you be more sarcastic?"}, {"role": "assistant", "content": "Around 384,400 kilometers. Give or take a few, like that really matters.", "weight": 1}]}
82+
```
83+
84+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
7585

7686
### Create your training and validation datasets
7787

@@ -89,7 +99,7 @@ The training and validation data you use **must** be formatted as a JSON Lines (
8999
{"prompt": "<prompt text>", "completion": "<ideal generated text>"}
90100
```
91101

92-
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 100 MB in size.
102+
In addition to the JSONL format, training and validation data files must be encoded in UTF-8 and include a byte-order mark (BOM). The file must be less than 512 MB in size.
93103

94104
### Create your training and validation datasets
95105

@@ -226,7 +236,7 @@ The **Validation data** pane displays any existing, previously uploaded training
226236
For large data files, we recommend that you import from an Azure Blob store. Large files can become unstable when uploaded through multipart forms because the requests are atomic and can't be retried or resumed.
227237

228238
> [!NOTE]
229-
> Similar to training data files, validation data files must be formatted as JSONL files, encoded in UTF-8 with a byte-order mark (BOM). The file must be less than 100 MB in size.
239+
> Similar to training data files, validation data files must be formatted as JSONL files, encoded in UTF-8 with a byte-order mark (BOM). The file must be less than 512 MB in size.
230240
231241
#### Upload validation data from local file
232242

@@ -267,13 +277,7 @@ The **Create custom model** wizard shows the hyperparameters for training your f
267277

268278
:::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":::
269279

270-
Select **Default** to use the default values for the fine-tuning job, or select **Advanced** to display and edit the hyperparameter values.
271-
272-
The **Advanced** option lets you configure the following hyperparameter:
273-
274-
| Parameter name | Description |
275-
| --- | --- |
276-
| **Number of epochs** | The number of epochs to use for training the model. An epoch refers to one full cycle through the training dataset. |
280+
Select **Default** to use the default values for the fine-tuning job, or select **Advanced** to display and edit the hyperparameter values. When defaults are selected, we determine the correct value algorithmically based on your training data.
277281

278282
After you configure the advanced options, select **Next** to [review your choices and train your fine-tuned model](#review-your-choices-and-train-your-model).
279283

articles/ai-services/openai/includes/model-matrix/quota.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Quota for standard deployments is described in of terms of [Tokens-Per-Minute (T
2828
| southindia | - | - | 150 K | - | 300 K | - | 350 K | - | - | - | - | - | - | - | - | - |
2929
| swedencentral | 40 K | 80 K | 150 K | 30 K | 300 K | 240 K | 350 K | - | - | 240 K | 250 K | 240 K | 250 K | 250 K | 250 K | 250 K |
3030
| switzerlandnorth | 40 K | 80 K | - | 30 K | 300 K | - | 350 K | - | - | - | - | - | - | - | - | - |
31+
| switzerlandwest | - | - | - | - | - | - | - | - | - | - | 250 K | - | 250 K | 250 K | 250 K | 250 K |
3132
| uksouth | - | - | 80 K | - | 240 K | - | 350 K | - | - | - | - | - | - | - | - | - |
3233
| westeurope | - | - | - | - | 240 K | - | 240 K | - | - | - | - | - | - | - | - | - |
3334
| westus | - | - | 80 K | 30 K | 300 K | - | 350 K | - | - | - | - | - | - | - | - | - |

articles/ai-services/openai/whats-new.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,38 @@ ms.custom:
1010
- ignite-2023
1111
- references_regions
1212
ms.topic: whats-new
13-
ms.date: 04/02/2024
13+
ms.date: 04/18/2024
1414
recommendations: false
1515
---
1616

1717
# What's new in Azure OpenAI Service
1818

1919
## April 2024
2020

21-
### Fine-tuning is now supported in East US 2
21+
### Fine-tuning is now supported in two new regions East US 2 and Switzerland West
2222

23-
Fine-tuning is now available in East US 2 with support for:
23+
Fine-tuning is now available with support for:
2424

25+
### East US 2
26+
27+
- `gpt-35-turbo` (0613)
28+
- `gpt-35-turbo` (1106)
29+
- `gpt-35-turbo` (0125)
30+
31+
### Switzerland West
32+
33+
- `babbage-002`
34+
- `davinci-002`
2535
- `gpt-35-turbo` (0613)
2636
- `gpt-35-turbo` (1106)
2737
- `gpt-35-turbo` (0125)
2838

2939
Check the [models page](concepts/models.md#fine-tuning-models), for the latest information on model availability and fine-tuning support in each region.
3040

41+
### Multi-turn chat training examples
42+
43+
Fine-tuning now supports [multi-turn chat training examples](./how-to/fine-tuning.md#multi-turn-chat-file-format).
44+
3145
### GPT-4 (0125) is available for Azure OpenAI On Your Data
3246

3347
You can now use the GPT-4 (0125) model in [available regions](./concepts/models.md#public-cloud-regions) with Azure OpenAI On Your Data.

0 commit comments

Comments
 (0)