Skip to main content
QUICK REVIEW

[Paper Review] PFNs4BO: In-Context Learning for Bayesian Optimization

Samuel Müller, Matthias Feurer|arXiv (Cornell University)|May 27, 2023
Gaussian Processes and Bayesian InferenceComputer Science3 citations
TL;DR

This paper introduces PFNs4BO, a novel in-context learning framework using Prior-data Fitted Networks (PFNs) to replace Gaussian Processes (GPs) as surrogate models in Bayesian optimization. PFNs approximate the posterior predictive distribution through fast, differentiable inference on any prior distribution that can be sampled from, enabling flexible, scalable, and accurate Bayesian optimization with support for user priors, feature ignoring, and non-myopic acquisition learning. The method achieves state-of-the-art performance on hyperparameter optimization benchmarks including HPO-B, BayesMark, and PD1.

ABSTRACT

In this paper, we use Prior-data Fitted Networks (PFNs) as a flexible surrogate for Bayesian Optimization (BO). PFNs are neural processes that are trained to approximate the posterior predictive distribution (PPD) through in-context learning on any prior distribution that can be efficiently sampled from. We describe how this flexibility can be exploited for surrogate modeling in BO. We use PFNs to mimic a naive Gaussian process (GP), an advanced GP, and a Bayesian Neural Network (BNN). In addition, we show how to incorporate further information into the prior, such as allowing hints about the position of optima (user priors), ignoring irrelevant dimensions, and performing non-myopic BO by learning the acquisition function. The flexibility underlying these extensions opens up vast possibilities for using PFNs for BO. We demonstrate the usefulness of PFNs for BO in a large-scale evaluation on artificial GP samples and three different hyperparameter optimization testbeds: HPO-B, Bayesmark, and PD1. We publish code alongside trained models at github.com/automl/PFNs4BO.

Motivation & Objective

  • To address the limitations of Gaussian Processes (GPs) in Bayesian optimization, such as rigid kernel constraints and non-Bayesian hyperparameter fitting.
  • To develop a general-purpose surrogate modeling framework that can approximate any prior distribution via in-context learning, enabling principled Bayesian inference without kernel restrictions.
  • To extend PFNs to support practical BO enhancements like user-defined priors on optima, dimension ignoring, and non-myopic acquisition function learning.
  • To evaluate the proposed PFNs4BO framework on large-scale hyperparameter optimization benchmarks, demonstrating robustness and performance gains over existing methods.

Proposed method

  • PFNs are trained via in-context learning to mimic the posterior predictive distribution (PPD) of a given prior, such as a GP or Bayesian neural network, using a single forward pass.
  • The method leverages neural processes to enable fast, differentiable, and scalable Bayesian inference, bypassing the need for expensive MCMC or variational inference.
  • Acquisition functions like Expected Improvement (EI), Probability of Improvement (PI), and Upper Confidence Bound (UCB) are implemented analytically within the PFN framework.
  • User priors on the location of optima are incorporated by conditioning the PFN on prior knowledge during in-context learning.
  • Irrelevant input dimensions are ignored by masking or suppressing features during the forward pass, improving generalization in high-dimensional spaces.
  • Non-myopic Bayesian optimization is enabled by training the PFN to learn the acquisition function end-to-end, allowing long-horizon decision making.

Experimental results

Research questions

  • RQ1Can PFNs effectively approximate the posterior predictive distribution of a GP with fixed hyperparameters, achieving near-ground-truth performance in a single forward pass?
  • RQ2How does PFNs4BO perform compared to standard GP-based and SOTA BO methods (e.g., HEBO, DGP) across diverse hyperparameter optimization benchmarks?
  • RQ3To what extent can user priors on the location of optima improve optimization performance when incorporated via PFNs?
  • RQ4Does the ability to ignore irrelevant input dimensions enhance PFNs4BO’s performance in high-dimensional search spaces?
  • RQ5Can PFNs be trained to learn acquisition functions end-to-end, enabling non-myopic Bayesian optimization?

Key findings

  • PFNs4BO achieves near-identical performance to ground-truth GP posteriors on synthetic GP samples, demonstrating accurate PPD approximation via in-context learning.
  • On the HPO-B benchmark, PFN (HEBO+) outperforms standard HEBO and other baselines, achieving a mean rank of 2.189 and mean regret of 0.091 on large search spaces.
  • The inclusion of user priors on optima location significantly improves optimization performance when priors are accurate, as shown in ablation studies.
  • Ignoring irrelevant features improves performance on high-dimensional search spaces, with PFN (HEBO+, 30% ignored features) achieving a mean rank of 2.189 on HPO-B.
  • Removing the initial design phase and using simple EI without noise improves HEBO’s performance, and PFN (HEBO+) outperforms even this improved HEBO baseline.
  • The ablation study confirms that EI and UCB acquisition functions perform best, while PI is less effective, and input warping is critical for performance on ill-conditioned spaces.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.