Learning Priors for Invariance

Eric T. Nalisnick, Padhraic Smyth

Introduction

In Bayesian machine learning, the prior distribution is intended to encapsulate our domain knowledge before observing data. However, for high-dimensional models like deep neural networks, designing an informative prior is notoriously difficult. Consequently, practitioners often resort to non-Bayesian "engineering tricks" to enforce robustness, such as data augmentation (e.g., rotating images) and dropout (randomly masking features). While effective, these methods lack a rigorous probabilistic foundation and often involve conditioning on "fake" data. This paper introduces a variational framework to formally encode these desired invariances directly into the Bayesian prior, allowing models to learn structural properties even from unlabeled data.

Methodology: Learning Invariant Priors

The authors propose learning a prior $p(\theta)$ from a parametric family that minimizes the sensitivity of the model's output to specific perturbations.

  1. Perturbation Processes (PP): Transformations like dropout (element-wise masking) and rotation (affine transforms) are defined as stochastic processes $\zeta$.
  2. The Objective Function: Based on the Principle of Maximum Entropy, the goal is to find a prior that maximizes its own entropy (remaining as unbiased as possible) while minimizing the Kullback-Leibler (KL) divergence between the model's predictions on original and perturbed inputs.
  3. Variational Optimization: To handle the intractability of marginalizing over parameters, the authors use Jensen’s inequality to derive an upper bound. This makes the prior $p(\theta)$ accessible for optimization via Monte Carlo sampling and the reparameterization trick.
  4. Theoretical Links: For linear regression, the authors prove that the learned dropout-invariant prior is equivalent to a diagonalized version of Zellner’s $g$-prior, providing a formal link between modern dropout and classical Bayesian statistics.

Visualizing Learned Invariance

A key strength of this approach is its ability to learn interpretable structural features. When the framework is applied to learn a dropout-invariant prior, the resulting weights in the center of the image—where features are most frequent—are effectively down-weighted. For rotation invariance, the prior learns "spiral" filters, reflecting the circular symmetry inherent in the transformation.

Visualizing learned priors: The left grid shows filters learned for dropout invariance, while the right grid displays spiral filters learned for rotation invariance.

Experimental Results

The method was evaluated on two primary tasks: Rotated MNIST and IMDB Sentiment Analysis.

Quantitative Invariance

The effectiveness of the learned priors is demonstrated by measuring the expected KL divergence between predictions on clean and perturbed data. As shown in the plots below, standard Gaussian priors and posteriors fail to maintain invariance as the perturbation intensity increases. In contrast, the proposed Invariant Priors (using implicit or mixture approximations) maintain near-zero divergence, indicating successful encoding of the desired symmetry.

KL divergence between clean and perturbed predictions for (a) Feature Dropout and (b) Rotation. The proposed Invariant Priors (red and blue lines) maintain significantly higher invariance than standard baselines.

Classification Performance

  • Rotated MNIST: A Bayesian Neural Network (BNN) with the learned invariant prior achieved an 8.29% error rate, outperforming a standard BNN (10.08%) and a standard dropout-regularized network (8.85%).
  • IMDB Sentiment: Bayesian Logistic Regression with the invariant prior reached an 11.81% error rate, surpassing both standard Bayesian methods and specialized dropout penalties.

Conclusion

This work provides a theoretical bridge between heuristic deep learning techniques and Bayesian principles. By treating invariance as a constraint on the prior, the authors enable models to leverage unlabeled data to learn structural inductive biases. While the current method captures "coarse" invariances, future work may extend this to more granular, feature-specific symmetries.

Summary updated

BibTeX
@inproceedings{nalisnick2018learning,
  author = {Eric T. Nalisnick and Padhraic Smyth},
  title = {{Learning Priors for Invariance}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2018},
}
Figure