TL;DR
Vector-Quantized Variational Autoencoders (VQ-VAEs) generate high-quality data but suffer from intractable probabilistic inference due to an exponentially large discrete latent space. This paper demonstrates that because VQ-VAEs naturally underutilize this space (a phenomenon known as index collapse), they can be distilled into tractable Probabilistic Circuits by extracting a small, high-probability subset of latent variables using beam search.
What Problem Does This Paper Address?
Deep generative models like VQ-VAEs excel at creating realistic samples (images, audio, video), but they act as "black boxes" when it comes to answering basic probabilistic questions. Tasks like calculating exact marginal likelihoods or performing conditional inference (e.g., image inpainting) are analytically intractable because the discrete latent space grows exponentially ($K^{HW}$, where $K$ is the codebook size and $H \times W$ is the latent grid dimension).
Conversely, Tractable Probabilistic Models—such as Probabilistic Circuits (PCs)—allow for exact, closed-form inference queries but often struggle to match the raw expressive power of deep neural networks. The authors bridge this gap by turning an inherent flaw of VQ-VAEs into a tool for tractability.
Methods
The authors introduce Model Distillation (DM) to transform a trained VQ-VAE into a tractable mixture model (a type of Probabilistic Circuit). By enforcing conditional independence of pixels given the latent state, the VQ-VAE decoder acts as a product unit, and the prior acts as a sum unit.
To make the model computationally viable, they select a small, highly representative subset of latent configurations ($\bar{Z}$) rather than evaluating the entire exponential space. They propose two selection strategies:
- Random Sampling (DMRS): Latent variables are sampled directly from the VQ-VAE prior. While effective, it serves primarily as a baseline because true random sampling theoretically requires enumerating the massive prior space.
- Class-Conditioned Beam Search (DMBS): A heuristic sequence search that traverses the latent space to find the most probable regions without full enumeration. This reduces the computational complexity from exponential to a manageable $O(NHWK)$.
Datasets
The method is evaluated on the standard MNIST dataset. The authors test the framework under two different pixel-modelling assumptions:
- Continuous MNIST: Pixels are modeled using a Gaussian distribution.
- Categorical MNIST: Pixel intensities are treated as discrete values.
Key Insights and Ideas
- Index Collapse as a Feature: In VQ-VAE literature, "index collapse" (where the model only utilizes a small fraction of its available codebook states) is typically treated as a failure mode to be fixed. The authors realize this is a golden opportunity: since the probability mass is highly concentrated, we can safely discard the vast majority of the latent space without losing expressiveness.
- Quantifying the Concentration: As shown in Figure 1, for a trained PixelCNN prior, 90% of the total probability mass is concentrated in just ~5% of the latent space, and 99% is contained within approximately 25%.
Key Results
- Density Estimation: In terms of Bits Per Dimension (BPD), the distilled models (DMs) perform competitively against established tractable baselines like Continuous Mixtures (CMs) and Einsum Networks (EiNets). Crucially, the beam-search version (DMBS) closely tracks the random sampling version (DMRS), proving that beam search successfully isolates the most important latent regions.
- Tractable Inference (Inpainting): The distilled models excel at image inpainting ($p(x_u|x_o)$). Qualitatively, the DMs produce sharper, more coherent digit reconstructions than CMs and EiNets, which tend to generate blurrier results.
Limitations and Future Work
- Latent Redundancy: Selecting latent variables purely based on the highest prior probability $p(z)$ can lead to highly correlated components. This redundancy means the distilled mixture components might focus on the same dominant data modes rather than specializing in diverse regions of the data space.
- Future Directions: The authors suggest developing data-driven exploration strategies to select a more diverse set of latent variables, which could further boost the efficiency and modeling capacity of the distilled circuit.
Summary updated