Skip to main content
Back

UCL's Hybrid AI Slashes Expensive Lab Experiments From 25 to One

A hybrid Bayesian optimization approach that embeds physics equations as constraints and uses Gaussian processes only for missing terms converged in a single iteration versus 25+ for standard BO.

Pro

Paper, Full Access
  • Hybrid BO embeds known physics as NLP constraints and uses a Gaussian process only for missing equations.
  • On a flash unit, four hybrid iterations beat 25 standard BO iterations by two orders of magnitude.
  • GP is written as an equality constraint via the reparameterization trick, then discretized using sample-average approximation.
  • New SAA-EI acquisition function replaces analytical Expected Improvement, solved with IPOPT and multi-starts.
  • Open-source Python library built on CasADi is published on GitLab for GP training and NLP embedding.
  • Limitation: highly non-convex acquisition function and SAA discretization prevent exact convergence to the global optimum.

Bayesian optimization is the go-to tool when every experiment costs money, time, or reagents, but the standard recipe wastes samples relearning physics that engineers already know. A new paper from researchers at UCL, RWTH Aachen, Wisconsin-Madison, and Forschungszentrum Jülich proposes a hybrid formulation that keeps the known equations and only learns the unknown pieces, and the speedup is dramatic: in an in-silico distillation problem, the hybrid model converges in as few as one iteration, depending on the initial samples, whereas the standard BO does not converge within 25 for any of the seeds.

Why black-box BO leaves performance on the table

Standard Bayesian optimization treats the objective as a completely opaque function and fits a Gaussian process (GP) directly from decision variables to the scalar objective. That works, but the standard BO loop may require a prohibitively large number of experiments to converge to the optimum, especially for high-dimensional and nonlinear systems.

In practice, engineers rarely have zero knowledge. They have conservation laws, ideal thermodynamics, kinetic sketches, or lower-fidelity simulators. Prior attempts to inject that knowledge include prior-mean modeling, multi-fidelity BO, and BO with composite functions, but most hybrid modeling formulations are not probabilistic, which makes them hard to plug into a BO acquisition loop.

The trick: make the GP a constraint, not the objective

The core idea is to flip what the GP is used for. Instead of learning a direct mapping from inputs to the objective, the authors write all known equations for a physics-based model and infer expressions for variables missing equations using a probabilistic model. The final formulation then includes the GP as a constraint in the hybrid model, thereby allowing other physics-based nonlinear and implicit model constraints.

Concretely, if you know Newton's laws but not the forces, you write the mechanics as equality constraints and let a GP predict the forces. The optimizer then solves a constrained nonlinear program (NLP) instead of a black-box search. Because GP outputs are random variables, the NLP becomes a stochastic program, which the authors discretize using sample-average approximation (SAA), essentially drawing Monte Carlo samples of the GP posterior and enforcing constraints across all scenarios.

To make this differentiable and solver-friendly, they apply the reparameterization trick, splitting the GP into a deterministic mean plus a deterministic Cholesky factor times a standard normal noise sample. That isolates the randomness into a single vector ξ and leaves the rest of the constraint smooth enough for second-order NLP solvers.

How the acquisition function changes

Expected Improvement (EI) has a clean analytical form when the GP models the objective directly, but here the GP models a constraint, so the closed form breaks. The authors define a new SAA-EI acquisition problem: for each Monte Carlo scenario, evaluate the mechanistic objective given the sampled GP realization, take the min(0, f - f') improvement against the current incumbent, and average across scenarios. The result is a non-convex acquisition NLP, tackled with multi-start IPOPT.

Key implementation choices worth noting:

  • Built on CasADi in Python for automatic differentiation and a differentiable Cholesky decomposition, since existing frameworks like pyomo and OMLT do not currently support GPs.
  • Solved with IPOPT, which exploits the block-triangular sparsity of the SAA discretization.
  • Matern52 kernel with a constant zero prior mean throughout.
  • 100 Latin-hypercube multi-starts for both GP hyperparameter fitting and each acquisition solve.
  • 25 Monte Carlo scenarios for the SAA discretization in the experiments.

Two case studies, one clear pattern

On a modified Forrester function with a known outer transformation and an unknown inner term, after ten iterations, the hybrid model BO has identified solutions with regrets seven orders of magnitude lower than the standard BO. The random uniform sampling performs similarly to the standard BO.

The second case study is a flash unit for separating water and acetic acid, where mass balances, Antoine's equation, and modified Raoult's law are known but the activity coefficient for the nonideal liquid mixture is not. The GP predicts ln(γ) as a function of temperature and bottom mole fraction. The NRTL model serves as the ground truth oracle. After just four iterations, the average hybrid model BO achieves objective values two orders of magnitude lower than the standard BO achieves after 25 iterations.

The sampling analysis reveals why: standard EI keeps finding tempting regions far from the true optimum, while SAA-EI returns zero across most of the temperature-pressure plane after the first hybrid step, because the mechanistic constraints already rule out infeasible and clearly suboptimal regions before any GP sample is even drawn.

When it helps, and when it hurts

This approach shines when you have an incomplete but structurally correct mechanistic model. Good fits include chemical process design, reaction engineering, battery and electrode design, controller tuning with partial system models, and biochemistry pipelines where conservation laws are trivial to write but constitutive relations are hard.

Limitations the authors acknowledge:

  1. The SAA-EI acquisition function is highly non-convex and requires many multi-starts, which is expensive per iteration even if the total number of physical experiments drops sharply.
  2. Because the SAA is a discrete approximation of the tail of the objective distribution, the acquisition function often collapses to zero across the entire search space before the loop has truly converged to the global optimum, limiting the method to near-optimal solutions.
  3. Writing the hybrid model demands at least undergraduate-level mechanistic modeling knowledge, so the extra effort must be justified by expensive experiments.
  4. Currently no explicit handling of unknown infeasible regions, noisy experiments, or model-form errors, all flagged as future work.

The authors have published their Python library for GP training and NLP embedding on GitLab, including kernel and prior options and the same GP object usable for both fitting and acquisition. For anyone running expensive experiments in a system where the physics is only half-written, the tradeoff is compelling: pay a modeling tax up front to save an order of magnitude in samples later.