Understanding and Overcoming the Challenges of Efficient Transformer Quantization

Transformer-based architectures have become the de-facto standard models for\na wide range of Natural Language Processing tasks. However, their memory\nfootprint and high latency are prohibitive for efficient deployment and\ninference on resource-limited devices. In this work, we explore quantization\nfor transformers. We show that transformers have unique quantization challenges\n-- namely, high dynamic activation ranges that are difficult to represent with\na low bit fixed-point format. We establish that these activations contain\nstructured outliers in the residual connections that encourage specific\nattention patterns, such as attending to the special separator token. To combat\nthese challenges, we present three solutions based on post-training\nquantization and quantization-aware training, each with a different set of\ncompromises for accuracy, model size, and ease of use. In particular, we\nintroduce a novel quantization scheme -- per-embedding-group quantization. We\ndemonstrate the effectiveness of our methods on the GLUE benchmark using BERT,\nestablishing state-of-the-art results for post-training quantization. Finally,\nwe show that transformer weights and embeddings can be quantized to ultra-low\nbit-widths, leading to significant memory savings with a minimum accuracy loss.\nOur source code is available\nat~\\url{https://github.com/qualcomm-ai-research/transformer-quantization}.\n

Paper

References (76)

05Transformers: State-of-the-Art Natural Language Processing2020 · EMNLP

Scroll for more · 38 remaining

Similar papers

© 2026 NYSGPT2525 LLC