[Paper Review] Massive Activations in Large Language Models
The paper discovers rare, extremely large activations in LLMs that are input-agnostic and function as fixed biases, concentrate attention on specific tokens, and can be eliminated by explicit attention biases. It also observes similar phenomena in Vision Transformers.
We observe an empirical phenomenon in Large Language Models (LLMs) -- very few activations exhibit significantly larger values than others (e.g., 100,000 times larger). We call them massive activations. First, we demonstrate the widespread existence of massive activations across various LLMs and characterize their locations. Second, we find their values largely stay constant regardless of the input, and they function as indispensable bias terms in LLMs. Third, these massive activations lead to the concentration of attention probabilities to their corresponding tokens, and further, implicit bias terms in the self-attention output. Last, we also study massive activations in Vision Transformers. Code is available at https://github.com/locuslab/massive-activations.
Motivation & Objective
- Identify and characterize massive activations across various LLMs and model sizes.
- Determine where in the network these activations occur and how they behave with respect to inputs.
- Understand the functional role of massive activations within self-attention and model computation.
- Explore whether massive activations generalize to Vision Transformers and their relation to register tokens.
Proposed method
- Analyze hidden states across multiple LLMs (e.g., LLaMA2-7B/13B, Mixtral-8x7B) to locate activations with magnitudes far exceeding the median.
- Define a practical criterion for massive activations (magnitude surpasses 100 and is roughly 1000x the median).
- Intervene on identified activations by setting them to zero or to their mean to assess impact on perplexity and zero-shot tasks.
- Decompose attention outputs to show how massive activations bias attention toward associated tokens.
- Augment self-attention with explicit bias terms to test if such biases remove the need for massive activations.
- Extend analysis to Vision Transformers (ViTs) to compare phenomena and relate to register tokens.
Experimental results
Research questions
- RQ1Do massive activations exist across different LLM architectures and sizes, and where do they occur?
- RQ2What is the input dependence of these activations, and do they function as fixed biases?
- RQ3How do massive activations influence self-attention patterns and attention concentration on certain tokens?
- RQ4Can explicit attention biases replace the need for massive activations in LLMs?
- RQ5Do similar massive activations appear in Vision Transformers, and how do they relate to register tokens?
Key findings
- Massive activations are extremely rare yet widespread across several LLMs, with magnitudes thousands of times larger than the hidden-state median.
- In LLaMA2-7B, the two fixed feature dimensions (1415, 2533) and specific tokens (starting token and period/newline) host massive activations; in LLaMA2-13B they occur in two fixed feature dimensions (2100, 4743) at the starting token; in Mixtral-8x7B they occur in two fixed feature dimensions (2070, 3398) at the starting token, delimiters, and certain words.
- Massive activations behave as input-agnostic bias terms; disabling them catastrophically degrades performance, while setting them to their mean leaves performance largely unchanged.
- Self-attention becomes biased toward tokens with massive activations, effectively forming an implicit attention bias that is additive to the normal attention updates.
- Augmenting attention with explicit bias terms can eliminate the need for massive activations, suggesting they are a learned mechanism to implement biases during pretraining.
- In Vision Transformers, massive activations exist in some ViTs (e.g., CLIP, DINOv2) as fixed biases, often associated with particular tokens or registers; MAE shows no such activations.
- Explicitly fixing register features in ViTs yields performance comparable to originals, indicating registers function as learned biases similar to massive activations.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.