NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Vector Quantized Wasserstein Auto-Encoder

Long Tung Vuong, Trung Le, He Zhao, Chuanxia Zheng, Mehrtash Harandi, Jianfei Cai, Dinh Q. Phung

Introduction

Vector Quantized Variational Auto-Encoders (VQ-VAEs) have become a foundational tool in deep learning, enabling the mapping of high-dimensional data—such as images—into discrete latent spaces. This discretization is essential for downstream tasks requiring symbolic abstraction, including reasoning, planning, and high-quality image generation (e.g., DALL-E).

However, VQ-VAEs are notoriously plagued by codebook collapse. During training, the model frequently converges to a state where only a small fraction of the available "codewords" (discrete symbols) are utilized. The remaining codewords become "dead" or redundant, severely limiting the model's capacity and degrading reconstruction quality. While researchers have historically relied on heuristics like codebook resets or exponential moving averages to mitigate this, a rigorous theoretical solution has remained elusive. The Vector Quantized Wasserstein Auto-Encoder (VQ-WAE) addresses this gap by reframing discrete representation learning as a distribution alignment problem using Optimal Transport.

Methodology: A Generative Viewpoint

To solve codebook collapse, the authors pivot from the traditional auto-encoding perspective to a generative viewpoint. Instead of merely minimizing the distance between an input and its reconstruction, VQ-WAE minimizes the Wasserstein (WS) distance between the distribution of decoded codewords and the empirical data distribution.

This theoretical bridge proves that the generative objective is equivalent to a trainable form: a standard reconstruction loss combined with a WS distance alignment term between the encoder's latent representations and the learnable codewords. Key methodological innovations include:

  • Controllable Clustering: Standard VQ-VAEs rely on simple K-means clustering. In contrast, the WS distance framework utilizes the entropic dual form of Optimal Transport, allowing the model to explicitly regulate the proportion of data points assigned to each codeword. By forcing each codeword to "claim" a specific amount of data mass, codebook collapse is mathematically prevented.
  • KL Regularization: To ensure uniform utilization across the entire codebook and stabilize training, the authors introduce a Kullback-Leibler (KL) divergence term on the codeword weights.
  • Kantorovich Potential Network: To make the Optimal Transport mathematics tractable in a deep learning context, a small auxiliary neural network is employed to estimate the dual form of the Wasserstein distance during training.

Experimental Validation and Key Results

The VQ-WAE was rigorously evaluated across five standard benchmarks of varying complexity: MNIST, CIFAR10, SVHN, CelebA, and high-resolution FFHQ. The results demonstrate significant improvements over traditional VQ-VAE and its variants.

Unprecedented Codebook Utilization

VQ-WAE achieves near-perfect "Perplexity," a metric indicating the number of active codewords. On the MNIST dataset with a codebook size of 512, VQ-WAE successfully utilizes 508.4 codewords on average, compared to a mere 47.2 for the standard VQ-VAE.

Superior Reconstruction and Generation

By effectively leveraging the entire codebook, VQ-WAE consistently delivers lower reconstructed Frechet Inception Distance (rFID) scores. On CIFAR10, VQ-WAE achieved an rFID of 54.3, significantly outperforming VQ-VAE's 77.3. Furthermore, when paired with a PixelCNN for image generation, VQ-WAE produced higher-quality images with fewer artifacts than VQ-GAN, particularly on the high-resolution FFHQ dataset.

Enhanced Latent Geometry

The discrete codes learned by VQ-WAE are more semantically meaningful. In simple single-layer classification tasks on CIFAR10, VQ-WAE latent representations yielded an accuracy of 50.19%, compared to 43.21% for VQ-VAE. Visualizations using t-SNE confirm that VQ-WAE learns cleaner, more well-separated clusters in the latent space, avoiding the overlapping or "smeared" representations typical of VQ-VAE and SQ-VAE.

Limitations and Future Directions

While VQ-WAE offers a robust theoretical solution to codebook collapse, it introduces new challenges:

  • Computational Overhead: Training the auxiliary Kantorovich potential network increases computational cost. For instance, an epoch on CIFAR10 takes approximately 64 seconds for VQ-WAE, compared to 40 seconds for a standard VQ-VAE.
  • Hyperparameter Sensitivity: The model introduces new trade-off parameters ($\lambda$ and $\lambda_r$) that require careful tuning to balance reconstruction accuracy with codebook diversity.
  • Joint Distribution Simplification: The current implementation relies on a simplified upper bound to handle the joint distribution over sequences of codewords. The authors note that learning this joint distribution directly—potentially via an auto-regressive model—represents a promising, albeit complex, avenue for future research.

Conclusion

By replacing heuristic patches with a solid mathematical framework based on Optimal Transport, the Vector Quantized Wasserstein Auto-Encoder successfully eliminates codebook collapse. Its ability to enforce controllable clustering yields vastly improved codebook utilization, cleaner latent geometries, and superior downstream generation, marking a significant step forward in discrete representation learning.

Summary updated

BibTeX
@inproceedings{vuong2023vector,
  author = {Long Tung Vuong and Trung Le and He Zhao and Chuanxia Zheng and Mehrtash Harandi and Jianfei Cai and Dinh Q. Phung},
  title = {{Vector Quantized Wasserstein Auto-Encoder}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=AwY5wiJevM},
}
Figure