Massive Activations in Large Language Models

Mingjie Sun, Xinlei Chen, J. Zico Kolter, Zhuang Liu
2/27/2024
cs.CLcs.LG

Official code: locuslab/massive-activations (201 stars, MIT, last commit 2024-03-04).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

MIT

Code accompanying the paper "Massive Activations in Large Language Models"

20115PythonFeb 6, 20242 years agoMIT
large-language-models

Similar Papers

Cite this paper

@article{sun2024massive,
  title  = {Massive Activations in Large Language Models},
  author = {Mingjie Sun and Xinlei Chen and J. Zico Kolter and Zhuang Liu},
  year   = {2024},
  eprint = {2402.17762},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.17762v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.17762.svg)](https://codeofpaper.com/paper/2402.17762)

Discussion