Papers
Topics
Authors
Recent
Search
2000 character limit reached

Distance-informed Neural Process (DNP)

Updated 9 July 2026
  • Distance-informed Neural Process (DNP) is a neural process variant that augments standard NPs with global and target-specific local latent variables to capture both task-level and distance-sensitive uncertainty.
  • It employs a bi-Lipschitz-regularized latent space and Laplace cross-attention to preserve input geometry, ensuring that nearby context points exert more influence over predictions.
  • Empirical results demonstrate significant gains in predictive performance, calibration, and out-of-distribution detection across regression and classification tasks.

Distance-informed Neural Process (DNP) is a Neural Process variant that improves uncertainty estimation by combining a global latent variable with a distance-aware local latent variable. It was proposed to address limitations of standard Neural Processes in uncertainty calibration, local dependency modeling, and out-of-distribution (OOD) behavior, particularly in settings where a single global latent summary is too coarse to reflect target-specific similarity to context observations. DNP constructs its local path in a bi-Lipschitz-regularized latent space and uses Laplace cross-attention to define a target-specific local prior, with reported gains in predictive performance, calibration, and OOD detection across regression and classification tasks (Venkataramanan et al., 26 Aug 2025).

1. Origins in the Neural Process family

Neural Processes (NPs) were introduced as neural latent-variable models that learn distributions over functions while combining properties associated with Gaussian Processes (GPs) and neural networks. In the canonical formulation, training proceeds over tasks or functions sampled from an underlying distribution, each episode being split into a context set and a target set. A standard NP encodes each context pair independently, aggregates the resulting representations with a permutation-invariant operation, and decodes target predictions conditioned on the aggregate representation and, in the latent formulation, a global latent variable zz (Garnelo et al., 2018).

The basic NP stochastic-process viewpoint is expressed by a random function F:XYF:\mathcal{X}\to\mathcal{Y}, finite-dimensional marginals ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n}), and architectural constraints motivated by exchangeability and consistency. In practice, the context representation is often formed by mean aggregation,

r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,

which enforces permutation invariance and supports variable-size context sets (Garnelo et al., 2018).

This architecture yields fast amortized inference, but it also creates the central limitation that motivates DNP. Vanilla NP compresses all context information into a single global representation and typically a single global latent variable, so it has no explicit mechanism by which nearby context points matter more than distant ones for a given target. The original NP formulation therefore has a global aggregation bottleneck, no target-specific context retrieval, weak locality, and no explicit distance-based influence function between context and target inputs. These properties are directly relevant because DNP is designed to reintroduce a GP-like dependence of uncertainty on similarity to observed data (Garnelo et al., 2018).

2. Core idea and model structure

DNP augments the standard NP latent structure with two latent paths. The first is a global latent path that learns a global latent variable zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z} and captures task-level or function-level uncertainty. The second is a local latent path that learns a target-specific latent variable ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}, depends on the target input xt\mathbf{x}_t and the context set, and is constructed in a geometry-aware latent space (Venkataramanan et al., 26 Aug 2025).

The model uses the context set in two distinct ways. In the global path, context pairs (xc,yc)(\mathbf{x}_c,\mathbf{y}_c) are encoded and mean-aggregated into a summary sC\mathbf{s}_C, which parameterizes the global prior. In the local path, context inputs are mapped to distance-aware embeddings uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c), which serve as keys in cross-attention; context pairs also provide per-context Gaussian parameters that are combined into the target-specific local prior. For each target input F:XYF:\mathcal{X}\to\mathcal{Y}0, DNP computes a target embedding F:XYF:\mathcal{X}\to\mathcal{Y}1, evaluates target-context similarities through cross-attention, and uses the resulting weights to define the local prior over F:XYF:\mathcal{X}\to\mathcal{Y}2 (Venkataramanan et al., 26 Aug 2025).

The model is explicitly positioned relative to earlier NP-family variants. The appendix comparison distinguishes: CNP as a deterministic global representation with no latent uncertainty; NP as a stochastic global latent only; AttnNP as a stochastic global latent plus a deterministic local target-specific representation from attention; DSVNP as a stochastic global plus stochastic local latent without explicit distance preservation; and DNP as a stochastic global plus stochastic local latent with the local path constructed in a geometry-aware, distance-preserving latent space (Venkataramanan et al., 26 Aug 2025).

This architecture targets two limitations of standard NPs. First, a single global latent variable does not explicitly encode how a target relates to nearby context inputs. Second, standard NPs lack an explicit distance-based inductive bias of the kind that makes GP uncertainty naturally increase away from observed data. DNP therefore combines global task uncertainty with distance-aware local uncertainty.

3. Probabilistic formulation

The global prior is parameterized from the mean-aggregated context summary: F:XYF:\mathcal{X}\to\mathcal{Y}3

For the local path, inputs are embedded as

F:XYF:\mathcal{X}\to\mathcal{Y}4

Target-context similarity is then computed using Laplace attention: F:XYF:\mathcal{X}\to\mathcal{Y}5

The target-specific local prior is written as

F:XYF:\mathcal{X}\to\mathcal{Y}6

The source equation is unusual in its covariance construction, but this is the formula reported in the paper (Venkataramanan et al., 26 Aug 2025).

The intended context-conditioned generative model is

F:XYF:\mathcal{X}\to\mathcal{Y}7

Under this factorization, outputs are conditionally independent across F:XYF:\mathcal{X}\to\mathcal{Y}8 given F:XYF:\mathcal{X}\to\mathcal{Y}9, ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})0, and ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})1; the global latent is shared across all points; and local latents factorize across points under their priors (Venkataramanan et al., 26 Aug 2025).

The variational posteriors are

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})2

and

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})3

The appendix assumes a factorized variational posterior,

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})4

The main ELBO is

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})5

At test time, the posterior predictive distribution is

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})6

A formal claim in the paper, stated as Proposition 1, is that the generative construction defines an exchangeable stochastic process by satisfying exchangeability and marginal consistency, as required by the Kolmogorov Extension Theorem (Venkataramanan et al., 26 Aug 2025).

4. Geometry preservation and the meaning of “distance-informed”

The defining technical device in DNP is the distance-preserving latent space used by the local path. The embedding network ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})7 is regularized to satisfy an approximate bi-Lipschitz condition: ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})8 This condition is intended to prevent two failure modes: over-sensitivity, in which small input changes become large latent changes, and feature collapse, in which distinct inputs are mapped too close together (Venkataramanan et al., 26 Aug 2025).

The layerwise regularizer is

ρx1:n(y1:n)\rho_{x_{1:n}}(y_{1:n})9

where r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,0 and r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,1 are the smallest and largest singular values of the layer weight matrix r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,2. The final training objective is reported as

r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,3

Because the paper writes the ELBO as a quantity to maximize but then writes the final objective as a sum, the sign convention is not fully clarified in the text (Venkataramanan et al., 26 Aug 2025).

The paper emphasizes that this is stronger than ordinary spectral normalization because it controls both upper and lower distortion. Activations are required to be bi-Lipschitz-compatible, and the implementation uses activations such as Leaky ReLU. Exact SVD is avoided; instead, the method uses LOBPCG to approximate extreme eigenvalues of r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,4 or r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,5, with per-layer cost

r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,6

where r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,7 (Venkataramanan et al., 26 Aug 2025).

The distance-informed uncertainty mechanism is GP-like in intent. The global latent captures broad task ambiguity, while the local latent injects target-dependent uncertainty based on distance to context points. The paper states that when a target is far from the context set, the attention weights tend toward zero and the local prior approaches a standard normal or non-informative prior; this is the intended mechanism for higher uncertainty in unsupported regions. The paper says a proof is in the appendix, but that proof is not present in the provided text (Venkataramanan et al., 26 Aug 2025).

This use of distance distinguishes DNP from attention mechanisms whose learned embeddings may distort geometry. In DNP, attention weights are explicitly distance-based and are meant to operate in a latent space where relative distances are preserved closely enough to remain meaningful.

5. Learning procedure, computational profile, and empirical results

A training episode begins from a target set and a subset selected as context. The model first encodes context pairs for the global path and mean-aggregates them into r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,8, defining the global prior. It then encodes target pairs into r=1ni=1nri,r = \frac{1}{n}\sum_{i=1}^n r_i,9, defining the global posterior. For the local path, it embeds all context and target inputs as zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}0 and zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}1, computes Laplace attention weights zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}2, forms the local prior, forms the local posterior using zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}3, samples latents, and decodes target predictions. The appendix states that the decoder uses the concatenation of zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}4, zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}5, and zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}6; regression uses a Gaussian output and classification a categorical output (Venkataramanan et al., 26 Aug 2025).

For regression, the reported architecture uses a 3-layer MLP for the global latent encoder, a shared 2-layer MLP backbone from zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}7 to a hidden representation for the local encoder, a projection to zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}8, local prior and posterior parameters from hidden representation concatenated with zGRdz\mathbf{z}_G \in \mathbb{R}^{d_z}9, and a 3-layer MLP decoder on ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}0. For classification, the paper uses VGG-16 as feature extractor, with VGG features and one-hot labels in global and local latent parameterization (Venkataramanan et al., 26 Aug 2025).

The appendix reports prediction-time complexity

ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}1

for DNP, compared with

ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}2

for AttnNP and DSVNP because DNP avoids self-attention over the ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}3 context points and uses only cross-attention. Training adds the LOBPCG cost for singular value estimation (Venkataramanan et al., 26 Aug 2025).

Empirically, the paper reports strong performance on 1D synthetic regression from GP priors. On target-set evaluation, DNP is best across RBF, Matérn-ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}4, and Periodic kernels, with RBF results of LL ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}5 and ECE ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}6, Matérn-ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}7 results of LL ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}8 and ECE ztRdz\mathbf{z}_t \in \mathbb{R}^{d_z}9, and Periodic results of LL xt\mathbf{x}_t0 and ECE xt\mathbf{x}_t1. On the corresponding context-set results, DNP reports RBF LL xt\mathbf{x}_t2, ECE xt\mathbf{x}_t3; Matérn LL xt\mathbf{x}_t4, ECE xt\mathbf{x}_t5; and Periodic LL xt\mathbf{x}_t6, ECE xt\mathbf{x}_t7. Under 5\%, 10\%, and 15\% noise on RBF functions, DNP consistently gives the highest LL and usually the best ECE (Venkataramanan et al., 26 Aug 2025).

On synthetic-to-real regression for predator-prey dynamics, trained on simulated Lotka–Volterra data and tested on real hare-lynx data, DNP reports LL xt\mathbf{x}_t8 on simulated data and xt\mathbf{x}_t9 on real data, outperforming DSVNP (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)0, AttnNP (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)1, NP (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)2, CNP (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)3, and exact GP (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)4. On multi-output real-world regression, DNP reports SARCOS MSE (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)5, ECE (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)6; Water Quality MSE (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)7, ECE (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)8; and SCM20D MSE (xc,yc)(\mathbf{x}_c,\mathbf{y}_c)9, ECE sC\mathbf{s}_C0. On Water Quality, AttnNP has slightly better MSE sC\mathbf{s}_C1, but DNP has the best ECE (Venkataramanan et al., 26 Aug 2025).

For image classification and OOD detection, DNP is evaluated with CIFAR-10 and CIFAR-100 as in-distribution datasets. With CIFAR-10 as ID, it reports accuracy sC\mathbf{s}_C2, ECE sC\mathbf{s}_C3, and latency sC\mathbf{s}_C4 ms; OOD AUPR is sC\mathbf{s}_C5 for SVHN, sC\mathbf{s}_C6 for CIFAR100, and sC\mathbf{s}_C7 for TinyImageNet. With CIFAR-100 as ID, it reports accuracy sC\mathbf{s}_C8, ECE sC\mathbf{s}_C9, and OOD AUPR uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)0 for SVHN, uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)1 for CIFAR10, and uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)2 for TinyImageNet. The paper characterizes the principal gain here as calibration and OOD detection, with accuracy roughly competitive rather than uniformly best (Venkataramanan et al., 26 Aug 2025).

The ablation studies support the architectural claims. On CIFAR10 vs CIFAR100, a model without regularization reports accuracy uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)3, ECE uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)4, AUPR uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)5; bi-Lipschitz regularization yields accuracy uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)6, ECE uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)7, AUPR uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)8, outperforming 2-sided gradient penalty, orthogonal regularization, and spectral normalization in ECE and AUPR. A global-latent-only variant reports accuracy uc=h(xc)\mathbf{u}_c = h(\mathbf{x}_c)9, ECE F:XYF:\mathcal{X}\to\mathcal{Y}00, AUPR F:XYF:\mathcal{X}\to\mathcal{Y}01, while a local-latent-only variant reports accuracy F:XYF:\mathcal{X}\to\mathcal{Y}02, ECE F:XYF:\mathcal{X}\to\mathcal{Y}03, AUPR F:XYF:\mathcal{X}\to\mathcal{Y}04, and the full model gives the best overall balance. Laplace attention outperforms dot-product attention, and the best reported settings include F:XYF:\mathcal{X}\to\mathcal{Y}05, F:XYF:\mathcal{X}\to\mathcal{Y}06, and F:XYF:\mathcal{X}\to\mathcal{Y}07 for classification (Venkataramanan et al., 26 Aug 2025).

DNP belongs to a broader line of work that attempts to restore some form of geometry or distance sensitivity to NP-style models. The original NP formulation lacked an explicit mechanism ensuring that nearby context points influence a target more strongly than distant ones, because dependence on input geometry was learned only implicitly through encoder and decoder parameterizations (Garnelo et al., 2018). DNP addresses this at the representation and prior-construction level by introducing a target-specific local latent variable whose prior depends on target-context distances in a bi-Lipschitz-regularized latent space (Venkataramanan et al., 26 Aug 2025).

A distinct but closely related route appears in “Wasserstein Neural Processes,” which preserves the permutation-invariant conditional-process architecture but replaces likelihood/KL-based training with sliced Wasserstein distance between generated and observed target outputs. In that formulation, the distance is not imposed through a geometry-preserving local latent structure; it is imposed through the learning signal itself, at the empirical output-distribution level. This makes Wasserstein Neural Processes a concrete example of a distance-informed NP in an objective-level sense, whereas DNP is distance-informed in a latent-structure and similarity-mechanism sense (Carr et al., 2019).

This distinction is important because “distance-informed” does not denote a single design pattern. In WNP, the key distance is an optimal-transport discrepancy between empirical predictive distributions. In DNP, the key distance is a target-context similarity computed in a latent space constrained to preserve input geometry. A plausible implication is that these approaches address different failure modes: WNP is motivated by misspecified or intractable likelihoods and disjoint support, while DNP is motivated by weak local dependency modeling, poor calibration, and OOD overconfidence (Carr et al., 2019).

The limitations of DNP are explicitly stated or directly implied in the paper. The authors note that DNP can still be occasionally overconfident because the bi-Lipschitz constraint is only approximate. Singular value estimation via LOBPCG adds training overhead. Performance depends on F:XYF:\mathcal{X}\to\mathcal{Y}08, F:XYF:\mathcal{X}\to\mathcal{Y}09, and F:XYF:\mathcal{X}\to\mathcal{Y}10, and too large F:XYF:\mathcal{X}\to\mathcal{Y}11 or too tight bounds hurt performance by reducing flexibility. Some theoretical details are incomplete in the provided text, notably the appendix proof concerning the local prior becoming non-informative far from context. DNP is also not uniformly best on every raw predictive metric, as illustrated by the Water Quality dataset where AttnNP attains slightly better MSE while DNP retains the best calibration (Venkataramanan et al., 26 Aug 2025).

In practical terms, DNP can be understood as an NP-family model that restores a more GP-like notion of proximity to observed support without abandoning amortized inference or permutation-invariant set processing. Its reported contribution is not merely the addition of another latent variable, but the combination of global task uncertainty, target-specific local uncertainty, and geometry-preserving regularization into a single stochastic-process model.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (3)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Distance-informed Neural Process (DNP).