Amortized Probabilistic Conditioning for Optimization, Simulation and Inference

Paul E. Chang, Nasrulloh Loka, Daolang Huang, Ulpu Remes, Samuel Kaski, Luigi Acerbi · DOI

TL;DR

This paper introduces the Amortized Conditioning Engine (ACE), a novel transformer-based meta-learning model that unifies probabilistic conditioning and prediction across diverse tasks. ACE allows for flexible injection of prior knowledge about latent variables at runtime, enabling more powerful and adaptable solutions for optimization, simulation, and inference problems.

What Problem Does This Paper Address?

Many machine learning tasks, from image classification to Bayesian optimization and simulation-based inference, can be framed as predicting data or latent variables given observed data. While amortized meta-learning methods, particularly those based on transformers, have shown great promise in learning these predictive distributions, existing approaches often struggle to flexibly incorporate user-provided prior information about task-relevant latent variables at inference time. This limitation necessitates task-specific solutions and complex approximations, hindering the development of general-purpose, adaptable models. The authors aim to bridge this gap by developing a unified framework that explicitly models and conditions on interpretable latent variables, allowing for the seamless integration of prior knowledge.

Methods

The core contribution is the Amortized Conditioning Engine (ACE), a transformer-based architecture that extends the "prediction map" formalism. ACE is designed to handle arbitrary combinations of conditioning on observed data and latent variables, and predicting data and latent variables, all in a probabilistic manner.

Key methodological innovations include:

  • Explicit Latent Variable Modeling: ACE explicitly represents and manipulates task-relevant latent variables (e.g., classes in image tasks, optimum location/value in Bayesian optimization, parameters in simulators) alongside observed data.
  • Runtime Prior Injection: ACE allows users to specify probabilistic information (priors) over latent variables at inference time without retraining. This is achieved by converting one-dimensional probability density functions into normalized histograms, which are then incorporated into the model's context.
  • Flexible Embeddings and Output Heads: ACE employs a novel embedding layer that handles both discrete and continuous inputs (data and latents) without tokenization. The output head is also flexible, supporting Gaussian Mixture Models (GMMs) for continuous variables and categorical distributions for discrete variables.
  • Autoregressive Predictions: While ACE can predict marginals independently, it can also generate joint predictions over data and latents autoregressively, enabling more complex conditional generation.

ACE builds upon the Transformer Neural Process - Diagonal (TNP-D) architecture but significantly extends its capabilities by incorporating explicit latent variable handling and runtime prior injection.

Datasets

The paper utilizes a variety of datasets and benchmarks across different domains:

  • Image Completion and Classification: MNIST and CELEBA datasets are used for image tasks.
  • Bayesian Optimization: Synthetic functions sampled from Gaussian Processes (GPs) with RBF and Matérn kernels are used, covering various dimensions and complexities.
  • Simulation-Based Inference (SBI): Three time-series models are used:
  • Ornstein-Uhlenbeck Process (OUP)
    • Susceptible-Infectious-Recovered (SIR) model
    • Turin model (for radio propagation)
  • Gaussian Processes (GPs): Experiments involve learning GP kernel hyperparameters and types.
  • Real-world Data: An influenza outbreak dataset from a boarding school is used for the SIR model.

No new benchmarks are explicitly introduced, but the paper demonstrates ACE's applicability to existing benchmarks across diverse fields.

Key Insights and Ideas

  • Unifying Framework: ACE demonstrates that many seemingly disparate machine learning tasks (optimization, simulation, inference, image tasks) can be unified under a single probabilistic conditioning and prediction framework. This suggests a path towards more general-purpose AI models.
  • Power of Runtime Priors: The ability to inject prior knowledge about latent variables at runtime is a significant advantage. This allows for more informed predictions and faster convergence, especially in tasks like Bayesian optimization where prior beliefs about the optimum can guide the search.
  • Interpretability and Control: By explicitly modeling interpretable latent variables, ACE offers greater control and interpretability compared to methods that rely on learned, opaque latent representations.
  • Transformer Versatility: The paper further highlights the remarkable versatility of transformer architectures, showing their effectiveness across a wide range of probabilistic modeling tasks when appropriately adapted.

Key Results

  • Image Completion/Classification: ACE outperforms existing Transformer Neural Processes (TNP-D) on image completion tasks, with further improvements when conditioning on latent variables (e.g., class labels, appearance features).
  • Bayesian Optimization: ACE-TS and ACE-MES achieve competitive performance against state-of-the-art methods (GP-TS, GP-MES, AR-TNPD-TS) on various benchmark functions. The use of priors (ACEP-TS) significantly improves performance, often matching or exceeding specialized prior-injection methods (πBO-TS).
  • Simulation-Based Inference: ACE achieves comparable or better posterior estimation performance than established methods like NPE and NRE on OUP, SIR, and Turin models. Crucially, ACE offers significantly faster inference times for data sampling compared to methods like Simformer. ACE also demonstrates improved calibration when using informative priors.
  • Gaussian Processes: ACE can accurately amortize GP predictive distributions, identify GP kernels (model selection), and learn kernel hyperparameters, approaching the GP upper bound.

Limitations and Future Work

  • Quadratic Complexity: The transformer architecture's quadratic complexity in context size can be a bottleneck for very large contexts. The authors suggest exploring sub-quadratic attention variants.
  • Scalability: While ACE can learn full joint distributions, scaling to a very large number of data points and latents remains challenging. The prior-setting approach is currently limited to few latents under factorized priors.
  • Generalization to Unseen Data: Like all amortized methods, ACE's predictions can become unreliable when applied to data that significantly deviates from the training distribution. Future work could focus on developing more robust training objectives and diagnostic tools.
  • Discovering Latents and Multi-Task Learning: Future work could explore automatically discovering interpretable latents and extending ACE to handle multiple tasks simultaneously, moving beyond the current single-task supervised learning approach.
  • Handling Non-Stationarity: The paper notes that ACE struggles with highly non-stationary functions in Bayesian optimization, suggesting the need for specialized techniques like input and output warping.

Summary updated

BibTeX
@inproceedings{chang2025amortized,
  author = {Paul E. Chang and Nasrulloh Loka and Daolang Huang and Ulpu Remes and Samuel Kaski and Luigi Acerbi},
  title = {{Amortized Probabilistic Conditioning for Optimization, Simulation and Inference}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2025},
  url = {https://openreview.net/forum?id=3kRGSyp309},
}
Figure