Abstract
Neural Processes (NPs) have emerged as a powerful framework for uncertainty-aware meta-learning. However, traditional NP architectures are constrained by "dimension-lock," requiring fixed input and output dimensions defined at training time. This paper introduces Dimension Agnostic Neural Processes (DANP), a novel architecture that leverages a Dimension Aggregator Block (DAB) to handle datasets of arbitrary dimensionality. By treating input features as sets and employing self-attention with positional encodings, DANP achieves zero-shot generalization across varying dimensions. Experimental results on synthetic Gaussian Processes, image completion, and real-world hyperparameter optimization benchmarks demonstrate that DANP not only matches but often exceeds the performance of dimension-specific specialized models.
Introduction
In the field of meta-learning, the objective is to develop models capable of inferring underlying functions from a limited "context set" to make accurate predictions on new target points. Neural Processes (NPs) are particularly effective for this task as they combine the flexibility of deep neural networks with the robust uncertainty quantification of stochastic processes.
Despite their strengths, standard NPs suffer from a major limitation: they are typically locked into specific input and output dimensions. A model trained for 1D regression cannot be applied to 2D spatial data or high-dimensional optimization tasks without significant architectural modification and retraining. This lack of flexibility prevents NPs from serving as "general regressors" or foundation models for regression tasks. DANP addresses this by introducing a dimension-agnostic encoding mechanism.
Methodology
The authors propose two primary innovations to break the dimensionality barrier: the Dimension Aggregator Block (DAB) and a hybrid latent-deterministic path architecture.
The Dimension Aggregator Block (DAB)
The core innovation of DANP is treating the dimensions of a single data point as a set rather than a fixed-length vector. The DAB processes each dimension independently through a learnable linear projection, expanding it into a higher-dimensional representation. To maintain the identity of specific features (e.g., distinguishing latitude from longitude), sine and cosine positional encodings are added. Self-attention is then applied across these dimensions, allowing the model to learn complex feature interactions regardless of their order or quantity. Finally, average pooling collapses these contextualized features into a fixed-size latent representation, enabling the model to ingest data of any dimensionality.
Hybrid Latent-Deterministic Path
Building on the Transformer Neural Process (TNP), DANP incorporates both a deterministic path for precise mapping and a latent path to capture functional uncertainty. This dual-path approach is critical for handling the inherent noise and variability when generalizing across completely different types of tasks and dimensionalities.
Experimental Evaluation
DANP was evaluated against a rigorous "cross-dimensional" suite of tasks:
- Synthetic GP Regression: 1D through 7D Gaussian Process data using various kernels.
- Image and Video Completion: Grayscale EMNIST, RGB CelebA, and CelebA video (where time is a 3rd input dimension).
- Real-World Benchmarks: HPO-B for black-box hyperparameter optimization (2 to 16 dimensions) and MIMIC-III for time-series blood pressure estimation.
Key Results and Insights
Superior Performance and Zero-Shot Generalization
DANP consistently outperformed specialized NP variants (such as TNP, ANP, and CANP) even when those baselines were specifically tuned for the target dimension. For example, on 2D Matern GP tasks, DANP achieved a target log-likelihood of 0.068, surpassing the next best model (TNP at 0.060).
More impressively, DANP demonstrated strong zero-shot generalization. A model trained on 2D, 3D, and 4D data could perform 1D regression immediately without seeing any 1D training examples, achieving a log-likelihood of 0.826—nearly matching models trained specifically on 1D data.
Foundation Model for Regression
In the HPO-B benchmark, a single DANP model pre-trained on low-dimensional tasks outperformed all baselines on 16-dimensional optimization tasks. This suggests that DANP effectively learns the general "concept" of regression, making it a robust surrogate model for complex engineering and optimization problems.
Conclusion and Future Work
DANP represents a significant advancement toward universal regression models. By treating features as sets and utilizing dimension-level attention, it overcomes the traditional constraints of fixed-dimension architectures. While the current work focuses on regression, future research could extend the DAB architecture to classification tasks and explore even more flexible decoders to handle diverse downstream data structures. Although dimension-level attention increases computational complexity, it remains a scalable solution for most practical regression scenarios.
Summary updated