On the Distribution, Sparsity, and Inference-time Quantization of Attention Values in Transformers
Not on the map. Why?
Abstract (arXiv)
How much information do NLP tasks really need from a transformer's attention mechanism at application-time (inference)? From recent work, we know that there is sparsity in transformers and that the floating-points within its computation can be discretized to fewer values with minimal loss to task accuracies. However, this requires retraining or even creating entirely new models, both of which can be expensive and carbon-emitting. Focused on optimizations that do not require training, we systematically study the full range of typical attention values necessary. This informs the design of an inference-time quantization technique using both pruning and log-scaled mapping which produces only a few (e.g. 23) unique values. Over the tasks of question answering and sentiment analysis, we find nearly 80% of attention values can be pruned to zeros with minimal (< 1.0%) relative loss in accuracy. We use this pruning technique in conjunction with quantizing the attention values to only a 3-bit format, without retraining, resulting in only a 0.8% accuracy reduction on question answering with fine-tuned RoBERTa.
Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Builds on 31 of its 41 references that are in the map. First posted on arXiv 2 Jun 2021.
Builds on
31 of 41 references.
References · 31
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2016SQuAD: 100,000+ Questions for Machine Comprehension of Textcited by 4,115
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2019Generating Long Sequences with Sparse Transformerscited by 1,523
- 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 994
- 2019Attention is not Explanationcited by 916
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
- 2020A Primer in BERTology: What we know about how BERT workscited by 807
- 2019Are Sixteen Heads Really Better than One?cited by 803
- 2018Image Transformercited by 770
- 2019Attention is not not Explanationcited by 629
19 more
- 2019Q-BERT: Hessian Based Ultra Low Precision Quantization of BERTcited by 355
- 2019Axial Attention in Multidimensional Transformerscited by 350
- 2019Revealing the Dark Secrets of BERTcited by 300
- 2019Q8BERT: Quantized 8Bit BERTcited by 296
- 2019A Multiscale Visualization of Attention in the Transformer Modelcited by 292
- 2020The Lottery Ticket Hypothesis for Pre-trained BERT Networkscited by 275
- 2021I-BERT: Integer-only BERT Quantizationcited by 250
- 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 241
- 2020BinaryBERT: Pushing the Limit of BERT Quantizationcited by 175
- 2019Adaptively Sparse Transformerscited by 154
- 2020TernaryBERT: Distillation-aware Ultra-low Bit BERTcited by 145
- 2019On Identifiability in Transformerscited by 115
- 2020GOBO: Quantizing Attention-Based NLP Models for Low Latency and Energy Efficient Inferencecited by 103
- 2018Context-Aware Neural Machine Translation Learns Anaphora Resolutioncited by 97
- 2019Efficient 8-Bit Quantization of Transformer Neural Machine Language Translation Modelcited by 58
- 2020Similarity Analysis of Contextual Word Representation Modelscited by 54
- 2019Fully Quantized Transformer for Machine Translationcited by 36
- 2020Telling BERT's full story: from Local Attention to Global Aggregationcited by 15
- 2019Big Bidirectional Insertion Representations for Documentscited by 1
Built on by
Citing papers per year: 2022: 3; 2023: 2; 2024: 3; 2025: 2; 2026: 4.
14 papers.
Sort:
By area:
- 2022Efficient Methods for Natural Language Processing: A Surveycited by 78
- 2023Towards Accurate Post-Training Quantization for Vision Transformercited by 70
- 2022A Study of the Attention Abnormality in Trojaned BERTscited by 47
- 2023Attention-Enhancing Backdoor Attacks Against BERT-based Modelscited by 32
- 2025Hallucination Detection in LLMs with Topological Divergence on Attention Graphscited by 18
- 2024A Comprehensive Survey of Compression Algorithms for Language Modelscited by 15
- 2025ZSMerge: Zero-Shot KV Cache Compression for Memory-Efficient Long-Context LLMscited by 8
- 2022Attention Hijacking in Trojan Transformerscited by 6
- 2024Hybrid Dynamic Pruning: A Pathway to Efficient Transformer Inferencecited by 2
- 2026D2Prune: Sparsifying Large Language Models via Dual Taylor Expansion and Attention Distribution Awarenesscited by 2
- 2026VSPrefill: Vertical-Slash Sparse Attention with Lightweight Indexing for Long-Context Prefillingcited by 1
- 2024Analyzing Multi-Head Attention on Trojan BERT Modelscited by 0
- 2026On-Device Language Models for Privacy-Preserving Stress Prediction: A Multimodal Evaluation on Mobile Health11 Aug 2026
- 2026Backdoor Learning in Language Models and Vision-Language Models8 Jun 2026
- 2026VSPrefill: Vertical-Slash Sparse Attention with Lightweight Indexing for Long-Context Prefilling3 Mar 2026
- 2026D2Prune: Sparsifying Large Language Models via Dual Taylor Expansion and Attention Distribution Awareness14 Jan 2026
- 2025Hallucination Detection in LLMs with Topological Divergence on Attention Graphs14 Apr 2025
- 2025ZSMerge: Zero-Shot KV Cache Compression for Memory-Efficient Long-Context LLMs13 Mar 2025
- 2024Hybrid Dynamic Pruning: A Pathway to Efficient Transformer Inference17 Jul 2024
- 2024Analyzing Multi-Head Attention on Trojan BERT Models12 Jun 2024
- 2024A Comprehensive Survey of Compression Algorithms for Language Models27 Jan 2024
- 2023Attention-Enhancing Backdoor Attacks Against BERT-based Models23 Oct 2023
- 2023Towards Accurate Post-Training Quantization for Vision Transformer25 Mar 2023
- 2022Efficient Methods for Natural Language Processing: A Survey31 Aug 2022
2 more
- 2022Attention Hijacking in Trojan Transformers9 Aug 2022
- 2022A Study of the Attention Abnormality in Trojaned BERTs13 May 2022
- 2022Efficient Methods for Natural Language Processing: A Surveycited by 78
- 2023Towards Accurate Post-Training Quantization for Vision Transformercited by 70
- 2022A Study of the Attention Abnormality in Trojaned BERTscited by 47
- 2025Hallucination Detection in LLMs with Topological Divergence on Attention Graphscited by 18
- 2024A Comprehensive Survey of Compression Algorithms for Language Modelscited by 15
- 2022Attention Hijacking in Trojan Transformerscited by 6
- 2024Hybrid Dynamic Pruning: A Pathway to Efficient Transformer Inferencecited by 2
- 2026D2Prune: Sparsifying Large Language Models via Dual Taylor Expansion and Attention Distribution Awarenesscited by 2
- 2026VSPrefill: Vertical-Slash Sparse Attention with Lightweight Indexing for Long-Context Prefillingcited by 1
- 2024Analyzing Multi-Head Attention on Trojan BERT Modelscited by 0
- 2026On-Device Language Models for Privacy-Preserving Stress Prediction: A Multimodal Evaluation on Mobile Healthcited by 0
- 2026On-Device Language Models for Privacy-Preserving Stress Prediction: A Multimodal Evaluation on Mobile Health11 Aug 2026
- 2026VSPrefill: Vertical-Slash Sparse Attention with Lightweight Indexing for Long-Context Prefilling3 Mar 2026
- 2026D2Prune: Sparsifying Large Language Models via Dual Taylor Expansion and Attention Distribution Awareness14 Jan 2026
- 2025Hallucination Detection in LLMs with Topological Divergence on Attention Graphs14 Apr 2025
- 2024Hybrid Dynamic Pruning: A Pathway to Efficient Transformer Inference17 Jul 2024
- 2024Analyzing Multi-Head Attention on Trojan BERT Models12 Jun 2024
- 2024A Comprehensive Survey of Compression Algorithms for Language Models27 Jan 2024
- 2023Towards Accurate Post-Training Quantization for Vision Transformer25 Mar 2023
- 2022Efficient Methods for Natural Language Processing: A Survey31 Aug 2022
- 2022Attention Hijacking in Trojan Transformers9 Aug 2022
- 2022A Study of the Attention Abnormality in Trojaned BERTs13 May 2022