Deep Latent Variable Models (DLVMs) typically force researchers to choose between two imperfect inference methods: Variational Inference (VI) or Markov chain Monte Carlo (MCMC). VI is fast because it uses an encoder to "amortize" the cost of predicting latent variables, but it often yields inaccurate posteriors by forcing them into simple shapes (like a Gaussian). MCMC, on the other hand, is highly flexible and can approximate complex, multi-modal distributions, but it is notoriously slow because it requires a separate iterative sampling process for every single datapoint.
This paper introduces Amortized Langevin Dynamics (ALD), a novel method that bridges this efficiency-flexibility gap. By updating an encoder's parameters instead of individual latent variables, the authors create the Langevin Autoencoder (LAE)—a model that achieves the high-fidelity posterior sampling of MCMC with the speed and generalization benefits of an amortized encoder.
Amortized Langevin Dynamics (ALD)
In traditional Langevin Dynamics, the latent variable $z$ is updated by following the gradient of the log-posterior plus injected noise. ALD flips this paradigm: it defines a deterministic encoder $f(x; \phi)$ and performs Langevin updates on the encoder parameters $\phi$ rather than the latent variables themselves.
This parameter-space MCMC brings several key advantages:
- Implicit Updates: Updating the encoder parameters implicitly updates the latent variables for the entire mini-batch simultaneously.
- Theoretical Guarantees: The authors prove that under mild conditions, this parameter-space MCMC converges to the true posterior distribution in the latent space.
- Simplified Training: The LAE training loop closely resembles a standard autoencoder, but includes "inner-loop" steps where the encoder's weights are jittered with noise and updated via gradients to simulate a Markov chain.
Key Insights: Generalization and the "Wide Layer"
A major benefit of ALD is that generalization acts as acceleration. Because the encoder learns a mapping, running ALD on one mini-batch helps the encoder initialize better for the next. This allows the MCMC chain to converge much faster than if it started from scratch for every data point.
Interestingly, the theoretical validity of ALD relies on a specific structural constraint: the "Wide Layer" requirement. For the parameter-space MCMC to properly capture the latent posterior, the encoder's final linear layer must be sufficiently wide. Specifically, its dimensionality $d$ must be greater than or equal to the mini-batch size $n$.
As shown in toy dataset experiments, when $d \ge n$, ALD successfully captures the ground truth shape of complex distributions. When $d < n$, the model fails to approximate the true posterior accurately.
Results and Future Directions
The authors validated the Langevin Autoencoder on both synthetic toy datasets (to visualize posterior capture) and standard image benchmarks (MNIST, SVHN, CIFAR-10, and CelebA).
Key Findings: * Superior Likelihood: LAE consistently achieved a lower negative ELBO (higher test likelihood) than standard VAEs, VAEs with Normalizing Flows, and previous partially amortized MCMC methods across all tested image datasets. * Posterior Flexibility: Unlike VI, which failed to capture multi-modal or highly correlated distributions in toy data, ALD accurately modeled the ground truth shapes. * Efficiency: While roughly 2x slower than a standard VAE due to the inner-loop ALD iterations, LAE is significantly faster than traditional MCMC-based training.
While the "wide layer" requirement might pose structural constraints for highly complex hierarchical architectures (like Very Deep VAEs), ALD successfully unbiases the traditional autoencoder, turning it into a mathematically sound generative model. Future work may explore extending this amortization framework beyond Langevin dynamics to more sophisticated algorithms like Hamiltonian Monte Carlo (HMC).
Summary updated