Toward INT4 Fixed-Point Training via Exploring Quantization Error for Gradients

Dohyung Kim, Junghyup Lee, Jeimin Jeon, Jaehyeon Moon, Bumsub Ham

Introduction

Training neural networks entirely in 4-bit fixed-point (INT4) arithmetic is often considered the "holy grail" of efficient deep learning. While quantization for inference is well-established, quantizing the training process—specifically gradients—remains a significant challenge. Gradients are volatile, possess a wide dynamic range, and are typically maintained in FP32 to ensure convergence. Standard quantization methods often lead to training instability or significant accuracy drops.

This research identifies that the key to stable INT4 training is not minimizing the total quantization error, but rather protecting large-magnitude gradients. By adaptively adjusting the quantization interval to preserve these critical "tail" values, the authors achieve stable training across diverse tasks including classification, detection, and super-resolution.

Methodology: Protecting the Gradient Tail

The core of the proposed approach is a layer-wise uniform quantization scheme with a learnable clipping factor ($\gamma$).

The Insight

Most gradients in a neural network are concentrated near zero. Traditional methods like DSGC (Direction Sensitive Gradient Clipping) aim to minimize total quantization noise or maximize cosine similarity between original and quantized gradients. However, this often results in a narrow quantization interval that aggressively clips rare, large-magnitude gradients. Since these large gradients are the primary drivers of weight updates, losing their precision makes training unstable.

Gradient distribution and quantization regions. The tail region ($\alpha$) contains critical large-magnitude gradients.

Adaptive Interval Update

The authors derive an upper bound for the quantization error specifically for these "large gradients" (the top $\alpha$ percentage). They introduce an adaptive algorithm that monitors the "clip-out ratio"—the proportion of gradients falling outside the current quantization interval.

  • Expansion: If the clip-out ratio is too high, the interval expands to capture more large gradients.
  • Contraction: If the interval is too wide, it shrinks to improve precision for the majority of values.

This dynamic adjustment allows the network to adapt as gradient distributions shift throughout the training process, avoiding the "gradient wall" effect where large updates are flattened.

Key Insights and Results

The research highlights that in gradient distributions, the "tail" (large values) effectively "wags the dog." Even though they are few in number, their relative error is the most critical factor for stable descent.

Comparison of training stability across different clipping factors ($\gamma$) and the DSGC baseline.

Performance Benchmarks

The method was evaluated across several benchmarks, significantly outperforming previous state-of-the-art fixed-point training techniques:

  • ImageNet (ResNet-18): Achieved 67.1% top-1 accuracy in a 4/4/4-bit (weights/activations/gradients) setting, significantly outperforming DSGC (29.8%) and standard baselines (63.3%).
  • Object Detection (COCO): Reached 34.2 mAP in a 6/6/6-bit setting, closely approaching the full-precision baseline of 38.2.
  • Super-Resolution: Successfully quantized gradients for the EDSR architecture, demonstrating generalizability to regression tasks beyond simple classification.

Conclusion and Future Work

This work demonstrates that INT4 training is feasible by prioritizing the precision of large-magnitude gradients. The proposed adaptive uniform quantizer is hardware-friendly and adds minimal computational overhead.

Future research directions include refining the selection of the $\alpha$ hyperparameter, which currently requires some manual tuning for different architectures. Additionally, extending quantization to the first and last layers—traditionally kept in higher precision—remains a goal for achieving fully quantized training pipelines. Finally, validating these theoretical gains on actual INT4-capable hardware will be essential for real-world deployment on edge devices.

Summary updated

BibTeX
@inproceedings{kim2024toward,
  author = {Dohyung Kim and Junghyup Lee and Jeimin Jeon and Jaehyeon Moon and Bumsub Ham},
  title = {{Toward INT4 Fixed-Point Training via Exploring Quantization Error for Gradients}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72897-6\_24},
}
Figure