Emergent Mind

Large Language Models to Enhance Bayesian Optimization

Published Feb 6, 2024 in cs.LG and cs.AI


Bayesian optimization (BO) is a powerful approach for optimizing complex and expensive-to-evaluate black-box functions. Its importance is underscored in many applications, notably including hyperparameter tuning, but its efficacy depends on efficiently balancing exploration and exploitation. While there has been substantial progress in BO methods, striking this balance still remains a delicate process. In this light, we present \texttt{LLAMBO}, a novel approach that integrates the capabilities of large language models (LLM) within BO. At a high level, we frame the BO problem in natural language terms, enabling LLMs to iteratively propose promising solutions conditioned on historical evaluations. More specifically, we explore how combining contextual understanding, few-shot learning proficiency, and domain knowledge of LLMs can enhance various components of model-based BO. Our findings illustrate that \texttt{LLAMBO} is effective at zero-shot warmstarting, and improves surrogate modeling and candidate sampling, especially in the early stages of search when observations are sparse. Our approach is performed in context and does not require LLM finetuning. Additionally, it is modular by design, allowing individual components to be integrated into existing BO frameworks, or function cohesively as an end-to-end method. We empirically validate \texttt{LLAMBO}'s efficacy on the problem of hyperparameter tuning, highlighting strong empirical performance across a range of diverse benchmarks, proprietary, and synthetic tasks.


  • Introduces LLAMBO, a novel method enhancing Bayesian Optimization (BO) through LLMs for tasks like hyperparameter tuning.

  • Employs zero-shot prompting for warmstarting optimization, enhancing surrogate modeling via iterative context learning, and efficient candidate sampling.

  • Demonstrates superior performance in hyperparameter tuning benchmarks compared to traditional BO methods, especially with limited initial data.

  • Highlights future work in balancing computational efficiency and exploring hybrid models, adhering to ethical standards and promoting reproducibility.

Introduction to LLAMBO and Its Motivation

Bayesian Optimization (BO) is a critical technique in the optimization of complex, black-box functions, often applied in hyperparameter tuning (HPT) across various fields. Despite its widespread application, BO faces challenges in efficient search due to the delicate balance required between exploration and exploitation, and the construction of accurate surrogate models with limited observations. Addressing these challenges, this paper introduces LLAMBO, a novel approach that leverages the capabilities of LLMs to improve model-based BO through zero-shot warmstarting, enhancement of surrogate modeling, and efficient candidate sampling. LLAMBO’s modular architecture allows seamless integration into existing BO frameworks, providing an end-to-end method that utilizes the inherent strengths of LLMs without the need for finetuning.

Key Components and Methodology

Warmstarting with Zero-Shot Prompting

LLAMBO employs zero-shot prompting to generate initial points for the BO process, effectively leveraging LLM's prior knowledge to begin optimization from promising regions of the search space. This technique outperforms traditional random initialization methods in early search stages by utilizing problem-specific information provided in natural language.

Enhancing Surrogate Models through Iterative Context Learning (ICL)

Surrogate modeling is critical for predicting the performance of untested candidates. LLAMBO introduces two strategies for leveraging LLMs in surrogate modeling:

  • A discriminative approach for regression-based prediction with uncertainty.

  • A generative approach for generating candidates based on binary classification, mimicking techniques like TPE but with direct conditioning on desired objective values.

These methods capitalize on LLMs' proficiency in few-shot learning and contextual reasoning, enabling accurate predictions and efficient exploration of the search space with sparse initial data.

Efficient Candidate Sampling

LLAMBO proposes a novel sampling strategy that directly generates candidates by conditioning on specific target objective values. This approach surpasses traditional methods in identifying high-potential points by leveraging the contextual understanding and generative capabilities of LLMs, tailored towards the optimization objective.

Experimental Validation and Findings

The paper provides an extensive empirical analysis of LLAMBO, focusing on the domain of HPT. The evaluation demonstrates LLAMBO’s superior performance in initializing the optimization process, improving surrogate model accuracy, and efficiently generating promising candidate points, especially with limited observations. Notably, across diverse benchmarks, LLAMBO outperformed established BO baselines, showcasing its efficacy as a cohesive, stand-alone BO method.

Implications and Future Directions

The integration of LLMs into BO opens new avenues for optimizing complex black-box functions more efficiently. LLAMBO’s performance gains highlight the potential of LLMs to transform BO by enhancing its core components. However, the computational demands of leveraging LLMs call for further investigation into balancing computational costs with optimization efficiency. Future work could explore hybrid approaches, integrating LLAMBO with more computationally efficient algorithms, or adapting LLAMBO to domains with sparse LLM expertise through domain-specific finetuning.

Ethics and Reproducibility

The research adheres to ethical guidelines, particularly in the handling of private datasets, and commits to reproducibility by outlining detailed experimental procedures and offering to release the code upon acceptance.


LLAMBO represents a significant step forward in the application of LLMs to enhance BO. By leveraging the contextual understanding, in-context learning capabilities, and generative prowess of LLMs, LLAMBO addresses key challenges in BO, setting a new benchmark for performance in HPT and potentially other optimization tasks within AI research.

Get summaries of trending AI/ML papers delivered straight to your inbox

Unsubscribe anytime.

  1. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining
  2. Hpo-b: A large-scale reproducible benchmark for black-box hpo based on openml. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2)
  3. Quantification of model uncertainty: Calibration, model discrepancy, and identifiability. Journal of mechanical design, 134(10)
  4. Collaborative hyperparameter tuning. In International conference on machine learning, pages 199–207. PMLR
  5. James O Berger. Statistical decision theory and Bayesian analysis. Springer Science & Business Media
  6. Algorithms for hyper-parameter optimization. Advances in neural information processing systems, 24
  7. Hyperopt: A python library for model selection and hyperparameter optimization. Computational Science & Discovery, 8(1):014008
  8. A bayesian interactive optimization approach to procedural animation design. In Proceedings of the 2010 ACM SIGGRAPH/Eurographics Symposium on Computer Animation, pages 103–112
  9. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901
  10. Manifold gaussian processes for regression. In 2016 International joint conference on neural networks (IJCNN), pages 3338–3345. IEEE
  11. Bayesian optimization for learning gaits under uncertainty: An experimental comparison on a dynamic bipedal walker. Annals of Mathematics and Artificial Intelligence, 76:5–23
  12. Towards learning universal hyperparameter optimizers with transformers. Advances in Neural Information Processing Systems, 35:32053–32068
  13. PaLM: Scaling Language Modeling with Pathways
  14. Hebo: Pushing the limits of sample-efficient hyperparameter optimisation. Journal of Artificial Intelligence Research, 74, 07 2022.
  15. Hebo: Pushing the limits of sample-efficient hyper-parameter optimisation. Journal of Artificial Intelligence Research, 74:1269–1349
  16. Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. Journal of Machine Learning Research, 15:3873–3923
  17. Lift: Language-interfaced fine-tuning for non-language machine learning tasks. In A. H. Oh, A. Agarwal, D. Belgrave, and K. Cho, editors, Advances in Neural Information Processing Systems
  18. The surveillance, epidemiology and end results (SEER) program and pathology: towards strengthening the critical relationship. The American Journal of Surgical Pathology, 40(12):e94
  19. David Duvenaud. Automatic model construction with Gaussian processes. PhD thesis
  20. Scalable global optimization via local Bayesian optimization. In Advances in Neural Information Processing Systems, pages 5496–5507
  21. Bohb: Robust and efficient hyperparameter optimization at scale. In International conference on machine learning, pages 1437–1446. PMLR
  22. Practical Transfer Learning for Bayesian Optimization
  23. Initializing bayesian hyper-parameter optimization via meta-learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence
  24. A Tutorial on Bayesian Optimization
  25. Bayesian optimization for adaptive experimental design: A review. IEEE access, 8:13937–13948
  26. Explaining Emergent In-Context Learning as Kernel Regression
  27. Efficient global optimization using deep gaussian processes. In 2018 IEEE Congress on evolutionary computation (CEC), pages 1–8. IEEE
  28. Tabllm: Few-shot classification of tabular data with large language models. In International Conference on Artificial Intelligence and Statistics, pages 5549–5581. PMLR
  29. Sequential model-based optimization for general algorithm configuration. In International Conference on Learning and Intelligent Optimization, pages 507–523. Springer
  30. Dataset2vec: Learning dataset meta-features. Data Mining and Knowledge Discovery, 35(3):964–985
  31. Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13:455–492
  32. Chembo: Bayesian optimization of small organic molecules with synthesizable recommendations. In International Conference on Artificial Intelligence and Statistics, pages 3393–3403. PMLR
  33. HJ Kushner. A new method of locating the maximum point of an arbitrary multipeak curve in the presence of noise. Journal of Basic Engineering, 86(1):97–106
  34. Smac3: A versatile bayesian optimization package for hyperparameter optimization. The Journal of Machine Learning Research, 23(1):2475–2483
  35. Automatic gait optimization with gaussian process regression. In IJCAI, volume 7, pages 944–949
  36. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8086–8098
  37. Large Language Models as General Pattern Machines
  38. Pfns4bo: In-context learning for bayesian optimization. 2023.
  39. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730–27744
  40. Prostate Cancer UK PCUK. Cutract. https://prostatecanceruk.org

  41. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830
  42. The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Only
  43. Predicting survival in heart failure: a risk score based on 39 372 patients from 30 studies. European Heart Journal, 34(19):1404–1413
  44. Warm starting bayesian optimization. In 2016 Winter Simulation Conference (WSC), pages 770–781. IEEE
  45. Bayesian Optimization of Catalysts With In-context Learning
  46. Gaussian processes for machine learning, volume 1. Springer
  47. Multitask prompted training enables zero-shot task generalization. In International Conference on Learning Representations
  48. Large language models encode clinical knowledge. Nature, pages 1–9
  49. Practical bayesian optimization of machine learning algorithms. Advances in neural information processing systems, 25
  50. Scalable bayesian optimization using deep neural networks. In International Conference on Machine Learning, pages 2171–2180
  51. Bayesian optimization with robust bayesian neural networks. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc.
  52. Gaussian process optimization in the bandit setting: no regret and experimental design. In Proceedings of the 27th International Conference on International Conference on Machine Learning, pages 1015–1022
  53. Density ratio estimation in machine learning. Cambridge University Press
  54. Multi-task bayesian optimization. Advances in neural information processing systems, 26
  55. Uber. Uber/bayesmark: Benchmark framework to easily compare bayesian optimization methods on real machine learning tasks
  56. Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11)
  57. Generalizing from a few examples: A survey on few-shot learning. ACM computing surveys (csur), 53(3):1–34
  58. Tree-Structured Parzen Estimator: Understanding Its Algorithm Components and Their Roles for Better Empirical Performance
  59. Emergent Abilities of Large Language Models
  60. Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35:24824–24837
  61. Larger language models do in-context learning differently
  62. Deep kernel learning. In Arthur Gretton and Christian C. Robert, editors, Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, volume 51 of Proceedings of Machine Learning Research, pages 370–378, Cadiz, Spain, 09–11 May 2016. PMLR.
  63. Few-shot bayesian optimization with deep kernel surrogates. In International Conference on Learning Representations
  64. An explanation of in-context learning as implicit bayesian inference. In International Conference on Learning Representations
  65. Large Language Models as Optimizers
  66. Calibrate before use: Improving few-shot performance of language models. In International Conference on Machine Learning, pages 12697–12706. PMLR

Show All 66