SoftWater: Class-Aware Rate Allocation for Softmax Quantization
Joao V. Cavalcanti, Ashia C. Wilson
Massachusetts Institute of Technology
cs.LG
Submitted: 2026-08-12
Updated: 2026-08-13
Code: https://github.com/egorlifar/watersic
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 95/100
The gist: Based on the paper, here is the summary: The paper introduces SoftWater, a method for quantizing the softmax output layer (head) of large language models (LLMs) under a rate-distortion framework
Terminology
Summary
Based on the paper, here is the summary:
The paper introduces SoftWater, a method for quantizing the softmax output layer (head) of large language models (LLMs) under a rate-distortion framework using KL divergence, rather than the standard weighted mean-squared error (WMSE) used for linear layers. The authors note that PTQ pipelines typically leave the head in high precision, but in small LLMs with modern vocabularies, the head holds 15–30% of all parameters, so a nominal “2-bit” model with an fp16 head can store several times as many bits per weight.
The paper poses softmax-layer quantization as a rate-distortion problem under the KL divergence between the original and quantized output distributions. A second-order analysis reveals a class-aware geometry: quantization error is weighted jointly by feature covariance and class-specific softmax curvature. The derived error metric is E[(diag(p) − pp⊤) ⊗ XX⊤], where p is the softmax output distribution and X is the input. A separability approximation replaces the Kn × Kn Cholesky with one n × n factorization rescaled per class, making the lattice encodable by successive interference cancellation (SIC), with both statistics from a single forward pass.
The resulting method, SoftWater, gives fine grids to frequent, low-variance classes and coarse grids to rare ones, a large gap under Zipfian token distributions. The grid spacing for class k and column i is proportional to (λ̄klii)(-1/2), where λ̄k = EX[pk(1 − pk)] is the expected softmax curvature and lii is the diagonal of the Cholesky factor of the feature covariance. The method also includes a smoothing prior (ϵ = 0.1) that caps the grid spacing on classes with vanishing calibration probability, interpolating between the calibration distribution and a uniform distribution (which recovers WaterSIC).
Key contributions and results:
-
Problem formulation: Poses softmax-layer quantization as a rate-distortion problem under output KL and derives the induced error metric, reducing it to a class-rescaled lattice problem.
-
The SoftWater algorithm: Allocates bits to classes that are frequent and low-variance, with a smoothing prior to keep the Taylor expansion valid.
-
Head quantization results: Across five models from 1B to 32B parameters, SoftWater outperforms the released WaterSIC quantizer at matched head rates on 59 of 60 test points, using none of that pipeline’s refinements. It cuts head-induced KL by 6.5×–8.3× at 2 bits. On Llama-3.2-1B-Instruct with quantized bodies, a 2-bit head removes 45–60% of stored bytes for a 2.9–3.7% perplexity increase. On a tied model, a 4-bit head is near-lossless and a 2-bit head costs under 4% perplexity.
The paper also demonstrates that the class-side statistic carries domain information, allowing a head to be targeted at its deployment domain, and that matching calibration to the deployment domain gives the lowest KL on that domain throughout. The method transfers unchanged to models with released GuidedQuant bodies. The paper validates the separability assumption empirically, showing the proxy underestimates the true distortion by at most 10% (a rate penalty of at most 0.07 bits), and shows the SoftWater factors are close to the Frobenius-optimal Kronecker factorization from the start.
Improvements for AI systems
Improvements to AI Systems:
-
Memory-Efficient LLM Deployment on Edge Devices: By quantizing the softmax head to 2–4 bits without significant perplexity loss (e.g., <4% at 2 bits, near-lossless at 4 bits on tied models), AI systems can run large language models (1B–32B parameters) on devices with limited RAM/VRAM (e.g., smartphones, embedded systems). This reduces storage and inference memory by 45–60% when the head is quantized alongside the body, enabling on-device assistants, real-time translation, and offline chatbots that were previously infeasible.
-
Domain-Adaptive Language Models: The class-side statistic (expected softmax curvature per token) carries domain information. An AI system can now be calibrated on a specific deployment domain (e.g., medical text, legal documents, code) and have its softmax head quantized to match that domain, achieving lower KL divergence on that domain than a generic quantizer. This allows for specialized, lightweight models that are fine-tuned for niche applications without retraining the entire network.
-
Faster Inference Through Reduced Precision Arithmetic: With the head quantized to 2–4 bits, matrix multiplications in the output layer can use low-precision arithmetic (e.g., int2/int4) on specialized hardware (e.g., NPUs, GPUs with tensor cores). This speeds up token generation, especially for small LLMs where the head is a bottleneck (15–30% of parameters). Improved systems can generate responses faster in real-time applications like voice assistants, autocomplete, and interactive coding tools.
-
Unified Quantization Pipelines for Small Models: Current PTQ pipelines leave the head in fp16, making
2-bit
models misleading. SoftWater enables a fully quantized pipeline (body + head) with a principled rate-distortion trade-off. AI systems can now report true bit-per-weight metrics, and practitioners can deploy models with predictable memory footprints, improving resource planning for multi-model serving systems (e.g., serving many specialized models on a single GPU). -
Improved Calibration Robustness: The smoothing prior (ε=0.1) prevents grid collapse on rare tokens, making the quantizer robust to calibration data that may not cover all vocabulary. This means AI systems can be quantized with smaller, more diverse calibration sets (e.g., a single forward pass) without catastrophic degradation on out-of-distribution inputs, improving generalization in production environments.
-
Seamless Integration with Existing Quantized Bodies: SoftWater transfers unchanged to models with GuidedQuant bodies, meaning AI systems can upgrade their head quantization independently of the body quantizer. This modularity allows for incremental improvements—e.g., a system can adopt SoftWater on the head while keeping its current body quantization, reducing engineering effort and risk.
-
Lower-Latency, Higher-Throughput Serving: For tied embedding/head models, a 2-bit head reduces memory bandwidth during the final projection, which is a common bottleneck in autoregressive generation. Improved systems can serve more concurrent users or longer contexts on the same hardware, enhancing the scalability of LLM APIs and cloud-based inference services.
Abstract
Post-training quantization pipelines routinely leave the softmax output layer in high precision. Yet in small LLMs with modern vocabularies, the head holds 15--30% of all parameters, so a nominal ``2-bit'' model with an fp16 head can store several times as many bits per weight. We pose softmax-layer quantization as a rate-distortion problem under the KL divergence between the original and quantized output distributions. A second-order analysis reveals a class-aware geometry: quantization error is weighted jointly by feature covariance and class-specific softmax curvature. A separability approximation replaces the Kn times Kn Cholesky with one n times n factorization rescaled per class, making the lattice encodable by successive interference cancellation, with both statistics from a single forward pass. The resulting method, SoftWater, gives fine grids to frequent, low-variance classes and coarse grids to rare ones, a large gap under Zipfian token distributions. Across five models from 1B to 32B, SoftWater outperforms the released WaterSIC quantizer (near-optimal under linear-layer WMSE but not output KL) at matched head rates on 59 of 60 test points, using none of that pipeline's refinements and cutting head-induced KL by 6.5 times -- 8.3 times at 2 bits. On Llama-3.2-1B-Instruct with quantized bodies, a 2-bit head removes 45--60% of stored bytes for a 2.9 -- 3.7% perplexity increase. Because the class-side statistic comes from calibration data, matching calibration to the deployment domain gives the lowest KL on that domain throughout. On a tied model, a 4-bit head is near-lossless and a 2-bit head costs under 4% perplexity, making head quantization of such models practical.
Sources
- QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
- QuIP: 2-Bit Quantization of Large Language Models With Guarantees
- The Geometry of LLM Quantization: GPTQ as Babai's Nearest Plane Algorithm
- GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers
- Optimal Brain Compression: A Framework for Accurate Post-Training Quantization and Pruning
- Efficient softmax approximation for GPUs
- GuidedQuant: Large Language Model Quantization via Exploiting End Loss Guidance
- LFQ: Logit-aware Final-block Quantization for Boosting the Generation Quality of Low-Bit Quantized LLMs
- WaterSIC: Information-Theoretically (Near) Optimal Linear Layer Quantization
- CSV-Decode: Certifiable Sub-Vocabulary Decoding for Efficient Large Language Model Inference
- SpinQuant: LLM quantization with learned rotations
- Optimizing Neural Networks with Kronecker-factored Approximate Curvature
- Up or Down? Adaptive Rounding for Post-Training Quantization
- NestQuant: Nested Lattice Quantization for Matrix Products and LLMs
- VQ-Logits: Compressing the Output Bottleneck of Large Language Models via Vector Quantized Logits
- OmniQuant: Omnidirectionally Calibrated Quantization for Large Language Models
- DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
- FlashHead: Efficient Drop-In Replacement for the Classification Head in Language Model Inference
- QuIP#: Even Better LLM Quantization with Hadamard Incoherence and Lattice Codebooks
- QTIP: Quantization with Trellises and Incoherence Processing
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: Local-Consistency Optimisation for Bayesian Neural Networks
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks