LESSON 34.04 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
Prompt compression and context pruning
Watch three cuts shrink a chat prompt, and see what each cut costs.
Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 34.04 · PROMPT TRIMMERPROMPT 1,000 · OUTPUT 200 · 45.7 MS
01
Stage 1 of 5 · Where tokens go
Each prompt holds a system prompt, earlier turns, help chunks and a question. One output token costs as much as 6 prompt tokens.
Explain it simply
Each row is one of the 12 sample chats. Each row starts with the system prompt, and the prefix cache already holds it, so it costs little. In the panel, one output token takes about 144 microseconds of GPU time. A new prompt token takes only 23.
Twelve rows of prompt tokens, 1,000 on average. A request uses 45.7 GPU milliseconds, and the busy GPU time costs 137 dollars a day.
prompt tokens: system, turns, summary, chunks, questionoutput tokens, GPU time, costsettings, 1B model worklost factsdashed: removed tokens
Toy: 12 help-chat requests, 8B model on an H100, toy prices
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
GPU time adds new prompt tokens, cached tokens and output tokens.
PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
- 4 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.