cs.ITMar 20, 2026

Optimal Scalar Quantization for Matrix Multiplication: Closed-Form Density and Phase Transition

Authors: Calvin Ang, Sungyoon Kim, Mert Pilanci

Organizations: Stanford University

Abstract

We study entrywise scalar quantization of two matrices prior to multiplication. Given A∈Rm×kA\in R^{m\times k} and B∈Rk×nB\in R^{k\times n}, we quantize entries of AA and BB independently using scalar quantizers with KXK_X and KYK_Y levels per entry, and form C^=A^ B^\widehat C=\widehat A\,\widehat B. The objective is to minimize the matrix multiplication mean-squared error (MSE) E[∥AB−A^B^∥F2]E[\|{AB-\widehat A\widehat B}\|_F^2] under a pair-i.i.d.\ inner-product model. In the high-resolution regime KX,KY→∞K_X,K_Y\to\infty, we derive a sharp K−2K^{-2} asymptotic expansion for E\mathcal{E}, 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

λ⋆(u) ∝ exp⁡ ⁣(−u26)((1−ρ2)+ρ2u2)1/3,u=xσX,λ^\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 y/σYy/σ_Y, and prove a correlation-driven phase transition: the density is unimodal at the origin for ∣ρ∣≤1/3|ρ|\leq 1/\sqrt{3} and becomes bimodal for ∣ρ∣>1/3|ρ|>1/\sqrt{3} with peaks at upeak=±3−1/ρ2u_{\mathrm{peak}}=\pm\sqrt{3-1/ρ^2}. 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

Explore similar work

CardsList
  1. A Nuclear-Norm Lower Bound for Dithered Scalar Quantization of Matrix Products

    Sep 4, 2026Piyush Sao, Narasinga Miniskar, Pedro Valero-Lara +2Matrix Optimization

  2. Product-Aware Deterministic Rounding for Quantized Matrix Multiplication

    Sep 11, 2026Piyush Sao, Narasinga Miniskar, Pedro Valero-Lara +2Neural Network QuantizationActivation Quantization

  3. Contraction-Gauge Preconditioning for Quantized Matrix Multiplication

    Jul 21, 2026Piyush Sao, Narasinga Miniskar, Pedro Valero-Lara +2Post-Training QuantizationLow-Bit Quantization