Bootstrapping neural processes

Juho Lee, Yoonho Lee, Jungtaek Kim, Eunho Yang, Sung Ju Hwang, Yee Whye Teh

Overview

Bootstrapping Neural Processes (BNP) introduces a novel way to handle uncertainty in neural models by replacing rigid Gaussian latent variables with a "residual bootstrap" resampling technique. This allows the model to learn functional uncertainty directly from data, making it significantly more robust and reliable when encountering out-of-distribution data—a common issue known as model-data mismatch.

The Bottleneck in Standard Neural Processes

Neural Processes (NPs) are a powerful family of models that combine the flexibility of neural networks with the probabilistic benefits of stochastic processes, such as Gaussian Processes. They learn to map a set of "context" observations to a predictive distribution over a target space.

However, standard NPs have a structural bottleneck: they typically model "functional uncertainty"—the global uncertainty about the shape of the underlying function—using a single Gaussian latent variable. This assumption is often too restrictive. If the test data looks significantly different from the training data, the Gaussian prior can fail to capture the true uncertainty, leading to overconfident and inaccurate predictions.

The Bootstrapping Solution

To overcome this, the authors propose the Bootstrapping Neural Process (BNP) and its attentive counterpart, BANP. Instead of relying on a fixed parametric distribution for uncertainty, they utilize the bootstrap, a classic frequentist technique that estimates uncertainty by resampling the original data.

The core mechanism is a multi-step residual bootstrap process:

  1. Initial Fit: A base NP model fits the original context data to get initial predictions and residuals (the difference between the data and the prediction).
  2. Residual Resampling: These residuals are resampled with replacement and added back to the predictions to create multiple "synthetic" bootstrap context sets.
  3. Encoding with Adaptation: Both the original context and the bootstrapped contexts are passed through an encoder. A novel adaptation layer then combines these representations.
  4. Ensemble Prediction: The decoder produces predictions for each bootstrap sample, which are then aggregated into a final ensembled distribution.
Architecture comparison between standard Neural Processes (left) and the proposed Bootstrapping Neural Process (right).

To ensure the model learns effectively, the authors use a dual training objective that simultaneously optimizes the base model (to produce good residuals) and the full bootstrapped model.

Key Insights

  • The "Data-Driven" Philosophy: NPs were originally designed to be "data-driven" stochastic processes. By using the bootstrap, BNP pushes this philosophy further, letting the data itself dictate the shape of the functional uncertainty rather than forcing it into a Gaussian mold.
  • Robustness through Residuals: When the model encounters a data distribution it hasn't seen before, its initial predictions will be poor, leading to larger residuals. These large residuals are then reflected in the bootstrap samples, naturally forcing the model to produce wider, more conservative uncertainty estimates.
  • Efficiency via Parallelism: Unlike some ensemble methods that require training multiple independent models, BNP's bootstrap samples can be processed in parallel as a single tensor batch through the neural network, making it computationally efficient.

Performance and Results

The authors evaluated BNP and BANP across several challenging domains, including 1D synthetic regression, Bayesian optimization, image completion, and predator-prey modeling. BNP and BANP consistently outperformed standard NPs and even Deep Ensembles (which use 5x more parameters) in mismatch scenarios.

In 1D regression tasks, models were trained on functions generated by one type of kernel (e.g., RBF) and tested on others (like data with heavy-tailed $t$-noise) to simulate model-data mismatch. BANP maintained high target log-likelihoods while standard ANP's performance plummeted, successfully producing wider, more robust uncertainty estimates.

Comparison of ANP and BANP on 1D regression with t-noise. BANP produces wider, more robust uncertainty estimates in the presence of model-data mismatch.

Similar robustness was observed in real-world datasets and image completion tasks, where BANP successfully recovered underlying shapes with much higher clarity under noise compared to standard ANPs.

Limitations and Future Work

  • Regression Focus: This specific implementation relies on residual bootstrapping, which is designed for regression. Applying this to classification tasks would require a different resampling strategy (like paired bootstrap), which the authors noted performed slightly worse in preliminary tests.
  • Training Complexity: The model requires balancing the training of the base path and the bootstrap path, adding a layer of complexity to the optimization process.
  • Future Directions: The authors suggest that "learning to resample"—developing a neural network that learns the optimal way to generate bootstrap datasets—could be a promising next step for even more flexible uncertainty modeling.

Summary updated

BibTeX
@inproceedings{lee2020bootstrapping,
  author = {Juho Lee and Yoonho Lee and Jungtaek Kim and Eunho Yang and Sung Ju Hwang and Yee Whye Teh},
  title = {{Bootstrapping neural processes}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=y_AkFeKGB_h},
}
Figure