Abstract: Neural Processes (NPs) are appealing due to their ability to perform fast adaptation based on a context set. This set is encoded by a latent variable, which is often assumed to follow a simple distribution. However, in real-word settings, the context set may be drawn from richer distributions having multiple modes, heavy tails, etc. In this work, we provide a framework that allows NPs' latent variable to be given a rich prior defined by a graphical model. These distributional assumptions directly translate into an appropriate aggregation strategy for the context set. Moreover, we describe a message-passing procedure that still allows for end-to-end optimization with stochastic gradients. We demonstrate the generality of our framework by using mixture and Student-t assumptions that yield improvements in function modelling and test-time robustness.
Introduction
Neural Processes (NPs) bridge the gap between neural networks and Gaussian Processes, enabling rapid adaptation to new tasks using a small set of context points. Traditionally, NPs employ a sum-decomposition architecture where individual context points are encoded and then aggregated via a simple mean-pooling operation. While computationally efficient and permutation-invariant, this heuristic approach implicitly assumes a unimodal Gaussian latent space. In practical scenarios, data often exhibits multi-modality or contains significant outliers, where simple averaging fails to capture the underlying complexity. This paper proposes a formal probabilistic framework to replace heuristic aggregation with structured inference in Probabilistic Graphical Models (PGMs).
Methodology
The core innovation lies in reframing context aggregation as Bayesian inference. Instead of mapping context points to a generic vector, the encoder outputs "Neural Sufficient Statistics"—the parameters of a distribution (such as mean and variance). By placing a PGM prior on the latent space, the aggregation rule is mathematically derived rather than heuristically chosen.
The authors introduce two primary variants of this framework:
- Mixture Bayesian Aggregation (mBA): Utilizing a Mixture of Gaussians prior allows the model to maintain multiple hypotheses, effectively handling multi-modal data distributions through a weighted sum of components.
- Robust Bayesian Aggregation (rBA): By adopting a Student-t distribution (implemented via a Gamma prior on precision), the model can automatically downweight outliers. For non-conjugate cases, the authors employ Variational Message Passing (VMP)—a fast, iterative procedure—to refine the latent state during the forward pass.
Crucially, because these operations are fully differentiable, the entire system—PGM and all—can be trained end-to-end using standard stochastic gradients.
Experimental Evaluation
The framework was evaluated on 1D regression tasks and image completion using the EMNIST dataset. For 1D regression, data was generated from Gaussian Processes with RBF and Matern kernels, subjected to varying levels of noise corruption to test robustness.
As shown in the quantitative results, the Robust NP (rBA) significantly outperforms standard NPs and Attentive NPs (NP+SA) in noisy environments, maintaining a much lower Root Mean Square Error (RMSE) as corruption increases. In the EMNIST image completion task, the Mixture NP (mBA with K=5) showed superior out-of-distribution (OOD) robustness on unseen letter classes, achieving a Predictive Log-Likelihood of 0.642, compared to 0.537 for standard Bayesian Aggregation.
Discussion and Conclusion
This work highlights that standard NP aggregation is a simplified case of Bayesian inference. By introducing structured PGMs, the model gains a form of "probabilistic attention" where data points are weighted based on statistical relevance rather than learned black-box mechanisms. This structural approach often results in models with fewer parameters than Attentive NPs while providing superior robustness to noise and outliers.
Future work may extend this to more complex structures like State-Space Models for temporal data or Directed Acyclic Graphs (DAGs) for causal reasoning, further expanding the capabilities of Neural Processes in structured domains.
Summary updated