Training-Free Vector Quantization via Gaussian VAEs

Tongda Xu, Wendi Zheng, Jiajun He, José Miguel Hernández-Lobato, Yan Wang, Ya-Qin Zhang, Jie Tang

Abstract Vector-quantized variational autoencoders (VQ-VAEs) are foundational to modern autoregressive image generation, yet their discrete nature makes them notoriously difficult to train. This paper introduces Gaussian Quant (GQ), a novel framework that bypasses these training hurdles. By training a standard continuous Gaussian VAE under a specific constraint and subsequently converting it into a discrete VQ-VAE without additional training, GQ achieves state-of-the-art reconstruction and generation performance while entirely avoiding common pitfalls like codebook collapse.

The Challenge of Discrete Image Representation

Discrete image representation serves as the backbone for modern autoregressive generative models, such as Llama-Gen and VQGAN. However, training the VQ-VAE responsible for producing these discrete "tokens" presents significant optimization challenges. The core issue lies in the quantization step—mapping a continuous vector to the nearest discrete codebook entry—which is inherently non-differentiable.

To circumvent this, researchers traditionally rely on workarounds like the Straight-Through Estimator (STE), commitment losses, and complex entropy penalties. Despite these interventions, models frequently suffer from "codebook collapse," a failure mode where only a small fraction of the available codebook entries are ever utilized. The authors of this paper ask a provocative question: What if we bypassed training the discrete model altogether?

The Gaussian Quant (GQ) Approach

To answer this, the researchers propose a two-stage pipeline called Gaussian Quant (GQ) that separates the learning of the latent space from the discretization process.

1. Constrained Continuous Training Instead of training a discrete model from scratch, the authors first train a continuous Gaussian VAE. To ensure this continuous space can be effectively discretized later, they introduce the Target Divergence Constraint (TDC). This heuristic forces the Kullback–Leibler (KL) divergence of every single latent dimension to match a specific target bitrate ($\log K$, where $K$ is the desired codebook size).

2. Training-Free Conversion Once the Gaussian VAE is fully trained, it is converted into a VQ-VAE without any further parameter updates. The codebook is generated using fixed, random one-dimensional Gaussian noise. For each latent dimension, the model simply selects the closest entry in this random codebook.

Key Insights and Theoretical Grounding

The success of GQ is rooted in a surprising insight: you do not need to learn a codebook. If the latent space is properly constrained during the continuous training phase, a codebook constructed from pure Gaussian noise performs exceptionally well.

The paper provides a rigorous theoretical foundation for this approach. The authors prove that the quantization error decays "doubly exponentially" as the codebook bitrate exceeds the VAE's bits-back coding rate. This provides a principled guideline for codebook selection, giving engineers a clear target for sizing their codebooks.

Furthermore, the authors demonstrate that per-dimension control is critical. Previous methods (like HiFiC) only controlled the average bitrate across all dimensions. By using TDC to control each dimension individually, GQ prevents any single dimension from hoarding too much information, ensuring smooth discretization.

Empirical Results and Benchmarks

The researchers evaluated GQ across standard benchmarks, including ImageNet (for quantitative reconstruction and generation), COCO 2017 (for out-of-distribution generalization), and FFHQ (for human face generation).

  • State-of-the-Art Reconstruction: GQ consistently outperforms established methods like VQGAN, FSQ, LFQ, and BSQ across both UNet and ViT architectures. For instance, on ImageNet at 0.25 bits-per-pixel, GQ achieved a PSNR of 27.61, significantly surpassing VQGAN's 26.51.
  • Zero Codebook Collapse: Because the codebook is fixed and the latent space is explicitly constrained to match it, GQ achieves 100% codebook usage and higher codebook entropy than its competitors.
  • High Efficiency: While a naive PyTorch implementation of the nearest-neighbor search can be slow, the authors provide a custom CUDA kernel that makes the encoding process nearly as fast as a standard continuous VAE.
  • Plug-and-Play Versatility: The TDC training method is highly adaptable. The authors show it can be used to improve existing conversion techniques like TokenBridge, proving that the constraint itself is a powerful, standalone tool for discretization.

Limitations and Future Directions

While GQ offers a robust solution to VQ-VAE training, it is not without limitations. The introduction of the TDC requires tuning new hyperparameters ($\alpha$ and $\beta$), although the authors provide grid search results to justify their default configurations. Additionally, like most low-bitrate VQ-VAEs, GQ struggles with rendering extremely fine details, such as legible text on license plates in highly compressed images.

Finally, the authors note that while GQ excels at reconstruction, superior reconstruction does not always perfectly translate to better downstream generation. Future work will likely explore "feature alignment" techniques to further optimize these discrete tokens for the autoregressive models that consume them.

Summary updated

BibTeX
@inproceedings{xu2026training,
  author = {Tongda Xu and Wendi Zheng and Jiajun He and José Miguel Hernández-Lobato and Yan Wang and Ya-Qin Zhang and Jie Tang},
  title = {{Training-Free Vector Quantization via Gaussian VAEs}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=2CQkqiZ6p9},
}
Figure