[Paper Review] Optimal Scalar Quantization for Matrix Multiplication: Closed-Form Density and Phase Transition
This work derives high-rate, closed-form scalar quantization strategies for matrix multiplication, revealing a density-based phase transition for correlated Gaussian pairs and validating on synthetic and LLM activations.
We study entrywise scalar quantization of two matrices prior to multiplication. Given $A\in R^{m imes k}$ and $B\in R^{k imes n}$, we quantize entries of $A$ and $B$ independently using scalar quantizers with $K_X$ and $K_Y$ levels per entry, and form $\widehat C=\widehat A\,\widehat B$. The objective is to minimize the matrix multiplication mean-squared error (MSE) $E[\|{AB-\widehat A\widehat B}\|_F^2]$ under a pair-i.i.d.\ inner-product model. In the high-resolution regime $K_X,K_Y o\infty$, we derive a sharp $K^{-2}$ asymptotic expansion for $\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 \[ λ^\star(u)\ \propto\ \exp\!\left(-\frac{u^2}{6} ight)\bigl((1-ρ^2)+ρ^2u^2\bigr)^{1/3}, \qquad u=\frac{x}{σ_X}, \] with the same form for $y/σ_Y$, and prove a correlation-driven phase transition: the density is unimodal at the origin for $|ρ|\leq 1/\sqrt{3}$ and becomes bimodal for $|ρ|>1/\sqrt{3}$ with peaks at $u_{\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.
Motivation & Objective
- Motivate quantization design for matrix multiplication where distortion is measured on the product AB, not input reconstructions.
- Derive a high-rate, leading-term MSE expansion for quantized A and B under a pair-i.i.d. inner-product model.
- Obtain optimal companding densities and explicit constants for general distributions, with closed-form results for correlated Gaussian pairs.
- Demonstrate the method's practicality through synthetic experiments and activation quantization in transformer models.
Proposed method
- Reduce matrix multiplication MSE to two weighted scalar MSE problems driven by conditional second moments w_X and w_Y.
- Show a sharp K^{-2} asymptotic scaling for E under high-rate companding quantizers and derive optimal point densities lambda_X^* and lambda_Y^*.
- Specialize to correlated Gaussian pairs to obtain closed-form lambda^* with a phase transition at |rho|=1/sqrt(3).
- Provide corollaries that express rate form and optimal bit split between X and Y, and compute a Gaussian high-rate constant J(rho).
- Validate the theory through synthetic matrix multiplication, quantized least squares, and activation quantization in GPT-2 and Qwen3 models.

Experimental results
Research questions
- RQ1What scalar quantization scheme minimizes the Frobenius MSE of the product AB when A and B are quantized entrywise?
- RQ2What is the high-rate asymptotic behavior and the leading constants for the optimal matrix multiplication MSE under pair-i.i.d. inner-products?
- RQ3How do conditional second moments shape the optimal companding densities for A and B?
- RQ4In the correlated Gaussian case, what is the explicit form of the optimal density and does a phase transition occur with respect to correlation?
- RQ5Do the proposed quantizers improve practical tasks such as quantized matrix multiplication, quantized least squares, and activation quantization in transformers?
Key findings
- The matrix multiplication MSE scales as E = mnk(I_X^3/(12 K_X^2) + I_Y^3/(12 K_Y^2)) + o(K^{-2}).
- Optimal per-entry quantizers are companding quantizers with densities lambda_X^*(x) ∝ (f_X(x) w_X(x))^{1/3} and lambda_Y^*(y) ∝ (f_Y(y) w_Y(y))^{1/3}.
- For correlated Gaussian pairs, the closed-form optimal densities are lambda^*(x) ∝ exp(-x^2/6sigma_X^2) ((1-ρ^2)+ρ^2 x^2/sigma_X^2)^{1/3}, with a unimodal-to-bimodal phase transition at |ρ|=1/√3.
- The phase transition yields a single mode at small |ρ| and two symmetric modes at larger |ρ|, with peak locations u_peak = ±√(3 - 1/ρ^2).
- Corollaries provide rate-form expressions and an optimal bit split: K_X and K_Y balance according to (alpha_X/alpha_Y)^{1/4} when total rate is fixed.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.