| # | Temp | Conc | Press | Yield | Purity |
|---|
Analyzing performance data…
| Rank | Name | Format | Runs | Best | vs AI | Score |
|---|
Stored locally in this browser only.
Bayesian Optimization (BO) is an Artificial Intelligence — and more specifically a Machine-Learning — strategy that finds the best possible outcome — like the highest chemical yield — with as few experiments as possible. It is ideal when each lab test is expensive or time-consuming, like highlighted in this game. Instead of guessing blindly or scanning a rigid grid, Bayesian Optimization has a strategic approach: it maintains a mathematical model of the chemistry, determines where the optimum likely is, and sharpens its beliefs with every new result it observes.
The word "Bayesian" refers to Bayes' theorem — a rule for updating beliefs when new evidence arrives. Think of a detective: before any clues emerge, they hold a prior belief about who the suspect is (perhaps everyone is equally suspicious). As evidence accumulates, they update that belief into a posterior — a sharper, more informed picture. BO works exactly the same way, except the "suspect" is the optimal reaction condition, like the yield.
You can watch this happen. After any match, open What the AI believed on the results screen and drag the slider through the run — the fog really does clear.
To maintain this prior-to-posterior update cycle efficiently, Bayesian Optimization needs a flexible mathematical model. It uses a Gaussian Process, which is a model that does not just predict a single number for an untested condition, but outputs an entire probability distribution. This means for every point in the parameter space, the Gaussian Process gives you both a best-guess yield and a measure of how confident it is in that guess.
Imagine drawing a map of a mountain range through thick fog. Wherever you have already climbed, the map is precise and detailed. In unvisited valleys, the map shows a blurry, uncertain region. It could be a gentle hill or a towering peak. The Gaussian Process represents both the best guess of the height (the mean prediction) and the thickness of the fog (the uncertainty, or variance). It achieves this using a kernel function: a mathematical rule that says "conditions that are close to each other in parameter space should produce similar yields." This is what lets the model generalize smoothly between your existing data points rather than treating every untested point as completely unknown.
Knowing the posterior map is powerful, but Bayesian Optimization still needs a strategy to decide where to experiment next. At every step it faces a dilemma: should it trust what it already knows, or risk venturing somewhere completely new?
Both extremes are dangerous. Too much exploitation and you get stuck at a local optimum — a decent result, but never the global best. Too much exploration and you waste your entire experiment budget wandering regions that turn out to be barren, never converging on anything useful.
The Acquisition Function is what resolves the exploitation vs. exploration tension automatically. Rather than picking the point with the single highest predicted yield, it scores every untested condition by asking a smarter question: "How much improvement over my current best result can I realistically expect here?"
This game uses Expected Improvement (EI). For any candidate point, EI calculates the probability-weighted average gain above your current best yield. Crucially, EI only rewards upside uncertainty, which is the chance that the true yield is better than your current best. A region that is very uncertain but predicted to be terrible still scores low, because the probability of a meaningful improvement is small. This means:
As optimization progresses, this balance shifts naturally. Early on, large swaths of the map are fogged, so exploration dominates and EI sends the AI to uncharted territory. Later, once most of the landscape is mapped, the high-yield regions become attractive for focused exploitation. EI handles this shift automatically. It is a built-in self-correcting compass that requires no manual tuning.
Real labs rarely run one reaction at a time — they fill a plate. Picking a batch needs care: the naive approach picks the same promising spot four times over, which wastes three wells. Batch mode in this game uses the Kriging Believer trick: after choosing a point, the model pretends it already got back its own predicted value, updates itself, and only then picks the next well. The result is a spread of conditions that complement rather than duplicate each other.
Chemists rarely want yield alone — they want yield and purity, or yield at acceptable cost. When two objectives peak in different places, no single condition is best at everything, and instead there is a Pareto front: the set of conditions where improving one objective necessarily costs you the other. Two-objective mode scores you on whichever objective is doing worse, which pushes you toward balanced conditions rather than lopsided ones.
Bayesian Optimization ties everything together in a repeating cycle. The Gaussian Process posterior is computed from all existing data. The acquisition function scores every candidate condition, and the point with the highest EI is selected as the next experiment. That reaction is run, the observed yield is added to the dataset, and the posterior updates — the fog clears a little more. This cycle repeats until the experiment budget runs out or a satisfying result is found.
Because every experiment is chosen intelligently rather than arbitrarily, Bayesian Optimization typically finds near-optimal conditions in a fraction of the experiments a random search or grid scan would require. It is not just smart at the start: it gets smarter with every single data point you give it.
Click anywhere on the grid to run a reaction there. You'll see the yield straight away. The surface is hidden — somewhere on it is a sweet spot, and every click costs budget.
Tip: click a row in the mission log to find that point again on the grid.