TL;DR
Rotated Runtime Smooth (RRS) is a training-free, plug-and-play method that finally makes 4-bit weight and activation (W4A4) quantization viable for Large Language Models. By combining runtime smoothing with a rotation operation, it eliminates both persistent channel-wise outliers and sporadic "spike" outliers, reducing LLaMA3-70B perplexity from a broken 57.33 to a near-lossless 6.66.
The Challenge of INT4 Quantization
Quantizing LLMs to 4-bit (INT4) is the "holy grail" for efficient inference, offering massive savings in memory and computation. However, while we can quantize weights to 4-bit relatively easily, quantizing activations is notoriously difficult due to outliers.
Outliers are activation values with much higher magnitudes than the rest. They "stretch" the quantization range; if you have one value at 100 and the rest at 1, a 4-bit scale (which only has 16 levels) will lump all the "1s" into a single bin, destroying the model's precision.
Previous solutions like SmoothQuant try to migrate these outliers from activations to weights offline, but they struggle because:
- Scale Mismatch: Outliers during actual inference don't always match the "calibration" data used offline.
- Weight Corruption: Moving outliers to weights makes the weights themselves harder to quantize to 4-bit.
- Spike Outliers: Some outliers aren't tied to specific channels but appear sporadically (spikes), which offline methods can't predict.
Introducing Rotated Runtime Smooth (RRS)
The authors propose Rotated Runtime Smooth (RRS), which consists of two main components designed to tackle these specific outlier types without retraining:
- Runtime Smooth (RS): Instead of using fixed offline scales, RS calculates smoothing scales dynamically during inference. It reorders activations and weights to group outliers together and then smooths them using group-wise maximums. Crucially, it does not migrate outliers to weights, keeping the weights "clean" and easy to quantize.
- Rotation Operation: To handle "spike outliers," the authors apply a Hadamard rotation matrix to the activations. This "spreads" the energy of a single massive spike across multiple channels. This prevents the "victim" effect, where a single spike in a group forces a huge scaling factor that crushes all other normal values in that group to zero.
The authors also developed a fused GEMM kernel to ensure that the reordering and scaling operations happen efficiently on the GPU, adding negligible overhead compared to standard INT4 matrix multiplication.
Evaluation and Datasets
The researchers evaluated RRS across a wide range of mainstream LLM families:
- Models: LLaMA-2 (13B, 70B), LLaMA-3/3.1 (8B, 70B), Qwen-1.5/2.5, Mistral, and Mixtral.
- Benchmarks:
- Language Modeling: WikiText-2 (Perplexity).
- Common Sense QA: ARC-e, ARC-c, BoolQ, and OBQA.
- Downstream Tasks: GSM8k (Math), MMLU, C-Eval (Chinese), and HumanEval (Code).
Key Insights
- Outlier Taxonomy: The paper categorizes outliers into "channel-wise" (consistent across tokens) and "spike" (sporadic). This distinction is vital because a one-size-fits-all smoothing approach fails to address both.
- The "Victim" Problem: In group-wise quantization, a single spike outlier is a "bully." It dictates a large scale for the whole group, turning all other useful information (the "victims") into noise. Rotation turns that one bully into a group of slightly larger, but manageable, values.
- Training-Free vs. Training-Based: RRS outperforms training-based methods like SpinQuant. This is surprising and significant because RRS requires zero expensive retraining or fine-tuning, making it much more practical for deployment.
- Reordering is Key: By sorting channels based on their maximum values during runtime, the model can group "troublemaker" channels together, allowing for more fine-grained control over the quantization error.
Results
- Accuracy Recovery: On LLaMA3-70B, RRS improved the WikiText-2 perplexity from 57.33 (the previous state-of-the-art, QuaRot) to 6.66, which is very close to the FP16 baseline of 2.80.
- Zero-Shot Superiority: In Common Sense QA tasks, RRS consistently outperformed other methods by an average of ~3%, showing better generalization across different types of reasoning.
- Efficiency: The fused kernel implementation shows that RRS achieves performance (Tops) nearly identical to standard INT4 per-channel quantization, proving it is hardware-friendly.
- Robustness: RRS showed strong performance even on "out-of-distribution" tasks like coding (HumanEval) and math (GSM8k), where activation patterns can be quite different from standard text.
Limitations and Future Work
- Multiple Spikes: The authors note that while rotation handles single spikes well, the rare case of multiple massive spikes in a single activation token could still pose a challenge for the smoothing scale.
- Hardware Specifics: While tested on NVIDIA RTX 4070 Ti, the performance on other architectures (like mobile chips or specialized AI accelerators) remains to be seen.
- Extreme Quantization: The paper focuses on INT4. Future work could explore whether these "rotated runtime" principles can push LLMs down to 2-bit or 3-bit activations without total collapse.
Summary updated