NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Adaptive Layer-Wise Transformations for Post-Training Quantization of Large Language Models

Cuong Pham, Hoang Anh Dung, Cuong C. Nguyen, Trung Le, Gustavo Carneiro, Jianfei Cai, Thanh-Toan Do · DOI

Introduction

Large Language Models (LLMs) have revolutionized natural language processing but come with immense computational and memory requirements. To deploy these models on consumer-grade hardware, Post-Training Quantization (PTQ) is essential, reducing 16-bit weights to 4 bits or even lower. However, aggressive quantization often leads to significant performance degradation due to "outlier" values in weights and activations.

This paper introduces a novel framework that moves away from traditional "one-size-fits-all" quantization strategies. Instead, it adaptively selects the optimal mathematical transformation—either Affine or Rotation—for each individual layer based on its unique statistical properties, specifically its kurtosis. This approach achieves state-of-the-art accuracy and perplexity on LLaMA models with minimal computational overhead.

The Challenge of Outliers in Quantization

The primary obstacle in low-bit quantization is the presence of outliers—extreme values that significantly deviate from the mean. These outliers force the quantization scale to be excessively wide, which in turn causes the majority of "normal" values to lose precision, effectively drowning out the signal with quantization noise.

Existing state-of-the-art methods like FlatQuant (utilizing Affine transformations) and QuaRot (utilizing Rotation transformations) attempt to mitigate this by "smoothing" the distribution before quantization. However, these methods are homogeneous, applying the same transformation type across all layers. The authors argue that LLM layers are inherently heterogeneous; for instance, an attention layer typically exhibits a different outlier distribution than a feed-forward network (FFN) layer. Forcing a uniform transformation across these diverse layers results in suboptimal performance.

Methodology: Adaptive Layer-Wise Transformation

The proposed framework addresses layer heterogeneity through an adaptive selection process. The authors developed two primary methods for determining the best transformation per layer:

The choice between Affine and Rotation transformations is formulated as a differentiable optimization problem. During a brief calibration phase, "softmax weights" are used to blend the two transformations, allowing the model to "learn" which one minimizes the reconstruction error for each specific layer.

2. Outlier-Guided Heuristic

Recognizing that differentiable search can be computationally expensive for massive models, the researchers identified a practical shortcut. They discovered a strong correlation between a layer's Kurtosis—a statistical measure of the "tailedness" of a distribution—and the optimal transformation type.

  • High Kurtosis: Layers with concentrated, extreme outliers benefit from Rotation, which redistributes the outlier energy across multiple dimensions.
  • Low Kurtosis: Layers with flatter distributions are better served by Affine transformations, which offer greater flexibility and computational efficiency.

By employing robust z-score normalization (using Median Absolute Deviation), the heuristic achieves 85-87% agreement with the differentiable search while significantly reducing processing time.

Kurtosis of Attention and FFN layers in LLaMA-2-7B, showing the adaptive selection of Rotation vs. Affine transformations.

Experimental Setup

The framework was evaluated using the LLaMA model family, including LLaMA-2 (7B, 13B, 70B) and LLaMA-3 (8B, 70B). Performance was measured across two primary categories:

  • Language Modeling: Perplexity (PPL) was calculated using the WikiText-2 and C4 datasets.
  • Zero-Shot Tasks: The models were tested on six standard benchmarks: ARC-Easy, ARC-Challenge, HellaSwag, LAMBADA, PIQA, and WinoGrande.

Calibration was performed using a small sample of 128 sequences from the WikiText-2 dataset to fine-tune quantization parameters.

Results and Analysis

The adaptive approach consistently outperformed fixed-transformation baselines, particularly in aggressive low-bit settings (e.g., 3-bit weights and activations).

Key findings include:

  • Performance Gains: On LLaMA-3-8B (W3A3K2V2 setting), the method achieved a 4.58-point improvement in perplexity and a 2.11% increase in average zero-shot accuracy compared to FlatQuant.
  • LLaMA-2 Improvements: For LLaMA-2-7B, zero-shot accuracy improved by 5.49% over FlatQuant in extreme 3-bit configurations.
  • Efficiency: The heuristic selection method is 3x faster than the differentiable search.
  • Inference Speed: The method maintains high efficiency, delivering up to a 1.89x prefill speedup on A100 GPUs compared to standard FP16 models.
Zero-shot performance comparison across LLaMA models in various low-bit quantization settings.

The empirical data confirms that attention layers often favor rotation due to higher outliers, while FFN layers frequently benefit from affine transformations. This statistical "fingerprint" is the key to unlocking higher precision in quantized models.

Conclusion

By embracing the inherent heterogeneity of LLM layers, the Adaptive Layer-Wise Transformation framework provides a robust solution to the outlier problem in PTQ. The discovery that kurtosis can guide transformation selection allows for high-performance quantization without the need for exhaustive search. Future work may extend this logic to other architectures like MoE models or explore additional non-linear mapping techniques to further push the boundaries of low-bit LLM deployment.

Summary updated

BibTeX
@misc{pham2025adaptive,
  author = {Cuong Pham and Hoang Anh Dung and Cuong C. Nguyen and Trung Le and Gustavo Carneiro and Jianfei Cai and Thanh-Toan Do},
  title = {{Adaptive Layer-Wise Transformations for Post-Training Quantization of Large Language Models}},
  year = {2025},
  eprint = {2511.17809},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.17809},
}
Figure