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/concepts/customizing-llm.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,25 +15,25 @@ recommendations: false
15
15
16
16
There are several techniques for adapting a pre-trained language model to suit a specific task or domain. These include prompt engineering, RAG (Retrieval Augmented Generation), and fine-tuning. These three techniques are not mutually exclusive but are complementary methods that in combination can be applicable to a specific use case. In this article, we'll explore these techniques, illustrative use cases, things to consider, and provide links to resources to learn more and get started with each.
17
17
18
-
## Techniques
18
+
## Prompt engineering
19
19
20
-
### Definition - prompt engineering
20
+
### Definition
21
21
22
22
[Prompt engineering](./prompt-engineering.md) is a technique that is both art and science, which involves designing prompts for generative AI models. This process utilizes in-context learning ([zero shot and few shot](./prompt-engineering.md#examples)) and, with iteration, improves accuracy and relevancy in responses, optimizing the performance of the model.
23
23
24
-
### Illustrative use cases - prompt engineering
24
+
### Illustrative use cases
25
25
26
26
A Marketing Manager at an environmentally conscious company can use prompt engineering to help guide the model to generate descriptions that are more aligned with their brand’s tone and style. For instance, they can add a prompt like "Write a product description for a new line of eco-friendly cleaning products that emphasizes quality, effectiveness, and highlights the use of environmentally friendly ingredients" to the input. This will help the model generate descriptions that are aligned with their brand’s values and messaging.
27
27
28
-
### Things to consider - prompt engineering
28
+
### Things to consider
29
29
30
30
-**Prompt engineering** is the starting point for generating desired output from generative AI models.
31
31
32
32
-**Craft clear instructions**: Instructions are commonly used in prompts and guide the model's behavior. Be specific and leave as little room for interpretation as possible. Use analogies and descriptive language to help the model understand your desired outcome.
33
33
34
34
-**Experiment and iterate**: Prompt engineering is an art that requires experimentation and iteration. Practice and gain experience in crafting prompts for different tasks. Every model might behave differently, so it's important to adapt prompt engineering techniques accordingly.
35
35
36
-
### Getting started - prompt engineering
36
+
### Getting started
37
37
38
38
-[Introduction to prompt engineering](./prompt-engineering.md)
@@ -42,45 +42,45 @@ A Marketing Manager at an environmentally conscious company can use prompt engin
42
42
43
43
## RAG (Retrieval Augmented Generation)
44
44
45
-
### Definition - RAG
45
+
### Definition
46
46
47
47
[RAG (Retrieval Augmented Generation)](../../../ai-studio/concepts/retrieval-augmented-generation.md) is a method that integrates external data into a Large Language Model prompt to generate relevant responses. This approach is particularly beneficial when using a large corpus of unstructured text based on different topics. It allows for answers to be grounded in the organization’s knowledge base (KB), providing a more tailored and accurate response.
48
48
49
49
RAG is also advantageous when answering questions based on an organization’s private data or when the public data that the model was trained on might have become outdated. This helps ensure that the responses are always up-to-date and relevant, regardless of the changes in the data landscape.
50
50
51
-
### Illustrative use case - RAG
51
+
### Illustrative use case
52
52
53
53
A corporate HR department is looking to provide an intelligent assistant that answers specific employee health insurance related questions such as "are eyeglasses covered?" RAG is used to ingest the extensive and numerous documents associated with insurance plan policies to enable the answering of these specific types of questions.
54
54
55
-
### Things to consider - RAG
55
+
### Things to consider
56
56
57
57
- RAG helps ground AI output in real-world data and reduces the likelihood of fabrication.
58
58
59
59
- RAG is helpful when there is a need to answer questions based on private proprietary data.
60
60
61
61
- RAG is helpful when you might want questions answered that are recent (for example, before the cutoff date of when the [model version](./models.md) was last trained).
62
62
63
-
### Getting started - RAG
63
+
### Getting started
64
64
65
65
-[Retrieval Augmented Generation in Azure AI Studio - Azure AI Studio | Microsoft Learn](../../../ai-studio/concepts/retrieval-augmented-generation.md)
66
66
-[Retrieval Augmented Generation (RAG) in Azure AI Search](../../../search/retrieval-augmented-generation-overview.md)
67
67
-[Retrieval Augmented Generation using Azure Machine Learning prompt flow (preview)](../../../machine-learning/concept-retrieval-augmented-generation.md)
68
68
69
69
## Fine-tuning
70
70
71
-
### Definition - fine-tuning
71
+
### Definition
72
72
73
73
[Fine-tuning](../how-to/fine-tuning.md), specifically [supervised fine-tuning](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/fine-tuning-now-available-with-azure-openai-service/ba-p/3954693?lightbox-message-images-3954693=516596iC5D02C785903595A) in this context, is an iterative process that adapts an existing large language model to a provided training set in order to improve performance, teach the model new skills, or reduce latency. This approach is used when the model needs to learn and generalize over specific topics, particularly when these topics are generally small in scope.
74
74
75
75
Fine-tuning requires the use of high-quality training data, in a [special example based format](../how-to/fine-tuning.md#example-file-format), to create the new fine-tuned Large Language Model. By focusing on specific topics, fine-tuning allows the model to provide more accurate and relevant responses within those areas of focus.
76
76
77
-
### Illustrative use case - fine-tuning
77
+
### Illustrative use case
78
78
79
79
An IT department has been using GPT-4 to convert natural language queries to SQL, but they have found that the responses are not always reliably grounded in their schema, and the cost is prohibitively high.
80
80
81
81
They fine-tune GPT-3.5-Turbo with hundreds of requests and correct responses and produce a model that performs better than the base model with lower costs and latency.
82
82
83
-
### Things to consider - fine-tuning
83
+
### Things to consider
84
84
85
85
- Fine-tuning is an advanced capability; it enhances LLM with after-cutoff-date knowledge and/or domain specific knowledge. Start by evaluating the baseline performance of a standard model against their requirements before considering this option.
86
86
@@ -94,7 +94,7 @@ They fine-tune GPT-3.5-Turbo with hundreds of requests and correct responses and
94
94
95
95
- Fine-tuning has upfront costs for training the model. And additional hourly costs for hosting the custom model once it's deployed.
96
96
97
-
## Getting started - fine-tuning
97
+
## Getting started
98
98
99
99
-[When to use Azure OpenAI fine-tuning](./fine-tuning-considerations.md)
100
100
-[Customize a model with fine-tuning](../how-to/fine-tuning.md)
0 commit comments