mlsanityData to 7 Oct 2026

Attend First, Consolidate Later: On the Importance of Attention in Different LLM Layers

arXiv 2409.03621 ↗First posted 5 Sep 2024cs.CLcited by 25

Not on the map. Why?

Abstract (arXiv)

In decoder-based LLMs, the representation of a given layer serves two purposes: as input to the next layer during the computation of the current token; and as input to the attention mechanism of future tokens. In this work, we show that the importance of the latter role might be overestimated. To show that, we start by manipulating the representations of previous tokens; e.g. by replacing the hidden states at some layer k with random vectors. Our experimenting with four LLMs and four tasks show that this operation often leads to small to negligible drop in performance. Importantly, this happens if the manipulation occurs in the top part of the model-k is in the final 30-50% of the layers. In contrast, doing the same manipulation in earlier layers might lead to chance level performance. We continue by switching the hidden state of certain tokens with hidden states of other tokens from another prompt; e.g., replacing the word "Italy" with "France" in "What is the capital of Italy?". We find that when applying this switch in the top 1/3 of the model, the model ignores it (answering "Rome"). However if we apply it before, the model conforms to the switch ("Paris"). Our results hint at a two stage process in transformer-based LLMs: the first part gathers input from previous tokens, while the second mainly processes that information internally.

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

Builds on

17 of 22 references.

References · 17

  1. 2017Attention Is All You Needcited by 59,932
  2. 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
  3. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  5. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
  6. 2015Teaching Machines to Read and Comprehendcited by 1,039
  7. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 522
  8. 2023Llemma: An Open Language Model For Mathematicscited by 385
  9. 2020DeeBERT: Dynamic Early Exiting for Accelerating BERT Inferencecited by 322
  10. 2023In-Context Learning Creates Task Vectorscited by 302
  11. 2024LayerSkip: Enabling Early Exit Inference and Self-Speculative Decodingcited by 302
  12. 2024Patchscopes: A Unifying Framework for Inspecting Hidden Representations of Language Modelscited by 225
5 more
  1. 2024The Remarkable Robustness of LLMs: Stages of Inference?cited by 138
  2. 2020The Right Tool for the Job: Matching Model and Instance Complexitiescited by 125
  3. 2019How Does BERT Answer Questions? A Layer-Wise Analysis of Transformer Representationscited by 63
  4. 2019Improving Transformer Models by Reordering their Sublayerscited by 52
  5. 2020Pay Attention when Requiredcited by 8

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 4; 2025: 16; 2026: 5.

25 papers.

Sort:

By area:

  1. 2024From Tokens to Words: On the Inner Lexicon of LLMscited by 46
  2. 2024Looking Beyond Text: Reducing Language bias in Large Vision-Language Models via Multimodal Dual-Attention and Soft-Image Guidancecited by 32
  3. 2025AttentionRAG: Attention-Guided Context Pruning in Retrieval-Augmented Generationcited by 19
  4. 2025Spotlight Your Instructions: Instruction-following with Dynamic Attention Steeringcited by 18
  5. 2025Empowering GraphRAG with Knowledge Filtering and Integrationcited by 15
  6. 2025Understanding Language Prior of LVLMs by Contrasting Chain-of-Embeddingcited by 13
  7. 2024Looking Beyond The Top-1: Transformers Determine Top Tokens In Ordercited by 12
  8. 2025When Semantics Mislead Vision: Mitigating Large Multimodal Models Hallucinations in Scene Text Spotting and Understandingcited by 12
  9. 2024Persistent Topological Features in Large Language Modelscited by 11
  10. 2025MindGuard: Intrinsic Decision Inspection for Securing LLM Agents Against Metadata Poisoningcited by 10
  11. 2025Multimodal LLMs as Customized Reward Models for Text-to-Image Generationcited by 9
  12. 2025From ASR to ASP: Evaluating Prompt Attack Vulnerabilities Against Open-Source LLMscited by 6
13 more
  1. 2026AttenMIA: LLM Membership Inference Attack through Attention Signalscited by 4
  2. 2025Attention Basin: Why Contextual Position Matters in Large Language Modelscited by 2
  3. 2025Plug-in and Fine-tuning: Bridging the Gap between Small Language Models and Large Language Modelscited by 1
  4. 2025Entropy Meets Importance: A Unified Head Importance-Entropy Score for Stable and Efficient Transformer Pruningcited by 1
  5. 2025PAS : Prelim Attention Score for Detecting Object Hallucinations in Large Vision--Language Modelscited by 1
  6. 2025Speech Recognition Model Improves Text-to-Speech Synthesis using Fine-Grained Rewardcited by 1
  7. 2026Shallow Prefill, Deep Decoding: Efficient Long-Context Inference via Layer-Asymmetric KV Visibilitycited by 1
  8. 2025Hopscotch: Discovering and Skipping Redundancies in Language Modelscited by 0
  9. 2025SVAgent: AI Agent for Hardware Security Verification Assertioncited by 0
  10. 2025ShishuLM : Achieving Optimal and Efficient Parameterization with Low Attention Transformer Modelscited by 0
  11. 2026Entropy and Attention Dynamics in Small Language Models: A Trace-Level Structural Analysis on the TruthfulQA Benchmarkcited by 0
  12. 2026Deep Pre-Alignment for VLMscited by 0
  13. 2026EASE-TTT: Evidence-Aligned Selective Test-Time Training for Long-Context Question Answeringcited by 0