Deep learning models are notoriously overconfident, often making "certain" predictions even when the input is far outside the training distribution. To address this, researchers typically turn to Bayesian Neural Networks (BNNs) or Gaussian Processes (GPs). However, both approaches have significant drawbacks. BNNs require defining priors over network weights—a notoriously difficult task since we lack an intuitive understanding of how millions of weights interact to form a function. Consequently, these priors are often arbitrary, and posterior inference is computationally brutal. GPs, on the other hand, define priors directly over functions using kernels, which is far more intuitive. Unfortunately, GPs struggle with high-dimensional data like images and scale cubically ($O(N^3)$) with the number of data points, making them impractical for large-scale datasets.
To bridge this gap, researchers have introduced the Functional Neural Process (FNP). The FNP is a new family of stochastic processes that models distributions over functions by building a dependency graph between data points in a latent space. It offers the flexibility and representation power of deep learning alongside the robust uncertainty estimates of Gaussian Processes, all while scaling efficiently without the need for complex weight-space priors.
Methodology: The FNP Pipeline
Unlike previous "Neural Processes" that rely on global latent variables, the FNP focuses on local relationships between data points. The architecture operates through a distinct pipeline:
- Embedding: Every input $x_i$ is mapped to a latent representation $u_i$ using a standard neural network.
- Graph Construction: The model builds a Directed Acyclic Graph (DAG) among a "reference set" of points (conceptually similar to inducing points in sparse GPs) and a bipartite graph connecting this reference set to the rest of the data. This graph explicitly defines which points influence others.
- Local Latents: For each point, the model samples a local latent variable $z_i$. Crucially, the distribution of $z_i$ is conditioned on its "parents" in the dependency graph. This mechanism allows the model to transfer information and uncertainty from known reference points to new query points.
- Prediction: Finally, the target $y_i$ is predicted from the local latent $z_i$.
The authors propose two variants of the model. The standard FNP is conservative, defaulting to a prior when querying points far from the training data, much like a GP. The FNP+ variant adds a direct path from the embedding $u_i$ to the prediction, allowing it to extrapolate more aggressively like a traditional neural network while still maintaining a calibrated sense of uncertainty. The model is trained using Variational Inference, optimizing an Evidence Lower Bound (ELBO) that incorporates a Gumbel-softmax relaxation to handle the discrete nature of the dependency graphs.
Key Results and Insights
The FNP framework introduces a powerful paradigm shift: relational priors are often superior to weight priors. It is significantly easier to encode inductive biases by defining how points should relate to each other (e.g., "nearby points in latent space should have similar outputs") than by guessing the correct prior for a massive weight matrix. Furthermore, because the dependency structure is built around a reference set, the model facilitates mini-batch optimization, allowing it to scale linearly rather than cubically.
In empirical evaluations across 1D regression tasks, MNIST, and CIFAR-10, FNPs demonstrated highly robust uncertainty estimation. In toy tasks, FNPs correctly exhibited high variance in regions where data was missing, whereas standard Neural Networks and Dropout-based models remained overconfident.
Most notably, FNPs achieved superior Out-of-Distribution (OOD) detection. When trained on CIFAR-10 and tested on "alien" datasets like SVHN or iSUN, the FNP models showed much higher predictive entropy (uncertainty) compared to standard BNNs or original Neural Processes. The FNP+ variant generally performed the best overall, successfully combining the high accuracy of deep learning with best-in-class uncertainty metrics.
Limitations and Future Work
While promising, the FNP framework has limitations. In the current iteration, the reference set is chosen randomly. The authors suggest that employing "coresets" or actively learning which points should constitute the reference set could further improve both efficiency and accuracy. Additionally, building and sampling discrete graphs adds architectural complexity to the training pipeline compared to simple feed-forward networks.
Looking forward, there is significant potential in extending FNPs to unsupervised tasks. The learned graph structure could be leveraged to discover better representations or to impute missing labels in semi-supervised learning environments, opening new doors for robust, uncertainty-aware deep learning.
Summary updated