TL;DR
Learning-based post-training quantization (PTQ) for Large Language Models (LLMs) suffers from "Optimization Imbalance" because the standard Mean Squared Error (MSE) loss couples gradient strength to the magnitude of reconstruction error. By simply switching to Root Mean Squared Error (RMSE), researchers can decouple these factors, achieving balanced optimization across all model layers and significantly boosting performance in aggressive low-bit quantization settings.
What Problem Does This Paper Address?
Quantizing LLMs—reducing the precision of their weights and activations to save memory—is essential for deployment but notoriously difficult. State-of-the-art methods use Post-Training Quantization (PTQ), which processes the model sequentially, block by block (e.g., one Transformer layer at a time). These methods typically optimize auxiliary parameters (like scaling factors or clipping thresholds) using gradient descent to minimize a reconstruction loss—the difference between the original high-precision block output and the new quantized output.
The industry standard for this loss is Mean Squared Error (MSE). However, the authors discovered a fundamental flaw: in sequential quantization, the magnitude of the reconstruction loss varies wildly—often by more than 10,000x—from the first layer to the last. Because the gradient of MSE is proportional to the square root of the loss, this "reconstruction loss scale" creates an Optimization Imbalance. Early layers, which have smaller initial errors but the greatest impact on downstream results, receive very weak updates, while later layers receive disproportionately strong ones.
Methods
The authors propose a deceptively simple fix: replace MSE with Root Mean Squared Error (RMSE).
Mathematically, the gradient magnitude of RMSE is constant (normalized by the number of elements), regardless of the loss magnitude. This provides implicit gradient normalization, ensuring that every block in the model receives a comparable "strength" of optimization during the quantization process.
Beyond a simple global RMSE, the authors introduced a unified family of four RMSE variants based on how feature elements are grouped:
- RMSE-Sample: Normalizes per calibration sample.
- RMSE-Channel: Normalizes per feature channel.
- RMSE-Token: Normalizes per token.
- RMSE-Element: Normalizes per individual element (equivalent to L1 loss).
These variants allow for fine-tuning the normalization behavior based on the specific architecture of the LLM being quantized.
Datasets
The researchers evaluated their approach across a wide range of models and tasks:
- Calibration: 128 samples from WikiText2.
- Language Modeling: Perplexity (PPL) on WikiText2.
- Common Sense Reasoning: PIQA, ARC-Easy, ARC-Challenge, Winogrande, HellaSwag, and BoolQ.
- Mathematical Reasoning: GSM8K and MATH-500.
- Coding Tasks: HumanEval and MBPP.
Key Insights and Ideas
- The Scale Problem: The "reconstruction loss scale" is a previously overlooked phenomenon where errors accumulate and output magnitudes shift as you move deeper into a model during sequential quantization.
- Coupling is the Enemy: MSE inherently couples optimization strength to the error magnitude. In a sequential setting, this means the "budget" for learning is distributed unfairly across layers.
- RMSE as a Stabilizer: RMSE acts as a drop-in replacement that requires no new hyperparameters or extra memory. It preserves the gradient direction of MSE but fixes the magnitude, leading to the "Balanced" optimization shown in the authors' tracking of parameter updates.
- Model-Specific Preferences: Interestingly, different model families prefer different RMSE groupings. LLaMA-based models generally perform best with RMSE-Token, while Qwen-based models favor RMSE-Channel.
Key Results
The switch to RMSE yielded consistent, significant gains, particularly in "aggressive" quantization regimes (like 2-bit weights or 4-bit weights/activations):
- Accuracy Boosts: In W2A16 quantization for Qwen3.5-27B, RMSE improved average downstream accuracy from 60.45% to 70.96% and slashed perplexity from 37.51 to 22.20.
- Generalization: The benefits were observed across four different state-of-the-art PTQ frameworks (OmniQuant, DuQuant, FlatQuant, and SliderQuant), proving the issue lies with the loss function, not the specific quantization algorithm.
- Efficiency: As shown in the results table below, RMSE variants consistently outperform MSE across almost every model scale and bit-width configuration.
Limitations and Future Work
While RMSE provides a massive boost, it is not a silver bullet for the most extreme quantization settings. For instance, in the W2A16G128 setting (2-bit weights with group-wise scaling), while RMSE improved results, the models still suffered significant performance degradation compared to their original versions. This suggests that for ultra-low-bit regimes, better optimization must be paired with more advanced quantization designs.
Additionally, the paper notes that the optimal feature grouping (Token vs. Channel) is model-dependent. Future work could investigate automated ways to determine the best grouping strategy or explore adaptive loss functions that combine multiple normalization scales.
Summary updated