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.