RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization

Xijie Huang, Zechun Liu, Shih-Yang Liu, Kwang-Ting Cheng · DOI

Abstract

RoLoRA is a novel parameter-efficient fine-tuning (PEFT) scheme designed to enable effective 4-bit weight and activation (W4A4) quantization in Large Language Models (LLMs). By employing mathematical rotations to redistribute extreme activation values (outliers), RoLoRA transforms "spiky" activation distributions into quantizable, "flat" distributions. This approach achieves significant accuracy improvements—up to 29.5% over standard LoRA in low-bit settings—with minimal training overhead.

Introduction: The Challenge of Weight-Activation Quantization

Fine-tuning Large Language Models (LLMs) is notoriously memory-intensive. While methods like LoRA and QLoRA have addressed weight-related memory constraints, weight-activation quantization (e.g., W4A4) remains the "final frontier" for efficiency. W4A4 promises faster compute-intensive matrix multiplications and even lower memory footprints.

However, LLMs are plagued by "activation outliers"—specific channels with disproportionately large values that stretch the quantization range and degrade precision for the majority of the data. Standard LoRA fails in these scenarios because it does not account for the dynamic nature of these outliers during the fine-tuning process, where they can shift or emerge anew.

Methods: Taming Outliers via Rotation

RoLoRA addresses the outlier problem through a two-pronged strategy involving mathematical rotation and rotation-aware fine-tuning.

1. Rotation for Outlier Elimination

RoLoRA uses orthogonal rotation matrices, specifically Hadamard transforms, to redistribute the energy of activation outliers across all channels. This process converts a "spiky" distribution into a more Gaussian, "flat" one, which is significantly easier to quantize without massive precision loss.

Activation smoothing: The rotation process redistributes extreme outlier values across channels, creating a distribution that is much easier to quantize.

The framework employs two types of rotation to maintain computational invariance:

  • Between-Block Rotation (BBR): Rotates the weights of linear layers to eliminate outliers in the activations passed between transformer blocks.
  • In-Block Rotation (IBR): An efficient "online" rotation node placed before non-linear layers (like SwiGLU in the Feed-Forward Network) where weights cannot be pre-rotated.

2. Rotation-aware Fine-tuning (LAR)

The authors introduce LoRA After Rotation (LAR). By merging the rotation into the pre-trained weights before adding the LoRA adapter, LAR minimizes approximation errors in low-rank settings. This ensures the model remains "outlier-free" throughout the training process.

RoLoRA Architectural Overview: The integration of rotation matrices (R) within the Self-Attention and Feed-Forward Network blocks ensures computational invariance while smoothing activations.

Key Results and Insights

RoLoRA was evaluated across LLaMA2, LLaMA3, and LLaVA-1.5 models using the Alpaca dataset and various reasoning benchmarks.

  • Massive Accuracy Gains: On LLaMA2-13B with W4A4 quantization, RoLoRA achieved a 29.5% absolute accuracy improvement on reasoning tasks compared to a standard LoRA baseline.
  • MMLU Performance: On the MMLU benchmark, RoLoRA outperformed the previous state-of-the-art (IR-QLoRA) by up to 6.0 points.
  • Multimodal Robustness: For LLaVA-1.5, RoLoRA preserved complex reasoning and detailed description capabilities that were almost entirely lost with standard 4-bit LoRA. Standard LoRA often failed to describe visual content accurately under quantization, whereas RoLoRA maintained high fidelity.
  • Low Overhead: RoLoRA is highly efficient, adding only about 2.8% to training time and 0.1 GB to VRAM usage compared to standard LoRA.

Conclusion

RoLoRA demonstrates that activation outliers are not just a static property of pre-trained models but a dynamic challenge that must be managed during fine-tuning. By integrating rotation into the PEFT pipeline, RoLoRA enables the practical use of W4A4 quantization, paving the way for more efficient deployment of state-of-the-art LLMs on resource-constrained hardware without sacrificing performance.

Summary updated

BibTeX
@inproceedings{huang2024rolora,
  author = {Xijie Huang and Zechun Liu and Shih-Yang Liu and Kwang-Ting Cheng},
  title = {{RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.444},
}
Figure