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/advanced-prompt-engineering.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,24 +9,26 @@ ms.topic: conceptual
9
9
ms.date: 09/05/2024
10
10
manager: nitinme
11
11
keywords: ChatGPT, GPT-4, meta prompts, chain of thought
12
-
zone_pivot_groups: openai-prompt
13
12
---
14
13
15
-
# System messages
14
+
# System message design
16
15
17
16
This guide will walk you through some techniques in system message design.
18
17
19
-
While the principles of prompt engineering can be generalized across many different model types, certain models expect a specialized prompt structure. For Azure OpenAI GPT models, there are currently two distinct APIs where prompt engineering comes into play:
20
18
21
-
- Chat Completion API.
22
-
- Completion API.
23
19
24
-
Each API requires input data to be formatted differently, which in turn impacts overall prompt design. The **Chat Completion API** supports the GPT-35-Turbo and GPT-4 models. These models are designed to take input formatted in a [specific chat-like transcript](../how-to/chatgpt.md) stored inside an array of dictionaries.
20
+
## What is a system message?
25
21
26
-
The **Completion API** supports the older GPT-3 models and has much more flexible input requirements in that it takes a string of text with no specific format rules.
22
+
A system message is a feature-specific set of instructions or contextual frameworks given to a generative AI model (e.g. GPT4-o, GPT3.5 Turbo, etc.) to direct and improve the quality and safety of a model’s output. This is particularly helpful in situations that need certain degrees of formality, technical language, or industry-specific terms.
27
23
28
-
The techniques in this guide will teach you strategies for increasing the accuracy and grounding of responses you generate with a Large Language Model (LLM). It is, however, important to remember that even when using prompt engineering effectively you still need to validate the responses the models generate. Just because a carefully crafted prompt worked well for a particular scenario doesn't necessarily mean it will generalize more broadly to certain use cases. Understanding the [limitations of LLMs](/legal/cognitive-services/openai/transparency-note?context=/azure/ai-services/openai/context/context#limitations), is just as important as understanding how to leverage their strengths.
29
24
25
+
There is no prescribed length. A system message can be one short sentence:
26
+
27
+
```
28
+
You are a helpful AI assistant.
29
+
```
30
+
31
+
A system message can also be *many* lines long, containing detailed rules, detailed context, formatting and output guidelines, and responsible AI (RAI) mitigations.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/prompt-engineering.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,17 @@ Supporting content is information that the model can utilize to influence the ou
104
104
105
105
## Scenario-specific guidance
106
106
107
+
While the principles of prompt engineering can be generalized across many different model types, certain models expect a specialized prompt structure. For Azure OpenAI GPT models, there are currently two distinct APIs where prompt engineering comes into play:
108
+
109
+
- Chat Completion API.
110
+
- Completion API.
111
+
112
+
Each API requires input data to be formatted differently, which in turn impacts overall prompt design. The **Chat Completion API** supports the GPT-35-Turbo and GPT-4 models. These models are designed to take input formatted in a [specific chat-like transcript](../how-to/chatgpt.md) stored inside an array of dictionaries.
113
+
114
+
The **Completion API** supports the older GPT-3 models and has much more flexible input requirements in that it takes a string of text with no specific format rules.
115
+
116
+
The techniques in this section will teach you strategies for increasing the accuracy and grounding of responses you generate with a Large Language Model (LLM). It is, however, important to remember that even when using prompt engineering effectively you still need to validate the responses the models generate. Just because a carefully crafted prompt worked well for a particular scenario doesn't necessarily mean it will generalize more broadly to certain use cases. Understanding the [limitations of LLMs](/legal/cognitive-services/openai/transparency-note?context=/azure/ai-services/openai/context/context#limitations), is just as important as understanding how to leverage their strengths.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/safety-system-message-templates.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,23 @@
1
+
---
2
+
title: Safety system message templates
3
+
titleSuffix: Azure OpenAI Service
4
+
description: This article contains recommended safety system messages for your generative AI systems, to help reduce the propensity of harm in various concern areas.
5
+
ms.service: azure-ai-openai
6
+
ms.topic: conceptual
7
+
ms.date: 09/20/2024
8
+
ms.custom:
9
+
manager: nitinme
10
+
author: PatrickFarley
11
+
ms.author: pafarley
12
+
---
1
13
2
14
15
+
# Safety system message templates
3
16
4
-
# Safety System Message Templates
5
17
18
+
This article contains recommended safety system messages for your generative AI systems, to help reduce the propensity of harm in various concern areas. Before you begin evaluating and integrating your safety system messages, visit the [Safety System Message documentation](/azure/ai-services/openai/concepts/system-message) to get started.
6
19
7
-
This article contains recommended safety system messages for your generative AI systems, to help reduce the propensity of harm in various concern areas. Before you begin evaluating and integrating your safety system messages, visit the [Safety System Message documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/system-message) to get started.
8
-
9
-
Please note using a safety system message is one of many techniques that can be used for mitigations risks in AI systems, and different from [Azure AI Content Safety](https://learn.microsoft.com/en-us/azure/ai-services/content-safety/overview).
20
+
Please note using a safety system message is one of many techniques that can be used for mitigations risks in AI systems, and different from [Azure AI Content Safety](/azure/ai-services/content-safety/overview).
10
21
11
22
## Recommended system messages
12
23
@@ -26,7 +37,7 @@ The following steps show how to leverage safety system messages in Azure AI stud
26
37
1. Go to Azure AI Studio and navigate to Azure OpenAI and the Chat playground.
27
38
:::image type="content" source="../media/navigate-chat-playground.PNG" alt-text="Screenshot of the AI Studio selection.":::
28
39
1. Navigate to the default safety system messages integrated in the studio.
29
-
:::image type="content" source="../media/navigate-system-message.PNG" alt-text="Screenshot of the system message selection.":::
40
+
:::image type="content" source="../media/navigate-system-message.PNG" alt-text="Screenshot of the system message navigation.":::
30
41
1. Select the system message(s) that are applicable to your scenario.
31
42
:::image type="content" source="../media/select-system-message.PNG" alt-text="Screenshot of the system message selection.":::
32
43
1. Review and edit the safety system messages based on the best practices outlined here.
@@ -40,4 +51,4 @@ The following steps show how to leverage safety system messages in Azure AI stud
40
51
41
52
## Evaluation
42
53
43
-
We recommend informing your safety system message approach based on an iterative process of identification and evaluation. Learn more in our [Safety System Message documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/system-message).
54
+
We recommend informing your safety system message approach based on an iterative process of identification and evaluation. Learn more in our [Safety System Message documentation](/azure/ai-services/openai/concepts/system-message).
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/system-message.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Safety System Messages
2
+
title: Safety system messages
3
3
titleSuffix: Azure OpenAI Service
4
4
description: Learn about how to construct system messages also know as metaprompts to guide an AI system's behavior.
5
5
ms.service: azure-ai-openai
@@ -13,7 +13,7 @@ ms.author: mbullwin
13
13
recommendations: false
14
14
---
15
15
16
-
# Safety System Messages
16
+
# Safety system messages
17
17
18
18
This article recommends frameworks and examples for writing effective system messages to guide AI models’ behavior, improve output quality and accuracy, and mitigate harms. Alongside other mitigation techniques, system messages provide a more precise way of determining safe outputs.
19
19
@@ -35,9 +35,9 @@ You are a helpful AI assistant.
35
35
36
36
A system message can also be *many* lines long, containing detailed rules, detailed context, formatting and output guidelines, and responsible AI (RAI) mitigations.
37
37
38
-
## Safety System Messages
38
+
## Safety system message examples
39
39
40
-
Safety system messages are a type of system message that provide explicit instructions to mitigate against potential RAI harms and guide systems to interact safely with users. Safety system messages complement your safety stack and can be added alongside foundation model training, data grounding, Azure AI Content Safety classifiers, and UX/UI interventions. Learn more about [Responsible AI practices for Azure OpenAI models](https://learn.microsoft.com/en-us/legal/cognitive-services/openai/overview?context=%2Fazure%2Fai-services%2Fopenai%2Fcontext%2Fcontext).
40
+
Safety system messages are a type of system message that provide explicit instructions to mitigate against potential RAI harms and guide systems to interact safely with users. Safety system messages complement your safety stack and can be added alongside foundation model training, data grounding, Azure AI Content Safety classifiers, and UX/UI interventions. Learn more about [Responsible AI practices for Azure OpenAI models](/legal/cognitive-services/openai/overview?context=%2Fazure%2Fai-services%2Fopenai%2Fcontext%2Fcontext).
41
41
42
42
While this technique is very effective, it is still fallible, and most safety system messages need to be used in combination with other safety mitigations.
43
43
@@ -107,7 +107,7 @@ For safety system message components, the primary criterion is the improvement i
107
107
108
108
### 7/ Iterate on system messages and safety system components and above steps
109
109
110
-
Based on your evaluations, revisit your top components to improve any issues to reach an acceptable level. Continue to monitor and evaluate your system regularly as changes are introduced, including new use cases, updated models, etc. Remember that even when using this guidance, you still need to validate your model responses per scenario. A well-crafted system message for one scenario may not work more broadly across other scenarios. Understanding the [limitations of LLMs](https://learn.microsoft.com/en-us/legal/cognitive-services/openai/transparency-note?context=/azure/ai-services/openai/context/context#limitations) and the [mechanisms for evaluating and mitigating those limitations](https://learn.microsoft.com/en-us/legal/cognitive-services/openai/overview?context=/azure/ai-services/openai/context/context) is just as important as understanding how to leverage their strengths.
110
+
Based on your evaluations, revisit your top components to improve any issues to reach an acceptable level. Continue to monitor and evaluate your system regularly as changes are introduced, including new use cases, updated models, etc. Remember that even when using this guidance, you still need to validate your model responses per scenario. A well-crafted system message for one scenario may not work more broadly across other scenarios. Understanding the [limitations of LLMs](/legal/cognitive-services/openai/transparency-note?context=/azure/ai-services/openai/context/context#limitations) and the [mechanisms for evaluating and mitigating those limitations](/legal/cognitive-services/openai/overview?context=/azure/ai-services/openai/context/context) is just as important as understanding how to leverage their strengths.
111
111
112
112
113
113
## Summary of best practices
@@ -163,7 +163,7 @@ Finally, remember that system messages, or metaprompts, are not "one size fits a
-[Prompt engineering techniques with Azure OpenAI](/azure/ai-services/openai/concepts/advanced-prompt-engineering?pivots=programming-language-chat-completions)
168
168
-[Announcing Safety System Messages in Azure AI Studio and Azure OpenAI Studio](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-safety-system-messages-in-azure-ai-studio-and-azure/ba-p/4146991) - Microsoft Community Hub
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/use-your-data.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -478,7 +478,7 @@ Use the following practices for best results when chatting with the model.
478
478
479
479
* If you aren't satisfied with the model response for a specific question, try either making the question more specific or more generic to see how the model responds, and reframe your question accordingly.
480
480
481
-
*[Chain-of-thought prompting](advanced-prompt-engineering.md?pivots=programming-language-chat-completions#chain-of-thought-prompting) has been shown to be effective in getting the model to produce desired outputs for complex questions/tasks.
481
+
*[Chain-of-thought prompting](prompt-engineering.md?pivots=programming-language-chat-completions#chain-of-thought-prompting) has been shown to be effective in getting the model to produce desired outputs for complex questions/tasks.
0 commit comments