TL;DR
Neural Diffusion Processes (NDPs) bring the power of generative diffusion models to the world of stochastic processes. By learning to denoise function values at arbitrary input locations, NDPs can model complex, non-Gaussian distributions over functions that surpass the flexibility of Gaussian Processes (GPs) and the sample quality of Neural Processes (NPs).
The Problem: Modeling Distributions Over Functions
In machine learning, we often want to model a "distribution over functions"—for example, predicting not just a single line through data points, but a range of possible curves that reflect our uncertainty.
Currently, researchers rely on two main tools, both with significant drawbacks:
- Gaussian Processes (GPs): These are mathematically elegant and provide great uncertainty estimates, but they are strictly limited to Gaussian distributions. They struggle to model functions with sudden jumps (discontinuities) or complex, non-linear priors in high dimensions.
- Neural Processes (NPs): These use neural networks to be more flexible than GPs, but they often produce "jittery" or inconsistent samples and lack a tractable way to measure how well the model fits the data.
The authors identify a gap: while Diffusion Models have revolutionized image and audio generation by learning to reverse a noise process, they haven't been successfully adapted to model the abstract "function space" required for Bayesian inference and regression.
Methods: The Neural Diffusion Process
The core innovation is the Neural Diffusion Process (NDP). Instead of diffusing a fixed grid of pixels (like an image), the NDP diffuses the values ($y$) of a function at a set of input locations ($x$).
Key technical components include:
- Forward/Reverse Process: The model gradually adds Gaussian noise to function values while keeping the input locations fixed. It then trains a neural network to "denoise" these values, effectively learning the underlying distribution of functions.
- Bi-Dimensional Attention Block: This is the "secret sauce" of the architecture. It uses two types of Multi-Head Self-Attention (MHSA) in parallel: one across the data points (ensuring the model is "exchangeable," meaning the order of points doesn't matter) and one across the input dimensions (ensuring the model is invariant to the order of features).
- Conditional Sampling: To perform regression, the authors adapt the RePAINT algorithm. This allows the model to generate new function samples that are strictly "conditioned" on observed data points.
- Joint Diffusion: The authors also propose a version that diffuses both inputs ($x$) and outputs ($y$) simultaneously, which they use for a novel global optimization strategy.
Key Insights and Capabilities
- Implicit Hyperparameter Marginalization: Usually, when using a GP, you have to pick a specific "lengthscale" (how wiggly the function is). NDPs don't need this; they naturally learn to sample from the entire distribution of possible hyperparameters they saw during training.
- Breaking the Gaussian Ceiling: Unlike GPs, NDPs can model multimodal distributions. For a step function, an NDP can correctly predict that the "jump" could happen in multiple places, whereas a GP would just produce a blurry, average line.
- Input Agnosticity: Because the model uses attention rather than fixed layers, a single trained NDP can handle datasets of any size and any number of input dimensions without retraining.
Results
The authors evaluated NDPs across several challenging regimes, including synthetic GP data, step functions, image regression (MNIST and CelebA), and standard Bayesian Optimization benchmarks.
- Superior to NPs: In synthetic regression tasks, NDPs significantly outperformed various Neural Process variants (GNP, ConvNP, ANP) in terms of log-likelihood.
- Scaling to High Dimensions: While GPs are hard to beat in 1D, NDPs became the clear winner as the input dimensionality increased ($D=2$ and $D=3$), maintaining high performance where other neural models struggled.
- Image "Hallucination": When given only the top half of an MNIST digit or a few random pixels of a face, the NDP could generate multiple plausible, sharp completions, demonstrating its ability to learn complex functional priors.
- Optimization: In Bayesian Optimization, NDPs matched the performance of Gaussian Process Regression (the gold standard) but offered a more flexible way to seek out global minima by diffusing the input locations directly.
Limitations and Future Work
- Inference Speed: Like all diffusion models, NDPs require multiple iterations (steps) to generate a sample. This makes them slower at test time than "one-shot" models like standard NPs.
- Out-of-Distribution Inputs: The authors note that, like most neural networks, NDPs perform poorly if the test input locations ($x$) are far outside the range of the training data.
- Strict Consistency: While NDPs approximate the properties of a stochastic process very well, they do not mathematically guarantee consistency (the Kolmogorov Extension Theorem) in the way a GP does. Future work could look into "wiring" this constraint more deeply into the architecture.
Summary updated