TL;DR
Finding the optimal setting for a complex system with hundreds or thousands of variables—like tuning robot control policies or designing biological sequences—usually requires human experts to painstakingly hand-craft mathematical assumptions. This paper introduces Kernel Discovery, a framework where Large Language Models (LLMs) act as automated mathematicians, inventing and evolving novel Gaussian Process kernels on the fly. Rather than choking on massive tables of raw numbers, the LLM operates in pure math space, achieving first place across five notoriously difficult high-dimensional benchmarks.
What Problem Does This Paper Address?
Imagine trying to find the highest peak in a pitch-black mountain range where you can only afford to take a few altitude measurements. That is black-box optimization, and Bayesian Optimization (BO) is our best flashlight. BO builds a statistical "surrogate" map of the landscape—typically a Gaussian Process (GP)—to decide where to step next. At the heart of a GP is its kernel: a mathematical function defining how similar two points are.
When landscapes scale to hundreds or thousands of dimensions, standard BO breaks down due to the curse of dimensionality; points become vastly spread out, causing the algorithm to get lost exploring the empty boundaries of the space. Recently, researchers found that clever mathematical tricks (like warping the input geometry into hyperspheres) make simple GPs work brilliantly in high dimensions, but discovering these tricks requires deep manual engineering.
Why not automate this with LLMs? Existing automated and LLM-based BO methods hit two major walls in high dimensions:
- The Interface Bottleneck: Most LLM-for-BO methods feed raw past observations directly into the prompt. In 6,000 dimensions, a few trials turn into a massive wall of floating-point numbers that blows past context limits and leaves the LLM unable to spot patterns.
- The Expressive Bottleneck: Traditional automated kernel search only adds or multiplies a fixed menu of basic kernels, missing out on creative geometric warpings or novel mathematical forms.
Methods
The authors embed an LLM (GPT-4o) inside an evolutionary loop to breed better GP kernels at every step of the standard BO process, without ever showing the LLM the raw data.
Here is what sets their Kernel Discovery pipeline apart from standard BO:
- High-Dimensional Seed Population: Instead of starting from scratch, the initial pool of kernels includes high-dimension-friendly priors and geometric warpings (like BOCK and Spherical Linear) to give the LLM strong mathematical building blocks.
- Two-Stage Generation (Math First, Code Second): Prompting an LLM to write novel kernel code directly often results in lazy "innovations"—renaming variables or swapping
x - yforx.sub(y). To force genuine creativity, one LLM call is prompted with existing formulas and goodness-of-fit scores to propose a novel mathematical expression. A second LLM call translates that math into PyTorch code. (Alongside this, a simpler composition prompt also adds/multiplies top kernels). - Automated Sanity Checks: Every generated kernel is empirically tested to ensure it handles arbitrary input dimensions and produces valid, positive semi-definite covariance matrices (via a Cholesky decomposition check).
- Smarter Selection (LOO-CRPS): Standard BO scores kernels using Marginal Log-Likelihood (MLL), which tends to reward overly complex, overfitted kernels. The authors instead select the winning kernel using Leave-One-Out Continuous Ranked Probability Score (LOO-CRPS)—computed analytically via a single matrix inversion—which penalizes overconfident, overfitted predictions on held-out data points (plus a parameter-count penalty in ultra-high dimensions).
Datasets
No new benchmarks are introduced; the authors evaluate on five established high-dimensional BO benchmarks spanning $D = 100$ to $D = 6392$:
- Rover ($D = 100$): Trajectory optimization.
- Mopta08 ($D = 124$): Vehicle mass minimization.
- Lasso-DNA ($D = 180$): Hyperparameter tuning on DNA sequences.
- SVM ($D = 388$): Support vector machine hyperparameter tuning.
- Humanoid ($D = 6392$): MuJoCo reinforcement learning locomotion control.
(Note: The authors explicitly exclude the standard Ant benchmark because it can be trivially exploited by random initialization).
Key Insights and Ideas
- LLMs are terrible high-dimensional number crunchers, but great mathematical mutators: Methods that feed raw trial numbers to LLMs perform worse than basic, decades-old kernels in high dimensions. Asking the LLM to reason purely over symbolic math bypasses context limits entirely.
- Decoupling math from code unlocks true diversity: Measuring the functional cosine distance between generated kernels proved that separating mathematical formulation from code translation stops LLMs from merely refactoring syntax and pushes them to invent genuinely distinct functions.
- Challenging BO orthodoxy: When analyzing the winning kernels, the authors found the LLM inventing combinations of multiple geometric warpings (like
arctanandtanhtransformations) and non-stationary polynomial components. Historically, the BO community avoids non-stationary kernels, yet a discoveredtanh-polynomial hybrid transferred remarkably well across tasks without falling into the trap of over-exploring search boundaries.
Key Results
Tested against 16 baselines—including 7 fixed kernels, 3 search-based methods, and 6 LLM-driven optimizers—Kernel Discovery achieved an average rank of 1.0 out of 17, taking first place on every single benchmark:
- SVM ($D=388$, lower is better): Achieved 0.054, beating the runner-up Compositional Search (0.068) and observation-conditioned LLM kernel search CAKE (0.117).
- Humanoid ($D=6392$, higher is better): Scored 748.70, substantially outperforming Compositional Search (669.31), BOCK (648.65), and standard RBF (538.47).
- Rover ($D=100$, higher is better): Reached 4.424 versus the best base kernel SL (4.185).
Furthermore, taking a single kernel discovered during the SVM run and freezing it (no search) beat standard fixed kernels across the board, earning an average rank of 2.8 out of 8.
Limitations and Future Work
- High Invalidity Rate: Roughly 30% to 45% of LLM-generated kernels fail the positive semi-definiteness or shape-agnosticity checks and get discarded. Better prompt engineering or constrained decoding could reduce wasted LLM calls.
- Per-Task Overhead: Currently, the evolutionary search runs from scratch on each new optimization problem (with a 60-second GP fitting timeout safeguard). Because discovered kernels showed strong cross-task transferability, future work could discover general-purpose high-dimensional kernels across multiple tasks simultaneously to amortize compute costs.
Summary updated