Skip to content

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

  1. 1

    Where a Prompt Goes

    Describe a prompt as the opening of a document the model continues.

    9 min
  2. 2

    Three Voices, One Document

    Explain what a system, user and assistant block are and what enforces them.

    10 min
  3. 3

    Say the Thing You Want

    Rewrite a vague request as constraints a reader could check by hand.

    10 min
  4. 4

    Show, Do Not Tell

    Build a worked-example prompt and say what the examples really teach.

    11 min
  5. 5

    Room to Think

    Say when working out loud buys accuracy and when it only buys tokens.

    11 min
  6. 6

    One Dial Called Temperature

    Predict how the shape of the next-token chances moves as temperature rises.

    11 min
  7. 7

    Cutting the Tail

    Say what top-k and top-p each remove, and which one adapts to the model's confidence.

    10 min
  8. 8

    Output You Can Parse

    Force output that parses every time, and check it after it parses.

    10 min
  9. 9

    Lost in the Middle

    Place the text that matters where the model actually reads it.

    9 min
  10. 10

    Why Models Make Things Up

    Explain where a confident false answer comes from and what actually reduces it.

    11 min
  11. 11

    Prompt Injection Is a Security Bug

    Find the injection path in an app and pick a defense that is not a prompt.

    11 min
  12. 12

    Test Sets, Not Vibes

    Build a small graded test set and use it to judge a prompt change.

    9 min
  13. 13

    When Prompting Is the Wrong Tool

    Decide whether a failure needs better words, more text, a tool or training.

    9 min

Before you start

Keep going

All chapters