Answered from Causal attention (masked self attention) | The attention family series - Lecture 7 · The attention family · 2026-09-24
Sreedath Panat of Vizuara explains that a language model generates text one token at a time, so at inference it never has value vectors, or keys, for tokens it has not produced yet. During training the whole sentence is available, but if the model learned to build context vectors from later tokens it would rely on information that disappears at inference. Causal attention makes training mimic inference: each position may only use the tokens up to and including itself.
“So if that is the behavior that you expect during inference, during training also you should inject that behavior.” Sreedath Panat · at 9:05 — open in the transcript →
Source: our own transcription of the episode. The full conversation is on The attention family (2026-09-24). Read the whole episode summary →