Sample-Efficient Optimisation with Probabilistic Transformer Surrogates

Alexandre Maraval, Matthieu Zimmer, Antoine Grosnit, Rasul Tutunov, Jun Wang, Haitham Bou-AmmararXiv 2022

Abstract

Faced with problems of increasing complexity, recent research in Bayesian Optimisation (BO) has focused on adapting deep probabilistic models as flexible alternatives to Gaussian Processes (GPs). In a similar vein, this paper investigates the feasibility of employing state-of-the-art probabilistic transformers in BO. Upon further investigation, we observe two drawbacks stemming from their training procedure and loss definition, hindering their direct deployment as proxies in black-box optimisation. First, we notice that these models are trained on uniformly distributed inputs, which impairs predictive accuracy on non-uniform data - a setting arising from any typical BO loop due to exploration-exploitation trade-offs. Second, we realise that training losses (e.g., cross-entropy) only asymptotically guarantee accurate posterior approximations. To tackle these shortcomings we introduce two components: 1) a BO-tailored training prior supporting non-uniformly distributed points, and 2) a novel approximate posterior regulariser trading-off accuracy and input sensitivity. In a large panel of experiments, we demonstrate that one transformer pre-trained on data sampled from random GP priors produces competitive results on 16 benchmark black-boxes compared to GP-based BO, achieving an order of magnitude time-reduction.

Introduction: The Challenge of Surrogate Modeling

Bayesian Optimisation (BO) is a cornerstone of "black-box" optimisation, used for tasks where function evaluations are expensive and lack a closed-form expression. While Gaussian Processes (GPs) are the traditional choice for surrogate modeling due to their robust uncertainty estimation, they suffer from cubic computational complexity. Probabilistic Transformers (PTs) offer a faster alternative, but their direct application in BO is hindered by two fundamental issues identified by the authors:

  1. The Distribution Gap: Standard PTs are trained on uniform input distributions. However, BO naturally clusters observations around promising regions, creating highly non-uniform data distributions that standard PTs struggle to model accurately.
  2. Sensitivity and Exploration: Standard training objectives like cross-entropy do not ensure the model reacts appropriately to single observations in unexplored regions, which is vital for effective exploration.
Non-uniform distribution of probed points in typical BO loops across benchmark functions, highlighting the concentration of samples around optima.

Proposed Methodology: Enhancing Transformers for BO

To overcome these limitations, the authors propose a pre-trained Transformer architecture that requires no task-specific fine-tuning. Two primary innovations are introduced to make PTs viable surrogates:

  • BO-Tailored Training Prior: The training data is sampled non-uniformly, with probabilities weighted toward target values. This mimics the "clumpy" data distributions found in real-world BO loops.
  • Approximate Posterior Regulariser: A KL-divergence-based regulariser is added to the loss function. This encourages the model to produce similar posterior distributions for nearby inputs, effectively inducing a "stationarity" property similar to GP kernels. This ensures the model remains sensitive to new data in exploratory regions.

Experimental Results

The proposed model, $PT-\nu\mathcal{R}_\epsilon$, was evaluated against 16 standard black-box benchmark functions (e.g., Ackley, Rastrigin, Griewank) from the BoTorch suite across multiple dimensions.

Evolution of the Probabilistic Transformer surrogate model as it incorporates increasing numbers of observations (N+1 to N+20) during the optimization process.

Performance and Efficiency

  • Computational Speed: The PT-based approach achieved a 10x reduction in wall-clock time compared to GP-based BO, as it avoids the expensive matrix inversions required by GPs.
  • High-Dimensional Scalability: While GPs perform well in 1D, the PT model excels in higher dimensions. In 10D tasks, the proposed method improved performance over random search from 36% (standard PT) to 72.1%, outperforming GPs (63.8%) in that specific setting.

Conclusion and Future Directions

This work demonstrates that a single Transformer, pre-trained on synthetic GP-derived data, can serve as a powerful zero-shot surrogate for diverse optimisation tasks. By aligning the training distribution with the operational distribution of BO, the authors bridge the gap between deep learning and classical Bayesian methods. Future work will address the quadratic memory complexity of the attention mechanism to support longer optimisation runs and explore heteroscedastic noise settings.

Summary updated

Abstract

Faced with problems of increasing complexity, recent research in Bayesian Optimisation (BO) has focused on adapting deep probabilistic models as flexible alternatives to Gaussian Processes (GPs). In a similar vein, this paper investigates the feasibility of employing state-of-the-art probabilistic transformers in BO. Upon further investigation, we observe two drawbacks stemming from their training procedure and loss definition, hindering their direct deployment as proxies in black-box optimisation. First, we notice that these models are trained on uniformly distributed inputs, which impairs predictive accuracy on non-uniform data - a setting arising from any typical BO loop due to exploration-exploitation trade-offs. Second, we realise that training losses (e.g., cross-entropy) only asymptotically guarantee accurate posterior approximations, i.e., after arriving at the global optimum, which generally cannot be ensured. At the stationary points of the loss function, however, we observe a degradation in predictive performance especially in exploratory regions of the input space. To tackle these shortcomings we introduce two components: 1) a BO-tailored training prior supporting non-uniformly distributed points, and 2) a novel approximate posterior regulariser trading-off accuracy and input sensitivity to filter favourable stationary points for improved predictive performance. In a large panel of experiments, we demonstrate, for the first time, that one transformer pre-trained on data sampled from random GP priors produces competitive results on 16 benchmark black-boxes compared to GP-based BO. Since our model is only pre-trained once and used in all tasks without any retraining and/or fine-tuning, we report an order of magnitude time-reduction, while matching and sometimes outperforming GPs.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
10-dimensional benchmark black-box tasksPT before the proposed pre-training componentsImprovement over random search36%Black Box Optimization · 0-shot · dimension=10
Source quote
L26: \paragraph{Contribution III: One randomly pre-trained PT can do sample-efficient optimisation.} As a third contribution of our work, we demonstrate that a transformer pre-trained with our components on data collected from random hyper-priors can optimise a variety of benchmark black-box functions, without the need for any fine-tuning or re-training. Results on 38 standard BO benchmark tasks indicate that our method is indeed sample efficient in that it recovers or outperforms GPs, while being an order of magnitude faster in wall-clock time. Additionally, we demonstrate that our contributions to the pre-training of PTs lead to significant improvements in BO performance (e.g., going from 36% improvement over random search to 72.1% on 10 dimensional tasks).
10-dimensional benchmark black-box tasksPT pre-trained with the proposed non-uniform prior and regulariserImprovement over random search72.1%Black Box Optimization · 0-shot · dimension=10
Source quote
L26: \paragraph{Contribution III: One randomly pre-trained PT can do sample-efficient optimisation.} As a third contribution of our work, we demonstrate that a transformer pre-trained with our components on data collected from random hyper-priors can optimise a variety of benchmark black-box functions, without the need for any fine-tuning or re-training. Results on 38 standard BO benchmark tasks indicate that our method is indeed sample efficient in that it recovers or outperforms GPs, while being an order of magnitude faster in wall-clock time. Additionally, we demonstrate that our contributions to the pre-training of PTs lead to significant improvements in BO performance (e.g., going from 36% improvement over random search to 72.1% on 10 dimensional tasks).
BibTeX
@misc{maraval2022sample,
  author = {Alexandre Maraval and Matthieu Zimmer and Antoine Grosnit and Rasul Tutunov and Jun Wang and Haitham Bou-Ammar},
  title = {{Sample-Efficient Optimisation with Probabilistic Transformer Surrogates}},
  year = {2022},
  eprint = {2205.13902},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2205.13902},
}
Figure