Instructor notes: Frame the problem before naming the mechanism. Collect an initial prediction and retain it for the exit ticket.
Instructor notes: These outcomes are observable: trace, calculation, comparison. A recited definition closes none of them.
Instructor notes: Connect every step to the next with a causal verb. Flag any merely decorative arrow.
Instructor notes: Act the three roles out physically: three learners hold q, k and v of the same position and announce what their vector is for. Once embodied, the roles stop being confused.
Instructor notes: Answer: a position’s score with itself becomes q·q = ‖q‖² ≥ 0, systematically favorable: the head stares at itself and loses the freedom to look for what does not resemble it (compatibility turns symmetric). Expected wrong answer: “nothing changes, they are two learned matrices”.
Instructor notes: Have them compute q·k_Maya and q·k_book before revealing 3 and 2, then ask which token will dominate. The prior vote makes the softmax legible.
Instructor notes: Answer: a key strongly anti-aligned with q = [2,1], e.g. k_Maya = [−4,−2]: q·k = −10 and the weight becomes negligible after softmax. Nuance to surface: an orthogonal key (q·k = 0) does NOT zero the weight — it merely stops favoring it.
Instructor notes: Show [0.62, 0.38] and [0.73, 0.27] side by side without labels and have them guess. Asking “which one divided?” anchors √d_head better than a statistical justification.
Instructor notes: Answer: softmax(3, 2) = [0.731, 0.269] versus [0.622, 0.378] with the division: the first weight rises by +0.11. Expected wrong answer: thinking the token order changes — it does not; only the sharpness of the distribution does.
Instructor notes: Draw the n × n matrix and have the room hatch the upper triangle. Then ask what value goes there: “0” is the frequent wrong answer — it is −∞ BEFORE softmax.
Instructor notes: Answer: only k_Maya is allowed → softmax row [1.000], independent of any learned weight — a single non-(−∞) entry always normalizes to 1. Expected wrong answer: [0.62, 0.38], i.e. the UNMASKED row, the one that reads the future.
Instructor notes: Compute O on the board, then ask aloud: “which word did the model retrieve?” Let someone answer “Maya”, then confront it with the vector [0.622, 0.378]. That moment carries the session.
Instructor notes: Answer: O = [0.622, 0.378] — a combination that is neither v_Maya nor v_book: “retrieval” is always a weighted blend, never a token copy. Expected wrong answer: announcing v_Maya because its weight dominates. Point back to common error 1.
Instructor notes: Have them estimate KV cache size for 32 heads, d_head = 128 and 2,000 tokens before any talk of optimization. The resulting number alone justifies MQA, GQA and cache quantization.
Instructor notes: Answer: recomputed = q, k, v of the single new token, plus one 1×2001 score row per head; merely re-read = the 2,000 k/v pairs × 32 heads from the cache; the time goes to memory bandwidth, not compute. Expected wrong answer: “the whole prefix is recomputed at every token”.
Instructor notes: Hide the final result. Elicit sign, shape, and order of magnitude before every operation.
Instructor notes: Walk line by line. Locate an inconsistency at the first faulty step, not only on the final line.
Instructor notes: Have learners fill the final row before revealing it: that trade-off is what decides in production.
Instructor notes: Retain initial and final values. Do not allow simultaneous changes that make the delta impossible to attribute.
Instructor notes: Have the group produce the smallest counterexample before giving the correction.
Instructor notes: Have the group produce the smallest counterexample before giving the correction.
Instructor notes: The boundary is not a footnote: it defines the cases where the mechanism no longer suffices.
Instructor notes: Separate verifiable mechanism, reported implementation choice, and experimental result. Evidence precision must match claim precision.
Instructor notes: Attribute each product choice to the supplied packet and retain reported status until an independent primary source confirms it.
Instructor notes: Answers: scaled scores [1.5, 1.0, 1.0] → A ≈ [0.452, 0.274, 0.274]: Maya’s weight drops from 0.622 to 0.452 although none of Maya’s vectors changed — every new key takes its share of the softmax budget (sum = 1). O ≈ [0.59, 0.41]. Misconception to harvest: “adding a token only affects that token”. Six to eight minutes, pairs.
Instructor notes: Rebuild the chain without looking at the slides. Reopen only the first break.
Instructor notes: Six lines maximum. Compare with the initial prediction and name what actually changed. Cite one retained trace that lets a peer verify the conclusion.