Post-Training Quantization (PTQ) is the process of compressing a high-precision neural network into low-bit integers (like INT8 or INT4) using only a small calibration dataset. While PTQ is highly efficient, it often fails when applied to modern architectures like Vision Transformers (ViTs) and Large Language Models (LLMs). These models suffer from "outliers"—specific channels in the activations that exhibit much larger values than others—which force the quantization scale to be too wide, crushing the precision of the remaining values.
A powerful family of techniques has emerged to solve this by applying equivalent transformations. The core intuition is to mathematically redistribute the difficulty of quantization from the activations to the weights before the model is deployed.
The Mathematical Shell Game
The fundamental operation in a neural network is $y = Wx$. If the input $x$ is difficult to quantize because of outliers, we can introduce a transformation matrix $S$ (often a diagonal scaling matrix) such that:
$$y = (W S^{-1}) (S x)$$
By choosing $S$ to "squash" the outliers in $x$, we make the new activations $\hat{x} = Sx$ much easier to quantize. Crucially, we don't actually perform this multiplication during inference. Instead, we pre-compute the new weights $\hat{W} = W S^{-1}$ offline. At runtime, the hardware simply executes $y = \hat{W}\hat{x}$.
This "folding" or "absorption" mechanism is the recurring theme across recent breakthroughs. Edouard YVINEC and colleagues demonstrated in SPIQ that per-channel input scaling factors can be absorbed into subsequent weights, allowing static quantization to achieve the accuracy of dynamic quantization without the runtime overhead of recalculating scales.
Scaling and Shifting for Outlier Suppression
While simple scaling works for many cases, some distributions are asymmetric or shifted far from zero. Xiuying Wei and the authors of Outlier Suppression+ expanded this idea to include channel-wise shifting. By centering the distribution and then scaling it, they migrated complex activation transformations into the model's weights and biases.
In the context of Vision Transformers, Zhikai Li introduced Scale Reparameterization in RepQ-ViT. This method integrates per-channel activation scales directly into the affine factors of normalization layers and subsequent linear weights. This allows the model to benefit from fine-grained, channel-wise precision while the hardware only sees a simple, fast layer-wise operation.
Beyond Scaling: Rotations and Permutations
Sometimes, scaling alone isn't enough because the "outlier-ness" is spread across many channels in a way that simple diagonal matrices can't fix. Researchers have pushed the boundaries of what can be "folded" into weights:
- Learnable Affine Transformations: Ofir Gordon and the LATMiX team use learnable matrices to squash outliers specifically for hardware-friendly microscaling formats.
- Block Rotations: Sai Sanjeet and others in PeRQ showed that one can permute and rotate activation blocks to distribute outlier "mass" more evenly. Because these rotations are linear, they can be merged into the static weights of permutation-equivariant layers.
- Outlier Self-Absorption: In OSAQ, Zhikai Li proposed an additive transformation that "absorbs" problematic outliers into the weight matrix itself by exploiting the low-rank consistency of the model's Hessian.
Why It Works: Quantization-Inference Decoupling
The common thread across these papers—from TEQ by Yiyang Cai to AdaQTransform by Zhaojing Wen—is the concept of quantization-inference decoupling.
During the calibration phase, we are free to use complex, high-precision transformations (like learnable affine matrices or per-channel scales) to find the optimal numerical distribution. As long as these transformations are linear, they can be mathematically collapsed into the existing model parameters ($W$ and $b$) before deployment.
This ensures that the final model benefits from a "wider optimization space" during quantization, but remains a standard, high-speed quantized graph during inference. As Junyi Wu demonstrated in PTQ4DiT, even the complex, time-dependent outliers in Diffusion Transformers can be managed by folding these corrections into adaptive normalization layers, resulting in near-lossless 4-bit weights with zero additional latency.