Source-linked AI summary
Quantum Variational Autoencoder
Amir Khoshaman, Walter Vinci, Brandon Denis, Evgeny Andriyash, Hossein Sadeghi, Mohammad H. Amin
TL;DR
Training unsupervised generative models is computationally complex, so the paper introduces a quantum variational autoencoder with a quantum Boltzmann machine in its latent space. QVAEs can be effectively trained with continuous-time quantum Monte Carlo and achieve performance comparable to classical discrete VAEs while remaining effective at transverse field Γ = 2.
Problem
Training unsupervised generative models is computationally complex, motivating generative models with efficient inference and sampling mechanisms.
Method
The QVAE uses a quantum Boltzmann machine for latent generation and trains through a quantum lower-bound objective with continuous-time quantum Monte Carlo sampling.
Results
QVAEs achieve performance on par with classical RBM-based discrete VAEs and generate satisfactory MNIST samples at transverse field Γ = 2.
Takeaways & Limitations
The results open a path toward practical machine-learning applications using current and next-generation quantum annealers.
Takeaways & Limitations
Continuous-time quantum Monte Carlo makes training impractical at large latent dimensions, while quantum-annealer implementations face control, coupling-range, and connectivity limitations.
Abstract
from arXiv · showhide
Variational autoencoders (VAEs) are powerful generative models with the salient ability to perform inference. Here, we introduce a quantum variational autoencoder (QVAE): a VAE whose latent generative process is implemented as a quantum Boltzmann machine (QBM). We show that our model can be trained end-to-end by maximizing a well-defined loss-function: a 'quantum' lower-bound to a variational approximation of the log-likelihood. We use quantum Monte Carlo (QMC) simulations to train and evaluate the performance of QVAEs. To achieve the best performance, we first create a VAE platform with discrete latent space generated by a restricted Boltzmann machine (RBM). Our model achieves state-of-the-art performance on the MNIST dataset when compared against similar approaches that only involve discrete variables in the generative process. We consider QVAEs with a smaller number of latent units to be able to perform QMC simulations, which are computationally expensive. We show that QVAEs can be trained effectively in regimes where quantum effects are relevant despite training via the quantum bound. Our findings open the way to the use of quantum computers to train QVAEs to achieve competitive performance for generative models. Placing a QBM in the latent space of a VAE leverages the full potential of current and next-generation quantum computers as sampling devices.
I. INTRODUCTION
The paper develops QVAEs that combine a classical VAE inference structure with a quantum Boltzmann machine generative process, addressing shortcomings of earlier quantum-assisted generative models. The approach provides a well-defined loss with backpropagating gradients and achieves state-of-the-art performance for discrete-unit models on MNIST.
- Motivation: Quantum processing units could accelerate supervised and unsupervised learning, motivating practical quantum machine-learning algorithms for current and near-future devices.Existing quantum algorithms can accelerate machine-learning tasks, while machine learning also supports quantum-control techniques.
- Limitations of prior work: Earlier quantum-assisted approaches required datasets with few input units, while QAHM lacked a well-defined loss and produced blurry, non-scalable MNIST images.QAHM also has gradients that do not correctly propagate between its two training phases.
- Proposed approach: The proposed QVAE uses a classical VAE with discrete variables whose generative process is realized by a quantum Boltzmann machine.QBM sampling is used for training, and QBMs can be trained by minimizing a quantum lower bound to the true log-likelihood.
- Contributions: QVAEs provide a well-defined loss with fully propagating gradients trained by backpropagation, enabling state-of-the-art performance for discrete-unit models on MNIST.The classical discrete VAE baseline uses large restricted Boltzmann machines in the latent space.
- Relation to quantum autoencoders: Unlike quantum autoencoders, QVAEs retain a classical autoencoding structure while using a quantum generative process.Quantum autoencoders use quantum circuits for encoding and can compress quantum or classical data, but lack a generative structure.
II. GENERATIVE MODELS WITH LATENT VARIABLES
Generative models with latent variables model joint relationships between visible and unobserved units, potentially learning useful data representations. Their variational objective balances reconstruction quality against matching the latent prior through KL divergence.
- Model structure: Latent-variable models define joint distributions over visible units x and latent units ζ through directed or undirected conditional relationships.Boltzmann machines are undirected models, while directed models factorize pθ(x, ζ) as pθ(x|ζ)pθ(ζ).
- Model structure: Latent variables can encode useful data representations that may improve downstream tasks such as super-resolution.
- Variational objective: The variational decomposition of log pθ(x) contains an autoencoding term and an expected KL-divergence term.The posterior pθ(ζ|x) describes latent-variable probabilities after observing x, while DKL measures distance between distributions.
- Variational objective: Maximizing the autoencoding term encourages pθ(x|ζ) to reconstruct input x when ζ is sampled from pθ(ζ|x).
- Variational objective: Maximizing the second term minimizes expected KL divergence, balancing reconstruction against the amount of information stored in the latent space.The balance depends on the generative-model type and training method; less expressive decoders can store more information in latent variables.
III. VARIATIONAL AUTOENCODERS
VAEs address latent-variable inference by replacing the intractable true posterior with a tractable variational approximation implemented by an encoder network. Optimizing the resulting ELBO jointly improves likelihood and posterior approximation, with tightness determined by the distance between the two posteriors.
- Latent-variable generative models face intractable inference because evaluating the posterior pθ(ζ|x) requires computing the marginal likelihood pθ(x).
- VAEs introduce a tractable variational posterior qφ(ζ|x) to approximate pθ(ζ|x), using neural networks for the encoder and decoder.
- The VAE objective combines expected reconstruction log-likelihood with a negative KL divergence between qφ(ζ|x) and the prior pθ(ζ).
- The objective L(θ, φ) is the evidence lower bound because it does not equal the log-likelihood but provides a lower bound on it.
- Maximizing the ELBO increases log-likelihood while reducing the distance between approximate and true posteriors, with tightness depending on qφ(ζ|x)'s flexibility.
A. The reparameterization trick
The reparameterization trick addresses problematic φ-derivatives by expressing latent variables as deterministic functions of φ and auxiliary φ-independent randomness, enabling differentiation inside expectations. Unlike REINFORCE, which suffers from high variance, this approach underlies the success of VAEs and can extend to discrete latents and more complex posteriors.
- The reparameterization trick: Derivatives with respect to φ are problematic because expectation estimates use samples drawn from a distribution that depends on φ.The issue arises when differentiating expectations over latent variables under qφ(ζ|x).
- The reparameterization trick: REINFORCE offers a naive solution, but its expectation estimator has high variance and requires intricate variance-reduction mechanisms.The passage assumes f does not depend on φ.
- The reparameterization trick: The reparameterization trick writes ζ as a deterministic function ζ(φ, ρ), where auxiliary randomness ρ follows p(ρ) independently of φ.This converts Eζ∼qφ[f(ζ)] into Eρ∼p(ρ)[f(ζ(φ, ρ))].
- The reparameterization trick: Moving the derivative inside the expectation makes gradient calculation straightforward and is identified as a major reason for the success and proliferation of VAEs.The method is called the reparameterization trick.
- The reparameterization trick: Choosing Fφ as the cumulative distribution function of qφ(ζ|x) makes p(ρ) uniform on [0, 1].The construction follows from matching p(ρ)dρ with qφ(ζ|x)dζ.
- The reparameterization trick: The derivation assumes continuous latent variables and a factorized posterior, while extensions to discrete latents and more complex approximate posteriors are possible.The factorization is qφ(ζ|x) = Q_l qφ(ζl|x).
IV. VAE WITH DISCRETE LATENT SPACE
This section develops a VAE with a discrete binary latent space, addressing the difficulty of differentiating through discrete stochastic units. It adopts a smoothing-based approach that enables reparameterizable, unbiased gradient estimates and yields an ELBO formulation.
- Discrete latent variables are difficult to optimize because their stochastic units are non-differentiable, despite their importance across supervised and unsupervised learning, attention, language modeling, and reinforcement learning.Discrete units are also used to represent semantic classes and support semisupervised generation.
- REINFORCE-based variational methods provide noisy gradient estimates, requiring variance-reduction techniques such as control variates.An alternative uses biased derivatives for Bernoulli variables.
- The proposed discrete VAE defines its prior over binary latent variables z ∼ pθ(z), with z ∈ {0, 1}^L, and uses reparameterizable, unbiased gradient estimates.The approach follows the method proposed in [55] to propagate gradients through discrete variables.
- The smoothing distribution r(ζ|z) enables the reparameterization trick, while the approximating posterior uses a product of Bernoulli probabilities for each discrete variable z_l.With these choices, the ELBO bound can be written in the resulting discrete-latent formulation.
- The marginalized posterior qφ(ζ|x) separates the KL term from ζ and the autoencoding term from z in the ELBO expression.This separation follows from the stated independence properties of the two terms.
A. The reparameterization trick for DVAE
The DVAE reparameterization trick uses spike-and-exponential smoothing to deterministically recover discrete latent variables from continuous noise, enabling gradient-based treatment of both autoencoding and KL terms. The KL term is decomposed into entropy and cross-entropy components, each reparameterized when needed.
- A. The reparameterization trick for DVAE: The inverse CDF reparameterization trick applies to the autoencoding term when r(ζ|z) is chosen so the marginalized posterior has the appropriate CDF.The method introduces a continuous auxiliary variable ζ for discrete latent-variable sampling.
- A. The reparameterization trick for DVAE: Spike-and-exponential smoothing allows each discrete variable z_l to be deterministically obtained from ζ_l and ρ_l.This deterministic relationship is crucial for applying the reparameterization trick to the KL term and evaluating its derivatives.
- A. The reparameterization trick for DVAE: The KL term is expressed as the difference between the entropy H(qφ(z|x)) and cross-entropy H(qφ(z|x), pθ(z)).This decomposition enables separate reparameterization of the two contributions.
- A. The reparameterization trick for DVAE: The entropy term can be reparameterized through the dependence of z on ρ and φ, although factorial Bernoulli posteriors permit analytic entropy evaluation instead.For factorial Bernoulli distributions, H(qφ) = −PL l=1 (q_l log q_l + (1 −q_l) log(1 −q_l)).
- A. The reparameterization trick for DVAE: Reparameterizing the cross-entropy gives −H(qφ, pθ) ≡ E_z∼qφ[log pθ] = E_ρ∼U[log pθ(z(ρ, φ))].The expression replaces sampling from qφ with uniform-noise sampling through the reparameterized latent variables.
B. DVAE with Boltzmann machines
Boltzmann machines provide expressive latent spaces for VAEs by representing complex multimodal distributions. Training uses a cross-entropy objective whose gradients are computed through positive and negative phases involving Boltzmann sampling.
- Motivation: Boltzmann machines are attractive VAE latent-space models because they can represent complex multi-modal probability distributions.This approach is also appealing for machine-learning applications of quantum computers.
- Objective: The negative cross-entropy term −H(qφ, pθ) = Ez∼qφ[log pθ] is the model log-likelihood of latent samples from the approximating posterior.The latent variable is sampled as z ∼qφ(z|x).
- Gradient computation: Gradients are computed as the difference between positive and negative phases, with the negative phase obtained through Boltzmann sampling from the Boltzmann machine.The positive phase uses expectations over the approximating posterior, while the negative phase uses the model distribution.
- Gradient computation: The positive phase is expressed using discrete variables z(ρ, φ), requiring derivatives to be calculated through these variables.The general computation of the positive phase is discussed in Appendix D.
C. Experimental results with DVAE
The DVAE achieves state-of-the-art performance among variational inference models with only latent variables on MNIST. Experiments evaluate RBM-based latent spaces across model sizes, decoder configurations, and comparisons with other discrete-variable methods.
- Experimental results with DVAE: The DVAE achieves state-of-the-art performance on MNIST among variational inference models using only latent variables.Experiments use restricted Boltzmann machines whose visible and hidden units are both treated as latent variables in the DVAE.
- Experimental results with DVAE: −83.5±0.2 LL was obtained for an RBM with 256 units per layer on MNIST.The reported uncertainty is a conservative estimate of the statistical uncertainty.
- Experimental results with DVAE: Decoder networks used one ReLU layer with 250–2000 deterministic units, because deeper networks made the decoder prone to overfitting.Larger RBMs typically required fewer decoder hidden units to avoid overfitting.
- Experimental results with DVAE: The study compares DVAE results with NVIL, VIMCO, CONCRETE, Gumbel-Softmax, and RWS, which use variance-reduction or reparameterization approaches for discrete latent variables.NVIL and VIMCO use REINFORCE with control variates, while CONCRETE and Gumbel-Softmax apply reparameterization to discrete latent variables.
V. QUANTUM VARIATIONAL AUTOENCODERS
The QVAE implements the VAE’s latent prior with a quantum Boltzmann machine and trains it using a tractable quantum lower bound to the ELBO. Because the transverse fields’ gradients are unavailable, Γ remains fixed as a training hyperparameter.
- Model construction: The QVAE replaces the VAE latent prior with a quantum Boltzmann machine.This embeds the quantum generative process directly in the latent space.
- Training objective: Intractable gradients of the QBM cross-entropy are handled with a lower bound derived from the Golden-Thompson inequality.The inequality applies to Hermitian matrices and enables a tractable training objective.
- Training objective: The resulting Q-ELBO is a tractable quantum bound to the true ELBO, with gradients estimated by sampling from the QBM.The gradient expression combines expectations under the encoder-induced distribution and the QBM distribution.
- Training limitations: The Q-ELBO gradients cannot train the transverse fields Γ, so Γ is held constant throughout training.Γ is treated as a hyperparameter rather than an optimized model parameter.
A. Experimental results with QVAE
QVAE experiments show that training via the quantum lower bound is effective even with relatively large transverse fields. Performance degradation is primarily attributed to the looser training bound, while larger QBM experiments remain computationally infeasible with QMC.
- Scalability: Large-latent-space QVAEs are computationally unfeasible to train with QMC, although quantum annealing could sample from large QBMs.The authors therefore expect quantum annealing devices may enable competitive results on datasets such as MNIST.
- Training procedure: QVAEs can be effectively trained by maximizing the quantum lower bound, Q-ELBO, to the true ELBO.Training used population annealing for continuous-time quantum Monte Carlo with 1000 samples and 5 sweeps per gradient evaluation.
- Quantum-bound behavior: Transverse field increases loosen Q-ELBO, but the corresponding training ELBO remains much tighter and closer to the classical case.This explains effective training at transverse field values as large as 2.
- Performance limitations: Performance deterioration is mostly caused by the increasingly loose Q-ELBO rather than an intrinsic QVAE limitation.Small quantum Boltzmann machines have been shown to outperform classical counterparts when trained by direct log-likelihood maximization.
VI. CONCLUSIONS · Appendix A: VAE with Guassian variables
The QVAE uses QBMs for latent-space generation and achieves strong discrete-latent performance, while computational costs limit simulations and motivate quantum-annealing approaches. The appendix describes Gaussian VAE priors, posteriors, reparameterization, and KL-divergence treatment.
- VI. CONCLUSIONS: QVAE uses quantum Boltzmann machines to implement the latent-space generative process and achieves state-of-the-art MNIST results at higher latent dimensions.The comparison concerns variational-inference models with stochastic discrete units.
- VI. CONCLUSIONS: 64×64 dimensional QBM was the largest simulated size because continuous-time quantum Monte Carlo sampling was computationally expensive.The study used CT-QMC to sample from QBMs in the latent space.
- VI. CONCLUSIONS: RBM and QBM training produces well-defined modes, making Markov Chain Monte Carlo sampling very inefficient.The conclusion identifies multimodality as a sampling limitation during training.
- VI. CONCLUSIONS: Quantum annealers could accelerate mixing between modes through quantum tunnelling, with computational advantage observed relative to quantum Monte Carlo methods.Successful deployment will likely require implementations tailored to mitigate physical limitations.
- VI. CONCLUSIONS: The work combines quantum algorithms with established classical frameworks to develop competitive generative models and support future quantum-annealer applications in machine learning.The authors describe this combination as a foundation for solving realistic machine-learning problems.
- Appendix A: VAE with Guassian variables: In the simplest VAE, the prior and approximate posterior are products of normal distributions with diagonal covariance matrices.The appendix introduces this Gaussian-variable formulation as the basic VAE version.
- Appendix A: VAE with Guassian variables: The prior is independent of θ, while posterior means and variances depend on inputs x and parameters φ, typically through a deep neural network.Diagonal Gaussians enable an easy reparameterization trick.
- Appendix A: VAE with Guassian variables: The Gaussian KL divergence is expressed as the sum of two integrals, and reparameterization is needed for a low-variance gradient estimate only in the autoencoding term.The reparameterization uses ζ_l = µ_l + σ_lρ with ρ sampled from a standard normal distribution.
Appendix B: DVAE with Bernoulli variables … Appendix E: Population-annealed continuous-time quantum Monte Carlo
The appendices develop discrete and hierarchical variational posteriors, derive gradients accounting for discrete-variable dependencies, and describe population-annealed continuous-time quantum Monte Carlo for sampling and likelihood-bound evaluation.
- Appendix B: DVAE with Bernoulli variables: The Bernoulli DVAE uses product Bernoulli distributions for both prior and approximating posterior, with probabilities produced by a deep feed-forward network.Only the autoencoding term requires the reparameterization trick for a low-variance gradient estimate.
- Appendix B: DVAE with Bernoulli variables: The Bernoulli DVAE derives entropy and cross-entropy terms for its variational objective.
- Appendix C: Hierarchical approximating posterior: Explain-away effects motivate hierarchical approximating posteriors because independent distributions cannot fully capture the resulting dependencies.A multivariate reparameterization trick is formulated through conditional-marginal CDFs.
- Appendix C: Hierarchical approximating posterior: With hierarchical posteriors, the dependence of conditional CDF functions on earlier continuous variables is encoded through qφ(z, ζ|x), and expectations require statistical reparameterization estimates.
- Appendix D: Computing the derivatives: Gradient computation must account for discrete variables’ dependence on φ through hierarchical posterior terms, using zl = Θ(ρl+ql−1) and the chain rule.The resulting expression computes derivatives of the positive phase for hierarchical posteriors with RBM or QRBM priors.
- Appendix D: Computing the derivatives: The derivative expression includes a 1−ql factor to account for zl = 0 with probability 1−ql and preserve statistical dependence on preceding variables.
- Appendix E: Population-annealed continuous-time quantum Monte Carlo: Quantum-distribution sampling uses continuous-time quantum Monte Carlo with population annealing, representing the system as M periodically coupled configurations along imaginary time.Cluster updates grow only along imaginary time and satisfy detailed balance.
- Appendix E: Population-annealed continuous-time quantum Monte Carlo: Population annealing uses a linear parameter schedule θt = tθ with periodic resampling to approximate equilibrium samples and estimate the quantum partition function.Quantum cross-entropy probabilities require evaluating a clamped-system partition function with the first imaginary-time slice fixed.