[Paper Review] Training Transformers with 4-bit Integers
The paper presents an INT4-based training method for transformers using Hadamard quantization for forward passes and leverage-score sampling with bit splitting for backpropagation, achieving competitive accuracy and hardware-friendly speedups on diverse tasks.
Quantizing the activation, weight, and gradient to 4-bit is promising to accelerate neural network training. However, existing 4-bit training methods require custom numerical formats which are not supported by contemporary hardware. In this work, we propose a training method for transformers with all matrix multiplications implemented with the INT4 arithmetic. Training with an ultra-low INT4 precision is challenging. To achieve this, we carefully analyze the specific structures of activation and gradients in transformers to propose dedicated quantizers for them. For forward propagation, we identify the challenge of outliers and propose a Hadamard quantizer to suppress the outliers. For backpropagation, we leverage the structural sparsity of gradients by proposing bit splitting and leverage score sampling techniques to quantize gradients accurately. Our algorithm achieves competitive accuracy on a wide range of tasks including natural language understanding, machine translation, and image classification. Unlike previous 4-bit training methods, our algorithm can be implemented on the current generation of GPUs. Our prototypical linear operator implementation is up to 2.2 times faster than the FP16 counterparts and speeds up the training by up to 35.1%.
Motivation & Objective
- Motivate training transformers with ultra-low precision (INT4) to accelerate computation and reduce memory footprint.
- Develop forward quantization that mitigates activation outliers using a Hadamard-based transform.
- Exploit structural sparsity in gradients to quantize backpropagation efficiently via bit splitting and leverage-score sampling.
- Provide a practical INT4 MM-based training pipeline compatible with current GPUs.
- Demonstrate competitive accuracy and speedups across NLP, translation, and vision benchmarks.
Proposed method
- Formulate all linear operations in transformers as matrix multiplications (MMs) and apply INT4 arithmetic with LSQ-based quantization.
- Introduce Hadamard quantization (HQ) to suppress forward-activation outliers by transforming activations with a block-diagonal Hadamard matrix before quantization.
- Leverage structural sparsity of gradients in backpropagation by applying bit splitting (BS) to split gradients into higher/lower 4-bit parts and using leverage score sampling (LSS) to select informative rows for MM computations.
- Quantize gradients dynamically for each MM while keeping activation/weight representations in INT4, and dequantize the final results for FP16 accumulation as needed.
- Provide two MM procedures: HQ-MM for forward and LSS-MM for backward, combining to enable INT4 MM-based training end-to-end.
- Evaluate on NLP benchmarks (GLUE, SQuAD, CoNLL, MT) and image classification (ViT, ImageNet) to compare against FP, INT8, FP4, and LSQ+LUQ baselines.

Experimental results
Research questions
- RQ1Can transformers be trained end-to-end with 4-bit integer arithmetic using only standard hardware without custom numeric formats?
- RQ2How can forward activation outliers and backward gradient sparsity be addressed to preserve accuracy in ultra-low precision training?
- RQ3What are the accuracy and efficiency trade-offs of Hadamard-based forward quantization and leverage-score sampling-based backpropagation in INT4 training?
Key findings
- HQ+LSS achieves competitive accuracy compared with FP and existing 4-bit training methods across NLP, MT, and vision tasks.
- On GLUE and SQuAD-style evaluations, HQ+LSS improves over LSQ+LUQ, notably surpassing them on Bert-base and Bert-large variants.
- Machine translation (WMT) shows ~1.0% BLEU degradation with HQ+LSS, which is better than some ultra-low setups and comparable to others while remaining hardware-friendly.
- Image classification with ViT models shows small accuracy degradations (often under 1-2%) compared to full-precision baselines, with HQ+LSS outperforming LSQ+LUQ in several cases.
- The method enables INT4 MM implementations on current GPUs, offering speedups (up to 2.2x faster than FP16 MM) and training speedups up to 35.1%.
- Ablation studies on CoLA confirm the importance of forward Hadamard quantization for maintaining accuracy while backpropagation benefits from BS+LSS.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.