Lune

ACL Findings2021

On the Distribution, Sparsity, and Inference-time Quantization of Attention Values in Transformers

Tianchu Ji, Shraddhan Jain, Michael Ferdman, Peter A. Milder, H. Andrew Schwartz, Niranjan Balasubramanian

摘要

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 logscaled mapping which produces only a few (e.g. 2 3 ) 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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • The Lottery Ticket Hypothesis for Pre-trained BERT Networks 引用了 Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. Towards Accurate Post-Training Quantization for Vision TransformerYifu Ding, Haotong Qin, Qinghua Yan, Zhenhua Chai 等ACM MM 2022 · 68 次引用
  2. Hallucination Detection in LLMs with Topological Divergence on Attention GraphsAlexandra Bazarova, Andrei Volodichev, Aleksandr Yugay, Andrey Shulga 等ACL 2026 · 14 次引用
  3. D2 Prune: Sparsifying Large Language Models via Dual Taylor Expansion and Attention Distribution AwarenessLang Xiong, Ning Liu, Ao Ren, Yuheng Bai 等AAAI 2026

它引用的 Paper12

  1. Q-BERT: Hessian Based Ultra Low Precision Quantization of BERTSheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma 等AAAI 2020 · 656 次引用
  2. Hopfield Networks is All You NeedHubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl 等ICLR 2021 · 620 次引用
  3. I-BERT: Integer-only BERT QuantizationSehoon Kim, Amir Gholami, Zhewei Yao, Michael W. Mahoney 等ICML 2021 · 439 次引用
  4. The Lottery Ticket Hypothesis for Pre-trained BERT NetworksTianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu 等NeurIPS 2020 · 428 次引用
  5. ETC: Encoding Long and Structured Inputs in TransformersJoshua Ainslie, Santiago Ontañón, Chris Alberti, Vaclav Cvicek 等EMNLP 2020 · 268 次引用

相关 Paper

  1. A Fast Post-Training Pruning Framework for TransformersWoosuk Kwon, Sehoon Kim, Michael W. Mahoney, Joseph Hassoun 等NeurIPS 2022 · 247 次引用
  2. General Purpose Text Embeddings from Pre-trained Language Models for Scalable InferenceJingfei Du, Myle Ott, Haoran Li, Xing Zhou 等EMNLP Findings 2020 · 8 次引用
  3. Masking as an Efficient Alternative to Finetuning for Pretrained Language ModelsMengjie Zhao, Tao Lin, Fei Mi, Martin Jaggi 等EMNLP 2020 · 61 次引用
  4. 8-bit Transformer Inference and Fine-tuning for Edge AcceleratorsJeffrey Yu, Kartik Prabhu, Yonatan Urman, Robert M. Radway 等ASPLOS 2024 · 26 次引用
  5. PreQuant: A Task-agnostic Quantization Approach for Pre-trained Language ModelsZhuocheng Gong, Jiahao Liu, Qifan Wang, Yang Yang 等ACL Findings 2023 · 5 次引用
黄昏的海面,两侧是细线勾勒的悬崖