Harnessing Large Language Models to Compile Task-Relevant Context into Bayesian Optimisation

Zhongwei Yu, Sourabh Roy, Bin Cao, Xue Yan, Anjie Liu +1 more
9/29/2026
cs.LG

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Incorporating rich task-relevant context, such as domain knowledge and external observations, is a key capability yet remains challenging for Bayesian optimisation (BO). Recently, practitioners have started to use large language models (LLMs) to generate and execute BO programs through coding harnesses. In such emerging practices, the posterior belief is shaped not only by Bayesian inference but also by LLM-generated model and data artefacts, offering a flexible route for task context to enter BO as executable code. To study whether and how LLMs can be harnessed to compile diverse contextual signals for BO, we formulate LLM-compiled BO as generalised-context decision making. We propose HarBO, a BO-specialised harness that compiles generalised context into the core artefacts of standard BO through a validated multi-stage workflow. Our theory analyses the regret under imperfect compilation and the effect of adding new context. Across synthetic functions and real-world benchmarks, we find that LLM harnesses can effectively compile context into standard BO, achieving competitive performance with specialised LLM-embedding-based and direct LLM-in-the-loop BO methods. General coding harnesses can be effective in familiar domains such as hyperparameter optimisation, but fall short in unfamiliar, context-rich domains. Together, these results establish LLM harnesses as a promising, but not automatically reliable, route for making rich task context usable in BO.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yu2026harnessing,
  title  = {Harnessing Large Language Models to Compile Task-Relevant Context into Bayesian Optimisation},
  author = {Zhongwei Yu and Sourabh Roy and Bin Cao and Xue Yan and Anjie Liu and Jun Wang},
  year   = {2026},
  eprint = {2609.36788},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.36788v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.36788.svg)](https://codeofpaper.com/paper/2609.36788)

Discussion