Causal Attention
What is Causal Attention?
In one sentence: Causal attention only lets each word look at the words before it, never the words after.
When a model writes text, it should not cheat by peeking at future words that do not exist yet. Causal attention blocks those future positions using a mask, so the model learns to predict truly from left to right.
What does Causal Attention look like?
When predicting the 5th word, causal attention lets the model see words 1 to 4 only.
Why does Causal Attention matter?
Causal attention is what makes GPT-style models able to generate text one token at a time.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/causal-attention/">Causal Attention, explained simply</a> (The AI Math Dictionary)