[Paper Review] SQ-VAE: Variational Bayes on Discrete Representation with Self-annealed Stochastic Quantization
This paper proposes SQ-VAE, a variational autoencoder with stochastic quantization and self-annealing training that improves codebook utilization without relying on heuristics like stop-gradient or codebook reset. By introducing trainable stochastic dequantization and quantization, SQ-VAE naturally anneals toward deterministic quantization during training, achieving better reconstruction and generative performance than VQ-VAE and standard VAE on vision and speech tasks.
One noted issue of vector-quantized variational autoencoder (VQ-VAE) is that the learned discrete representation uses only a fraction of the full capacity of the codebook, also known as codebook collapse. We hypothesize that the training scheme of VQ-VAE, which involves some carefully designed heuristics, underlies this issue. In this paper, we propose a new training scheme that extends the standard VAE via novel stochastic dequantization and quantization, called stochastically quantized variational autoencoder (SQ-VAE). In SQ-VAE, we observe a trend that the quantization is stochastic at the initial stage of the training but gradually converges toward a deterministic quantization, which we call self-annealing. Our experiments show that SQ-VAE improves codebook utilization without using common heuristics. Furthermore, we empirically show that SQ-VAE is superior to VAE and VQ-VAE in vision- and speech-related tasks.
Motivation & Objective
- Address codebook collapse in VQ-VAE, where only a fraction of codebook vectors are used due to deterministic quantization and heuristic training schemes.
- Develop a training framework that operates within the standard variational Bayes paradigm, avoiding reliance on stop-gradient, EMA, or codebook reset.
- Enable greater codebook utilization through a self-annealing process where stochasticity in quantization decreases over time.
- Design a method that generalizes across data types, with specialized variants for categorical data using the von Mises–Fisher distribution.
- Demonstrate superior performance in reconstruction and generation on vision and speech benchmarks without hyperparameter tuning or auxiliary techniques.
Proposed method
- Introduce a stochastic dequantization process that maps continuous latent variables to discrete codebook vectors using a differentiable, trainable probability distribution.
- Apply stochastic quantization with a trainable posterior categorical distribution over codebook vectors, enabling gradient flow through discrete choices.
- Use a self-annealing mechanism where the stochasticity of the quantization process decreases during training, naturally converging to deterministic quantization.
- Formulate the objective as an evidence lower bound (ELBO) that can be optimized via standard backpropagation without straight-through estimation.
- Propose two variants: Gaussian SQ-VAE for general data and vMF SQ-VAE for categorical data, with the latter using von Mises–Fisher distributions to improve performance on discrete distributions.
- Train the model using only one key hyperparameter (temperature for stochasticity), following the Gumbel-Softmax or concrete relaxation approach.
Experimental results
Research questions
- RQ1Can stochastic quantization in a VAE framework improve codebook utilization compared to deterministic VQ-VAE?
- RQ2Does the self-annealing process in SQ-VAE lead to better representation learning and reconstruction without heuristic interventions?
- RQ3How does SQ-VAE perform on vision and speech tasks relative to standard VAE and VQ-VAE?
- RQ4Can vMF SQ-VAE outperform Gaussian SQ-VAE on categorical data distributions such as image pixels?
- RQ5Does increasing codebook size improve performance in SQ-VAE, unlike in VQ-VAE where it often fails due to collapse?
Key findings
- SQ-VAE achieves higher codebook utilization than VQ-VAE without using stop-gradient, EMA, or codebook reset, indicating effective exploration of the codebook.
- The self-annealing process in SQ-VAE gradually reduces stochasticity in quantization, leading to stable convergence and improved representation learning.
- On MNIST and Gray-CelebA, SQ-VAE achieves better reconstruction performance than both VAE and VQ-VAE, with lower reconstruction loss.
- On CelebA-HQ 256×256, SQ-VAE produces high-fidelity reconstructed and generated samples, demonstrating scalability to large-scale datasets.
- vMF SQ-VAE significantly outperforms Gaussian SQ-VAE on categorical data, validating the effectiveness of the von Mises–Fisher distribution for discrete distributions.
- Increasing the codebook size improves performance in SQ-VAE, unlike in VQ-VAE where larger codebooks often lead to collapse and no gain.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.