AI-901 ยท Generative AI apps in Foundry
System, user and assistant messages
The roles of system, user and assistant messages; writing clear instructions, context, format and examples; few-shot prompting; and grounding with supplied data.
Key points
- The system message sets standing behavior (persona, rules, output format).
- User messages carry the request.
- Assistant messages are earlier model replies, used as conversation history or as examples.
- Good prompts state the task clearly, add context or source data (grounding), specify the format, and may include a few examples (few-shot).
Practice questions
Which message role is the best place for standing rules such as "always answer in two sentences"?
- System
- User
- Assistant
- Tool
Show answer
Answer: A. System
Standing behavior belongs in the system message. User messages are per-request, and assistant messages are model output.
Which techniques help ground answers in your own data?
- Include the relevant document excerpt in the prompt
- Instruct the model to answer only from the supplied text
- Increase the temperature
- Tell the model to say it does not know when the text lacks the answer
- Increase max tokens
Show answer
Answer: A. Include the relevant document excerpt in the prompt, B. Instruct the model to answer only from the supplied text, D. Tell the model to say it does not know when the text lacks the answer
Supplying the source text and telling the model to rely only on it (and admit gaps) grounds the answer. A higher temperature and a bigger token limit do not add facts.
True or false: Few-shot prompting retrains the model's weights with your examples.
Show answer
Answer: False
False. Examples in the prompt guide the response for that request only; the model weights stay unchanged.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
