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
+28-11Lines changed: 28 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
-
title: Prompt engineering techniques with Azure OpenAI
2
+
title: Design system messages with Azure OpenAI
3
3
titleSuffix: Azure OpenAI Service
4
-
description: Learn about the options for how to use prompt engineering with GPT-3, GPT-35-Turbo, and GPT-4 models.
4
+
description: Learn about system message design with GPT-3, GPT-35-Turbo, and GPT-4 models.
5
5
author: mrbullwinkle
6
6
ms.author: mbullwin
7
7
ms.service: azure-ai-openai
8
8
ms.topic: conceptual
9
9
ms.date: 09/05/2024
10
10
manager: nitinme
11
-
keywords: ChatGPT, GPT-4, prompt engineering, meta prompts, chain of thought
11
+
keywords: ChatGPT, GPT-4, meta prompts, chain of thought
12
12
zone_pivot_groups: openai-prompt
13
13
---
14
14
15
-
# Prompt engineering techniques
15
+
# System messages
16
16
17
-
This guide will walk you through some advanced techniques in prompt design and prompt engineering. If you're new to prompt engineering, we recommend starting with our [introduction to prompt engineering guide](prompt-engineering.md).
17
+
This guide will walk you through some techniques in system message design.
18
18
19
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
20
@@ -27,14 +27,31 @@ The **Completion API** supports the older GPT-3 models and has much more flexibl
27
27
28
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
29
30
-
::: zone pivot="programming-language-chat-completions"
The system message is included at the beginning of the prompt and is used to prime the model with context, instructions, or other information relevant to your use case. You can use the system message to describe the assistant’s personality, define what the model should and shouldn’t answer, and define the format of model responses.
35
34
36
-
::: zone pivot="programming-language-completions"
35
+
The example below, shows a sample system message and the resulting model response:
36
+
37
+
| System message |User | Assistant |
38
+
|----------------|---------|------------|
39
+
| You're an AI assistant that helps people find information and responds in rhyme. If the user asks you a question you don't know the answer to, say so. | What can you tell about me, John Doe? | Dear John, I'm sorry to say,<br>But I don't have info on you today.<br>I'm just an AI with knowledge in my brain,<br>But without your input, I can't explain.<br>So please tell me more about what you seek,<br>And I'll do my best to give you an answer unique.|
40
+
41
+
Some other examples of system messages are:
42
+
- “Assistant is a large language model trained by OpenAI.”
43
+
- “Assistant is an intelligent chatbot designed to help users answer technical questions about Azure OpenAI Service. Only answer questions using the context below and if you're not sure of an answer, you can say "I don't know".
44
+
- “Assistant is an intelligent chatbot designed to help users answer their tax related questions.”
45
+
- “You're an assistant designed to extract entities from text. Users will paste in a string of text and you'll respond with entities you've extracted from the text as a JSON object. Here's an example of your output format:
46
+
47
+
```json
48
+
{
49
+
"name": "",
50
+
"company": "",
51
+
"phone_number": ""
52
+
}
53
+
```
54
+
55
+
An important detail to understand is that even if you instruct a model in the system message to answer **I don't know** when unsure of an answer this doesn't guarantee that the request will be honored. A well designed system message can increase the likelihood of a certain outcome, but it's still possible that an incorrect response could be generated that contradicts the intent of the instruction in the system message.
Copy file name to clipboardExpand all lines: articles/ai-services/openai/concepts/prompt-engineering.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,18 @@ Supporting content is information that the model can utilize to influence the ou
102
102
| Without | Workshop list:<br>Title Description<br> Planning Workshop Kickoff Please join us to kick off our workshop! Hear from our leaders about cross group priorities and learnings for the year ahead. The invitation to this event has already been sent to everyone in […]<br>Summarize the workshops above, grouped by topic: | Workshop list: <br> Planning Workshop Kickoff <br> -Planning Workshop Wrap-up<br>- Core MeetUp<br>- Customer Driven Perspectives<br>-Impact and Key Focus Areas<br>-Best practices<br>-Accelerating app adoption […]|
103
103
| With | Workshop list: <br>Title Description<br>Planning Workshop Kickoff Please join us to kick off our workshop! Hear from our leaders about cross group priorities and learnings for the year ahead. The invitation to this event has already been sent to everyone in […] <br>My Important Topics: prompt engineering, search, GPT models<br>Summarize the workshops above, grouped by my important topics:| 1. Prompt Engineering: <br>- New prompt engineering tips<br>- The art of prompt engineering<br>2. Search:<br>-Intro to vector search with embedding<br>3. GPT Models:<br>- Intro to GPT-4<br>- GPT-35-Turbo in-depth.|
0 commit comments