mlsanityData to 7 Oct 2026

From Attention to Activation: Unravelling the Enigmas of Large Language Models

arXiv 2410.17174 ↗First posted 22 Oct 2024cs.CLcited by 13

Not on the map. Why?

Abstract (arXiv)

We study two strange phenomena in auto-regressive Transformers: (1) the dominance of the first token in attention heads; (2) the occurrence of large outlier activations in the hidden states. We find that popular large language models, such as Llama attend maximally to the first token in 98% of attention heads, a behaviour we attribute to the softmax function. To mitigate this issue, we propose a reformulation of softmax to softmax-1. Furthermore, we identify adaptive optimisers, e.g. Adam, as the primary contributor to the large outlier activations and introduce OrthoAdam, a novel optimiser that utilises orthogonal matrices to transform gradients, to address this issue. Finally, not only do our methods prevent these phenomena from occurring, but additionally, they enable Transformers to sustain their performance when quantised using basic algorithms, something that standard methods are unable to do. In summary, our methods reduce the attention proportion on the first token from 65% to 3.3%, the activation kurtosis in the hidden states from 1657 to 3.1, and perplexity penalty under 4-bit weight quantisation from 3565 to 0.3.

Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 33 of its 46 references that are in the map. First posted on arXiv 22 Oct 2024.

Builds on

33 of 46 references.

References · 33

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  5. 2022Training language models to follow instructions with human feedbackcited by 15,712
  6. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  7. 2024The Llama 3 Herd of Modelscited by 14,192
  8. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  9. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  10. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  11. 2020End-to-End Object Detection with Transformerscited by 7,384
  12. 2016Layer Normalizationcited by 5,579
21 more
  1. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  2. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  3. 2016Gaussian Error Linear Units (GELUs)cited by 3,431
  4. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  5. 2019Root Mean Square Layer Normalizationcited by 1,425
  6. 2022SmoothQuant: Accurate and Efficient Post-Training Quantization for Large Language Modelscited by 1,338
  7. 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,093
  8. 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
  9. 2017Sigmoid-Weighted Linear Units for Neural Network Function Approximation in Reinforcement Learningcited by 935
  10. 2022Toy Models of Superpositioncited by 928
  11. 2020On Layer Normalization in the Transformer Architecturecited by 906
  12. 2022LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scalecited by 881
  13. 2023Vision Transformers Need Registerscited by 844
  14. 2017The Implicit Bias of Gradient Descent on Separable Datacited by 649
  15. 2021Documenting Large Webtext Corpora: A Case Study on the Colossal Clean Crawled Corpuscited by 481
  16. 2023Quantizable Transformers: Removing Outliers by Helping Attention Heads Do Nothingcited by 147
  17. 2021Understanding and Overcoming the Challenges of Efficient Transformer Quantizationcited by 139
  18. 2018Theoretical Analysis of Auto Rate-Tuning by Batch Normalizationcited by 65
  19. 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
  20. 2020Towards Fully 8-bit Integer Inference for the Transformer Modelcited by 35
  21. 2024Understanding and Minimising Outlier Features in Neural Network Trainingcited by 10

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 6; 2026: 7.

13 papers.

Sort:

By area: