Test Time Scaling for Neural Processes

Hyungi Lee, Moonseok Choi, Hyunsu Kim, Kyunghyun Cho, Rajesh Ranganath, Juho LeeNeurIPS 2025

Introduction

Uncertainty-aware meta-learning aims to rapidly adapt to new tasks while providing reliable uncertainty estimation under limited supervision. Neural Processes (NPs) offer a flexible solution to this by combining the adaptability of neural networks with the principled uncertainty quantification of stochastic processes (like Gaussian Processes). They typically use a global latent variable to capture "functional uncertainty"—the ambiguity of which underlying function best fits a given set of context points.

However, a fundamental flaw limits their effectiveness: the latent variables in NPs are often miscalibrated, leading to overconfident or unreliable predictions. To address this, researchers have introduced Test Time Scaling for Neural Processes (TTSNPs), a framework that uses a learned Sequential Monte Carlo (SMC) approach to refine latent samples at inference time. This significantly improves prediction quality and uncertainty estimation without requiring any modifications to the original pre-trained model.

The Challenge of Amortized Inference

The core issue with standard NPs lies in their reliance on "amortized inference"—a quick, one-shot mapping from data to the latent space. Because the model guesses the latent state once and sticks with it, the resulting variational posteriors are frequently miscalibrated. They tend to be either too deterministic or excessively diffuse, especially when faced with out-of-distribution data.

This miscalibration occurs regardless of the specific loss function (ELBO vs. predictive likelihood) or model structure, suggesting that the amortized inference bottleneck itself is the primary culprit. Consequently, the model suffers from poor generalization and produces untrustworthy confidence intervals.

The TTSNP Framework

The central philosophy behind TTSNP is Test Time Scaling: the concept that spending more computational effort during inference should yield better results, much like how Large Language Models (LLMs) benefit from extended "thinking time" before generating an answer. To achieve this, TTSNP adapts Sequential Monte Carlo Samplers (SMCS) to the NP framework.

The TTSNP architecture featuring the Pseudo Context Generator and learned SMC procedure applied to a frozen pre-trained NP.

Key components of the framework include:

  • Sequential Refinement: Instead of relying on a single forward pass, TTSNP initializes samples from the pre-trained NP's variational posterior and iteratively transforms them into better approximations of the true posterior.
  • Pseudo Context Generator: This is the framework's "secret sauce." Using a permutation-invariant network based on Set Transformers, it generates "pseudo context points" (synthetic future data). This acts as a lookahead mechanism, forcing the model to consider latent states that remain robust under plausible future scenarios.
  • Learned Transition Kernels: Rather than using standard Langevin dynamics, which can be slow to converge, TTSNP trains neural networks to act as "drifts." These learned kernels efficiently guide the particles toward high-probability regions of the true posterior.
  • Zero-Modifications to the Base Model: Crucially, TTSNP refines the latent samples around a frozen, pre-trained NP. Practitioners can boost the performance of existing models without the expensive retraining of the core architecture.

Experimental Highlights

The authors evaluated TTSNP across several regression and image-based tasks, including 1D & 2D Gaussian Processes, EMNIST image completion, Corrupted EMNIST, and CelebA (for cross-domain generalization).

Log-likelihood improvements as the number of samples increases, demonstrating test-time scaling.
  • Log-Likelihood Gains: In 1D GP tasks, TTSNP achieved a target log-likelihood of 0.430, significantly outperforming both the pre-trained baseline (0.352) and standard SMCS (0.405).
  • Faster Convergence: TTSNP achieves higher performance with fewer SMC steps compared to standard samplers. For instance, it reaches better results in just 5 steps than standard SMCS does in 10.
  • Robustness to Shift: On the Corrupted EMNIST task (featuring snow, flip, and brightness corruptions), TTSNP maintained superior performance (Target LL: 0.613) compared to fine-tuning (0.583) and the base model (0.551), proving its effectiveness under covariate shift.
  • Transferable Refinement: A transition kernel trained on one type of data (e.g., Matern kernels) can effectively refine samples for a different type (e.g., Rational Quadratic kernels). This demonstrates that the underlying logic of posterior refinement learned by the model is highly transferable.

Limitations and Future Work

While test-time scaling demonstrably improves quality, it introduces computational overhead. TTSNP requires multiple iterations and gradient evaluations at test time, making it slower than a standard NP forward pass. Additionally, although the base NP is frozen, the transition kernels and pseudo-context generator still require a "meta-training" phase on representative data.

Future work will likely focus on minimizing the computational burden of the SMC procedure and exploring more complex pseudo-data generation strategies to further enhance the diversity and accuracy of the latent samples.

Summary updated

BibTeX
@inproceedings{lee2025test,
  author = {Hyungi Lee and Moonseok Choi and Hyunsu Kim and Kyunghyun Cho and Rajesh Ranganath and Juho Lee},
  title = {{Test Time Scaling for Neural Processes}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=7cirmREfbc},
}
Figure