Uncertainty in Neural Processes

Saeid Naderiparizi, Kenny Chiu, Benjamin Bloem-Reddy, Frank Wood

TL;DR

This paper shifts the focus of Neural Processes (NPs) back to the low-data regime, addressing how models handle extreme uncertainty when given very little conditioning data. By introducing max pooling and Semi-Implicit Variational Inference (SIVI), the authors create a novel NP architecture that achieves well-calibrated uncertainty—producing diverse, realistic samples when context is scarce, while naturally contracting uncertainty as more data arrives.

What Problem Does This Paper Address?

Conditional generative models excel at filling in missing data, such as completing an image from a few visible pixels (in-painting). Recent advances like Attentive Neural Processes (ANPs) have focused heavily on maximizing reconstruction quality when the amount of conditioning data (the "context set") is large.

However, the authors argue that this focus neglects a fundamental requirement of probabilistic modeling: calibrated uncertainty in the low-data regime. If you only see three pixels of a handwritten digit, those pixels might be compatible with a 0, a 2, or a 3. A good model shouldn't just guess one sharp image or produce a blurry average of all possibilities; it should be capable of generating diverse, distinct, and realistic samples across all valid possibilities. Existing methods fail here, either collapsing to a single output or producing unrealistic, un-diverse samples.

Methods

The authors investigate the mechanics of posterior contraction—how a model's uncertainty shrinks as it receives more information—and propose two key modifications to standard Neural Processes:

  1. Max Pooling Over Mean Pooling: Standard NPs aggregate context points using mean pooling to maintain permutation invariance. The authors replace this with max pooling. They demonstrate that max pooling simplifies the neural network's task of learning uncertainty, as the pooled embedding space naturally scales with the presence of highly informative pixels.
  2. Semi-Implicit Variational Inference (SIVI): To capture the multi-modal nature of uncertainty when data is scarce (e.g., the digit could be a 3 or a 8), the approximate posterior needs to be highly flexible. The authors employ SIVI to define a hierarchical, mixture-based variational distribution $q_\phi(z|x,y)$, allowing the model to represent complex, multi-modal latent spaces.
Figure 3: Our modified neural process architecture. The encoder produces a permutation invariant embedding that parameterizes a stochastic task encoding z as follows: features extracted from each element of the context set using neural net hφ are pooled, then passed to other neural networks ρφ and ηφ that control the distribution over task embedding z. The decoder uses such a task encoding along with embeddings of target inputs to produce the output distribution for each target input.

Datasets

The architecture was trained and evaluated on two standard image completion benchmarks:

  • MNIST: 10,000 test images of handwritten digits.
  • CelebA: 19,962 test images of celebrity faces.

In these tasks, the models are fed a random subset of pixels (ranging from a single pixel to the entire image) as the context set and must predict the remaining pixels.

Key Insights and Ideas

  • Informative Pixels Drive Contraction: Posterior contraction isn't driven merely by the number of pixels observed, but by the information content of specific pixels. A few strategically placed pixels can instantly rule out certain digit classes.
  • The Geometry of Pooling: Max pooling creates a non-decreasing embedding space as informative pixels are added. This makes mapping the embedding to a decreasing entropy function mathematically straightforward for the network. Mean pooling, conversely, forces the network to approximate a complex convex function where the minimum sits at the full-image embedding—a much harder optimization problem.
  • The Deterministic Path Trade-off: While adding a deterministic path (as seen in ANPs) helps generate ultra-sharp images in high-context settings, it actively harms sample diversity in low-context settings by causing the model to underestimate variance.

Key Results

The proposed NP+SIVI with max pooling approach demonstrates significant improvements both qualitatively and quantitatively in low-data scenarios.

  • Qualitative Realism and Diversity: As shown in the image completion tasks, when given very few context pixels, the authors' method generates sharp, distinct, and highly varied alternative digits/faces that are all perfectly consistent with the context. In contrast, standard NPs yield blurry images, and ANPs suffer from severe sample diversity collapse.
Figure 1: Representative image in-painting results for CelebA and MNIST. From left to right, neural process (NP) (Garnelo et al., 2018b), attentive neural process (ANP) (Kim et al., 2018), and ours. Top rows show context sets of given pixels, ranging from very few pixels to all pixels. In each panel the ground truth image (all pixels) is in the upper right corner. The rows correspond to i.i.d. samples from the corresponding image completion model given only the pixels shown in the top row of the same column. Our neural process with semi-implicit variational inference and max pooling produces results with the following characteristics: 1) the images generated with a small amount of contextual information are “sharper” and more face- and digit-like than NP results and 2) there is greater sample diversity across the i.i.d. samples than those from the ANP. This kind of “calibrated uncertainty” is what we target throughout.
  • Quantitative Log-Likelihood: The models utilizing max pooling achieved higher predictive held-out test log-likelihoods than their mean-pooled counterparts:
  • MNIST: 1.07 ± 0.11 (NP+max) vs. 0.96 ± 0.12 (NP+mean)
  • CelebA: 3.17 ± 0.30 (NP+max) vs. 2.91 ± 0.30 (NP+mean)
  • Inception Scores: Using domain-specific classifiers as a proxy for the Inception Score, the max-pooling architectures demonstrated vastly superior sample diversity scores in low-context settings.

Limitations and Future Work

While the proposed method dominates the low-data regime, the authors acknowledge that ANPs still produce sharper images when the context set is very large. In high-data regimes, sample diversity matters less than exact reconstruction, and attention mechanisms excel at this.

Additionally, evaluating posterior calibration quantitatively remains an open challenge in generative modeling. The modified Inception Scores used in the paper serve as a helpful proxy but are not a perfect metric for non-ImageNet domains. Future work includes developing more robust metrics for evaluating calibrated uncertainty.

Summary updated

BibTeX
@misc{naderiparizi2020uncertainty,
  author = {Saeid Naderiparizi and Kenny Chiu and Benjamin Bloem-Reddy and Frank Wood},
  title = {{Uncertainty in Neural Processes}},
  year = {2020},
  eprint = {2010.03753},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.03753},
}
Figure