Towards Consistent Variational Auto-Encoding (Student Abstract)

Yijing Liu, Shuyu Lin, Ronald Clark

Introduction

Variational Autoencoders (VAEs) are powerful tools for unsupervised representation learning, designed to map high-dimensional data into a structured latent space. A fundamental assumption in the VAE framework is the existence of a consistent bidirectional mapping between the data space and the latent space. However, in practice, standard VAEs often suffer from "latent drift," where the encoding of a reconstructed data point does not align with its original latent representation. This paper, originally presented as a student abstract at AAAI-20, introduces a novel consistency loss to address this discrepancy.

The Inconsistency Problem

In a standard VAE, an input $x$ is mapped to a latent distribution $q(z|x)$ by an encoder. A sample $z$ from this distribution is then mapped back to the data space as a reconstruction $x'$ by a decoder. Ideally, re-encoding $x'$ should yield the same latent distribution $q(z|x)$.

Due to the approximation gap in the inference model, a drift occurs: the re-encoded distribution $q(z'|x')$ often deviates significantly from the original $q(z|x)$. This inconsistency indicates that the model has failed to learn a robust, reversible mapping, potentially leading to suboptimal latent representations and lower fidelity in generated samples.

Proposed Consistency Loss

The authors propose a straightforward modification to the VAE training objective to enforce consistency. By introducing a third term to the Evidence Lower Bound (ELBO), the model is explicitly penalized for latent drift.

The proposed consistency loss is defined as the Kullback-Leibler (KL) divergence between the original encoding and the re-encoding of the reconstruction: $D_{KL}(z' || z)$. The augmented loss function is: $$\mathcal{L}_{total} = \text{ELBO} - \alpha \cdot D_{KL}(z' || z)$$ where $\alpha$ is a hyperparameter that weights the importance of the consistency constraint.

Figure 1: Diagram of the VAE architecture incorporating the proposed consistency loss, which minimizes the KL divergence between the original latent code $z$ and the re-encoded code $z'$.

Crucially, this method requires no additional parameters and can be integrated into existing VAE architectures with minimal computational overhead during training.

Experimental Results

The effectiveness of the consistency loss was evaluated on the MNIST and Fashion MNIST datasets. The results demonstrate a significant reduction in latent drift both qualitatively and quantitatively.

Latent Space Alignment

Visualizing the latent space reveals the impact of the consistency loss. In a standard VAE, there is a visible gap between the original encoding and the re-encoding of its reconstruction. The proposed method effectively collapses this gap, forcing the encoder and decoder to become more mathematically consistent.

Figure 3: Latent space visualizations for MNIST comparing (a) a standard VAE and (b) the proposed consistent VAE. The consistency loss significantly reduces the drift between original and decoded latent codes.

Quantitative Improvements

On the MNIST test set, the inconsistency (measured by the KL divergence between $z$ and $z'$) was reduced by nearly a factor of four, dropping from 3.09 in the standard VAE to 0.79 with the proposed method. Furthermore, the consistency loss provides greater stability during training; while the standard VAE's drift remains high and fluctuates, the proposed method maintains a low and stable drift level from the early stages of training.

Conclusion

This work presents a simple yet effective approach to improving the consistency of Variational Autoencoders. By adding a latent-space consistency term to the training objective, the authors achieve a more reliable bidirectional mapping between data and latent representations without increasing model complexity. Future research will focus on automated hyperparameter tuning and scaling the approach to more complex, high-resolution datasets.

Summary updated

BibTeX
@inproceedings{liu2020towards,
  author = {Yijing Liu and Shuyu Lin and Ronald Clark},
  title = {{Towards Consistent Variational Auto-Encoding (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i10.7207},
}
Figure