Papers
Topics
Authors
Recent
Search
2000 character limit reached

Smoothed Vector Quantization Techniques

Updated 13 July 2026
  • 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 EϕE_\phi maps an input xx to a latent zez_e, and quantization replaces zez_e by its nearest codebook element: zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|. A canonical VQ-VAE objective combines reconstruction with codebook and commitment terms: LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2, with sg[]sg[\cdot] denoting stop-gradient and β>0\beta>0 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 ϵ=zqze\epsilon = z_q - z_e 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 B=bdB=b\cdot d, a vector quantizer xx0 and decoder xx1 are evaluated by mean-squared error

xx2

and, for query xx3, inner-product distortion

xx4

The information-theoretic lower bounds reported for worst-case unit-norm inputs scale as xx5 for MSE and xx6 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 xx7 is combined with a simplex vector xx8,

xx9

and the quantized representation becomes

zez_e0

This formulation preserves differentiability through zez_e1 and generalizes hard VQ, which is recovered when zez_e2 is a canonical basis vector zez_e3 (Morita, 26 Sep 2025).

Soft Convex Quantization (SCQ) instantiates this idea as a convex program. For input zez_e4, codebook zez_e5, and nearest-neighbor one-hot assignment zez_e6, SCQ solves

zez_e7

The first term minimizes quantization error; the second softly biases the solution toward the VQ one-hot assignment. The quantized output is zez_e8. When zez_e9 is one-hot, SCQ reduces to standard VQ; as zez_e0, the optimum converges to zez_e1 (Gautam et al., 2023).

The same paper gives a batch formulation. If encoder outputs are flattened as zez_e2, with codebook zez_e3 and one-hot assignments zez_e4, SCQ solves

zez_e5

subject to zez_e6 and zez_e7, so that each column of zez_e8 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 zez_e9 and its zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.0-nearest smoothed assignments: zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.1 The paper studies both squared zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.2 distance,

zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.3

and cross-entropy,

zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.4

Because both induce ranking by the magnitude of zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.5, the zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.6-nearest assignments to each vertex can be obtained by top-zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.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 zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.8 and inequality constraints zq:=Q(ze)=ck,where k=argmin1jKzecj.z_q := Q(z_e) = c_k,\quad \text{where } k = \arg\min_{1 \le j \le K}\|z_e - c_j\|.9, the Lagrangian is

LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,0

Its KKT system includes stationarity,

LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,1

along with primal feasibility, dual feasibility, and complementary slackness LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,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 LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,3 and soft quantized output LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,4, the gradient with respect to the codebook contains both a direct term and a term through the dependence of LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,5 on LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,6: LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,7 The same mechanism transmits gradients back to encoder outputs through LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,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, LVQ=xx^22+(1β)sg[ze]zq22+βzesg[zq]22,\mathcal{L}_{\textrm{VQ}} = \|x-\hat{x}\|_2^2 + (1-\beta)\|sg[z_e]-z_q\|_2^2 + \beta\|z_e - sg[z_q]\|_2^2,9. SCQ therefore introduces a relaxation. It first solves the unconstrained regularized least-squares problem

sg[]sg[\cdot]0

a sg[]sg[\cdot]1 linear solve with cost sg[]sg[\cdot]2, and then projects each column of sg[]sg[\cdot]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 sg[]sg[\cdot]4, selected code sg[]sg[\cdot]5, normalized vectors sg[]sg[\cdot]6 and sg[]sg[\cdot]7, and scale sg[]sg[\cdot]8, one constructs a rotation sg[]sg[\cdot]9 that aligns β>0\beta>00 to β>0\beta>01, and defines

β>0\beta>02

Because β>0\beta>03 preserves norms and β>0\beta>04 matches magnitudes, the forward map satisfies β>0\beta>05. During backpropagation, β>0\beta>06 is treated as constant, giving

β>0\beta>07

The resulting gradient is deterministic and geometry-aware: unlike STE, it carries information about the angle and relative norm between β>0\beta>08 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 β>0\beta>09, it applies a random orthogonal rotation ϵ=zqze\epsilon = z_q - z_e0 to produce ϵ=zqze\epsilon = z_q - z_e1. This transforms any worst-case input into a random point uniformly distributed on the sphere. Each coordinate then has density

ϵ=zqze\epsilon = z_q - z_e2

which converges to ϵ=zqze\epsilon = z_q - z_e3 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 ϵ=zqze\epsilon = z_q - z_e4: ϵ=zqze\epsilon = z_q - z_e5 The MSE distortion obeys

ϵ=zqze\epsilon = z_q - z_e6

while the two-stage inner-product variant, which adds a 1-bit Quantized Johnson–Lindenstrauss residual quantizer, satisfies

ϵ=zqze\epsilon = z_q - z_e7

These bounds match the optimal ϵ=zqze\epsilon = z_q - z_e8 and ϵ=zqze\epsilon = z_q - z_e9 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 B=bdB=b\cdot d0 into B=bdB=b\cdot d1 contiguous segments B=bdB=b\cdot d2, with B=bdB=b\cdot d3, quantizes each segment with a single shared codebook, and reconstructs by concatenation: B=bdB=b\cdot d4 Its smoothing mechanism is a parameter-free extrapolation-by-interpolation (EBI) pipeline: bilinear interpolation to a B=bdB=b\cdot d5 grid, compositional quantization at all interpolated locations, and B=bdB=b\cdot d6 average pooling back to the original spatial resolution,

B=bdB=b\cdot d7

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 B=bdB=b\cdot d8, quantization error B=bdB=b\cdot d9, and perplexity xx00, compared with VQVAE at xx01, xx02, and xx03, respectively. On GTSRB, SCQ reached MSE xx04, quantization error xx05, and perplexity xx06. 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 xx07 and codebook size xx08, Softmax + KNN-CE achieved 100% code use, rMSE xx09, FID xx10, and IS xx11; Softmax + PPL, by contrast, had rMSE xx12, FID xx13, and IS xx14. In Wav2Vec 2.0 on LibriSpeech, Softmax + KNN-CE achieved 100% usage for a single xx15 codebook and for dual xx16 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 xx17, matching full precision at compression ratios around xx18 with 3–4 bits per channel. On LongBench, full cache at 16 bits scored xx19, TurboQuant at 3.5 bits/channel also scored xx20, and TurboQuant at 2.5 bits/channel scored xx21. In nearest-neighbor search, TurboQuant consistently outperformed product quantization and RaBitQ in recall while reducing 4-bit indexing time to xx22s, xx23s, and xx24s at dimensions xx25, xx26, and xx27, respectively (Zandieh et al., 28 Apr 2025).

LooC combines compact codebooks with spatial smoothing. On MNIST, LooC with a xx28 codebook reported LPIPS xx29, rFID xx30, SSIM xx31, and PSNR xx32; with xx33, it improved to LPIPS xx34, rFID xx35, SSIM xx36, and PSNR xx37. On CIFAR10, the corresponding xx38 setting reported LPIPS xx39, rFID xx40, SSIM xx41, and PSNR xx42. On FFHQ xx43, LooC-VAE xx44 achieved 100% codebook usage, LPIPS xx45, rFID xx46, SSIM xx47, and PSNR xx48, while xx49 further improved to LPIPS xx50, rFID xx51, SSIM xx52, and PSNR xx53 (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 xx54 to xx55, validation loss from xx56 to xx57, and r-FID from xx58 to xx59. In latent-diffusion VQGAN on ImageNet with latent xx60 and xx61, r-FID improved from xx62 to xx63, r-IS from xx64 to xx65, 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 xx66 yields sparser, more VQ-like assignments, while smaller xx67 permits denser mixtures and lower quantization error but can reduce compressibility and downstream discrete modeling fidelity. The paper explicitly notes that excessively small xx68 may produce overly dense mixtures, and suggests post hoc top-1 or top-xx69 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 xx70 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-xx71 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 xx72 can weaken local correlations and blur details, and that extreme segment granularity such as xx73 may cause over-fragmentation (Li et al., 1 Jan 2026). The rotation trick identifies numerical edge cases at xx74 and when xx75, where the rotation construction becomes ill-conditioned and requires xx76-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.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Smoothed Vector Quantization.