Reshape and Adapt for Output Quantization (RAOQ): Quantization-aware Training for In-memory Computing Systems

Bonan Zhang, Chia-Yu Chen, Naveen Verma

TL;DR

RAOQ (Reshape and Adapt for Output Quantization) is a novel training framework that enables high-performance AI on In-Memory Computing (IMC) hardware by overcoming the precision bottlenecks of Analog-to-Digital Converters (ADCs). By reshaping weight and activation distributions and using a "bit augmentation" training strategy, RAOQ allows complex models like BERT and LLMs to run on efficient, low-resolution analog hardware with minimal loss in accuracy.

What Problem Does This Paper Address?

In-Memory Computing (IMC) is a hardware paradigm where computation happens directly inside memory arrays, drastically reducing the energy-intensive "data movement" between processors and RAM. However, IMC relies on analog signals. To get results back into the digital world, the system needs Analog-to-Digital Converters (ADCs).

Overview of In-Memory Computing challenges: (a) Energy trade-offs with ADC precision, (b) IMC architecture, (c) Impact of ADC precision on accuracy, and (d) Training convergence under different ADC constraints.

The catch? High-resolution ADCs are massive energy hogs, while low-resolution ADCs (which are efficient) introduce significant quantization errors that can tank a neural network's accuracy. Unlike standard weights or activations, ADC quantization is "fixed" by the hardware design—you can't simply "learn" the best clipping levels during training. This paper tackles the challenge of making state-of-the-art (SOTA) AI models robust to these rigid, low-precision hardware constraints.

Methods

The authors propose a two-pronged strategy called RAOQ:

  1. Reshaping Statistics (SQNR Enhancement): To maximize the Signal-to-Quantization-Noise Ratio (SQNR), the authors aim to increase the variance of the signals entering the ADC.
  2. A-shift (Activation Shifting): Many activation functions (like SiLU or GELU) cluster values near zero. RAOQ shifts these activations away from zero, effectively "stretching" the signal to use more of the ADC's range.
  3. W-reshape (Weight Reshaping): The training loss is modified with a kurtosis penalty that flattens the weight distribution, pushing more weights toward the edges to further increase signal variance.
  4. Adapting the Model (Robustness):
    • BitAug (Bit Augmentation): During training, the model is exposed to ADCs of varying bit-precisions (e.g., target bit $\pm 1$). This forces the model to find "flatter" minima in the loss landscape that are less sensitive to quantization noise.
  5. ADC-LoRA: To make this training feasible for large models, the authors use Low-Rank Adaptation (LoRA). They introduce a specialized MSE-based initialization to ensure the low-rank adapters are properly "warmed up" for the specific noise profile of an ADC.

Datasets

The researchers evaluated RAOQ across a wide variety of tasks and scales:

  • Computer Vision: ImageNet (using ResNet18/50, MobileNetV2, and EfficientNet-lite0) and COCO 2017 (using YOLOv5s for object detection).
  • Natural Language Processing (NLP): SQuAD 1.1 (BERT-base/large) and WikiText-2/103 (OPT and BLOOM models ranging from 125M to 1.7B parameters).
  • Comparison Benchmarks: CIFAR-10 was used to compare against previous IMC-specific quantization methods.

Key Insights and Ideas

  • The Fixed-Step Dilemma: Traditional quantization-aware training (QAT) fails for IMC because it assumes you can tune the quantizer. In IMC, the hardware is the quantizer. RAOQ flips the script: instead of tuning the quantizer to the data, it tunes the data (statistics) to the quantizer.
  • Variance is Victory: By intentionally increasing the 2nd-order moments (variance) of weights and activations, the authors significantly boost the "signal" part of the SQNR, making the "noise" from a 7-bit or 8-bit ADC negligible.
  • Escaping Local Minima: The paper shows that ADC quantization makes the loss surface "jagged" with many poor local minima. BitAug acts as a powerful regularizer, helping the optimizer skip over these small traps to find more robust solutions.

Key Results

RAOQ achieves state-of-the-art results for IMC systems, often matching the performance of full-precision models:

  • LLMs: For the OPT-1.3B model, "vanilla" QAT resulted in a perplexity of over 500 (essentially unusable). RAOQ brought this down to 13.33, nearly matching the "No ADC" baseline of 12.40.
  • Computer Vision: On ImageNet, RAOQ maintained accuracy within ~1% of the baseline even with 7-bit ADCs, whereas standard methods saw drops of 10% or more.
  • Efficiency: Using ADC-LoRA reduced the number of trainable parameters by over 45x, allowing the team to fine-tune large models like BERT-Large (345M parameters) using only 3.5M trainable parameters.

Limitations and Future Work

  • Hardware Specifics: While the paper demonstrates robustness to general analog noise, the experiments primarily use a simulated IMC environment. Real-world hardware non-idealities (like device-to-device variation in ReRAM) might require further specialized tuning.
  • Extreme Low-Bit ADCs: The study focuses on 7-9 bit ADCs. Pushing the limits down to 4-5 bits remains a significant challenge that may require even more aggressive reshaping techniques.
  • Integration: Future work could explore combining RAOQ with other compression techniques like pruning to further enhance the efficiency of edge AI devices.

Summary updated

BibTeX
@inproceedings{zhang2024reshape,
  author = {Bonan Zhang and Chia-Yu Chen and Naveen Verma},
  title = {{Reshape and Adapt for Output Quantization (RAOQ): Quantization-aware Training for In-memory Computing Systems}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=fM9xTkpAdu},
}
Figure