paper-with-me

홈 › Papers

Quantizable Transformers: Removing Outliers by Helping Attention Heads Do Nothing

2023-06-22 · NeurIPS 2023 11

Transformer models have been widely adopted in various domains over the last years, and especially large language models have advanced the field of AI significantly. Due to their size, the capability of these networks has increased tremendously, but this has come at the cost of a significant increase in necessary compute. Quantization is one of the most effective ways to reduce the computational time and memory consumption of neural networks. Many studies have shown, however, that modern transformer models tend to learn strong outliers in their activations, making them difficult to quantize. To retain acceptable performance, the existence of these outliers requires activations to be in higher bitwidth or the use of different numeric formats, extra fine-tuning, or other workarounds. We show that strong outliers are related to very specific behavior of attention heads that try to learn a "no-op" or just a partial update of the residual. To achieve the exact zeros needed in the attention matrix for a no-update, the input to the softmax is pushed to be larger and larger during training, causing outliers in other parts of the network. Based on these observations, we propose two simple (independent) modifications to the attention mechanism - clipped softmax and gated attention. We empirically show that models pre-trained using our methods learn significantly smaller outliers while maintaining and sometimes even improving the floating-point task performance. This enables us to quantize transformers to full INT8 quantization of the activations without any additional effort. We demonstrate the effectiveness of our methods on both language models (BERT, OPT) and vision transformers.

📄 PDF Abstract BibTeX arXiv:2306.12929

Code (1)

qualcomm-ai-research/outlier-free-transformers pytorch

Tasks

Quantization

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

SplitQuant: Layer Splitting for Low-Bit Neural Network Quantization

2025-01-21 · Jaewoo Song, Fangzhen Lin

Quantization for deep neural networks (DNNs) is the process of mapping the parameter values of DNNs from original data types to other data types of lower precision to reduce model sizes and make inference faster. Quantiz…

Quantization

From Quantized DNNs to Quantizable DNNs

2020-04-11 · Kunyuan Du, Ya zhang, Haibing Guan

This paper proposes Quantizable DNNs, a special type of DNNs that can flexibly quantize its bit-width (denoted as `bit modes' thereafter) during execution without further re-training. To simultaneously optimize for all b…

Vision Transformers Don't Need Trained Registers

2025-06-09 · Nick Jiang, Amil Dravid, Alexei Efros, Yossi Gandelsman

We investigate the mechanism underlying a previously identified phenomenon in Vision Transformers -- the emergence of high-norm tokens that lead to noisy attention maps. We observe that in multiple models (e.g., CLIP, DI…

A Unified View of Attention and Residual Sinks: Outlier-Driven Rescaling is Essential for Transformer Training

2026-01-30 · Zihan Qiu, Zeyu Huang, Kaiyue Wen, Peng Jin 외 arxiv

We investigate the functional role of emergent outliers in large language models, specifically attention sinks (a few tokens that consistently receive large attention logits) and residual sinks (a few fixed dimensions wi…

How Can Mamba Learn In Context with Outliers and Generalize Provably?

2025-10-01 · Hongkang Li, Songtao Lu, Xiaodong Cui, Pin-Yu Chen 외 arxiv

The Mamba model has gained significant attention for its computational advantages over Transformer-based models, while achieving comparable performance across a wide range of language tasks. Like Transformers, Mamba exhi…

Binary Classification