Optimal Scalar Quantization for Matrix Multiplication: Closed-Form Density and Phase Transition
arXiv:2603.19559
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 \[ λ^\star(u)\ \propto\ \exp\!\left(-\frac{u^2}{6}\right)\bigl((1-Ï^2)+Ï^2u^2\bigr)^{1/3}, \qquad u=\frac{x}{Ï_X}, \] 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.