PACT: Parameterized Clipping Activation for Quantized Neural Networks

Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, Kailash GopalakrishnanarXiv 2018

Abstract

Deep learning algorithms achieve high classification accuracy at the expense of significant computation cost. To address this cost, a number of quantization schemes have been proposed - but most of these techniques focused on quantizing weights, which are relatively smaller in size compared to activations. This paper proposes a novel quantization scheme for activations during training - that enables neural networks to work well with ultra low precision weights and activations without any significant accuracy degradation. This technique, PArameterized Clipping acTivation (PACT), uses an activation clipping parameter $\alpha$ that is optimized during training to find the right quantization scale. PACT allows quantizing activations to arbitrary bit precisions, while achieving much better accuracy relative to published state-of-the-art quantization schemes. We show, for the first time, that both weights and activations can be quantized to 4-bits of precision while still achieving accuracy comparable to full precision networks across a range of popular models and datasets. We also show that exploiting these reduced-precision computational units in hardware can enable a super-linear improvement in inferencing performance due to a significant reduction in the area of accelerator compute engines coupled with the ability to retain the quantized model and activation data in on-chip memories.

Introduction

As Deep Learning models grow in complexity, the computational and storage costs of deploying them—especially on "edge" devices like smartphones or IoT sensors—become prohibitive. Quantization, the process of reducing the bit-precision of a network's weights and activations (e.g., from 32-bit floating point to 4-bit integers), is a primary solution to this challenge.

While quantizing weights has become relatively standard, quantizing activations remains a major hurdle. Standard activation functions like ReLU are unbounded, which can produce very large values. To quantize these into a small number of discrete levels (e.g., 16 levels for 4-bit precision), one must either use very large quantization bins—leading to high error—or clip the values at a specific threshold. Finding the optimal clipping zone is traditionally done through manual tuning or greedy heuristics, which often fail to maintain high accuracy at ultra-low precisions ($\le$ 2 bits).

Methodology: Parameterized Clipping Activation (PACT)

The authors introduce PACT, which replaces the standard ReLU activation with a parameterized version: $$y = PACT(x) = 0.5(|x| - |x - \alpha| + \alpha)$$ This function acts like a ReLU but caps all outputs at a learnable value $\alpha$. Unlike previous methods that determine clipping thresholds offline, PACT integrates this choice into the global training process.

Convergence of the learnable clipping parameter $\alpha$ across different network layers during training.

The clipping parameter $\alpha$ is optimized alongside the network weights using backpropagation. By employing the Straight-Through Estimator (STE), the network learns the optimal clipping range that minimizes the overall loss. Furthermore, L2 regularization is applied to $\alpha$, encouraging the network to find a compact representation that fits better into low-bit buckets without sacrificing descriptive power. As shown in Figure 4, the $\alpha$ values for different layers converge to stable, distinct points during the training process.

Experimental Results

The researchers evaluated PACT across several standard computer vision benchmarks, including CIFAR-10, SVHN, and ImageNet (using AlexNet, ResNet-18, and ResNet-50).

Performance and Stability

A key finding is the stability PACT brings to quantized training. As illustrated in Figure 1, standard ReLU with quantization can lead to diverging error rates, whereas PACT (clipping with quantization) maintains a stable training trajectory comparable to full-precision models.

Training and validation error curves comparing standard ReLU, fixed clipping, and PACT (clipping with quantization).

Accuracy at Ultra-Low Precision

PACT achieved near-lossless 4-bit precision on ImageNet. For instance, a 4-bit PACT ResNet-50 model achieved 76.5% top-1 accuracy, nearly matching the 76.9% of the full-precision baseline. At even lower precisions (2-bit), PACT significantly outperformed existing state-of-the-art methods like DoReFa-Net and HWGQ.

Hardware Efficiency

The paper demonstrates that 4-bit quantization allows for "super-linear" performance improvements. Moving from 16-bit to 2-bit logic results in an estimated 14× improvement in the density of Multiply-Accumulate (MAC) units. In bandwidth-constrained systems, 4-bit quantization provided a 4.5× speedup in inference due to reduced data movement and better utilization of on-chip memory.

Conclusion

PACT demonstrates that turning activation clipping into a learnable parameter is a powerful technique for ultra-low precision neural networks. By co-optimizing weights and quantization scales, it achieves state-of-the-art accuracy at 4-bit and 2-bit precisions. While current evaluations focus on image classification and keep the first and last layers at higher precision, the success of PACT opens new avenues for highly efficient hardware-algorithm co-design in deep learning.

Summary updated

BibTeX
@misc{choi2018pact,
  author = {Jungwook Choi and Zhuo Wang and Swagath Venkataramani and Pierce I-Jen Chuang and Vijayalakshmi Srinivasan and Kailash Gopalakrishnan},
  title = {{PACT: Parameterized Clipping Activation for Quantized Neural Networks}},
  year = {2018},
  eprint = {1805.06085},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.06085},
}
Figure