Learning undirected models via query training

Miguel Lázaro-Gredilla, Wolfgang Lehrach, Dileep GeorgearXiv 2019

Abstract

Typical amortized inference in variational autoencoders is specialized for a single probabilistic query. Here we propose an inference network architecture that generalizes to unseen probabilistic queries. Instead of an encoder-decoder pair, we can train a single inference network directly from data, using a cost function that is stochastic not only over samples, but also over queries. We can use this network to perform the same inference tasks as we would in an undirected graphical model with hidden variables, without having to deal with the intractable partition function. The results can be mapped to the learning of an actual undirected model, which is a notoriously hard problem. Our network also marginalizes nuisance variables as required. We show that our approach generalizes to unseen probabilistic queries on also unseen test data, providing fast and flexible inference. Experiments show that this approach outperforms or matches PCD and AdVIL on 9 benchmark datasets.

Introduction

In Probabilistic Graphical Models (PGMs), undirected models (like Markov Random Fields or Restricted Boltzmann Machines) are powerful for capturing symmetric dependencies. However, they are notoriously difficult to train due to the "partition function"—a global normalization constant that is often intractable. Furthermore, standard amortized inference, such as the encoder in a Variational Autoencoder (VAE), is typically optimized for a single query: mapping observed data to latent variables. If the task changes (e.g., from classification to inpainting), these models often require retraining or complex iterative procedures.

Methods: The QT-NN Architecture

To address these challenges, we introduce Query Training (QT) and the QT-NN architecture. The core innovation is treating inference as a learnable, general-purpose function.

The QT-NN architecture overview, illustrating how randomized query masks are used to train an unrolled inference network.

The architecture is built on several key principles:

  1. Unrolling Belief Propagation (BP): Rather than using a black-box neural network, the researchers unroll the iterative equations of Belief Propagation into $N$ layers. Each layer corresponds to one iteration of message passing, providing a strong inductive bias for probabilistic reasoning.
  2. Weight Sharing: Parameters $\theta$ are shared across all unrolled layers, mirroring the fixed parameters of a traditional PGM.
  3. Randomized Query Masks ($q$): During training, the model receives a data sample and a random binary mask. This mask designates certain variables as "observed" (inputs) and others as "missing" (targets for prediction).
  4. Stochastic Training: By training on a diverse distribution of query masks, the network learns the underlying joint distribution of the data. This avoids the need to compute the global partition function, as the model is optimized for predictive accuracy across arbitrary subsets of variables.
  5. Interpolating Inference: A learnable temperature parameter $T$ allows the network to transition between "sum-product" (marginal inference) and "max-product" (MAP inference) regimes.

Key Results

The authors evaluated QT-NN on 9 benchmark datasets, including UCI benchmarks (Adult, DNA, Mushroom) and image/text data (Digits, NIPS). They compared the approach against state-of-the-art methods for learning undirected models: Persistent Contrastive Divergence (PCD) and Advantageous Variational Inference and Learning (AdVIL).

Comparison of QT-NN against baseline methods across 9 benchmark datasets. Values represent Normalized Cross-Entropy (lower is better).

As shown in the results table, QT-NN consistently achieves the lowest Normalized Cross-Entropy (NCE) across nearly all datasets. For instance, on the 'Adult' dataset, QT-NN reached an NCE of 0.167, outperforming PCD-BP (0.215) and AdVIL-BP (0.224). Beyond accuracy, QT-NN offers significant speed advantages; once trained, it performs inference in a single forward pass, whereas traditional sampling-based methods are computationally expensive.

Conclusion

Query Training provides a flexible "Swiss Army Knife" for probabilistic inference. By unrolling classical inference algorithms and training with randomized masks, researchers can learn undirected models that generalize to unseen queries without the computational burden of the partition function. Future work will explore extending this framework to higher-order interactions and more complex graph topologies.

Summary updated

BibTeX
@misc{lazarogredilla2019learning,
  author = {Miguel Lázaro-Gredilla and Wolfgang Lehrach and Dileep George},
  title = {{Learning undirected models via query training}},
  year = {2019},
  eprint = {1912.02893},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.02893},
}
Figure