Low-Rank Quantization-Aware Training for LLMs

Yelysei Bondarenko, Riccardo Del Chiaro, Markus Nagel

TL;DR

This paper introduces LR-QAT, a novel Quantization-Aware Training (QAT) method that significantly reduces memory requirements for training Large Language Models (LLMs). By combining low-rank adaptation with quantization-aware techniques and efficient memory management, LR-QAT enables training of LLMs on consumer-grade GPUs while maintaining performance comparable to full-model QAT.

What Problem Does This Paper Address?

Large Language Models (LLMs) are becoming increasingly powerful but also demand substantial computational and memory resources, making their practical deployment challenging, especially on resource-constrained devices. While quantization is a key technique to reduce these demands, traditional Quantization-Aware Training (QAT) methods, which offer the best performance, are prohibitively expensive in terms of training time and GPU memory for LLMs. Existing methods often struggle to balance memory efficiency with predictive performance, or introduce inference overhead.

Methods

The authors propose LR-QAT (Low-Rank Quantization-Aware Training), a method that combines several innovations to achieve memory efficiency without sacrificing performance:

  • Low-Rank Quantization-Aware Reparameterization: Inspired by Parameter-Efficient Fine-Tuning (PEFT) and LoRA, LR-QAT introduces low-rank auxiliary weights. Crucially, these weights are kept in the integer domain to align with the quantization grid of the pretrained weights, allowing for seamless fusion during inference.
  • Downcasting Operator: The frozen pretrained weights are stored in a lower-precision format. This is achieved by using fixed-point or double-packed integers (e.g., INT4 packed into INT8), which further reduces memory usage.
  • Gradient Checkpointing: This technique is employed to avoid aggressive memory spikes by recomputing intermediate results during the backward pass instead of storing them.

LR-QAT is designed to be an "extended pretraining" framework, meaning the resulting quantized model can be used for any downstream task without further fine-tuning, or can be fine-tuned with additional adapters. It is also inference-efficient, with no additional overhead compared to traditional Post-Training Quantization (PTQ) after the low-rank adapters are fused.

Datasets

The authors trained and evaluated their models on:

  • SlimPajama: A subset of this dataset was used for training.
  • WikiText-2: Used for evaluating language generation perplexity.
  • Common sense reasoning tasks: Including BoolQ, PIQA, Winogrande, ARC-e, ARC-c, and HellaSwag, used for zero-shot evaluation.

Key Insights and Ideas

  • Low-rank adaptation can compensate for quantization noise: The paper demonstrates that by strategically applying low-rank approximations within the quantization process, the performance degradation typically associated with quantization can be effectively mitigated.
  • Integer domain for low-rank weights is crucial: Keeping the auxiliary low-rank weights in the integer domain, aligned with the main quantized weights, is key to achieving seamless fusion and inference efficiency.
  • Downcasting and double-packing offer significant memory savings: Storing the pretrained weights in lower-bit formats like INT4 (even when double-packed into INT8 for framework compatibility) drastically reduces memory footprint.
  • LR-QAT as a general pretraining framework: The method is positioned not just for fine-tuning but as a way to create efficient, general-purpose quantized LLMs.

Key Results

  • Memory Reduction: LR-QAT reduces the memory required to train a 7B LLM from over 98GB to under 21GB, enabling training on a single consumer-grade GPU (e.g., 24GB).
  • Performance: LR-QAT achieves performance comparable to full-model QAT on various downstream tasks, outperforming common PTQ methods.
  • Inference Efficiency: The method results in no additional inference overhead compared to traditional PTQ after adapter fusion.
  • Versatility: LR-QAT is shown to be effective across different LLM families (LLaMA-1/2/3, Mistral) and quantization settings (weight-only, weight-activation, per-channel, group-wise).

Limitations and Future Work

  • Scalability to Larger LLMs: While LR-QAT was demonstrated on models up to 13B parameters, its scalability to significantly larger LLMs remains an open question, though the authors see no inherent reason why it wouldn't extend.
  • Extended Pretraining: The current evaluation uses thousands of training iterations. The performance impact of using LR-QAT during pretraining for millions of iterations is not explored.
  • Bias in Quantization: The paper acknowledges that quantization, in general, might lead to biased predictions, referencing prior work on this topic.

The authors suggest that LR-QAT's effectiveness in compensating for quantization noise through low-rank adaptation is a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{bondarenko2024low,
  author = {Yelysei Bondarenko and Riccardo Del Chiaro and Markus Nagel},
  title = {{Low-Rank Quantization-Aware Training for LLMs}},
  booktitle = {ES-FoMo-II @ ICML},
  year = {2024},
  url = {https://openreview.net/forum?id=OBDUa8mhVC},
}
Figure