Attention Heads of Large Language Models: A Survey

Zifan Zheng, Yezhaohui Wang, Yuxin Huang, Shichao Song, Mingchuan Yang +3 more
9/5/2024
cs.CL

No official code found. Best implementation: IAAR-Shanghai/Awesome-Attention-Heads (412 stars, last commit 2025-03-02).

Abstract

Since the advent of ChatGPT, Large Language Models (LLMs) have excelled in various tasks but remain as black-box systems. Understanding the reasoning bottlenecks of LLMs has become a critical challenge, as these limitations are deeply tied to their internal architecture. Among these, attention heads have emerged as a focal point for investigating the underlying mechanics of LLMs. In this survey, we aim to demystify the internal reasoning processes of LLMs by systematically exploring the roles and mechanisms of attention heads. We first introduce a novel four-stage framework inspired by the human thought process: Knowledge Recalling, In-Context Identification, Latent Reasoning, and Expression Preparation. Using this framework, we comprehensively review existing research to identify and categorize the functions of specific attention heads. Additionally, we analyze the experimental methodologies used to discover these special heads, dividing them into two categories: Modeling-Free and Modeling-Required methods. We further summarize relevant evaluation methods and benchmarks. Finally, we discuss the limitations of current research and propose several potential future directions.

View on arXivView PDF

Code Implementations(1)

An awesome repository & A comprehensive survey on interpretability of LLM attention heads.

41212TeXJul 3, 20241 years ago
attention-head-miningattention-mechanismawesomechain-of-thoughtcircuit-analysis+11 more

Cite this paper

@article{zheng2024attention,
  title  = {Attention Heads of Large Language Models: A Survey},
  author = {Zifan Zheng and Yezhaohui Wang and Yuxin Huang and Shichao Song and Mingchuan Yang and Bo Tang and Feiyu Xiong and Zhiyu Li},
  year   = {2024},
  eprint = {2409.03752},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.03752v3}
}

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/2409.03752.svg)](https://codeofpaper.com/paper/2409.03752)

Discussion