Causal Attention
The core self-attention mechanism of the Transformer decoder, which uses a lower-triangular mask to ensure that the token at position i can only attend to the prefix from 0 to i, forming the theoretical basis for token-by-token generation and prefix KV reuse.
Core Facts
Timeline (last 90 days)
In autoregressive language models under causal attention, cached prefix states are not rewritten by subsequent tokens, and once the cache is written it is exactly consistent with the result of full recomputation.
In causal attention, positions at the front of the sequence participate in far less computation than positions at the back, which easily leaves threads idle.
The Transformer's encoder uses only self-attention, while the decoder alternates between self-attention and cross-attention.
The Transformer's causal attention mechanism dictates that each token's KV is related only to all the tokens before it, so prompts with completely identical prefixes generate completely identical KV that can be reused directly.
All Facts (5)
The Transformer's encoder uses only self-attention, while the decoder alternates between self-attention and cross-attention.
75%UnverifiedPrompt caching requires strict prefix matching from the beginning; once a token in the middle changes, the attention computation for all subsequent tokens changes and the cached KV pairs are invalidated.
70%UnverifiedIn autoregressive language models under causal attention, cached prefix states are not rewritten by subsequent tokens, and once the cache is written it is exactly consistent with the result of full recomputation.
50%UnverifiedIn causal attention, positions at the front of the sequence participate in far less computation than positions at the back, which easily leaves threads idle.
50%UnverifiedThe Transformer's causal attention mechanism dictates that each token's KV is related only to all the tokens before it, so prompts with completely identical prefixes generate completely identical KV that can be reused directly.
50%