Selective Attention: Enhancing Transformer through Principled Context Control
Not on the map. Why?
Abstract (arXiv)
The attention mechanism within the transformer architecture enables the model to weigh and combine tokens based on their relevance to the query. While self-attention has enjoyed major success, it notably treats all queries q in the same way by applying the mapping V^topsoftmax(Kq), where V,K are the value and key embeddings respectively. In this work, we argue that this uniform treatment hinders the ability to control contextual sparsity and relevance. As a solution, we introduce the textitSelective Self-Attention (SSA) layer that augments the softmax nonlinearity with a principled temperature scaling strategy. By controlling temperature, SSA adapts the contextual sparsity of the attention map to the query embedding and its position in the context window. Through theory and experiments, we demonstrate that this alleviates attention dilution, aids the optimization process, and enhances the model's ability to control softmax spikiness of individual queries. We also incorporate temperature scaling for value embeddings and show that it boosts the model's ability to suppress irrelevant/noisy tokens. Notably, SSA is a lightweight method which introduces less than 0.5% new parameters through a weight-sharing strategy and can be fine-tuned on existing LLMs. Extensive empirical evaluations demonstrate that SSA-equipped models achieve a noticeable and consistent accuracy improvement on language modeling benchmarks.
Key facts. Cited by 16 papers in the map (data through 14 Oct 2026). Builds on 45 of its 55 references that are in the map. First posted on arXiv 19 Nov 2024.
Builds on
45 of 55 references.
References · 45
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
33 more
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,411
- 2020GLU Variants Improve Transformercited by 1,804
- 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,786
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,470
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
- 2022In-context Learning and Induction Headscited by 964
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2016Language Modeling with Gated Convolutional Networkscited by 702
- 2020Long-tail learning via logit adjustmentcited by 618
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 514
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
- 2022Long Range Language Modeling via Gated State Spacescited by 265
- 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
- 2024Simple linear attention language models balance the recall-throughput tradeoffcited by 208
- 2023What Algorithms can Transformers Learn? A Study in Length Generalizationcited by 199
- 2021Scatterbrain: Unifying Sparse and Low-rank Attention Approximationcited by 130
- 2021Self-Attention Networks Can Process Bounded Hierarchical Languagescited by 105
- 2023Exposing Attention Glitches with Flip-Flop Language Modelingcited by 75
- 2023Generalization on the Unseen, Logic Reasoning and Degree Curriculumcited by 73
- 2023SlimPajama-DC: Understanding Data Combinations for LLM Trainingcited by 72
- 2024MambaByte: Token-free Selective State Space Modelcited by 59
- 2023Max-Margin Token Selection in Attention Mechanismcited by 58
- 2022AutoBalance: Optimized Loss Functions for Imbalanced Datacited by 49
- 2023GateLoop: Fully Data-Controlled Linear Recurrence for Sequence Modelingcited by 46
- 2024From Self-Attention to Markov Models: Unveiling the Dynamics of Generative Transformerscited by 34
- 2022Unraveling Attention via Convex Duality: Analysis and Interpretations of Vision Transformerscited by 30
- 2023Sparse Modular Activation for Efficient Sequence Modelingcited by 20
- 2023Attention Alignment and Flexible Positional Embeddings Improve Transformer Length Extrapolationcited by 9
- 2024Class-attribute Priors: Adapting Optimization to Heterogeneity and Fairness Objectivecited by 2
Built on by
Citing papers per year: 2025: 6; 2026: 10.
16 papers.
Sort:
By area:
- 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Freecited by 283
- 2026Semantic XPath: Structured Agentic Memory Access for Conversational AIcited by 7
- 2026Attention Smoothing Is All You Need For Unlearningcited by 7
- 2025SpiLiFormer: Enhancing Spiking Transformers with Lateral Inhibitioncited by 3
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answeringcited by 3
- 2026Scaling Limits of Long-Context Transformerscited by 3
- 2025OmniSparse: Training-Aware Fine-Grained Sparse Attention for Long-Video MLLMscited by 2
- 2025PromptDistill: Query-based Selective Token Retention in Intermediate Layers for Efficient Large Language Model Inferencecited by 1
- 2026TranX-Adapter: Bridging Artifacts and Semantics within MLLMs for Robust AI-generated Image Detectioncited by 1
- 2026Screening Is Enoughcited by 1
- 2025Can We Go Beyond Visual Features? Neural Tissue Relation Modeling for Relational Graph Analysis in Non-Melanoma Skin Histologycited by 0
- 2026Attention-guided Evidence Grounding for Spoken Question Answeringcited by 0
4 more
- 2026Good Token Hunting: A Hitchhiker's Guide to Token Selection for Visual Geometry Transformerscited by 0
- 2026Enhancing Multi-Agent Communication through Attention Steering with Context Relevancecited by 0
- 2026Pre-registered tests of solid-state-physics-inspired LLM compression: a cluster-level negative result at small-language-model scalecited by 0
- 2026Message Passing Does More with Less for In-Context Learning on Graphscited by 0
- 2026Message Passing Does More with Less for In-Context Learning on Graphs29 Sep 2026
- 2026Pre-registered tests of solid-state-physics-inspired LLM compression: a cluster-level negative result at small-language-model scale28 Sep 2026
- 2026Enhancing Multi-Agent Communication through Attention Steering with Context Relevance28 May 2026
- 2026Good Token Hunting: A Hitchhiker's Guide to Token Selection for Visual Geometry Transformers22 May 2026
- 2026Scaling Limits of Long-Context Transformers8 May 2026
- 2026Screening Is Enough1 Apr 2026
- 2026Attention-guided Evidence Grounding for Spoken Question Answering17 Mar 2026
- 2026Attention Smoothing Is All You Need For Unlearning1 Mar 2026
- 2026Semantic XPath: Structured Agentic Memory Access for Conversational AI1 Mar 2026
- 2026TranX-Adapter: Bridging Artifacts and Semantics within MLLMs for Robust AI-generated Image Detection25 Feb 2026
- 2025Can We Go Beyond Visual Features? Neural Tissue Relation Modeling for Relational Graph Analysis in Non-Melanoma Skin Histology7 Dec 2025
- 2025OmniSparse: Training-Aware Fine-Grained Sparse Attention for Long-Video MLLMs15 Nov 2025
4 more
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answering14 Oct 2025
- 2025Gated Attention for Large Language Models: Non-linearity, Sparsity, and Attention-Sink-Free10 May 2025
- 2025PromptDistill: Query-based Selective Token Retention in Intermediate Layers for Efficient Large Language Model Inference30 Mar 2025
- 2025SpiLiFormer: Enhancing Spiking Transformers with Lateral Inhibition20 Mar 2025
- 2026Attention Smoothing Is All You Need For Unlearningcited by 7
- 2026Attention Smoothing Is All You Need For Unlearning1 Mar 2026
- 2025SpiLiFormer: Enhancing Spiking Transformers with Lateral Inhibitioncited by 3
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answeringcited by 3
- 2026Scaling Limits of Long-Context Transformerscited by 3
- 2026TranX-Adapter: Bridging Artifacts and Semantics within MLLMs for Robust AI-generated Image Detectioncited by 1
- 2026Screening Is Enoughcited by 1
- 2025Can We Go Beyond Visual Features? Neural Tissue Relation Modeling for Relational Graph Analysis in Non-Melanoma Skin Histologycited by 0
- 2026Attention-guided Evidence Grounding for Spoken Question Answeringcited by 0
- 2026Good Token Hunting: A Hitchhiker's Guide to Token Selection for Visual Geometry Transformerscited by 0
- 2026Pre-registered tests of solid-state-physics-inspired LLM compression: a cluster-level negative result at small-language-model scalecited by 0
- 2026Message Passing Does More with Less for In-Context Learning on Graphscited by 0
- 2026Message Passing Does More with Less for In-Context Learning on Graphs29 Sep 2026
- 2026Pre-registered tests of solid-state-physics-inspired LLM compression: a cluster-level negative result at small-language-model scale28 Sep 2026
- 2026Good Token Hunting: A Hitchhiker's Guide to Token Selection for Visual Geometry Transformers22 May 2026
- 2026Scaling Limits of Long-Context Transformers8 May 2026
- 2026Screening Is Enough1 Apr 2026
- 2026Attention-guided Evidence Grounding for Spoken Question Answering17 Mar 2026
- 2026TranX-Adapter: Bridging Artifacts and Semantics within MLLMs for Robust AI-generated Image Detection25 Feb 2026
- 2025Can We Go Beyond Visual Features? Neural Tissue Relation Modeling for Relational Graph Analysis in Non-Melanoma Skin Histology7 Dec 2025
- 2025DSAS: A Universal Plug-and-Play Framework for Attention Optimization in Multi-Document Question Answering14 Oct 2025
- 2025SpiLiFormer: Enhancing Spiking Transformers with Lateral Inhibition20 Mar 2025