Bayesian Optimization & Active Experimental Design:
Gaussian Processes, Uncertainty Quantification & Self-Driving Labs
Lecture 04 roadmap: from uncertainty to autonomous labs
04a–04bGaussian Process Regression
Why small data demands uncertainty σ(x), multivariate Gaussian conditioning, RBF & Matérn kernels, 10-line NumPy GP posterior, WhiteKernel noise estimation, and Tanimoto molecular kernels.
Acquisition & Process BO
The 4-step active learning loop, balancing Exploitation vs. Exploration, Greedy vs. UCB vs. Expected Improvement (EI), and escaping local optima in 1D & 2D process windows.
Buchwald–Hartwig Case
Optimizing 3,955 Pd-catalyzed C–N coupling reactions (Science 2018): reaching >95% yield in ~25 experiments (<0.7% of space), Morgan FP + PCA generalization, and Batch BO.
Why expensive materials experiments need a new paradigm
Combinatorial Explosion
- 4 synthesis variables × 10 levels = 10,000 experiments.
- At 10 reactions/day, a full grid takes nearly 3 years.
- Wastes reagents and time in clearly poor regions of parameter space.
Self-Driving Lab Engine
- Start with just 3–5 initial experiments.
- Fit a surrogate model that predicts both mean μ(x) and uncertainty σ(x).
- Pick the single next experiment most likely to beat the current record—or resolve a blind spot.
Why prediction uncertainty σ(x) is essential in small data
From 1D Normal to Multivariate Correlated Gaussians
Kernel functions k(x, x′): encoding physical smoothness
GP Posterior in 10 lines of NumPy: exact analytical inference
L = np.linalg.cholesky(K) factorizes it stably.3-Line Production API
kernel = C(1.0) * RBF(1.0)
gp = GaussianProcessRegressor(kernel)
gp.fit(X_train, y_train)
mu, std = gp.predict(X_test, return_std=True)
How adding experiments collapses posterior uncertainty
Automatic hyperparameter tuning & WhiteKernel noise
WhiteKernel, GPR tries to interpolate noisy lab measurements (overfitting); adding WhiteKernel recovers the smooth trend + σnoise.Discrete molecular GPR: Tanimoto kernel & built-in AD
C8-BTBT and rubrene automatically.The 4-step Bayesian Optimization loop
Three classic Acquisition Functions: Greedy, UCB, and EI
1D process optimization: escaping a local optimum in 6 steps
How UCB exploration weight κ controls the search
2D process window: annealing temperature T × concentration c
Real-world synthesis: Buchwald–Hartwig coupling (N = 3,955)
BO vs. Random Search: >95% yield in 25 experiments (<0.7% of space)
From One-Hot IDs to chemistry: Morgan FP + PCA(30)
Engineering boundaries of BO & Batch BO for parallel labs
Standard GP-BO Struggles Above d > 20
In high dimensions, Euclidean distances concentrate. Compress molecular fingerprints via PCA (or VAE latent spaces in Lecture 09) before fitting GPR.
Exact GPR Slows Down Past N > 2,000
Cholesky inversion scales as O(N3). For large datasets, switch to Deep Ensembles, MC-Dropout, or Random Forest variance surrogates.
Activity Cliffs & Mixed Variables
Phase transitions or Activity Cliffs violate constant length-scale assumptions; use Matérn kernels, warped inputs, or tree-based BO (TPE/SMAC).
Batch BO (q-EI / Kriging Believer)
Real synthesis runs 8, 24, or 96 wells in parallel! Batch BO selects a diverse batch of q experiments per round instead of 1 at a time.
Practical cheat-sheet: GP kernels & acquisition functions
| Component | Choice | Key Behavior | When to Use in Materials Science |
|---|---|---|---|
| Kernel | RBF |
Infinitely differentiable (very smooth) | Smooth thermodynamic / optical response surfaces |
| Kernel | Matern(nu=1.5 / 2.5) |
Finite differentiability (realistic roughness) | Default choice for real experimental process landscapes |
| Noise Term | + WhiteKernel() |
Learns experimental noise floor σnoise | Mandatory whenever measurements have lab/assay noise |
| Molecular Kernel | Tanimoto |
Similarity on binary/count fingerprints | Discrete molecular screening with built-in AD uncertainty |
| Acquisition | EI / UCB |
EI: parameter-free; UCB: tunable κ | EI as default; UCB when you want explicit exploration control |
C() * Matern(nu=2.5) + WhiteKernel() with normalize_y=True and Expected Improvement (EI).Summary (Take home notes)
- Predict distributions, not just points: Gaussian Process Regression outputs both μ(x) and uncertainty σ(x), turning data gaps into quantifiable confidence bands.
- Encode physics in the kernel: Use Matérn/RBF for continuous process parameters, add
WhiteKernelfor noisy lab measurements, and use Tanimoto kernels for discrete molecular fingerprints. - Balance Exploitation & Exploration: Expected Improvement (EI) and UCB (μ + κσ) escape local optima where greedy optimization gets trapped.
- Massive lab savings: On 3,955 Buchwald–Hartwig coupling reactions, GP-BO consistently reaches >95% yield in ~25 experiments (<0.7% of the search space).
- Representations still rule: Pairing Morgan fingerprints +
PCA(30)lets BO transfer reactivity knowledge across chemical structures rather than treating IDs as isolated islands.
Thanks for your listening
04c_exercises.ipynb