Skip to content

Commit fcd06be

Browse files
committed
update
1 parent fbafc27 commit fcd06be

File tree

3 files changed

+62
-4
lines changed

3 files changed

+62
-4
lines changed

articles/cognitive-services/openai/includes/prompt-chat-completion.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,15 @@ Although following this technique is still generally recommended, in contrast to
6969
| System message |User | Assistant |
7070
|----------------|---------|------------|
7171
| You are an AI assistant that helps people find information.| Your task is to verify if the statement "Several sources mention a chance of another large eruption" is supported by a specific quote from the following set of snippets.<br>---<br>SNIPPETS<br>[1] 14 percent chance of megaquake hitting Seattle, experts say
72-
SEATTLE - There's a 14 percent chance of a magnitude 9 Cascadia earthquake hitting Seattle in the next 50 years, the U.S. Geological Survey estimates. "Unfortunately, we are unable to...<br><br>[2] Earthquake experts lay out latest outlook for Seattle's 'Really Big One’
73-
“We say that there's approximately a 14% chance of another approximately magnitude-9 earthquake occurring in the next 50 years,” said a geophysicist at the University of Washington...<br>---<br>Is the statement "Several sources mention a chance of another large eruption" directly implied or stated by the snippets?| No, the statement is not directly implied or stated by the snippets. The snippets mention a chance of a "megaquake" and a "magnitude 9 Cascadia earthquake" hitting Seattle in the next 50 years, but do not mention a chance of another large eruption. |
72+
SEATTLE - There's a 14 percent chance of a magnitude 9 Cascadia earthquake hitting Seattle in the next 50 years, the U.S. Geological Survey estimates. "Unfortunately, we are unable to...<br><br>[2] Earthquake experts lay out latest outlook for Seattle's 'Really Big One’<br>“We say that there's approximately a 14% chance of another approximately magnitude-9 earthquake occurring in the next 50 years,” said a geophysicist at the University of Washington...<br>---<br>Is the statement "Several sources mention a chance of another large eruption" directly implied or stated by the snippets?| No, the statement is not directly implied or stated by the snippets. The snippets mention a chance of a "megaquake" and a "magnitude 9 Cascadia earthquake" hitting Seattle in the next 50 years, but do not mention a chance of another large eruption. |
7473

7574
## Repeat instructions at the end
7675

7776
Models can be susceptible to “recency bias,” which means that information at the end of the prompt might have more significant influence over the output than information at the beginning of the prompt. Therefore, it is worth experimenting with repeating the instructions at the end of the prompt and evaluating the impact for your use case.
7877

7978
## Prime the output
8079

81-
This refers to including a few words or phrases at the end of the prompt to obtain a model response that follows the desired form. For example, using a cue such as “Here’s a bulleted list of key points:\n- ” can help make sure the outputted is formatted as a list of bullet points.
80+
This refers to including a few words or phrases at the end of the prompt to obtain a model response that follows the desired form. For example, using a cue such as `“Here’s a bulleted list of key points:\n- ”` can help make sure the outputted is formatted as a list of bullet points.
8281

8382
| System message |User | Assistant |
8483
|----------------|---------|------------|

articles/cognitive-services/openai/includes/prompt-completion.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,57 @@ manager: nitinme
1111
keywords: ChatGPT
1212
---
1313

14-
## Working with the ChatGPT models (preview)
14+
## Start with clear instructions
15+
16+
The sequence in which information is fed in the prompt, matters (GPT style models are built in a certain way and that’s the reason behind this). Our research suggests that telling the model the task you want it to do at the beginning of the prompt, before sharing additional contextual information or examples, can help produce higher-quality outputs.
17+
18+
|Prompt|Completion|
19+
|------|----------|
20+
|Your task is to verify if the statement "Several sources mention a chance of another large eruption" is supported by a specific quote from the following set of snippets.<br>---<br>SNIPPETS<br>[1] 14 percent chance of megaquake hitting Seattle, experts say<br>SEATTLE - There's a 14 percent chance of a magnitude 9 Cascadia earthquake hitting Seattle in the next 50 years, the U.S. Geological Survey estimates. "Unfortunately, we are unable to...<br><br>[2] Earthquake experts lay out latest outlook for Seattle's 'Really Big One’<br>“We say that there's approximately a 14% chance of another approximately magnitude-9 earthquake occurring in the next 50 years,” said a geophysicist at the University of Washington...<br>|Yes, the statement is directly implied by the snippets.|
21+
22+
In this next example, we give the exact statement we want to check (“Several sources mention a chance of another eruption”) before we give the snippet context. This allows the token representations extracted from the snippets to be tailored to the statement we are checking. And the resulting model response is accurate:
23+
24+
|Prompt|Completion|
25+
|------|----------|
26+
|Your task is to verify if the statement "Several sources mention a chance of another large eruption" is supported by a specific quote from the following set of snippets.<br>---<br>SNIPPETS<br>[1] 14 percent chance of megaquake hitting Seattle, experts say
27+
SEATTLE - There's a 14 percent chance of a magnitude 9 Cascadia earthquake hitting Seattle in the next 50 years, the U.S. Geological Survey estimates. "Unfortunately, we are unable to...<br><br>[2] Earthquake experts lay out latest outlook for Seattle's 'Really Big One’<br>“We say that there's approximately a 14% chance of another approximately magnitude-9 earthquake occurring in the next 50 years,” said a geophysicist at the University of Washington...<br>---<br>**Is the statement "Several sources mention a chance of another large eruption" directly implied or stated by the snippets?**| No, the statement is not directly implied or stated by the snippets. The snippets mention a chance of a "megaquake" and a "magnitude 9 Cascadia earthquake" hitting Seattle in the next 50 years, but do not mention a chance of another large eruption.|
28+
29+
## Repeat the instructions at the end
30+
31+
Models can be susceptible to “recency bias,” which means that information at the end of the prompt might have more significant influence over the output than information at the beginning of the prompt. Therefore, it is worth experimenting with repeating the instructions at the end of the prompt and evaluating the impact for your use case.
32+
33+
We saw in the earlier example how repeating the instruction at the beginning as well as the end of the prompt leads to a higher likelihood of getting an accurate model response.
34+
35+
## Prime the output
36+
37+
This refers to including a few words or phrases at the end of the prompt to obtain a model response that follows the desired form. For example, using a cue such as `“Here’s a bulleted list of key points:\n- ”` can help make sure the outputted is formatted as a list of bullet points.
38+
39+
|Prompt|Completion|
40+
|------|----------|
41+
| John Smith is married to Lucy Smith. They have five kids, and he works as a software engineer at Microsoft. What search queries should I do to fact-check this? <br>##<br>One possible search query is:|"John Smith Microsoft software engineer"<br>Another possible search query is: "Lucy Smith married to John Smith"<br>A third possible search query is: "John Smith family size".|
42+
43+
In the above prompt, the text **"One possible search query is:"** primes the model to produce an output in the form of a search query. This technique can help remove hedges that the model might typically add, such as “One possibility is...”.
44+
45+
## Add clear syntax
46+
47+
Using clear syntax for your prompt—including punctuation, headings, and section markers—helps communicate intent and often makes outputs easier to parse.
48+
49+
In the example below, separators (“---” in this case) have been added between different sources of information or steps. This allows the use of “---” as a stopping condition for generation. In addition, section headings or special variables are presented in uppercase to differentiate them.
50+
51+
|Prompt|Completion|
52+
|------|----------|
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
1565

1666

1767

articles/zone-pivot-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,15 @@ groups:
15111511
title: Chat Completion
15121512
- id: programming-language-chat-ml
15131513
title: ChatML
1514+
#Owner: mbullwin
1515+
- id: openai-prompt
1516+
title: API Options
1517+
prompt: API options
1518+
pivots:
1519+
- id: programming-language-chat-completions
1520+
title: Chat Completion
1521+
- id: programming-language-completions
1522+
title: Completion
15141523
# Owner: mbullwin
15151524
- id: openai-create-resource
15161525
title: Programming languages

0 commit comments

Comments
 (0)