Smoothed Vector Quantization Techniques
- Smoothed vector quantization is a family of methods that modify classical VQ to enhance differentiability and reduce issues like codebook collapse.
- Simplex-based smoothing employs soft assignments, convex mixtures, and vertex concentration to maintain balanced code usage while retaining fidelity.
- Alternative approaches use random rotations and spatial interpolation to smooth input statistics and gradient flows, lowering quantization error and boosting model performance.
Smoothed vector quantization designates a family of methods that modify classical vector quantization (VQ) so that the quantizer is less brittle with respect to optimization, codebook usage, or distortion. In standard deep-learning VQ, an encoder output is replaced by a single nearest codebook vector, which yields a discrete bottleneck but also introduces non-differentiability, codebook collapse, and residual quantization error. Recent work uses the term smoothed in several technically distinct senses: soft simplex assignments and convex mixtures of codewords, regularization that pushes softened assignments toward simplex vertices, random rotations that smooth coordinate statistics before scalar quantization, spatial interpolation-and-pooling around hard assignments, and geometry-aware backward maps that smooth gradient propagation without altering the hard forward assignment (Gautam et al., 2023, Morita, 26 Sep 2025, Zandieh et al., 28 Apr 2025, Li et al., 1 Jan 2026, Fifty et al., 2024).
1. Classical VQ and the rationale for smoothing
In VQ-VAE-style models, an encoder maps an input to a latent , and quantization replaces by its nearest codebook element: A canonical VQ-VAE objective combines reconstruction with codebook and commitment terms: with denoting stop-gradient and the commitment weight (Gautam et al., 2023).
The central difficulty is that nearest-neighbor selection is non-differentiable. Classical practice therefore uses the straight-through estimator (STE), which preserves the hard forward pass but substitutes a heuristic backward pass. The literature surveyed here identifies three recurrent pathologies of this construction. First, non-differentiability means the gradient estimator is only a surrogate. Second, codebook collapse arises when a few centroids dominate assignments and updates. Third, hard one-hot assignment is lossy: the residual is generally nonzero even though STE treats the quantizer as if it were identity in backpropagation (Gautam et al., 2023).
A parallel line of work frames VQ more directly as a rate–distortion problem. With bit budget , a vector quantizer 0 and decoder 1 are evaluated by mean-squared error
2
and, for query 3, inner-product distortion
4
The information-theoretic lower bounds reported for worst-case unit-norm inputs scale as 5 for MSE and 6 for inner products (Zandieh et al., 28 Apr 2025).
A useful distinction follows from these formulations. Some smoothed-VQ methods smooth the assignment itself; others smooth the statistics of the input or the backward signal while retaining hard assignment. The term is therefore broader than “soft VQ” in the narrow simplex-mixture sense.
2. Simplex-based smoothing: soft assignments, convex mixtures, and vertex concentration
The most direct form of smoothed VQ replaces a one-hot code index by a point on the probability simplex. In this setup, a codebook 7 is combined with a simplex vector 8,
9
and the quantized representation becomes
0
This formulation preserves differentiability through 1 and generalizes hard VQ, which is recovered when 2 is a canonical basis vector 3 (Morita, 26 Sep 2025).
Soft Convex Quantization (SCQ) instantiates this idea as a convex program. For input 4, codebook 5, and nearest-neighbor one-hot assignment 6, SCQ solves
7
The first term minimizes quantization error; the second softly biases the solution toward the VQ one-hot assignment. The quantized output is 8. When 9 is one-hot, SCQ reduces to standard VQ; as 0, the optimum converges to 1 (Gautam et al., 2023).
The same paper gives a batch formulation. If encoder outputs are flattened as 2, with codebook 3 and one-hot assignments 4, SCQ solves
5
subject to 6 and 7, so that each column of 8 lies on the simplex (Gautam et al., 2023).
A later simplex-based approach emphasizes that smoothing should satisfy two criteria simultaneously: assignments should remain close to simplex vertices, and all codes should be used. Its regularizer minimizes the average distance between each canonical vertex 9 and its 0-nearest smoothed assignments: 1 The paper studies both squared 2 distance,
3
and cross-entropy,
4
Because both induce ranking by the magnitude of 5, the 6-nearest assignments to each vertex can be obtained by top-7 selection on the corresponding simplex coordinate (Morita, 26 Sep 2025).
This regularizer is partly motivated by a critique of entropy-based usage penalties. Maximizing the perplexity of the mean assignment can be satisfied by diffuse or center-concentrated simplex distributions and therefore does not, by itself, enforce one-hotness. The cited work argues that this creates train–test mismatch when inference uses hard argmax codes (Morita, 26 Sep 2025). A plausible implication is that “balanced usage” and “sharp assignment” are distinct objectives and should not be conflated.
3. Differentiability and optimization through the quantizer
SCQ treats smoothed quantization as a differentiable convex optimization layer. For a single embedding, with equality constraint 8 and inequality constraints 9, the Lagrangian is
0
Its KKT system includes stationarity,
1
along with primal feasibility, dual feasibility, and complementary slackness 2. Differentiation through the forward solution is then performed by implicit differentiation of the KKT conditions, yielding exact gradients through the quantizer up to solver tolerances (Gautam et al., 2023).
For the task loss 3 and soft quantized output 4, the gradient with respect to the codebook contains both a direct term and a term through the dependence of 5 on 6: 7 The same mechanism transmits gradients back to encoder outputs through 8 (Gautam et al., 2023).
Exact interior-point solves are not scalable in the full batch formulation: the reported complexity is cubic in the number of decision variables, 9. SCQ therefore introduces a relaxation. It first solves the unconstrained regularized least-squares problem
0
a 1 linear solve with cost 2, and then projects each column of 3 onto the simplex by iterating nonnegativity clipping and sum-to-one correction. This removes the need for softmax or temperature parameterization while keeping runtime comparable to practical VQ implementations (Gautam et al., 2023).
A different route to differentiability keeps the hard forward pass unchanged and smooths only the backward map. In the rotation trick, with encoder output 4, selected code 5, normalized vectors 6 and 7, and scale 8, one constructs a rotation 9 that aligns 0 to 1, and defines
2
Because 3 preserves norms and 4 matches magnitudes, the forward map satisfies 5. During backpropagation, 6 is treated as constant, giving
7
The resulting gradient is deterministic and geometry-aware: unlike STE, it carries information about the angle and relative norm between 8 and its assigned code (Fifty et al., 2024).
4. Other meanings of smoothing: random rotations and spatial interpolation
TurboQuant uses smoothing in a distributional sense rather than a simplex-mixture sense. For a unit-norm vector 9, it applies a random orthogonal rotation 0 to produce 1. This transforms any worst-case input into a random point uniformly distributed on the sphere. Each coordinate then has density
2
which converges to 3 in high dimensions. The paper argues that the resulting coordinates are nearly independent, justifying identical Lloyd–Max scalar quantizers per coordinate without data-dependent codebook training (Zandieh et al., 28 Apr 2025).
Under this construction, per-coordinate decision thresholds are the midpoints between centroids 4: 5 The MSE distortion obeys
6
while the two-stage inner-product variant, which adds a 1-bit Quantized Johnson–Lindenstrauss residual quantizer, satisfies
7
These bounds match the optimal 8 and 9 rates up to constant factors (Zandieh et al., 28 Apr 2025).
LooC introduces yet another meaning of smoothing. It does not use weighted combinations of codevectors. Instead, it splits each feature vector 0 into 1 contiguous segments 2, with 3, quantizes each segment with a single shared codebook, and reconstructs by concatenation: 4 Its smoothing mechanism is a parameter-free extrapolation-by-interpolation (EBI) pipeline: bilinear interpolation to a 5 grid, compositional quantization at all interpolated locations, and 6 average pooling back to the original spatial resolution,
7
The paper explicitly characterizes this as spatial smoothing rather than soft assignment over the codebook (Li et al., 1 Jan 2026).
These examples show that “smoothed vector quantization” is not a single algorithmic template. In current usage, the smoothing target may be the assignment simplex, the input distribution, the local spatial neighborhood, or the backward Jacobian.
5. Empirical behavior across image, speech, retrieval, and LLM systems
SCQ reports large gains over matched VQ baselines in autoencoding and VQGAN-style settings. On CIFAR-10, across five runs of 50 epochs, SCQ achieved MSE 8, quantization error 9, and perplexity 00, compared with VQVAE at 01, 02, and 03, respectively. On GTSRB, SCQ reached MSE 04, quantization error 05, and perplexity 06. In LSUN Church and Classroom experiments with VQGAN losses, SCQGAN consistently improved both reconstruction loss and LPIPS, with the advantage increasing at smaller latent resolutions, which the paper interprets as better information preservation under stronger compression (Gautam et al., 2023).
The simplex-vertex KNN regularizer produces a different empirical profile. On ImageNet autoencoding with latent 07 and codebook size 08, Softmax + KNN-CE achieved 100% code use, rMSE 09, FID 10, and IS 11; Softmax + PPL, by contrast, had rMSE 12, FID 13, and IS 14. In Wav2Vec 2.0 on LibriSpeech, Softmax + KNN-CE achieved 100% usage for a single 15 codebook and for dual 16 product quantizers, whereas STE, rotational estimation, and PPL baselines showed severe collapse in the reported configurations (Morita, 26 Sep 2025).
TurboQuant emphasizes online quantization quality and speed rather than learned latent autoencoding. For KV-cache quantization in Llama models, Needle-In-A-Haystack recall was reported as 17, matching full precision at compression ratios around 18 with 3–4 bits per channel. On LongBench, full cache at 16 bits scored 19, TurboQuant at 3.5 bits/channel also scored 20, and TurboQuant at 2.5 bits/channel scored 21. In nearest-neighbor search, TurboQuant consistently outperformed product quantization and RaBitQ in recall while reducing 4-bit indexing time to 22s, 23s, and 24s at dimensions 25, 26, and 27, respectively (Zandieh et al., 28 Apr 2025).
LooC combines compact codebooks with spatial smoothing. On MNIST, LooC with a 28 codebook reported LPIPS 29, rFID 30, SSIM 31, and PSNR 32; with 33, it improved to LPIPS 34, rFID 35, SSIM 36, and PSNR 37. On CIFAR10, the corresponding 38 setting reported LPIPS 39, rFID 40, SSIM 41, and PSNR 42. On FFHQ 43, LooC-VAE 44 achieved 100% codebook usage, LPIPS 45, rFID 46, SSIM 47, and PSNR 48, while 49 further improved to LPIPS 50, rFID 51, SSIM 52, and PSNR 53 (Li et al., 1 Jan 2026).
The rotation trick was evaluated across 11 VQ-VAE and VQGAN paradigms. In VQGAN on FFHQ+CelebA-HQ, code usage reportedly increased from about 27% to about 99%, quantization error fell from 54 to 55, validation loss from 56 to 57, and r-FID from 58 to 59. In latent-diffusion VQGAN on ImageNet with latent 60 and 61, r-FID improved from 62 to 63, r-IS from 64 to 65, and usage from about 2% to about 9% (Fifty et al., 2024).
6. Trade-offs, misconceptions, and open technical questions
A persistent misconception is that smoothed VQ is synonymous with softmax or Gumbel-softmax over codewords. The literature here contradicts that identification. SCQ and the KNN-to-vertices method are explicitly simplex-based; TurboQuant smooths coordinate statistics by random rotation; LooC smooths spatially by interpolation and pooling while keeping hard per-segment assignments; the rotation trick smooths only the gradient path (Gautam et al., 2023, Zandieh et al., 28 Apr 2025, Li et al., 1 Jan 2026, Fifty et al., 2024).
Another recurrent issue is the tension between smoothness and discrete fidelity. In SCQ, larger 66 yields sparser, more VQ-like assignments, while smaller 67 permits denser mixtures and lower quantization error but can reduce compressibility and downstream discrete modeling fidelity. The paper explicitly notes that excessively small 68 may produce overly dense mixtures, and suggests post hoc top-1 or top-69 discretization when strict discrete tokens are required, at some performance cost (Gautam et al., 2023). The KNN-regularization paper frames a closely related problem as train–test mismatch: diffuse assignments can satisfy mean-perplexity objectives without resembling the hard argmax codes used at inference (Morita, 26 Sep 2025).
Scalability constraints differ by method. SCQ’s exact differentiable convex optimization is expensive at scale, motivating the regularized linear solve plus simplex projection relaxation (Gautam et al., 2023). TurboQuant is online and data-oblivious but incurs 70 dense rotation and projection costs per vector, which the paper identifies as a motivation for structured orthogonal transforms in future work (Zandieh et al., 28 Apr 2025). The KNN regularizer is limited primarily by memory because it must retain large assignment matrices and perform per-code top-71 selection; the paper therefore uses GPU-local KNN and discusses vertex subsampling or product quantization as scaling aids (Morita, 26 Sep 2025). LooC notes that very large interpolation scale 72 can weaken local correlations and blur details, and that extreme segment granularity such as 73 may cause over-fragmentation (Li et al., 1 Jan 2026). The rotation trick identifies numerical edge cases at 74 and when 75, where the rotation construction becomes ill-conditioned and requires 76-stabilization or a 180-degree fallback (Fifty et al., 2024).
Across these variants, the unifying principle is not a single formula but a shared design goal: preserve more information than hard nearest-neighbor VQ while reducing the optimization and utilization failures that arise from discrete assignment. The methods differ in where the smoothing is imposed, which failure mode they target most directly, and what compromises they make between exact discreteness, computational tractability, and downstream compatibility.