Controlling the Interaction Between Generation and Inference in Semi-Supervised Variational Autoencoders Using Importance Weighting

Ghazi Felhi, Joseph Le Roux, Djamé SeddaharXiv 2020

Abstract

Even though Variational Autoencoders (VAEs) are widely used for semi-supervised learning, the reason why they work remains unclear. In fact, the addition of the unsupervised objective is most often vaguely described as a regularization. The strength of this regularization is controlled by down-weighting the objective on the unlabeled part of the training set. Through an analysis of the objective of semi-supervised VAEs, we observe that they use the posterior of the learned generative model to guide the inference model in learning the partially observed latent variable. We show that given this observation, it is possible to gain finer control on the effect of the unsupervised objective on the training procedure. Using importance weighting, we derive two novel objectives that prioritize either one of the partially observed latent variable, or the unobserved latent variable. Experiments on the IMDB english sentiment analysis dataset and on the AG News topic classification dataset show the improvements brought by our prioritization mechanism and exhibit a behavior that is inline with our description of the inner working of Semi-Supervised VAEs.

Introduction

Semi-supervised learning (SSL) leverages a small amount of labeled data alongside a large pool of unlabeled data to improve model performance. Semi-Supervised Variational Autoencoders (SSVAEs), particularly the "M2" model, are a popular framework for this task. However, the mechanism by which the unsupervised loss contributes to classification performance is often dismissed as a vague "regularization" effect. This paper addresses this lack of clarity by demonstrating that the generative model (decoder) actively guides the inference model (encoder) through its posterior distribution. Furthermore, the authors identify a lack of fine-grained control in standard SSVAEs over the balance between learning labels ($y$) and unobserved latent features ($z$), such as style or tone in text.

Methodology

The authors propose a more precise control mechanism using importance weighting, building upon the Importance Weighted Autoencoder (IWAE). By deriving "Partially Importance Weighted" objectives, they introduce a "lever" to prioritize specific latent variables.

Graphical representation of the generative (left) and inference (right) models in a Semi-Supervised VAE.

Two novel objectives are introduced:

  1. SSPIWO (Semi-Supervised Partially Importance Weighted Objective): This objective prioritizes the partially observed latent variable ($y$), forcing the inference model to align more closely with the generative model’s posterior regarding labels.
  2. SSiPIWO (Inverse SSPIWO): This version prioritizes the unobserved latent variable ($z$), focusing on capturing the underlying distribution of data "style" or "noise."

By increasing the number of importance samples ($k$), the model's posterior approximation becomes more accurate, effectively annealing the divergence between the encoder and the true posterior.

Experimental Setup

The proposed objectives were evaluated on two Natural Language Processing (NLP) benchmarks:

  • IMDB: A binary sentiment analysis dataset (25K labeled, 50K unlabeled examples).
  • AG News: A 4-way topic classification dataset (32K labeled, 64K unlabeled examples).

Performance was tested across supervision rates ranging from 0.1% to 100% to evaluate the models in both data-scarce and data-abundant regimes.

Results and Discussion

The experimental results support the hypothesis that the generative model acts as a teacher. In High Supervision Rate (HSR) regimes (10% to 100% labeled data), prioritizing the label variable ($y$) via SSPIWO consistently yielded superior results compared to standard SSVAEs.

Classification accuracy on IMDB and AG News datasets across various supervision rates.

Key findings include:

  • Improved Accuracy: SSPIWO achieved 87.05% accuracy on IMDB at 100% supervision (vs. 86.43% for standard VAE) and 90.24% on AG News (vs. 90.13%).
  • Effective Integration: SSPIWO naturally selects lower values for the classification loss weight ($\alpha$), suggesting that importance weighting more effectively integrates the unsupervised signal than simple scalar tuning.
  • Prioritization Impact: The prioritization mechanism provides a distinct improvement over traditional $\alpha$-tuning, offering a more nuanced way to balance the learning of different latent components.

Conclusion

This work demystifies the inner workings of SSVAEs by highlighting the active guidance provided by the generative model. The introduction of SSPIWO and SSiPIWO allows for targeted learning of latent variables, leading to improved classification performance. While importance weighting increases computational cost, it provides a powerful tool for controlling the interaction between generation and inference. Future research may explore these objectives in conditional generation tasks to improve synthetic data quality.

Summary updated

BibTeX
@misc{felhi2020controlling,
  author = {Ghazi Felhi and Joseph Le Roux and Djamé Seddah},
  title = {{Controlling the Interaction Between Generation and Inference in Semi-Supervised Variational Autoencoders Using Importance Weighting}},
  year = {2020},
  eprint = {2010.06549},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.06549},
}
Figure