Causal Attention: Don't Peek Ahead

A model that predicts the next token must never see it. A triangular mask on the attention scores enforces this, and it is exactly what lets a model learn from every position of a sentence at once.

Large Language Models: From Transformers to Frontier Models

Sign up free to read the rest of this lesson