On the Encoder-Decoder Incompatibility in Variational Text Modeling and Beyond

Chen Wu, Prince Zizhuang Wang, William Yang Wang

Abstract

Variational autoencoders (VAEs) combine latent variables with amortized variational inference, whose optimization usually converges into a trivial local optimum termed posterior collapse, especially in text modeling. By tracking the optimization dynamics, we observe the encoder-decoder incompatibility that leads to poor parameterizations of the data manifold. We argue that the trivial local optimum may be avoided by improving the encoder and decoder parameterizations since the posterior network is part of a transition map between them. To this end, we propose Coupled-VAE, which couples a VAE model with a deterministic autoencoder with the same structure and improves the encoder and decoder parameterizations via encoder weight sharing and decoder signal matching. We apply the proposed Coupled-VAE approach to various VAE models with different regularization, posterior family, decoder structure, and optimization strategy. Experiments on benchmark datasets (i.e., PTB, Yelp, and Yahoo) show consistently improved results in terms of probability estimation and richness of the latent space. We also generalize our method to conditional language modeling and propose Coupled-CVAE, which largely improves the diversity of dialogue generation on the Switchboard dataset.

Introduction

Variational Autoencoders (VAEs) are powerful generative models, but applying them to text is notoriously difficult due to the posterior collapse problem. Because text decoders are typically strong autoregressive models (like RNNs or Transformers), the model often finds a trivial local optimum: the decoder ignores the latent variable $z$ entirely, and the posterior distribution collapses to match the prior. This paper diagnoses this issue as an encoder-decoder incompatibility and proposes Coupled-VAE, which pairs the VAE with a deterministic autoencoder to guide the learning process.

By tracking training dynamics, the authors observed that the VAE encoder receives almost no backpropagated gradient from the reconstruction loss compared to a standard Deterministic Autoencoder (DAE). Because the encoder is poorly optimized and the decoder is overly expressive, the two networks fail to communicate effectively, leading the model to abandon the latent space.

Methods: The Coupled-VAE Framework

To fix this incompatibility, the authors propose Coupled-VAE. The core idea is to use a multi-task learning setup where a standard VAE is trained alongside a Deterministic Autoencoder (DAE) that shares the exact same architecture.

Comparison of Variational Autoencoder (a) and Deterministic Autoencoder (b) architectures.

The coupling happens in two primary ways:

  1. Encoder Weight Sharing: The VAE and the DAE share the same encoder weights. Since the DAE does not suffer from posterior collapse, it passes rich, un-collapsed gradients back to the encoder, forcing it to learn meaningful representations.
  2. Decoder Signal Matching: A signal matching loss ($\mathcal{L}_{match}$) minimizes the distance between the stochastic decoding signal (from the VAE) and the deterministic decoding signal (from the DAE). This pushes the VAE's decoder to utilize the information provided by the encoder.

This approach is model-agnostic and can be applied to various VAE variants (e.g., $\beta$-VAE, Normalizing Flows) and extended to Conditional VAEs (Coupled-CVAE) for tasks like dialogue generation.

Key Insights and Results

The authors frame the VAE through the lens of differential geometry, where the encoder and decoder act as "chart maps" for the data manifold. Posterior collapse occurs when poorly optimized chart maps make it impossible to learn a smooth "transition map" (the posterior).

Empirical results on datasets like PTB, Yelp, and Yahoo demonstrate that Coupled-VAE successfully restores gradient flow to the encoder.

Optimization dynamics showing the increase in latent space utilization (Mutual Information) for Coupled-VAE compared to standard VAE.
  • Better Language Modeling: Coupled-VAE consistently improved Negative Log-Likelihood (NLL) and Perplexity (PPL). On the Yelp dataset, perplexity dropped from 54.3 to 51.6.
  • Mitigating Collapse: The models showed significantly higher KL divergence and Mutual Information (MI). On Yelp, MI increased from 8.28 to 9.65, indicating the latent space was actively used.
  • Dialogue Diversity: In dialogue generation on the Switchboard dataset, Coupled-CVAE drastically reduced generic responses. Distinct-1 and Distinct-2 scores jumped from 0.61 / 2.60 to 0.86 / 4.10.

Limitations and Future Work

The signal matching loss ($\mathcal{L}_{match}$) requires careful hyperparameter tuning ($\lambda_m$). High weights can distract from the primary generative objective. Future work may explore different "transition map" implementations, such as flow-based models, to further bridge the gap between encoder and decoder parameterizations.

Summary updated

Abstract

Variational autoencoders (VAEs) combine latent variables with amortized variational inference, whose optimization usually converges into a trivial local optimum termed posterior collapse, especially in text modeling. By tracking the optimization dynamics, we observe the encoder-decoder incompatibility that leads to poor parameterizations of the data manifold. We argue that the trivial local optimum may be avoided by improving the encoder and decoder parameterizations since the posterior network is part of a transition map between them. To this end, we propose Coupled-VAE, which couples a VAE model with a deterministic autoencoder with the same structure and improves the encoder and decoder parameterizations via encoder weight sharing and decoder signal matching. We apply the proposed Coupled-VAE approach to various VAE models with different regularization, posterior family, decoder structure, and optimization strategy. Experiments on benchmark datasets (i.e., PTB, Yelp, and Yahoo) show consistently improved results in terms of probability estimation and richness of the latent space. We also generalize our method to conditional language modeling and propose Coupled-CVAE, which largely improves the diversity of dialogue generation on the Switchboard dataset.
BibTeX
@inproceedings{wu2020encoder,
  author = {Chen Wu and Prince Zizhuang Wang and William Yang Wang},
  title = {{On the Encoder-Decoder Incompatibility in Variational Text Modeling and Beyond}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2020},
  url = {https://openreview.net/forum?id=dLiUDDDab4v},
}
Figure