paper-with-me

Papers

Active-Dormant Attention Heads: Mechanistically Demystifying Extreme-Token Phenomena in LLMs

2024-10-17 · Tianyu Guo, Druv Pai, Yu Bai, Jiantao Jiao, Michael I. Jordan, Song Mei

Practitioners have consistently observed three puzzling phenomena in transformer-based large language models (LLMs): attention sinks, value-state drains, and residual-state peaks, collectively referred to as extreme-token phenomena. These phenomena are characterized by certain so-called "sink tokens" receiving disproportionately high attention weights, exhibiting significantly smaller value states, and having much larger residual-state norms than those of other tokens. These extreme tokens give rise to various challenges in LLM inference, quantization, and interpretability. We elucidate the mechanisms behind extreme-token phenomena. First, we show that these phenomena arise in very simple architectures -- transformers with one to three layers -- trained on a toy model, the Bigram-Backcopy (BB) task. In this setting, we identify an active-dormant mechanism, where attention heads become sinks for specific input domains while remaining non-sinks for others. Our theoretical analysis of the training dynamics reveals that these phenomena are driven by a mutual reinforcement mechanism. Building on these insights, we propose strategies to mitigate extreme-token phenomena during pretraining, including replacing softmax with ReLU and Adam with SGD. Next, we extend our analysis to pretrained LLMs, including Llama and OLMo, showing that many attention heads exhibit a similar active-dormant mechanism as in the BB task, and that the mutual reinforcement mechanism also governs the emergence of extreme-token phenomena during LLM pretraining. Our results reveal that many of the static and dynamic properties of extreme-token phenomena predicted by the BB task align with observations in pretrained LLMs.

📄 PDF Abstract BibTeX arXiv:2410.13835

Code (1)

guotianyu2000/active-dormant-attention 공식 구현 pytorch

Tasks

Quantization

Methods 이 논문이 사용한 방법론

ReLU How Do I Communicate to Expedia? How Do I Communicate to Expedia? – Call ☎️ +1-(888) 829 (0881) or +1-805-330-4056 or +1-805-330-4056 for Live Support & Special Travel…
Attention 설명 없음
LLaMA LLaMA is a collection of foundation language models ranging from 7B to 65B parameters. It is based on the transformer architecture with various improvements that were…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
SGD Stochastic Gradient Descent is an iterative optimization technique that uses minibatches of data to form an expectation of the gradient, rather than the full gradient using…
ALIGN In the ALIGN method, visual and language representations are jointly trained from noisy image alt-text data. The image and text encoders are learned via contrastive loss…
Adam 설명 없음

Similar Papers 제목 키워드 기반

Attention Lens: A Tool for Mechanistically Interpreting the Attention Head Information Retrieval Mechanism

2023-10-25 · Mansi Sakarvadia, Arham Khan, Aswathy Ajith, Daniel Grzenda 외

Transformer-based Large Language Models (LLMs) are the state-of-the-art for natural language tasks. Recent work has attempted to decode, by reverse engineering the role of linear layers, the internal mechanisms by which …

Information RetrievalRetrieval

How does GPT-2 Predict Acronyms? Extracting and Understanding a Circuit via Mechanistic Interpretability

2024-05-07 · Jorge García-Carrasco, Alejandro Maté, Juan Trujillo

Transformer-based language models are treated as black-boxes because of their large number of parameters and complex internal interactions, which is a serious safety concern. Mechanistic Interpretability (MI) intends to …

Prediction

Debiasing LLMs by Masking Unfairness-Driving Attention Heads

2025-10-11 · Tingxu Han, Wei Song, Ziqi Ding, Ziming Li 외 arxiv

Large language models (LLMs) increasingly mediate decisions in domains where unfair treatment of demographic groups is unacceptable. Existing work probes when biased outputs appear, but gives little insight into the mech…

Induction Head Toxicity Mechanistically Explains Repetition Curse in Large Language Models

2025-05-17 · Shuxun Wang, Qingyu Yin, Chak Tou Leong, Qiang Zhang 외

Repetition curse is a phenomenon where Large Language Models (LLMs) generate repetitive sequences of tokens or cyclic sequences. While the repetition curse has been widely observed, its underlying mechanisms remain poorl…

In-Context Learning

Linking In-context Learning in Transformers to Human Episodic Memory

2024-05-23 · Li Ji-An, Corey Y. Zhou, Marcus K. Benna, Marcelo G. Mattar

Understanding connections between artificial and biological intelligent systems can reveal fundamental principles of general intelligence. While many artificial intelligence models have a neuroscience counterpart, such c…

In-Context LearningRetrieval