Martingale Posterior Neural Processes

Hyungi Lee, Eunggu Yun, Giung Nam, Edwin Fong, Juho Lee

TL;DR

Martingale Posterior Neural Processes (MPNP) introduce a more flexible, data-driven way to handle uncertainty in Neural Processes by leveraging martingale posteriors. Instead of relying on rigid assumptions like Gaussian latent variables, the model "imagines" potential future data points (pseudo-contexts) to quantify functional uncertainty, leading to state-of-the-art performance in regression, image completion, and Bayesian optimization.

The Bottleneck in Neural Processes

Neural Processes (NPs) are a family of models that learn to represent stochastic processes—essentially mappings from inputs to outputs that include a sense of "uncertainty." For example, if you have three data points on a curve, an NP shouldn't just give you one line; it should give you a distribution of possible lines that could fit those points.

The traditional way to handle this "epistemic uncertainty" is to use a global latent variable, usually assumed to follow a Gaussian distribution. However, this is a major bottleneck: real-world uncertainty is rarely perfectly Gaussian. While recent methods like the Bootstrap Neural Process (BNP) tried to move toward more data-driven uncertainty, they still have limitations in how they represent the underlying population distribution. This paper seeks a more theoretically grounded and flexible alternative to Bayesian inference for NPs.

Introducing Martingale Posterior Neural Processes

To overcome these limitations, the authors introduce Martingale Posterior Neural Processes (MPNP). The core idea is based on the "martingale posterior," a recent alternative to traditional Bayesian inference.

Instead of specifying a prior and a likelihood, a martingale posterior specifies a joint predictive distribution for future, unseen data.

MPNP Architecture

Here is how it works in the context of MPNP:

  1. Pseudo-Context Generation: Given a set of observed data (the context), the model uses an exchangeable generative neural network—specifically an Induced Self-Attention Block (ISAB)—to generate "pseudo-context" points. These represent plausible future observations.
  2. Functional Uncertainty: By combining the real observations with these randomly generated pseudo-observations, the model creates a variety of possible "empirical densities." Each set of pseudo-observations leads to a slightly different predicted function. The variation across these functions represents the model's uncertainty.
  3. Feature-Space Generation: To handle high-dimensional data (like images), the authors propose generating pseudo-observations in the latent feature space rather than the raw input space. This makes the generation process much more efficient and stable.
  4. Amortized Training: To keep the model fast, they use an encoder-decoder structure that "amortizes" the cost of finding the best function parameters, allowing for quick predictions at test time.

Key Insights

  • Predictive vs. Parametric: The shift from defining uncertainty over parameters (Bayesian) to defining it over future data (Martingale) allows the model to be much more flexible. It doesn't have to "guess" a prior; it learns the structure of uncertainty directly from the meta-training data.
  • The Power of "Imagination": The model essentially asks, "If I saw 50 more points like these, what would they look like?" By answering that question many times, it naturally discovers where it is certain and where it isn't.
  • Efficiency via Latent Features: Generating raw pixels is hard. Generating the meaningful features of those pixels is much easier. This "feature generation" approach was a key factor in making the model work for complex data like CelebA.

Experimental Results

The authors evaluated MPNP and its attentive variant (MPANP) on several benchmarks, including 1D synthetic regression, 2D image completion (MNIST, SVHN, CelebA), Bayesian optimization, and real-world time series.

1D Regression Performance
  • Superior Accuracy: In 1D regression, MPNP consistently achieved higher log-likelihoods than standard NPs and Bootstrap NPs (BNP), particularly demonstrating strong data efficiency even when the amount of training data was limited.
  • Better Uncertainty in Images: For image completion, MPANP produced more perceptually reasonable and diverse completions for complex images compared to baselines.
  • Optimization Efficiency: In Bayesian optimization tasks, MPNP reached the global optimum with fewer iterations (lower "regret") than other Neural Process variants.

Limitations and Future Work

While powerful, MPNP has some limitations. The authors noted that when there is a significant mismatch between the training data (simulated) and the test data (real-world), the performance gain of MPNP is less pronounced. Additionally, in some "direct input generation" experiments, the generator sometimes learned to create "meaningless" inputs that the decoder simply ignored. While feature-space generation solved this, it remains a challenge for direct input models. Future work may explore more complex generative architectures for the pseudo-context to capture even more intricate uncertainty structures.

Summary updated

BibTeX
@inproceedings{lee2023martingale,
  author = {Hyungi Lee and Eunggu Yun and Giung Nam and Edwin Fong and Juho Lee},
  title = {{Martingale Posterior Neural Processes}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=-9PVqZ-IR_},
}
Figure