Skip to content

Commit 76e0f1d

Browse files
author
Jill Grant
authored
Merge pull request #1147 from eric-urban/eur/aoai-fine-tune
fine-tuning models in studio
2 parents f91b04c + 077a9d0 commit 76e0f1d

File tree

4 files changed

+50
-68
lines changed

4 files changed

+50
-68
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -505,20 +505,7 @@ These models can only be used with Embedding API requests.
505505

506506
## Fine-tuning models
507507

508-
`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.
509-
510-
| Model ID | Fine-Tuning Regions | Max Request (tokens) | Training Data (up to) |
511-
| --- | --- | :---: | :---: |
512-
| `babbage-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
513-
| `davinci-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
514-
| `gpt-35-turbo` (0613) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 4,096 | Sep 2021 |
515-
| `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|
516-
| `gpt-35-turbo` (0125) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 16,385 | Sep 2021 |
517-
| `gpt-4` (0613) <sup>**1**</sup> | North Central US <br> Sweden Central | 8192 | Sep 2021 |
518-
| `gpt-4o-mini` <sup>**1**</sup> (2024-07-18) | North Central US <br> Sweden Central | Input: 128,000 <br> Output: 16,384 <br> Training example context length: 64,536 | Oct 2023 |
519-
| `gpt-4o` <sup>**1**</sup> (2024-08-06) | East US2 <br> North Central US <br> Sweden Central | Input: 128,000 <br> Output: 16,384 <br> Training example context length: 64,536 | Oct 2023 |
520-
521-
**<sup>1</sup>** GPT-4 is currently in public preview.
508+
[!INCLUDE [Fine-tune models](../includes/fine-tune-models.md)]
522509

523510
## Assistants (Preview)
524511

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Fine-tuning model guidance
3+
titleSuffix: Azure OpenAI
4+
description: Describes the models that support fine-tuning and the regions where fine-tuning is available.
5+
author: mrbullwinkle
6+
ms.author: mbullwin
7+
ms.service: azure-ai-openai
8+
ms.topic: include
9+
ms.date: 10/31/2024
10+
manager: nitinme
11+
---
12+
13+
> [!NOTE]
14+
> `gpt-35-turbo` - Fine-tuning of this model is limited to a subset of regions, and isn't available in every region the base model is available.
15+
>
16+
> The supported regions for fine-tuning might vary if you use Azure OpenAI models in an AI Studio project versus outside a project.
17+
18+
| Model ID | Fine-tuning regions | Max request (tokens) | Training Data (up to) |
19+
| --- | --- | :---: | :---: |
20+
| `babbage-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
21+
| `davinci-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
22+
| `gpt-35-turbo` (0613) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 4,096 | Sep 2021 |
23+
| `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|
24+
| `gpt-35-turbo` (0125) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 16,385 | Sep 2021 |
25+
| `gpt-4` (0613) <sup>**1**</sup> | North Central US <br> Sweden Central | 8192 | Sep 2021 |
26+
| `gpt-4o-mini` <sup>**1**</sup> (2024-07-18) | North Central US <br> Sweden Central | Input: 128,000 <br> Output: 16,384 <br> Training example context length: 64,536 | Oct 2023 |
27+
| `gpt-4o` <sup>**1**</sup> (2024-08-06) | East US2 <br> North Central US <br> Sweden Central | Input: 128,000 <br> Output: 16,384 <br> Training example context length: 64,536 | Oct 2023 |
28+
29+
**<sup>1</sup>** GPT-4 is currently in public preview.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ ms.custom: include, build-2024
1919
- An [Azure AI hub resource](../../../ai-studio/how-to/create-azure-ai-resource.md).
2020
- An [Azure AI project](../../../ai-studio/how-to/create-projects.md) in Azure AI Studio.
2121
- An [Azure OpenAI connection](/azure/ai-studio/how-to/connections-add?tabs=azure-openai#connection-details) to a resource in a [region where fine-tuning is supported](/azure/ai-services/openai/concepts/models#fine-tuning-models).
22+
> [!NOTE]
23+
> The supported regions might vary if you use Azure OpenAI models in an AI Studio project versus outside a project.
2224
- Fine-tuning access requires **Cognitive Services OpenAI Contributor** role on the Azure OpenAI resource.
2325
- If you don't already have access to view quota and deploy models in Azure AI Studio you need [more permissions](../how-to/role-based-access-control.md).
2426

@@ -92,7 +94,7 @@ In addition to the JSONL format, training and validation data files must be enco
9294

9395
### Create your training and validation datasets
9496

95-
The more training examples you have, the better. Fine tuning jobs will not proceed without at least 10 training examples, but such a small number are not enough to noticeably influence model responses. It is best practice to provide hundreds, if not thousands, of training examples to be successful.
97+
The more training examples you have, the better. Fine tuning jobs will not proceed without at least 10 training examples, but such a small number is not enough to noticeably influence model responses. It is best practice to provide hundreds, if not thousands, of training examples to be successful.
9698

9799
In general, doubling the dataset size can lead to a linear increase in model quality. But keep in mind, low quality examples can negatively impact performance. If you train the model on a large amount of internal data, without first pruning the dataset for only the highest quality examples you could end up with a model that performs much worse than expected.
98100

articles/ai-studio/concepts/fine-tuning-overview.md

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: azure-ai-studio
77
ms.custom:
88
- build-2024
99
ms.topic: conceptual
10-
ms.date: 5/29/2024
10+
ms.date: 10/31/2024
1111
ms.reviewer: sgilley
1212
ms.author: sgilley
1313
author: sdgilley
@@ -19,9 +19,9 @@ author: sdgilley
1919

2020
Fine-tuning retrains an existing large language model (LLM) by using example data. The result is a new, custom LLM that's optimized for the provided examples.
2121

22-
This article can help you decide whether or not fine-tuning is the right solution for your use case. This article also describes how Azure AI Studio can support your fine-tuning needs.
22+
This article can help you decide whether or not fine-tuning is the right solution for your use case. This article also describes how [Azure AI Studio](https://ai.azure.com) can support your fine-tuning needs.
2323

24-
In this article, fine-tuning refers to *supervised fine-tuning*, not continuous pretraining or reinforcement learning through human feedback (RLHF). Supervised fine-tuning is the process of retraining pretrained models on specific datasets. The purpose is typically to improve model performance on specific tasks or to introduce information that wasn't well represented when you originally trained the base model.
24+
In this article, fine-tuning refers to *supervised fine-tuning*, not to continuous pretraining or reinforcement learning through human feedback (RLHF). Supervised fine-tuning is the process of retraining pretrained models on specific datasets. The purpose is typically to improve model performance on specific tasks or to introduce information that wasn't well represented when you originally trained the base model.
2525

2626
## Getting starting with fine-tuning
2727

@@ -48,9 +48,7 @@ You might not be ready for fine-tuning if:
4848
- You can't find the right data to serve the model.
4949
- You don't have a clear use case for fine-tuning, or you can't articulate more than "I want to make a model better."
5050

51-
If you identify cost as your primary motivator, proceed with caution. Fine-tuning might reduce costs for certain use cases by shortening prompts or allowing you to use a smaller model. But there's a higher upfront cost to training, and you have to pay for hosting your own custom model. For more information on fine-tuning costs in Azure OpenAI Service, refer to the [pricing page](https://azure.microsoft.com/pricing/details/cognitive-services/openai-service/).
52-
53-
If you want to add out-of-domain knowledge to the model, you should start with RAG by using features like Azure OpenAI [On Your Data](../../ai-services/openai/concepts/use-your-data.md) or [embeddings](../../ai-services/openai/tutorials/embeddings.md). Using RAG in this way is often a cheaper, more adaptable, and potentially more effective option, depending on the use case and data.
51+
If you identify cost as your primary motivator, proceed with caution. Fine-tuning might reduce costs for certain use cases by shortening prompts or allowing you to use a smaller model. But typically there's a higher upfront cost to training, and you have to pay for hosting your own custom model.
5452

5553
### What isn't working with alternate approaches?
5654

@@ -82,7 +80,7 @@ You might not be ready for fine-tuning if:
8280

8381
Even with a great use case, fine-tuning is only as good as the quality of the data that you can provide. You need to be willing to invest the time and effort to make fine-tuning work. Different models require different data volumes, but you often need to be able to provide fairly large quantities of high-quality curated data.
8482

85-
Another important point is that even with high-quality data, if your data isn't in the necessary format for fine-tuning, you'll need to commit engineering resources for the formatting. For more information on how to prepare your data for fine-tuning, refer to the [fine-tuning documentation](../../ai-services/openai/how-to/fine-tuning.md?context=/azure/ai-studio/context/context).
83+
Another important point is that even with high-quality data, if your data isn't in the necessary format for fine-tuning, you need to commit engineering resources for the formatting.
8684

8785
You might be ready for fine-tuning if:
8886

@@ -92,63 +90,29 @@ You might be ready for fine-tuning if:
9290

9391
You might not be ready for fine-tuning if:
9492

95-
- You haven't identified a dataset yet.
93+
- An appropriate dataset hasn't been identified.
9694
- The dataset format doesn't match the model that you want to fine-tune.
9795

98-
### How will you measure the quality of your fine-tuned model?
96+
### How can you measure the quality of your fine-tuned model?
9997

10098
There isn't a single right answer to this question, but you should have clearly defined goals for what success with fine-tuning looks like. Ideally, this effort shouldn't just be qualitative. It should include quantitative measures of success, like using a holdout set of data for validation, in addition to user acceptance testing or A/B testing the fine-tuned model against a base model.
10199

102100
## Supported models for fine-tuning in Azure AI Studio
103101

104-
Now that you know when to use fine-tuning for your use case, you can go to Azure AI Studio to find models available to fine-tune. The following sections describe the available models.
105-
106-
### Azure OpenAI models
107-
108-
The following Azure OpenAI models are supported in Azure AI Studio for fine-tuning:
109-
110-
| Model ID | Fine-tuning regions | Max request (tokens) | Training data (up to) |
111-
| --- | --- | :---: | :---: |
112-
| `babbage-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
113-
| `davinci-002` | North Central US <br> Sweden Central <br> Switzerland West | 16,384 | Sep 2021 |
114-
| `gpt-35-turbo` (0613) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 4,096 | Sep 2021 |
115-
| `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|
116-
| `gpt-35-turbo` (0125) | East US2 <br> North Central US <br> Sweden Central <br> Switzerland West | 16,385 | Sep 2021 |
117-
| `gpt-4` (0613) <sup>1<sup> | North Central US <br> Sweden Central | 8192 | Sep 2021 |
118-
119-
<sup>1</sup> GPT-4 fine-tuning is currently in public preview. For more information, see the [GPT-4 fine-tuning safety evaluation guidance](/azure/ai-services/openai/how-to/fine-tuning?tabs=turbo%2Cpython-new&pivots=programming-language-python#safety-evaluation-gpt-4-fine-tuning---public-preview).
120-
121-
To fine-tune Azure OpenAI models, you must add a connection to an Azure OpenAI resource with a supported region to your project.
122-
123-
### Phi-3 family models
124-
125-
The following Phi-3 family models are supported in Azure AI Studio for fine-tuning:
126-
127-
- `Phi-3-mini-4k-instruct`
128-
- `Phi-3-mini-128k-instruct`
129-
- `Phi-3-medium-4k-instruct`
130-
- `Phi-3-medium-128k-instruct`
131-
132-
Fine-tuning of Phi-3 models is currently supported in projects located in East US2.
133-
134-
### Meta Llama 2 family models
135-
136-
The following Llama 2 family models are supported in Azure AI Studio for fine-tuning:
137-
138-
- `Meta-Llama-2-70b`
139-
- `Meta-Llama-2-7b`
140-
- `Meta-Llama-2-13b`
141-
142-
Fine-tuning of Llama 2 models is currently supported in projects located in West US3.
102+
Now that you know when to use fine-tuning for your use case, you can go to Azure AI Studio to find models available to fine-tune. The following table describes models that you can fine-tune in Azure AI Studio, along with the regions where you can fine-tune them.
143103

144-
### Meta Llama 3.1 family models
104+
| Model family | Model ID | Fine-tuning regions |
105+
| --- | --- | --- |
106+
| [Azure OpenAI models](../../ai-services/openai/how-to/fine-tuning.md?context=/azure/ai-studio/context/context) | Azure OpenAI Service models that you can fine-tune include among others `gpt-4` and `gpt-4o-mini`.<br/><br/>For details about Azure OpenAI models that are available for fine-tuning, see the [Azure OpenAI Service models documentation](../../ai-services/openai/concepts/models.md#fine-tuning-models) or the [Azure OpenAI models table](#fine-tuning-azure-openai-models) later in this guide. | Azure OpenAI Service models that you can fine-tune include among others North Central US and Sweden Central.<br/><br/>The supported regions might vary if you use Azure OpenAI models in an AI Studio project versus outside a project.<br/><br/>For details about fine-tuning regions, see the [Azure OpenAI Service models documentation](../../ai-services/openai/concepts/models.md#fine-tuning-models). |
107+
| [Phi-3 family models](../how-to/fine-tune-phi-3.md) | `Phi-3-mini-4k-instruct`<br/>`Phi-3-mini-128k-instruct`<br/>`Phi-3-medium-4k-instruct`<br/>`Phi-3-medium-128k-instruct` | East US2 |
108+
| [Meta Llama 2 family models](../how-to/fine-tune-model-llama.md) | `Meta-Llama-2-70b`<br/>`Meta-Llama-2-7b`<br/>`Meta-Llama-2-13b` | West US3 |
109+
| [Meta Llama 3.1 family models](../how-to/fine-tune-model-llama.md) | `Meta-Llama-3.1-70b-Instruct`<br/>`Meta-Llama-3.1-8b-Instruct` | West US3 |
145110

146-
The following Llama 3.1 family models are supported in Azure AI Studio for fine-tuning:
111+
This table provides more details about the Azure OpenAI Service models that support fine-tuning and the regions where fine-tuning is available.
147112

148-
- `Meta-Llama-3.1-70b-Instruct`
149-
- `Meta-Llama-3.1-8b-Instruct`
113+
### Fine-tuning Azure OpenAI models
150114

151-
Fine-tuning of Llama 3.1 models is currently supported in projects located in West US3.
115+
[!INCLUDE [Fine-tune models](../../ai-services/openai/includes/fine-tune-models.md)]
152116

153117
## Related content
154118

0 commit comments

Comments
 (0)