Cache It, Then Check It
A cache stores intermediate keys and values for already processed tokens. In a causal model, earlier token representations cannot depend on future tokens. Reusing those values saves projections, but each new query still compares against the available prefix.
Authored explanation · fixed examples, not a live experiment.
Prefixes 2, 3, 4 → nine uncached projections
→Cache exact prefix → 2 + 1 + 1 = four
→Compare every score, then measure elapsed time
What can a correct cache save? Name the evidence for your answer.
By the end of this lesson
Check every cached score against an uncached reference and reject stale prefixes.
Inside the lesson
- Trace cached projections
- Compare scores, not just IDs
- Test equivalence and stale prefixes
- Explain what was saved
- Reject an equal-length mismatch
- Keep cache provenance
The reproducibility tasks require running the supplied Python starter. Setup instructions and examples are included.