FrameQuant: Flexible Low-Bit Quantization for Transformers

Harshavardhan Adepu, Zhanpeng Zeng, Li Zhang, Vikas Singh

TL;DR

FrameQuant is a new post-training quantization (PTQ) method that enables Transformer models to run at just 2 bits with remarkably low accuracy loss. By representing weights in a redundant "Fusion Frame" space borrowed from signal processing, the authors create a system that is naturally robust to quantization noise, allowing for flexible, "fractional" bit-rates (e.g., 2.2 bits) that bridge the gap between extreme compression and model performance.

What Problem Does This Paper Address?

As Large Language Models (LLMs) and Vision Transformers (ViTs) grow in scale, the cost of serving them becomes prohibitive. Quantization—reducing the precision of model weights from 16-bit or 32-bit floats to lower bit-widths—is the standard solution.

However, there is a "performance cliff" in current post-training quantization. While 4-bit quantization is relatively mature, dropping to 2 bits usually causes a catastrophic collapse in accuracy. Existing methods struggle with weight outliers and the inherent sensitivity of the Transformer architecture. Furthermore, most methods are rigid: you either choose 2 bits or 3 bits, with no middle ground to balance the trade-off between memory savings and model quality.

Methods

The core innovation of FrameQuant is moving the quantization process out of the original weight space and into a Fusion Frame representation.

FrameQuant computation flow
  1. Fusion Frames (FF): Borrowed from harmonic analysis, these are redundant, overcomplete mathematical frames. Think of them as a "basis" that uses more vectors than necessary to describe a space. This redundancy is the secret sauce; in signal processing, it’s used to make transmissions robust against noise and erasures.
  2. Quantization as Noise: The authors treat quantization error as additive noise. Because Fusion Frames are mathematically designed to allow for "consistent recovery" even from noisy coefficients, quantizing in this space results in much lower reconstruction error when the weights are transformed back.
  3. The Workflow:
    • Weights are transformed into the FF representation.
  4. The authors apply a modified version of GPTQ (a popular iterative quantization algorithm) within this representation.
  5. They use a $2\sigma$ clipping strategy. Because the FF transformation spreads the "energy" of weight outliers across many coefficients, clipping becomes much more effective and less damaging to the model's signal.
  6. Flexibility (Fractional Bits): By adjusting the "redundancy factor" ($r$), the user can achieve bit-widths like 2.1 or 2.2 bits. This allows engineers to fine-tune a model to fit specific hardware constraints without the massive quality drop-off seen at exactly 2.0 bits.

Datasets

The authors evaluated FrameQuant across a massive "basket" of 15+ models:

  • Vision: ImageNet-1K for classification; COCO for object detection and segmentation (using Swin backbones).
  • Language: WikiText2 and C4 datasets to measure perplexity.
  • Models: ViT (Tiny to Huge), DeiT, Swin, BERT, OPT (125M to 6.7B), and Llama2 (7B to 70B).

Key Insights and Ideas

  • Redundancy is a Feature, Not a Bug: In standard quantization, every bit lost is a direct loss of information. In FrameQuant, the redundancy of the frame acts as a buffer. If one coefficient is poorly quantized, the others can "compensate" during the reconstruction step.
  • Outlier Diffusion: One of the biggest headaches in LLM quantization is "outlier weights." By projecting weights into a Fusion Frame, these extreme values are effectively "smeared" across the representation, making the distribution more Gaussian and easier to quantize.
  • Theoretical Backing: By casting quantization as a signal recovery problem, the authors can invoke decades of proofs from harmonic analysis regarding Mean Squared Error (MSE) reduction ($O(1/r)$ or $O(1/r^2)$) as redundancy increases.

Key Results

Accuracy comparison across Vision Transformers
  • Bridging the 2-bit Gap: On ImageNet, FrameQuant at 2.2 bits (redundancy $r=1.1$) achieved 80.93% accuracy on ViT-B, compared to just 29.26% for standard GPTQ at 2 bits. It even outperformed 3-bit PTQ4ViT in several configurations.
  • LLM Performance: For Llama2-70B, FrameQuant (2.2 bits) achieved a perplexity of 4.67 on WikiText2. For context, the full-precision model is 3.32, while 2-bit QuIP is 8.65 and 2-bit GPTQ fails completely (140.5).
  • Massive Compression: The method reduces the storage footprint of Llama2 models by approximately 85%.
  • Downstream Tasks: On the LM-Evaluation-Harness (ARC, BoolQ, etc.), FrameQuant consistently outperformed other 2-bit baselines, often by double-digit margins.

Limitations and Future Work

  • Inference Latency: Because FrameQuant requires transforming weights/activations into and out of the Fusion Frame space, it introduces computational overhead. Currently, it is slower than GPTQ (e.g., ~974 tokens/sec vs ~1425 tokens/sec on an A100 for Llama2-7B).
  • Need for Optimized Kernels: The authors note that the current implementation uses standard matrix operations. Custom CUDA kernels for the specific block-diagonal structures of Fusion Frames could significantly close the speed gap.
  • The 1-bit Frontier: The authors attempted to push the method to 1-bit quantization but were unsuccessful, suggesting that even with redundancy, 1-bit remains an extremely difficult target for post-training methods.
  • Quantization-Aware Training (QAT): This paper focuses on PTQ (no retraining). Applying Fusion Frames during the actual training process could potentially yield even better results.

Summary updated

BibTeX
@inproceedings{adepu2024framequant,
  author = {Harshavardhan Adepu and Zhanpeng Zeng and Li Zhang and Vikas Singh},
  title = {{FrameQuant: Flexible Low-Bit Quantization for Transformers}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=xPypr0kufs},
}
Figure