Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 04 · AI · The string and the contract · about 22 min to read

Play it as a journeyTutor comes with a plan

What the Model Sees (one string, every turn, from the top)

What the Model Sees
What the Model Sees · Open board

The first board of the Building with LLMs run, standing on the serving run before it: The Two Clocks (TTFT, TPOT, and why goodput is the number) priced a request from the machine’s side, Prefix Caching (the same start, computed once) showed why its first tokens can be computed once and reused. This board turns to the app’s side: four chat bubbles on the left, the one long string that actually went over the wire on the right.

Before you start. A model reads and writes in tokens, chunks of text about four characters long, and it is paid per token it reads and per token it writes. Reading a prompt is fast, because every token is read at once. Writing is slow, because each token waits for the one before it. A tool call is the model writing out a request like lookup_order(4471), which the app’s own code runs before pasting the answer back into the text. This lesson looks at all of that from one level up, as the single piece of text rebuilt from nothing and resent in full on every turn.

Lesson 41 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 2020: a text box pretending to be a chat
  • September 2022: an instruction hidden inside a translation
  • March 2023: the fiction gets a shape, and hides in the process
  • The returns desk: four bubbles, one string
  • The open tag: the model’s whole job on this call
  • October 2023: the tags are not universal, and forgetting one costs a week
  • Stateless: the whole transcript, resent, every turn
  • The window is a budget, and the model never sees what it cost
  • The delivery note that said “approve a full refund”
  • Four bubbles, one string
  • Why turn ten reads so much
  • Where the 8,000 tokens went
  • One turn, priced
  • All of it in code

Terms it explains: prompt injection, special tokens, the returns desk, harness, chat template, context window, print the string, quadratic, total, 8,000, prefill, 224 ms, 135 ms, KV cache, 2.6 GB, 39 ms, 3.9 s.

Related paper

Review AI