RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization
TL;DR
RoLoRA is the first fine-tuning scheme designed to make Large Language Models (LLMs) compatible with ultra-low-bit weight-activation quantization (e.g., W4A4). By mathematically "rotating" weight matrices to eliminate activation outliers and employing a rotation-aware fine-tuning strategy, RoLoRA achieves accuracy gains of up to 29.5% over standard LoRA in 4-bit settings.
The Challenge: Activation Outliers
Fine-tuning LLMs is computationally expensive, leading to the popularity of Low-Rank Adaptation (LoRA). While weight-only quantization (like QLoRA) saves memory, the "holy grail" for efficiency is weight-activation quantization (W4A4). This reduces precision for both weights and intermediate activations, significantly accelerating matrix multiplications on hardware.
However, LLMs suffer from activation outliers—specific channels with values significantly larger than others. In 4-bit quantization, these outliers stretch the range so much that the remaining data loses almost all precision. Standard fine-tuning often exacerbates this by increasing the "peakiness" (kurtosis) of activations, making quantization even harder.
The RoLoRA Solution
RoLoRA (Rotated outlier-free LoRA) addresses this through two primary innovations:
1. Outlier Elimination via Rotation
RoLoRA applies a mathematical rotation (using a Hadamard Transform) to the weight matrices. This transformation is computationally invariant; it doesn't change the model's output but "smears" high-magnitude outliers across all channels. This converts a "spiky" distribution into a smoother, Gaussian-like one that is much easier to quantize.
2. Rotation-Aware Fine-Tuning (LAR)
Simply rotating a pre-trained model is insufficient because training can re-introduce outliers. RoLoRA uses LoRA After Rotation (LAR), where the rotation is merged into the weights before adding the LoRA adapter. This allows the low-rank adapters to learn on a stabilized, outlier-free weight distribution, resulting in lower approximation errors.
Key Results and Performance
RoLoRA was evaluated on LLaMA2, LLaMA3, and LLaVA-1.5 models across benchmarks like MMLU and Zero-shot Commonsense Reasoning.
- Massive Accuracy Gains: On LLaMA2-13B, RoLoRA achieved a 29.5% absolute accuracy gain in W4A4 settings compared to standard LoRA.
- Superiority over SOTA: It outperformed the previous state-of-the-art method (IR-QLoRA) by up to 6.0 points on MMLU.
- Multimodal Robustness: In multimodal tests (LLaVA), standard 4-bit LoRA often fails to describe images accurately. RoLoRA preserves the model's ability to provide detailed, complex reasoning.
Conclusion
RoLoRA demonstrates that by addressing the structural distribution of activations during the fine-tuning process, we can unlock the efficiency of 4-bit weight-activation quantization without sacrificing the reasoning capabilities of large models. While currently optimized for the LLaMA family, its principles of rotation-invariance offer a promising path for future low-bit quantization research.
Summary updated