Abstract
Variational autoencoders are prominent generative models for modeling discrete data. However, with flexible decoders, they tend to ignore the latent codes. In this paper, we study a VAE model with a deterministic decoder (DD-VAE) for sequential data that selects the highest-scoring tokens instead of sampling. Deterministic decoding solely relies on latent codes as the only way to produce diverse objects, which improves the structure of the learned manifold. To implement DD-VAE, we propose a new class of bounded support proposal distributions and derive Kullback-Leibler divergence for Gaussian and uniform priors. We also study a continuous relaxation of deterministic decoding objective function and analyze the relation of reconstruction accuracy and relaxation parameters. We demonstrate the performance of DD-VAE on multiple datasets, including molecular generation and optimization problems.
Introduction
Variational Autoencoders (VAEs) are powerful tools for generating discrete data, such as text or chemical sequences. However, they frequently suffer from posterior collapse, a failure mode where flexible autoregressive decoders (e.g., RNNs) learn to generate data by relying on local context while ignoring the latent code $z$. This results in a latent space that lacks meaningful structure, rendering it ineffective for downstream tasks like visualization or Bayesian Optimization.
Methods: Deterministic Decoding and Bounded Support
To combat posterior collapse, the authors propose DD-VAE, which introduces two fundamental shifts from the standard VAE framework:
- Deterministic Decoding: Instead of sampling tokens from a probability distribution, the decoder selects the highest-scoring token using an
argmaxoperation. This ensures that the latent code $z$ is the only source of variation; to produce different outputs, the model is forced to utilize different regions of the latent space. - Bounded Support Proposals: Standard VAEs typically use Gaussian distributions, which have infinite tails. In a deterministic setting, the resulting overlap between distributions for different data points makes lossless reconstruction impossible. DD-VAE addresses this by using proposal distributions with bounded support—such as Triangular, Epanechnikov, or Quartic kernels—which drop to zero probability outside a specific range.
To ensure differentiability during training, the non-differentiable argmax is approximated using a continuous relaxation with a temperature parameter $\tau$. As $\tau$ is annealed toward zero, the model converges to the true deterministic objective.
Results and Manifold Analysis
The combination of deterministic decoding and bounded support distributions creates a highly organized, "brick-like" manifold. Unlike the messy, overlapping regions of a standard Gaussian VAE, DD-VAE learns to tile the latent space with distinct regions for each data point.
Empirical Performance
- Molecular Optimization: On the ZINC database, DD-VAE outperformed state-of-the-art baselines in goal-directed property optimization (e.g., solubility). It achieved a "Top 1" molecule score of 5.86, compared to 5.76 for a standard VAE.
- Representation Learning: On binarized MNIST, a simple K-nearest neighbor classifier using DD-VAE's 2D latent codes achieved 87.8% accuracy, surpassing the 86.1% achieved by a standard VAE.
- Distribution Learning: In the MOSES benchmark, DD-VAE consistently showed lower Fréchet ChemNet Distance (FCD), indicating a generated distribution closer to the ground truth.
Conclusion
DD-VAE effectively addresses posterior collapse by "locking" the decoder to the latent space. This deterministic approach, paired with bounded support proposals, results in a more interpretable and useful manifold for optimization. While the presence of "dead zones" in the latent space can occasionally lower the validity of random samples, the gains in optimization performance and manifold structure make DD-VAE a compelling alternative for discrete data generation.
Summary updated