Deep Prior

Alexandre Lacoste, Thomas Boquet, Negar Rostamzadeh, Boris N. Oreshkin, Wonchang Chung, David KruegerarXiv 2017

Introduction

Bayesian Neural Networks (BNNs) offer a principled framework for uncertainty estimation by learning a distribution over weights rather than a single point estimate. However, the effectiveness of BNNs is often bottlenecked by the choice of the "prior"—the initial distribution representing our beliefs before seeing data. Standard approaches typically employ simple, uninformative priors like isotropic Gaussians. This paper argues that such simplicity limits the model's ability to generalize, particularly in few-shot learning scenarios where data is scarce. The authors introduce a method to learn a "rich" prior distribution by looking across multiple related tasks, effectively parameterizing the prior using a generative model.

Methodology

The researchers propose a Hierarchical Bayes approach to learn a complex prior from a meta-dataset of related tasks. This approach relies on several key technical innovations:

  1. The Generator Trick: Inspired by Generative Adversarial Networks (GANs), the authors define weights $w$ as the output of a deterministic function $h_\alpha(z)$, where $z$ is a simple noise variable. This allows the model to represent a highly complex distribution of weights using a neural network.
  2. Latent Space Inference: Each task is assigned a latent variable $z$. By performing inference in this lower-dimensional latent space rather than the high-dimensional weight space, the model becomes significantly more computationally efficient.
  3. ELBO Simplification: A major mathematical contribution is the simplification of the Evidence Lower Bound (ELBO). By ensuring both the prior and the posterior use the same projection function to move from latent space to weight space, complex weight terms "cancel out," making the algorithm scalable and easier to train.
  4. Refined Posterior: To capture task-specific distributions that may be non-Gaussian, the model utilizes Inverse Autoregressive Flow (IAF), allowing for more flexible posterior distributions.

Experimental Setup

The framework was evaluated using a 1D Harmonic Signals meta-dataset consisting of 5,000 tasks. Each task involved a regression problem based on a sum of two sine waves with varying phases and amplitudes. The model was trained on a variety of these signals and then evaluated on entirely new signals it had not seen before. Evaluation focused on "few-shot" performance, using as few as 4 to 50 training samples per task.

Key Results and Quantitative Analysis

Quantitative analysis demonstrates that the inclusion of the learned prior (the "KL regularizer") significantly reduces Mean Squared Error (MSE) across all tested dataset sizes.

Mean Square Error (MSE) comparison between models with and without the learned KL prior across varying dataset sizes.

As shown in the figure above, the "with kl" model consistently outperforms the baseline, particularly in regimes where data is extremely scarce (e.g., $N=16$). Furthermore, the version without the learned prior performed ten times worse in terms of log-likelihood, indicating that the "Deep Prior" is crucial for accurate probabilistic modeling and uncertainty estimation.

Key Insights and Extrapolation

A core advantage of this approach is its ability to perform knowledge transfer. The learned prior acts as a form of memory, internalizing the structural properties of the task family—in this case, periodicity. Consequently, when presented with minimal data points, the model does not merely interpolate; it "recognizes" the underlying wave structure.

Qualitative performance of the Deep Prior model on 1D harmonic signals with increasing numbers of data points.

Standard models often struggle with extrapolation, but because this model learns the underlying structure of the data via the prior, it can predict the continuation of a wave far beyond the last observed data point. As visualized, even with very few red data points, the model (blue line) correctly identifies the frequency and phase of the signal.

Limitations and Future Work

Despite its success, the authors noted several challenges:

  • Local Minima: Training on new tasks sometimes resulted in the optimizer getting stuck in local minima, likely because the posterior distribution is multi-modal (multiple waves could fit a small number of points).
  • IAF Constraints: While IAF was used to handle complex distributions, it often struggled to adapt beyond a single distorted mode in practice.
  • Scaling: While the theoretical framework is general, the experiments in this paper were limited to 1D synthetic signals. Applying this to high-dimensional real-world data like video or audio remains a significant next step for the research.

Summary updated

BibTeX
@misc{lacoste2017deep,
  author = {Alexandre Lacoste and Thomas Boquet and Negar Rostamzadeh and Boris N. Oreshkin and Wonchang Chung and David Krueger},
  title = {{Deep Prior}},
  year = {2017},
  eprint = {1712.05016},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.05016},
}
Figure