Optimal Scalar Quantization for Matrix Multiplication: Closed-Form Density and Phase Transition
Organizations: Stanford University
Abstract
We study entrywise scalar quantization of two matrices prior to multiplication. Given and , we quantize entries of and independently using scalar quantizers with and levels per entry, and form . The objective is to minimize the matrix multiplication mean-squared error (MSE) under a pair-i.i.d.\ inner-product model. In the high-resolution regime , we derive a sharp asymptotic expansion for , identify the exact optimal leading constants, and characterize asymptotically optimal quantization center densities in terms of conditional second moments. We then specialize to correlated Gaussian multiplicative pairs, obtaining a closed-form optimal point density
with the same form for , and prove a correlation-driven phase transition: the density is unimodal at the origin for and becomes bimodal for with peaks at . We show our method's applicability in synthetic experiments such as matrix multiplication quantization and least squares optimization, as well as quantization of large language model key and query activations.
Figures & tables
| Model | -tuned vs FP8 (% wins) | -tuned vs INT8 (% wins) |
|---|---|---|
| GPT-2 Small (12 layers, 12 heads) | 100% | 96.5% |
| GPT-2 Medium (24 layers, 16 heads) | 100% | 97.9% |
| GPT-2 Large (36 layers, 20 heads) | 100% | 100% |
| GPT-2 XL (48 layers, 25 heads) | 100% | 99.7% |
| Qwen3-0.6B (28 layers, 8 heads) | 98.7% | 65.6% |
| Qwen3-1.7B (28 layers, 8 heads) | 98.7% | 59.4% |
Neural Network Quantization
Neural network quantization represents weights, activations, and states with fewer bits to reduce memory use, computation, and deployment costs.
See all 404 papers