Stage 2 · Intermediate · L5
Talking to models
In a 2023 test, GPT-3.5 did worse with the answer buried in the middle of twenty documents than with no documents at all.
13 lessons · 131 minSteady
About this chapter
A prompt is the opening of a document, and the model continues it. Two things shape what comes out: the text you hand over, and the dial that turns scores into chances. You will see why two worked examples beat a paragraph of adjectives, when step-by-step working helps, and how to get output that always parses. Then the hard parts: made-up facts, prompt injection, testing a prompt like code, and knowing when to stop prompting and change something else.
What you will be able to do
- 19 min
Where a prompt goes
Describe a prompt as the opening of a document the model continues.
- 210 min
Three voices, one document
Explain what a system, user and assistant block are and what enforces them.
- 310 min
Say the thing you want
Rewrite a vague request as constraints a reader could check by hand.
- 411 min
Show, do not tell
Build a worked-example prompt and say what the examples really teach.
- 511 min
Room to think
Say when working out loud buys accuracy and when it only buys tokens.
- 611 min
One dial called temperature
Predict how the shape of the next-token chances moves as temperature rises.
- 710 min
Cutting the tail
Say what top-k and top-p each remove, and which one adapts to the model's confidence.
- 810 min
Output you can parse
Force output that parses every time, and check it after it parses.
- 99 min
Lost in the middle
Place the text that matters where the model actually reads it.
- 1011 min
Why models make things up
Explain where a confident false answer comes from and what actually reduces it.
- 1111 min
Prompt injection is a security bug
Find the injection path in an app and pick a defense that is not a prompt.
- 129 min
Test sets, not vibes
Build a small graded test set and use it to judge a prompt change.
- 139 min
When prompting is the wrong tool
Decide whether a failure needs better words, more text, a tool or training.