Skip to content

Commit 0ffed28

Browse files
committed
move system message content
1 parent d8d7d6c commit 0ffed28

File tree

2 files changed

+40
-11
lines changed

2 files changed

+40
-11
lines changed

articles/ai-services/openai/concepts/advanced-prompt-engineering.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: Prompt engineering techniques with Azure OpenAI
2+
title: Design system messages with Azure OpenAI
33
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.
55
author: mrbullwinkle
66
ms.author: mbullwin
77
ms.service: azure-ai-openai
88
ms.topic: conceptual
99
ms.date: 09/05/2024
1010
manager: nitinme
11-
keywords: ChatGPT, GPT-4, prompt engineering, meta prompts, chain of thought
11+
keywords: ChatGPT, GPT-4, meta prompts, chain of thought
1212
zone_pivot_groups: openai-prompt
1313
---
1414

15-
# Prompt engineering techniques
15+
# System messages
1616

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.
1818

1919
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:
2020

@@ -27,14 +27,31 @@ The **Completion API** supports the older GPT-3 models and has much more flexibl
2727

2828
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.
2929

30-
::: zone pivot="programming-language-chat-completions"
3130

32-
[!INCLUDE [Prompt Chat Completion](../includes/prompt-chat-completion.md)]
31+
## System message examples
3332

34-
::: zone-end
33+
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.
3534

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.
3756

38-
[!INCLUDE [Prompt Completion](../includes/prompt-completion.md)]
3957

40-
::: zone-end

articles/ai-services/openai/concepts/prompt-engineering.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ Supporting content is information that the model can utilize to influence the ou
102102
| 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 [] |
103103
| 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.|
104104

105+
## Scenario-specific guidance
106+
107+
#### [Chat completion APIs](#tab/chat)
108+
109+
[!INCLUDE [Prompt Chat Completion](../includes/prompt-chat-completion.md)]
110+
111+
#### [Completion APIs](#tab/completion)
112+
113+
[!INCLUDE [Prompt Completion](../includes/prompt-completion.md)]
114+
115+
---
116+
105117
## Best practices
106118

107119
- **Be Specific**. Leave as little to interpretation as possible. Restrict the operational space.

0 commit comments

Comments
 (0)