IE437 · Data-Driven Decision Making and Control — Lecture 5

Data-Driven Design Optimization — Surrogate-Based

Deciding about designs no one has measured
Jinkyoo Park · KAIST
Offline, part 1 of 2 — learn the objective from a fixed dataset, then decide what to trust
Data-Driven Design Optimization — Surrogate-BasedLecture 5

Where we are — the query is taken away

Lecture 4 · Observe Lecture 5 · Trust Lecture 6 · Generate
the question which experiment to run next what to believe about designs no one has measured how to produce valid, good designs
access to ff one evaluation per round none — a fixed dataset none — a fixed dataset
uncertainty is a reason to look a reason to be careful a reason to stay on the data's manifold
The goal is unchanged — a good real design. What is gone is the chance to check one before it is returned.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based2 / 75
Data-Driven Design Optimization — Surrogate-BasedLecture 5

Learning route — two sessions, one question

Bring: regression and gradient ascent (Lecture 1), the GP posterior and UCB (Lecture 4).

Session What it does
1 · Why it fails Delete the evaluation → watch the optimiser exploit the surrogate → split the decision loss into two errors → conservatism, with COMs worked to the end
2 · Other grounds for trust Uncertainty: estimate what the surrogate does not know and decide with it → system knowledge: give it structure or physics → compare the three
Throughout, keep two things apart: how well a model predicts, and how good a decision it makes when an optimiser is pointed at it.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based3 / 75
Data-Driven Design Optimization — Surrogate-BasedLecture 5

Lecture 4's loop, with one line deleted

Every black-box method so far closes its loop through the real objective — Bayesian optimisation, and equally a genetic algorithm, CMA-ES, a policy gradient, or gradient ascent on a fitted proxy. Lecture 4's loop:

Online — Bayesian optimisation (Lecture 4)

for t = 1 … T:
  fit the GP on D_t
  x_{t+1} = argmax_x a_t(x)    ← acquisition, uses σ
  y_{t+1} = f(x_{t+1})         ← query
  D_{t+1} = D_t ∪ {(x_{t+1}, y_{t+1})}

Offline (this lecture)

fit a model f_θ on D           ← once
x̂ = argmax_x f_θ(x)           ← no query

return x̂

One line deleted, and with it every correction. Online, an over-rated point is queried, found wanting, and the model repairs itself — which is why BO could afford to seek uncertainty. Offline, the model is fitted once and never contradicted again.

Source alignment: Part 1 pp. 3–17 (the online methods — GA, CMA-ES, BO, policy gradient; tabulated in the appendix). The source's p. 5 box, gradient ascent on a proxy with a query per step, is the naive offline method of slide 8 with the query put back.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based4 / 75
Session 1 · Act 1

What breaks offline

Q1. Fit a model of ff to the data, then optimise the model. On paper it should work.
ACT 1What breaks offlineLecture 5

Offline model-based optimisation

Q1 What breaks offline?Q2 Conservatism?Q3 Uncertainty?Q4 System knowledge?
D={(xi,yi)}i=1N,yi=f(xi)+ϵi\mathcal D=\{(x_i,y_i)\}_{i=1}^{N},\qquad y_i=f(x_i)+\epsilon_i
findx∗=arg max⁡x∈Xvalidf(x)using only D\text{find}\quad x^*=\argmax_{x\in\mathcal X_{\text{valid}}} f(x)\qquad\text{using \hl{only} }\mathcal D

Evaluating ff is expensive or prohibitive — a molecule to synthesise, a protein to express, a chip or an aircraft to build. The source figure is one deleted arrow: data flows into an offline optimiser, a design flows out to superconductors, DNA, proteins and robot bodies, and the return arrow from the design back to the data is struck through — no additional interactions.

1 · Surrogate-based — this lecture

Approximate ff from D\mathcal D, then optimise over the surrogate. A forward model, and a search.

2 · Generative-based — Lecture 6

Learn a representation or distribution of plausible designs, then search in it, condition it, or guide it toward better ones.

Source alignment: Part 1 pp. 18–19; Part 2 pp. 3–4.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based6 / 75
ACT 1What breaks offlineLecture 5

The bar to beat is the best design you already ownthree ways to answer with the same data

rule the design it returns what it risks
Best observed arg max⁡xi∈D yi\argmax_{x_i\in\mathcal D}\,y_i nothing — and it can never improve
Naive surrogate arg max⁡xf^θ(x)\argmax_x \hat f_\theta(x) believing f^θ\hat f_\theta where no data checked it
Reliable offline optimisation the maximiser of a score that accounts for out-of-distribution risk this chapter
Offline optimisation is worth doing only if it beats the best design in D\mathcal D — and it has to do so without testing the design it returns.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based7 / 75
ACT 1What breaks offlineLecture 5

The obvious method — fit a proxy, then climb it

Step 1.θ∗=arg min⁡θ1N∑i=1N(fθ(xi)−yi)2Step 2.x^=arg max⁡xfθ∗(x)\textbf{Step 1.}\quad \theta^* = \argmin_\theta \frac1N\sum_{i=1}^N \big(f_\theta(x_i) - y_i\big)^2 \qquad\qquad \textbf{Step 2.}\quad \hat x = \argmax_x f_{\theta^*}(x)

Fit a neural network fθf_\theta to D\mathcal D — this is the surrogate, or proxy — and then, because fθf_\theta is differentiable where the real ff was not, run gradient ascent on it, starting from the best design in D\mathcal D.

Step 1 can pass every supervised-learning check. What goes wrong is the interaction: Step 2 searches exactly where Step 1 was never checked.

Source alignment: Part 1 p. 20.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based8 / 75
ACT 1What breaks offlineLecture 5

What the benchmark asks for, and how it is scoredthe six Design-Bench tasks as used by NEMO, COMs and RoMA (2021)

task dimension type dataset size
Superconductor 81 continuous 21,263
GFP (green fluorescent protein) 238 categorical (20) 5,000
MoleculeActivity 1,024 binary 4,216
HopperController 5,126 continuous 3,200
AntMorphology 60 continuous 25,009
DKittyMorphology 56 continuous 25,009

Three things to keep apart. The offline data D\mathcal D is all a method may use. The candidates — 128 designs in the papers of this lecture — are what it returns. The oracle scores them afterwards, for the benchmark only, and is never fed back: the physics simulator for the robot tasks, a model fitted to a larger held-out dataset for tasks such as Superconductor. The usual score, the best of the 128, is a benchmark number; deploying one design would still need a way to pick it without the oracle. HopperController has 3,200 designs in 5,126 dimensions: almost every direction the ascent can take was never checked against anything.

Source alignment: Part 2 p. 23 (task table). These are the 2021 versions of the tasks, the ones the COMs, NEMO and RoMA results use. The final benchmark (Trabucco, Geng, Kumar & Levine, ICML 2022, Table 1) revised them: Superconductor is 86-dimensional there, and GFP and MoleculeActivity were moved to its appendix as tasks not kept in the final suite.

Source alignment: Part 2 pp. 25 and 38 (128 candidates, 50th and 100th percentile).

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based9 / 75
ACT 1What breaks offlineLecture 5

Two different problems

Problem 1 — values off the data · every offline problem

The training data constrains the model where it has support. Away from it, a small training loss controls nothing — and the search must go there, because the goal is a design better than anything in D\mathcal D. The failure is the task.

Problem 2 — the valid set · only with a constraint

When designs must be real molecules, foldable proteins or buildable layouts, only a thin sliver of input space is valid, and ascent can leave it: a design off it is not merely poor but meaningless. If every input is a legitimate design, this problem does not exist.

valid invalid
near the data the data themselves a molecule string with one character changed — when the valid set is thin
far from the data the design we hope to find where unchecked ascent ends

Independent questions. A known constraint is Lecture 1's constrained optimisation. An implicit one — known only through valid examples — must be learned, and judging it off the data is Problem 1 again, for the constraint. This lecture attacks Problem 1; Lecture 6 learns the valid set.

Source alignment: Part 1 pp. 21, 23, 25.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based10 / 75
ACT 1What breaks offlineLecture 5

The two pictures

Left, the dataset does not determine ff off the data: every one of those dashed continuations fits D\mathcal D equally well. Right, only when designs must satisfy a constraint: the valid designs are a thin curve, and ascent from a data point leaves it at once. A point next to the data can be off the curve, and a point far from it can be on it.

Source alignment: Part 1 p. 22 (the fan of extrapolations) and p. 24 (the valid manifold, redrawn as a thin curve). "Near the data" here means close in the input space — the sense a GP's σ\sigma or a trust region uses. Measured instead by the support of the data distribution, a point inside it is valid whenever the data are.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based11 / 75
ACT 1What breaks offlineLecture 5

Watch it happen

Fifteen measured designs, a surrogate that fits them to an RMSE of 0.0580.058, and gradient ascent from the best of them. The faint curve is the true ff — drawn so that we can watch; the optimiser never sees it. Press → to walk the ascent to t=5t=5, 1212 and 4040: it returns −0.14-0.14 where the surrogate promised 4.314.31, worse than the design it started from.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based12 / 75
ACT 1What breaks offlineLecture 5

The optimiser is an adversary

A perturbation of size , chosen by following a gradient, turns 57.7 % "panda" into 99.3 % "gibbon". {p}(Goodfellow, Shlens & Szegedy, ICLR 2
A perturbation of size 0.0070.007, chosen by following a gradient, turns 57.7 % "panda" into 99.3 % "gibbon". (Goodfellow, Shlens & Szegedy, ICLR 2015)

Gradient ascent on f^θ\hat f_\theta is the same computation aimed at a regression model: it moves the input in whatever direction raises the model's output fastest. In a high-dimensional space with little data, many of those directions lead to errors.

The optimiser does not look for errors. It looks for high predictions — and where there is no data, high predictions are often errors.

Source alignment: Part 2 p. 29.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based13 / 75
ACT 1What breaks offlineLecture 5

A good fit can still make a bad decisionthe signed decision bound

Let x^\hat x be the design the optimiser returns and x∗x^* the true optimum. Add and subtract f^\hat f at both points:

f(x∗)−f(x^)=[f(x∗)−f^(x∗)]⏟A+[f^(x∗)−f^(x^)]⏟≤ 0 when x^ maximises f^+[f^(x^)−f(x^)]⏟B  ≤  A+Bf(x^*)-f(\hat x)=\underbrace{\big[f(x^*)-\hat f(x^*)\big]}_{A}+\underbrace{\big[\hat f(x^*)-\hat f(\hat x)\big]}_{\le\,0\ \text{when }\hat x\text{ maximises }\hat f}+\underbrace{\big[\hat f(\hat x)-f(\hat x)\big]}_{B}\;\le\;A+B

A — at the true optimum

How much the surrogate under-rates the best design. A model too pessimistic about the right answer pays here.

B — at the chosen design

How much the surrogate over-rates the design it picked. The optimiser's exploit pays here.

Validation error is an average over the data. The decision depends on the error at two particular points — and the optimiser chooses one of them.

The middle term, the optimiser gap, is never positive when x^\hat x maximises f^\hat f — that is all the inequality uses. The exact loss keeps it, so A+BA+B can sit well above the loss. AA and BB themselves can be negative.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based14 / 75
ACT 1What breaks offlineLecture 5

Where the loss comes from, on the same fit

Walk it with →. The surrogate is right about the true optimum — A=−0.03A=-0.03 — and wrong about the design it chose, B=4.44B=4.44. Exactly, 2.79=A+gap+B=−0.03−1.62+4.442.79=A+\text{gap}+B=-0.03-1.62+4.44; dropping the gap gives the bound 4.414.41. BB is the only large positive term.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based15 / 75
ACT 1What breaks offlineLecture 5

Temperature thread — what the surrogate promised, and what it deliveredshared teaching example · predict before revealing

Lecture 0's heater, offline: two commands, one surrogate, no experiment.

Predict: Which command does maximising the surrogate pick — and is it the better one?

It picks u=2u=2, the command it rates higher. Press → to run the heater and see why that is the worse choice.

Numbers behind the picture: hidden score f(u)=−[(u−2)2+u2]f(u)=-[(u-2)^2+u^2]; predictions f^(1)=−2.1\hat f(1)=-2.1, f^(2)=−1.0\hat f(2)=-1.0; truth f(1)=−2f(1)=-2, f(2)=−4f(2)=-4. So A=0.1A=0.1, gap =−1.1=-1.1, B=3B=3, and the loss 2=A+gap+B2=A+\text{gap}+B.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based16 / 75
ACT 1What breaks offlineLecture 5

Try it — the largest error is no longer the selected actionwork independently · reveal only after deciding

The same two commands; the surrogate is now exact at u=1u=1 and over-rates u=2u=2 by less.

Which command is chosen now — and does the remaining error at u=2u=2 cost anything?

Check your answer. It picks u=1u=1, the right command. The optimiser maximises truth plus error, not error alone: the error at u=2u=2 is still there, but an error costs the decision only when it changes the choice. Press → to see it.

Numbers behind the picture: errors 00 at u=1u=1 and +1+1 at u=2u=2, so predictions −2-2 and −3-3; the pick is u=1u=1, and A=B=0A=B=0.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based17 / 75
ACT 1What breaks offlineLecture 5

The cure is not a better optimiser

Two repairs suggest themselves first, and both treat the search as the problem.

Search harder

A stronger, more thorough optimiser finds a higher point of f^\hat f — on this surface, a point still further from the data and still more over-rated. It makes BB larger.

Optimisation strength is on the wrong side of the problem.

Search less

Restricting the search to measured designs caps the result at the best recorded score. A neighbourhood limit can still allow improvement, but it also excludes the novel designs we came for.

The trade is between evidence and novelty.

What has to change is what the surrogate is entitled to say away from the data.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based18 / 75
ACT 1What breaks offlineLecture 5

Check — prediction quality versus decision quality

Surrogate S1S_1 has a lower validation error than surrogate S2S_2, yet the design chosen by maximising S1S_1 is worse. Is that a contradiction?

Validation error averages over designs like those in D\mathcal D. The decision loss is bounded by A+BA+B: the errors at the true optimum and at the chosen design, which the optimiser picks because the prediction is high there. A model can win on the first number and lose on the second — the surrogate in Watch it happen had an RMSE of 0.0580.058 and B=4.44B=4.44.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based19 / 75
ACT 1What breaks offlineLecture 5

Three ways to give a surrogate grounds for trustthe map for both sessions

Conservatism

Change what f^\hat f says where the optimiser goes: a training penalty on the designs it would chase.

COMs (ICML 2021) · PRIME · RoMA — Session 1

Uncertainty

Estimate what f^\hat f does not know, and decide with it: μ−κσ\mu-\kappa\sigma, Lecture 4's UCB with the sign turned.

Deep Ensembles (NeurIPS 2017) · NEMO — Session 2

System knowledge

Give the model structure or physics, so that its extrapolation has grounds other than the data.

FGM (AISTATS 2024) · Kennedy & O'Hagan — Session 2

All three try to shrink BB; each brings its own assumptions and can cost something elsewhere — too much conservatism inflates AA, as Session 1 will show. They are not rivals: an uncertainty penalty is itself conservative, and a structured model can be trained conservatively.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based20 / 75
ACT 1What breaks offlineLecture 5

The papers of this lecture — why each is here

Press → for Session 2's papers; click any paper for what it does, why we read it and how it connects. The same list is a table in the appendix.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based21 / 75
Session 1 · Act 2

Conservatism: train the surrogate against its own optimiser

Q2. If the optimiser will attack the surrogate, let the surrogate see the attack while it is trained.
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

COMs — what we want, and the obstacleConservative Objective Models · Trabucco, Kumar, Geng & Levine, ICML 2021

Q1 What breaks offline?Q2 Conservatism?Q3 Uncertainty?Q4 System knowledge?

We want a model that does not over-rate the designs an optimiser would chase — a small BB. The obstacle is knowing which designs those are, and the answer is to generate them by running the attack we fear.

Eμθ[fθ]=1M∑j=1Mfθ(xT(j)),xt+1(j)=xt(j)+η∇xfθ(xt(j)),x0(j)∼D\E_{\mu_\theta}\big[f_\theta\big]=\frac1M\sum_{j=1}^{M} f_\theta\big(x_T^{(j)}\big),\qquad x_{t+1}^{(j)}=x_t^{(j)}+\eta\nabla_x f_\theta\big(x_t^{(j)}\big),\quad x_0^{(j)}\sim\mathcal D

μθ\mu_\theta is where TT ascent steps from the data end up; the loss uses it only through this average.

Start from the datax0∼Dx_0\sim \mathcal D — real designs
Run the attackera few steps of ascent on the current surrogate
Collect where it ends upthose designs form μθ\mu_\theta: the designs this surrogate is tempting

Because fθf_\theta changes at every training step, μθ\mu_\theta is regenerated as training proceeds — an inner attacker chasing an outer defender, as in adversarial training for robustness.

Source alignment: Part 2 pp. 26–29. The paper describes μ\mu as "several steps of gradient ascent" from data points; its implementation uses a single step (Trabucco et al., 2021, §3.4). Written as a distribution, μθ=1M∑jδxT(j)\mu_\theta=\frac1M\sum_j\delta_{x_T^{(j)}} — a point mass 1/M1/M at each end point — which is why its expectation is the plain average above. The toy widgets collect every point the 25-step ascent visits, not only the end points; with the paper's one step the two coincide.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based23 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

Three terms, three fitsadd a term to the loss and watch the surrogate move · the same fifteen points, α = 0.3

(i) fit the data

12 ED[(fθ−y)2]\tfrac12\,\E_{\mathcal D}\big[(f_\theta-y)^2\big]
The plain fit: right on the data, and it keeps climbing where there is none.

(ii) + push the attacker's designs down

12 ED[(fθ−y)2]+α Eμθ[fθ]\tfrac12\,\E_{\mathcal D}\big[(f_\theta-y)^2\big]+\hl{\alpha\,\E_{\mu_\theta}[f_\theta]}
The cheapest way to lower the attacker's scores is to lower everything: the surface sinks below the very data it was fitted to, by exactly α\alpha.

(iii) + hold the data up

12 ED[(fθ−y)2]+α Eμθ[fθ]  −  α ED[fθ]\tfrac12\,\E_{\mathcal D}\big[(f_\theta-y)^2\big]+\alpha\,\E_{\mu_\theta}[f_\theta]\;\hl{-\;\alpha\,\E_{\mathcal D}[f_\theta]}
A constant shift now moves both averages alike, so sinking no longer pays: lifted back by α\alpha inside the data, the push stays where the attacker went.

Source alignment: Part 2 p. 30 ("Problem: underestimation. Solution: regularise by maximising function values under the data distribution"). The three panels are one widget in three instances, each trained for real on the same fifteen points at α = 0.3. Panel (ii): the first attempt's mean error on D is −0.30 — exactly −α: lowering the whole surface by c cuts the penalty by αc and costs the fit ½c², so the balance is c = α; 14 of the 15 points sit above it, by up to 0.81 at the right end of D, where the attacker's designs (the grey strip) crowd. Panel (iii): with the data term the mean error is 0.00 — a constant shift moves E_μ[f] and E_D[f] alike, so the penalty no longer rewards it. The full COMs curve is the first attempt lifted by 0.30 exactly inside D, so the attacker's paths, and any later search, are unchanged: only the level was wrong. If asked why that matters: without the data term the surrogate is biased low even on the designs we measured, and α would set the level as well as the relative push; with it α sets only the gap. The attacker never goes past x ≈ 5.8, and the far edge is still over-rated (1.98 for the first attempt, 2.31 for full COMs, against a true −0.14) — the point of "Conservatism is learned where the attacker went". No search is drawn: Algorithm 2 comes two slides later.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based24 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

The loss, term by term

L(θ)=12 E(x,y)∼D[(fθ(x)−y)2]⏟(i) fit the data  +  α(Ex∼μθ[fθ(x)]⏟(ii) push the attacker’s designs down  −  Ex∼D[fθ(x)]⏟(iii) hold the data up)L(\theta) = \underbrace{\tfrac12\,\E_{(x,y)\sim \mathcal D}\big[(f_\theta(x)-y)^2\big]}_{\text{(i) fit the data}} \;+\; \alpha\Big(\underbrace{\E_{x\sim\mu_\theta}[f_\theta(x)]}_{\hl{\text{(ii) push the attacker's designs down}}} \;-\; \underbrace{\E_{x\sim \mathcal D}[f_\theta(x)]}_{\hl{\text{(iii) hold the data up}}}\Big)
  • (i) ordinary regression — be right about the designs we measured;
  • (ii) prevent over-estimation out of distribution;
  • (iii) prevent under-estimation in distribution.
The source's picture of the same sum: regression on real designs, a push up on real designs, a push down on designs from adversarial generat
The source's picture of the same sum: regression on real designs, a push up on real designs, a push down on designs from adversarial generation.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based25 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

COMs as an algorithm — train against an attacker, then search slowly

Algorithm 1 — train the conservative surrogate

initialise f_θ; pick η, α
repeat:
  sample (x₀, y) ~ D
  x_K ← K ascent steps from x₀ on f_θ
  μ   ← empirical distribution of the x_K
  L   = ½ E_D (f_θ(x₀) − y)²
        + α E_μ[f_θ] − α E_D[f_θ]
  θ   ← θ − λ ∇_θ L

Algorithm 2 — search it, slowly

x₀ = argmax_{(x,y)∈D} y    ← the best design we own
for t = 0 … T−1:            ← T = 450 in the paper
  x_{t+1} = x_t + η ∇_x L_opt(x_t)
                            ← L_opt: f̂ with a brake, next slide
return x̂ = x_T

Left — learn. Ordinary regression on D\mathcal D plus the penalty of the last two slides. The attacker is re-run on the current fθf_\theta every round, so the surrogate is flattened exactly where it was tempting. Out comes one model, f^θ∗\hat f_{\theta^*}.

Right — search. Start from the best design we own and take TT small steps uphill — not on f^θ∗\hat f_{\theta^*} itself but on LoptL_{\text{opt}}, a braked copy of it that distrusts what the surrogate promises one step further on.

Training flattens the surrogate on a distribution of challenging designs near the data. The final search is deliberately slow and short, so that within its budget it does not get far from where conservatism was learned.

Source alignment: Part 2 p. 35 (Algorithms 1 and 2). The toy in the next widgets: the attacker takes K = 25 plain ascent steps from every data point; the search is Algorithm 2 with β = 0.9 and T = 450. With the paper's one-step attacker this 1-D toy is too local to protect anything.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based26 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

The brake — what Algorithm 2 climbsa trust region, as in Lecture 1: do not trust the model further than one step

Lopt(x)=f^θ∗(x)⏟what the surrogate says here  −  β f^θ∗(x+η ∇xf^θ∗(x))⏟what it promises one trial step up ,β=0.9L_{\text{opt}}(x)=\underbrace{\hat f_{\theta^*}(x)}_{\text{what the surrogate says here}}\;-\;\beta\,\underbrace{\hat f_{\theta^*}\big(x+\eta\,\nabla_x\hat f_{\theta^*}(x)\big)}_{\text{what it promises one trial step up}}\,,\qquad \beta=0.9

To second order, Lopt≈(1−β) f^−βη∥∇f^∥2L_{\text{opt}}\approx(1-\beta)\,\hat f-\beta\eta\lVert\nabla\hat f\rVert^2: a tenth of the climb, minus a penalty on steepness. T=450T=450 steps is a budget, not convergence.

Trabucco et al. (2021), Eq. 4 and §3.4: β = 0.9, T = 450; the paper also reports that using the trust-region procedure to build μ performs similarly. On flat ground the trial step promises about what the surrogate says, so nine tenths of the same number is subtracted and a tenth is left: the search climbs at a tenth of the pace. On a steep slope the promise is larger by about η‖∇f̂‖², and nine tenths of that is subtracted too, so L_opt falls where f̂ is steep — the edge beyond the data, where a plain fit extrapolates, is downhill for the search. In the toy of the next widgets η = 0.34 and the conservative surrogate's slope beyond the data is about 0.07, so the brake acts mostly through the pace: 450 steps travel about 1.1 units.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based27 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

Turning the dial

The same picture as Act 1: at x^\hat x the dot is what the surrogate promised, the ring what x^\hat x is really worth. The search always takes the same 450 slow steps from □; only the penalty α\alpha changes. Too little and it runs to the edge (BB large); too much and it stops short of x∗x^* (AA large).

Numbers on the dial: BB falls from 4.444.44 at α=0\alpha=0 to below zero by α=0.15\alpha=0.15; AA rises to 1.411.41 at α=1.3\alpha=1.3; the loss is 2.792.79, 0.330.33 at 0.150.15, 0.030.03 or less from 0.30.3 to 0.90.9, and 0.700.70 at 1.31.3. At α=0\alpha=0 the trust-region search passes the optimum (worth 2.662.66) near step 50 and reaches the edge by step 450 — the same end point as plain ascent. Why the search stops: the trust-region gradient is about 0.1×f^′0.1\times\hat f', so on the conservative surrogate (slope about 0.070.07 beyond the data, against 0.410.41 for the plain fit) each step moves about 0.00240.0024 and 450 steps travel about 1.11.1. Run longer at α=0.3\alpha=0.3: x=7.41x=7.41 after 900 steps (worth 1.901.90), 9.789.78 after 1,800, the edge by 4,500. Only α=1.3\alpha=1.3 stops at a real peak of the surrogate (x=4.43x=4.43). The attacker's farthest point at α=0.3\alpha=0.3 is x=5.84x=5.84, so x^=6.32\hat x=6.32 is just outside μ\mu.

The exact three-term split f(x∗)−f(x^)=A+gap+Bf(x^*)-f(\hat x)=A+\text{gap}+B always holds. Dropping the gap to get the bound A+BA+B is valid only when the gap is non-positive — when the search ends at a point the surrogate rates at least as high as x∗x^*. A local search need not, which is why the dial shows AA, BB and the loss but not the bound.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based28 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

The same shape on a real taskCOMs against naive gradient ascent · HopperController, 5,126 dimensions

Average return of the design after each ascent step, as the source deck shows it. The published version (Trabucco et al., 2021, Fig. 3) runs
Average return of the design after each ascent step, as the source deck shows it. The published version (Trabucco et al., 2021, Fig. 3) runs to 450 steps and shows the same shape.

Naive ascent improves at first — near 2,800 after about seven steps in this figure — then deteriorates as further steps carry it further from the data.

COMs climbs slowly and stays high over the 450 steps — as in the toy, where a flattened surrogate and a slow search keep the design near the data for that budget.

The penalty does not make the search smarter. It makes later steps stop being rewarded for leaving the data.

Source alignment: Part 2 p. 38. The paper reports the same comparison for the evaluation budget (p. 40): COMs reaches about 2,400 within 25 candidates, naive ascent needs all 128 to reach about 2,100.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based29 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

Conservatism is learned where the attacker wentso the final search must not go far from there

α=0.3\alpha=0.3: after 450 slow steps the search is next to the true best, still rising slowly. Press →: plain ascent on the same surrogate runs to the far edge, where nothing pushed it down. Press → again: the slow search on the steep plain fit.

The 2 × 2 of model and search, 450 steps from the best design in DD: plain fit + plain ascent → x=10x=10, worth −0.14-0.14; plain fit + trust region → x=10x=10, −0.14-0.14 (it passes 2.662.66 near step 50); conservative fit + plain ascent → x=10x=10, −0.14-0.14, where the surrogate still promises 2.312.31 (it passes 2.652.65 near step 40); conservative fit + trust region → x=6.32x=6.32, 2.622.62. In this toy neither half works alone — and the slow search is still rising when its steps run out: run far longer, it reaches the edge too.

COMs is the pair: a surrogate flattened where the attacker went, and a short, slow search on it.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based30 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

What conservatism promises, and what it does nota lower bound on average over the attacker's designs — not design by design

Three designs, one value each; grey is how often the data sees it, red how often the attacker does. Press → to apply f^=y−α(μ/d−1)\hat f=y-\alpha(\mu/d-1), and again for what follows.
Averaged over the attacker's designs the surrogate sits below the truth — the paper's Proposition 1; averaged over the data it is unbiased. Design by design it can sit above, and it can pull the best design down: the cost AA.

Where the formula comes from, in one line: the penalty pushes a design down in proportion to μ(x), holds it up in proportion to d(x), and the fit term resists in proportion to d(x), so with one free value per design the balance is f̂ = y − α(μ/d − 1). The two-line derivation is the appendix slide "Backup — the tabular COMs solution". Numbers behind the picture (α = 0.5): d = (0.5, 0.3, 0.2), μ = (0.1, 0.3, 0.6), y = (1, 2, 3), so f̂ = (1.4, 2.0, 2.0); E_μ[f̂ − y] = −0.56 ≤ 0, E_d[f̂ − y] = 0. Proposition 1 (Trabucco et al., 2021) is the network version of the same statement: with α large enough, the surrogate's average over the optimiser's own outputs is at most the truth's, under Lipschitz and kernel-style assumptions. The calculation holds μ fixed and needs μ(x) > 0 only where d(x) > 0: where the attacker leaves the data altogether the tabular loss has no minimum, so this explains the mechanism inside the data and does not show that OOD is solved.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based31 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

Conservatism is a dial — make it a budgetchoosing α is hard, so state the conservatism in the objective's own units

θ∗=arg min⁡θ12ED[(fθ(x)−y)2]s.t.Ex∼μθ[fθ(x)]−Ex∼D[fθ(x)]  ≤  τ\theta^* = \argmin_\theta \tfrac12\E_{\mathcal D}\big[(f_\theta(x)-y)^2\big] \quad\text{s.t.}\quad \E_{x\sim\mu_\theta}[f_\theta(x)] - \E_{x\sim \mathcal D}[f_\theta(x)] \;\le\; \hl{\tau}
HopperController, five budgets. {p}(Trabucco et al., 2021)
HopperController, five budgets. (Trabucco et al., 2021)

α\alpha's right value depends on the scale of yy; τ\tau is a budget on how far the surrogate may rate the attacker's designs above the data. It bounds a gap between two of the surrogate's own averages — not its error, which is never observed offline. With the objective normalised first, the paper uses τ=0.05\tau=0.05 on every task, and α\alpha becomes the constraint's Lagrange multiplier.

τ=0.1\tau=0.1 barely moves for forty steps — conservative enough to stay home. τ=1\tau=1 and τ=2\tau=2 climb fastest. Neither end is free.

Turning a penalty into a constraint with an interpretable budget is a move this course makes more than once — Lecture 1's trust region, and TRPO's bound on the policy step in Lecture 10.

Source alignment: Part 2 pp. 36 (the constraint form) and 39 (the τ ablation).

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based32 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

The same disease, one rung up the coursean analogy Lecture 12 takes up

COMs — a conservative objective

θ∗=arg min⁡θ  {12ED[(fθ(x)−y)2]+α(Eμ[fθ]−ED[fθ])}.\begin{aligned} \theta^*=\argmin_\theta\;\Big\{&\tfrac12\E_D[(f_\theta(x)-y)^2]\\ &+\alpha\big(\E_\mu[f_\theta]-\E_D[f_\theta]\big)\Big\}. \end{aligned}

An optimiser exploits fθf_\theta at designs outside the data.

CQL — a conservative value

Q∗=arg min⁡Q  {12ED[(Q−BπQ^)2]+α Es∼D[log⁡∑aeQ(s,a)−Ea∼π^β(⋅∣s)[Q(s,a)]]}.\begin{aligned} Q^*=\argmin_Q\;\Big\{&\tfrac12\E_D[(Q-\mathcal B^\pi\hat Q)^2]\\ &+\alpha\,\E_{s\sim D}\Big[\log\textstyle\sum_a e^{Q(s,a)}\\ &\qquad-\E_{a\sim\hat\pi_\beta(\cdot\mid s)}[Q(s,a)]\Big]\Big\}. \end{aligned}

A policy exploits QQ at actions outside the data.

Fit the data · push down what the optimiser would chase · hold up what the data contains. The problem and the shape of the objective are shared; the targets, the optimiser and the guarantees are not.

Source alignment: Part 2 p. 33, where the source deck draws this comparison itself.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based33 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

Check — what conservatism costs

In COMs, raise α\alpha far past its useful range. Which term of the decision bound grows, and why?

Conservatism trades BB for AA. Too little and the optimiser exploits the error; too much and the model refuses to rate anything it has not already seen, which is a very safe way to be useless. In the toy, α=1.3\alpha=1.3 gives A=1.41A=1.41 and a returned design worse than the best in D\mathcal D. Writing the conservatism as a budget τ\tau makes the trade visible; it does not remove it.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based34 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

PRIME — a conservative surrogate for hardware designKumar, Yazdanbakhsh, Hashemi, Swersky & Levine · ICLR 2022

θ∗=arg min⁡θ  ED[(fθ(x)−y)2]−α Ex−∼Opt(fθ)[fθ(x−)]−β Ex′∼Dinfeasible[fθ(x′)]\theta^*=\argmin_\theta\;\E_{\mathcal D}\big[(f_\theta(x)-y)^2\big]-\alpha\,\E_{x^-\sim\mathrm{Opt}(f_\theta)}\big[f_\theta(x^-)\big]-\beta\,\E_{x'\sim\mathcal D_{\text{infeasible}}}\big[f_\theta(x')\big]

Here ff is a latency, which is minimised — so conservative means pushing the predicted latency up at the designs the optimiser finds, and at designs the log records as infeasible. Training over many target applications lets one model serve unseen ones.

The search uses only a log of past simulations; the baseline calls the simulator as it searches.

Latency of the best accelerator found (lower is better). {p}(Kumar et al., 2022)
Latency of the best accelerator found (lower is better). (Kumar et al., 2022)

Source alignment: Part 2 pp. 54–55. The source writes PRIME's loss without COMs' data term; it is reproduced as written.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based35 / 75
ACT 2Conservatism: train the surrogate against its own optimiserLecture 5

RoMA — make the surrogate smooth where the optimiser standsYu, Ahn, Song & Shin · NeurIPS 2021

The jagged surrogate's tallest spike is a wrong solution; the smooth one peaks on the truth. {p}(Yu et al., 2021, Fig. 2)
The jagged surrogate's tallest spike is a wrong solution; the smooth one peaks on the truth. (Yu et al., 2021, Fig. 2)

Its assumption: over-estimates come from a network that is not smooth, with spurious spikes between and beyond the data. So it changes the surrogate's shape near each candidate, not its level.

Stage 1 — train it smooth

L(θ)=max⁡θ~∈B(θ) E(x,y)∼D, δ∼N(0,σ)[(f(x+δ;θ~)−y)2]L(\theta)=\max_{\tilde\theta\in B(\theta)}\ \E_{(x,y)\sim D,\ \hl{\delta\sim\mathcal N(0,\sigma)}}\Big[\big(f(\hl{x+\delta};\tilde\theta)-y\big)^2\Big]

Noise on the inputs and the worst weights nearby: the fit must hold on a neighbourhood of each point, not at the point alone.

Stage 2 — re-smooth at each step

θt=arg min⁡θ~∈B(θ) ∥∇xf(x(t);θ~)∥2+α[f(x(t);θ~)−f(x(t);θt−1)]2\theta_t=\argmin_{\tilde\theta\in B(\theta)}\ \hl{\big\lVert\nabla_x f(x^{(t)};\tilde\theta)\big\rVert_2}+\alpha\big[f(x^{(t)};\tilde\theta)-f(x^{(t)};\theta_{t-1})\big]^2

Flat at the candidate (the gradient term) without moving its prediction there (the second). Then one ascent step on f(⋅;θt)f(\cdot;\theta_t).

Adjacent to COMs rather than the same idea: COMs lowers the scores the optimiser would reach; RoMA removes the slopes that would carry it there.

Source alignment: Part 2 pp. 41–49. The picture is the paper's Figure 2; the objectives are the source's pp. 47 and 49, with B(θ)={θ~:∥θl−θ~l∥F≤ϵ∥θl∥F ∀l}B(\theta)=\{\tilde\theta:\lVert\theta_l-\tilde\theta_l\rVert_F\le\epsilon\lVert\theta_l\rVert_F\ \forall l\} (Stage 1 is the double-perturbation loss of Adversarial Weight Perturbation, NeurIPS 2020; the inner maximisation runs by projected gradient ascent). Stage 1 smooths only where the data is, which is why Stage 2 re-adapts at every candidate — the paper's pipeline figure is on the appendix slide "Backup — RoMA's two stages".

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based36 / 75
SESSION 1Conservatism: train the surrogate against its own optimiserLecture 5

Session 1 — what conservatism fixed, and what it left

Mitigated

BB, the optimiser's exploit — on the designs the training attacker visits, with a dial (α\alpha) or a budget (τ\tau) to set how hard, and a short, slow search that does not get far from there.

Left

  • the protection is tied to the region its attacker explored — and to the search's budget;
  • too much of it inflates AA;
  • it never says how much the model knows, so it cannot tell a gap in the data from a region that is truly poor.
COMs controls the optimiser's optimism. Session 2 asks two questions it cannot answer: can we tell which predictions are actually uncertain, and can knowledge of the system make the model trustworthy to begin with?
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based37 / 75
Session 2 · Act 3

Uncertainty: decide with what the model does not know

Q3. Conservatism controls the optimiser's optimism. Can the surrogate instead tell us where it does not know — and can the decision use that?
ACT 3Uncertainty: decide with what the model does not knowLecture 5

Session 2 — where Session 1 left off

Q1 What breaks offline?Q2 Conservatism?Q3 Uncertainty?Q4 System knowledge?

What conservatism did

It lowered the scores the optimiser would reach — BB shrank — on the designs its own attacker visited, and a slow search kept the final design there.

What it could not tell us

How much the model knows. A penalty treats a gap in the data and a genuinely poor region alike: both are simply rated low.

Two answers today. Uncertainty: estimate what the surrogate does not know, and decide with it. System knowledge: give the surrogate grounds to extrapolate that the data alone cannot.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based39 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

The papers of Session 2

The two right-hand columns are today's. Click a paper for what it does, why we read it and how it connects.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based40 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

Uncertainty is Lecture 4's tool, with the sign turned

Online — Bayesian optimisation (Lecture 4)

xt+1=arg max⁡x  μ(x)+κ σ(x)x_{t+1}=\argmax_x\;\mu(x)+\kappa\,\sigma(x)

Optimism. Go where the band is wide: if the model is wrong there, the next measurement says so and the band collapses.

Offline — this lecture

x^=arg max⁡x  μ(x)−κ σ(x)\hat x=\argmax_x\;\mu(x)-\kappa\,\sigma(x)

Pessimism. Stay where the band is narrow: no measurement will ever correct a wrong guess, so a wide band is a risk, not an opportunity.

The same two numbers, μ\mu and σ\sigma. What changed is whether the loop closes — whether uncertainty can still be reduced by looking.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based41 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

One model, two signs

A model of the same fifteen points whose mean extrapolates optimistically — like Session 1's surrogate — but whose σ\sigma grows honestly away from the data. Optimism walks to the far edge, where the band is widest; pessimism with κ\kappa about 2 stays at the data.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based42 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

Where σ\sigma comes from for a neural surrogate — Deep EnsemblesLakshminarayanan, Pritzel & Blundell · NeurIPS 2017

A GP gives σ\sigma in closed form. A neural network does not. The simplest widely used answer: train several networks and read their disagreement.

μ(x)=1M∑m=1Mf^m(x),σens2(x)=1M∑m=1M(f^m(x)−μ(x))2\mu(x)=\frac1M\sum_{m=1}^M\hat f_m(x),\qquad \sigma^2_{\text{ens}}(x)=\frac1M\sum_{m=1}^M\big(\hat f_m(x)-\mu(x)\big)^2

The bet

Members trained from different random starts (or resampled data) agree where the data pins the function down, and disagree where it does not.

The offline rule

Plug the ensemble's μ\mu and σ\sigma into μ−κσ\mu-\kappa\sigma. If the bet holds, the rule avoids the designs the members argue about.

The paper also has each member predict its own noise variance and adds it to σ2\sigma^2; the disagreement term above is the part that grows away from the data.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based43 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

In our toy, the alarm is too quiet

Ten members, each fitted to a resample of the same fifteen points. Their spread does widen off the data — but at the far edge it is only 0.24 while their mean is wrong by 4.4. The rule μ−κσ\mu-\kappa\sigma still walks to x=10x=10; it would take κ≈10\kappa\approx10 to stop it. The members share an architecture and data, so they extrapolate wrongly together.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based44 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

NEMO — uncertainty as how easily the model could be talked into any answerFu & Levine · ICLR 2021

Left: we want at a design far from the data. Middle: pretend each possible label was observed there, and refit. Right: normalise across all
Left: we want p(y∣x)p(y\mid x) at a design far from the data. Middle: pretend each possible label yy was observed there, and refit. Right: normalise across all those refits. (Fu & Levine, 2021, Fig. 1)
pNML(y∣x)=p(y∣x;θ^D∪(x,y))⏞pretend this label was measured here and refit — how likely is it now?∫p(y′∣x;θ^D∪(x,y′)) dy′⏟the same score for every label — so they sum to onep_{\text{NML}}(y\mid x)=\frac{\overbrace{p\big(y\mid x;\hat\theta_{\mathcal D\cup(x,y)}\big)}^{\text{pretend this label was measured here and refit — how likely is it now?}}}{\underbrace{\textstyle\int p\big(y'\mid x;\hat\theta_{\mathcal D\cup(x,y')}\big)\,dy'}_{\text{the same score for every label — so they sum to one}}}
How easily could one extra point drag the model to any answer? Far from the data, easily: every label passes its own test, the scores come out equal, and the distribution is flat — I don't know. Inside the data, the neighbours hold the model: only labels near the trend pass, and it is narrow.

θ^D∪(x,y)\hat\theta_{\mathcal D\cup(x,y)} is the model refit on the data plus one pretend point (x,y)(x,y) — a different refit for every label. Source alignment: Part 2 pp. 15–16. Computing it exactly would mean refitting for every label; NEMO quantises yy into KK bins and keeps KK models that it updates while it optimises xx (Part 2 pp. 17–20; see the appendix backup).

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based45 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

The NML formula, one label at a time

The same fifteen points. Press → four times: pretend and refit, score each label (the numerator), normalise (the denominator), decide. Drag the design xx into the data and back out at any step.
The decision. NEMO climbs xx on EpNML[y∣x]\E_{p_{\text{NML}}}[y\mid x]. Where the distribution is flat, that mean sits mid-range, so optimistic extrapolation stops paying and the climb stays near the data.

The model class here is kernel ridge regression — the GP mean of Lecture 4 (linear trend plus RBF, noise sd 0.1); refitting with one extra point (x,y)(x,y) moves the prediction at xx by the share s2(x)/(s2(x)+0.12)s^2(x)/(s^2(x)+0.1^2) of the way to yy. Numbers: at x=3x=3 one new point moves the model 26% of the way, and the NML spread is 0.14 with mean 1.45 (the model's own prediction); at x=8.5x=8.5 it moves it 99%, the NML is flat over the labels [−0.5,3.5][-0.5,3.5] (spread 1.17) and its mean is 1.53, where the model says 3.50. The NML mean peaks at x=5.52x=5.52 (worth 2.56; best in D\mathcal D 2.43); the model's own mean peaks at the edge, x=10x=10 (worth −0.14-0.14). The pull to mid-range comes from the bounded label set, as in NEMO's quantised labels.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based46 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

NEMO's own test — against the ensemble

The same data (left), modelled by NML (middle) and by a bootstrapped ensemble (right). In the boxed region, outside the data, NML is smeared
The same data (left), modelled by NML (middle) and by a bootstrapped ensemble (right). In the boxed region, outside the data, NML is smeared; the ensemble is still a thin, confident line. (Fu & Levine, 2021)
The point NEMO makes is the one our toy just made: an uncertainty estimate is only useful offline if it widens where the data runs out.

Source alignment: Part 2 p. 21.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based47 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

How far can an uncertainty estimate be trusted?Ovadia et al., "Can you trust your model's uncertainty?" · NeurIPS 2019

What they found

Across many methods, calibration — whether a 90 % band holds the truth 90 % of the time — gets worse as the test data drift away from the training data. Ensembles held up best, but they also degraded.

What it means here

An optimiser does not drift gently away from the data: it searches for the most extreme design it can find. Offline MBO puts the uncertainty estimate exactly where such studies find it least reliable.

Not an MBO paper; it is the standard large-scale study of predictive uncertainty under dataset shift, and it tested deep ensembles among other methods.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based48 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

What uncertainty buys, and what it costs

Assumption added

σ\sigma tracks the error: wide where the model is wrong, narrow where it is right.

What it solves

The decision can see the difference between I have checked this and I have not — and avoid the second.

What it leaves

σ\sigma is itself a model output. Off the data it can be as wrong as μ\mu, and in the same direction.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based49 / 75
ACT 3Uncertainty: decide with what the model does not knowLecture 5

Check — reading an ensemble's agreement

At a design far from the data, all ten members of an ensemble agree to within 0.05. What can you conclude?

Agreement is evidence only where the members could have disagreed. Off the data, members built the same way from the same points tend to extrapolate the same way — our toy's ensemble agreed to 0.24 where it was wrong by 4.4. Uncertainty estimates also degrade under shift for every method studied (Ovadia et al., 2019), and an optimiser seeks out exactly the most shifted designs.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based50 / 75
Session 2 · Act 4

System knowledge: give extrapolation grounds

Q4. The data cannot say what happens where there is no data. What we know about the system sometimes can.
ACT 4System knowledge: give extrapolation groundsLecture 5

Knowledge, ordered by how much of it you have

Q1 What breaks offline?Q2 Conservatism?Q3 Uncertainty?Q4 System knowledge?
Structurewhich variables act together — the function splits into parts
A simulatoran approximate model of the system, wrong in level but right in shape
The equationsthe governing laws themselves, as constraints
Each step down adds information the dataset does not contain — and each is an assumption. Right knowledge makes extrapolation trustworthy; wrong knowledge biases every prediction.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based52 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

Structure — count what it takes to see the spacefunctional graphical models · Grudzien Kuba, Uehara, Abbeel & Levine, AISTATS 2024

Cut each variable into ten cells. To see every cell of the whole space takes 10410^4 designs; if the function splits into parts, it is enough to see every cell of each part — press →. A count of coverage, not the paper's theorem.

The paper's result is a regret bound for offline optimisation that depends on how well the data cover each clique's marginal, rather than the joint; it also gives an algorithm that infers the structure from data, over the inputs or over a latent representation. The 10,000-versus-210 count is the intuition, not the bound.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based53 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

Structure — a design better than any in the data

Press → to stitch, and again to check.
FGM's question is exactly slide 7's: can offline optimisation beat the best design in the data? With the right structure, yes — by combining parts that were each seen, in a combination that never was.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based54 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

A simulator — Kennedy & O'HaganBayesian calibration of computer models · JRSS-B 2001

The same fifteen points and the same hidden function as Session 1. Press → twice.
The prediction relaxes to the simulator, not to a straight line, because the GP's error term returns to its zero prior mean away from the data. That is an assumption, not a guarantee: where the simulator is wrong and there is no data, so is the model.

Kennedy & O'Hagan is a calibration paper — it fits the simulator's parameters θ\theta and the discrepancy jointly; it is not itself an MBO algorithm. Here θ\theta is fixed and only the discrepancy is learned. Lecture 4's GP plays the role of δ(x)\delta(x).

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based55 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

The equations — physics-informed surrogateshPINN · Lu, Pestourie, Yao, Wang, Verdugo & Johnson · SIAM J. Sci. Comput. 2021

Designthe shape or material layout being optimised
Networkpredicts the physical field the design produces
Physics in the lossthe governing equation's residual, and hard constraints built into the network
Objectivecomputed from the field, then improved
When the governing equation is known, extrapolation is no longer left to the data: the network is trained to satisfy the equation at points spread over the domain, with the design's constraints imposed explicitly. The cost is the strongest assumption of the three — a known equation — and the physics holds only as well as it is enforced.

hPINN solves inverse-design problems in optics and fluids with physics-informed networks, imposing hard constraints by penalty and augmented-Lagrangian methods. It is adjacent work, not fixed-dataset offline MBO: it uses the equations, not just logged designs.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based56 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

What knowledge buys, and what it costs

Assumption added

The structure, the simulator or the equations are right — beyond the data, where they cannot be checked.

What it solves

Extrapolation gets grounds other than the data: parts combine, a simulator supplies the shape, physics rules out the impossible.

What it leaves

Knowledge is often partial or missing, and wrong knowledge does not announce itself — it is trusted most exactly where the data cannot correct it.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based57 / 75
ACT 4System knowledge: give extrapolation groundsLecture 5

Check — when to trust a stitched design

An additive model f(x1,x2)=g(x1)+h(x2)f(x_1,x_2)=g(x_1)+h(x_2) predicts that a combination never measured beats every design in the data. When should you trust it?

The prediction rests on the structure, not on the fit: if x1x_1 and x2x_2 interact, a small training error can coexist with a badly wrong stitched value. With the right structure and coverage of each part, combining parts that were each seen is exactly how offline optimisation can beat the best design in the data.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based58 / 75
CLOSING

Closing

Three answers to one failure — and the problem they leave for Lecture 6.
CLOSINGLecture 5

Three answers, side by side

Conservatism Uncertainty System knowledge
in depth COMs Deep Ensembles, NEMO FGM
mechanism lower the scores the optimiser would reach estimate what the model does not know; decide with μ−κσ\mu-\kappa\sigma constrain how the model may extrapolate
assumption the attacker finds the tempting designs σ\sigma tracks the error the structure, simulator or physics is right
strength curbs optimism where the search goes separates unchecked from checked can beat the best design in the data
weakness too much inflates AA; tied to its search σ\sigma fails where it matters most wrong knowledge biases everything
Not rivals: an uncertainty penalty is itself conservative, and a structured model can be trained conservatively. Each controls BB under a different assumption.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based60 / 75
CLOSINGLecture 5

What all three leave — and what Lecture 6 takes up

Performance

Is the design good? — the objective

Reliability

Can we trust the predicted score? — this lecture

Validity

Is the design possible at all — a molecule, a foldable protein? — Lecture 6

OOD and invalid are different problems: a design outside the data can be valid and excellent, and one next to the data can break a constraint. This lecture gave predictions grounds for trust, each under a stated assumption; it did not make the search space valid or give a batch of different good candidates. Lecture 6 learns the distribution of plausible designs and lets a performance model in at four places — and every tool of this lecture can still be used there.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based61 / 75
CLOSINGLecture 5

Where we are — a forward model, then a search

the model the decision
Surrogate (Lec 5 ✓) forward: fθ(x)≈f(x)f_\theta(x)\approx f(x) search fθf_\theta — conservatively, with uncertainty, or with knowledge
Generative (Lec 6) a distribution of plausible designs, plus a performance model search its coordinates, refit it, condition it, or steer its sampler

Hold the shape of this lecture: a forward model searched carefully. Lecture 6 keeps a performance model in the loop and adds a generator that decides where to look — and this lecture's failure reappears there wherever the performance model steers the generator. Lecture 12 meets it again, with a policy exploiting a QQ-function.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based62 / 75
Offline, every number off the data is a guess — decide accordingly.
Lower the guess where the search goes, measure how unsure it is, or give it grounds from what you know about the system.
Questions?
Two things to carry out of here. The optimiser is an adversary of its own model — it will find the errors. And trust needs grounds — a penalty, an honest uncertainty, or knowledge of the system.
APPENDIX

Backup slides

Complete statements, kept out of the narrative.
APPENDIXBackup slidesLecture 5

Reading guide — Session 1 papers: the problem and conservatism

paper why we read it how it connects
Adversarial examples · Goodfellow et al., ICLR 2015 the mechanism: gradient search finds where a model is wrong COMs generates this attack during training and trains against it
Design-Bench · Trabucco et al., ICML 2022 defines offline evaluation; every method here is scored on it we use its 2021 task versions
COMs · Trabucco et al., ICML 2021 — in depth the clearest conservative surrogate one-step twin of CQL; PRIME and LCOMs build on it
PRIME · Kumar et al., ICLR 2022 conservatism in real chip design, from logged simulations builds on COMs
RoMA · Yu et al., NeurIPS 2021 another lever: shape, not level compared with COMs
CQL · Kumar et al., NeurIPS 2020 the same disease, with a policy as the optimiser Lecture 12
LCOMs · Qi et al., ICLR 2023 workshop a conservative surrogate searched in a learned space Lecture 6
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based66 / 75
APPENDIXBackup slidesLecture 5

Reading guide, continued — Session 2 papers: uncertainty and system knowledge

paper why we read it how it connects
Deep Ensembles · Lakshminarayanan et al., NeurIPS 2017 — in depth the standard σ behind μ−κσ\mu-\kappa\sigma Lecture 4's UCB, sign turned
NEMO · Fu & Levine, ICLR 2021 uncertainty built for offline MBO same group and year as COMs
Uncertainty under shift · Ovadia et al., NeurIPS 2019 calibration degrades with shift, even for ensembles stress-tests the uncertainty stream
Functional graphical models · Grudzien Kuba et al., AISTATS 2024 — in depth when structure lets us beat the best design in the data Lecture 3's graphs
Kennedy & O'Hagan · JRSS-B 2001 a simulator inside a surrogate Lecture 4's GP as the error term
Hard-constraint PINN · Lu et al., SIAM J. Sci. Comput. 2021 the governing equations themselves needs a known PDE

Most of these papers come from one research programme — Levine's group at Berkeley: CQL (2020), COMs and NEMO (2021), PRIME and Design-Bench (2022), LCOMs (2023), FGM (2024). The map slide says so in its Session 2 text.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based67 / 75
APPENDIXBackup slidesLecture 5

Backup 1 — offline MBO against Bayesian optimisation

The same goal, arg max⁡xf(x)\argmax_x f(x), under different access — and the difference dictates the method.

Bayesian optimisation (Lec 4) Offline MBO (Lec 5)
data active — query ff each round fixed — a static dataset DD
a mistake is corrected by the next query uncorrectable — it is returned as the answer
uncertainty drives where to sample where not to trust
the core risk is slow convergence overestimation →\to an invalid design
the design principle exploration conservatism

Both build a surrogate; both maximise something over it. What differs is whether the loop closes. When it does, optimism is self-correcting and therefore cheap — an over-rated point gets queried, found wanting, and the posterior repairs itself. When it does not, optimism is a one-way door.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based68 / 75
APPENDIXBackup slidesLecture 5

Backup 2 — NEMO, made tractable

The estimator. pNMLp_{\text{NML}} is the minimax solution of   arg min⁡hmax⁡y′(log⁡p(y′∣x;θ^D∪(x,y′))−log⁡h(y′∣x))\;\argmin_h \max_{y'} \big(\log p(y'\mid x;\hat\theta_{D\cup(x,y')}) - \log h(y'\mid x)\big), where θ^D∪(x,y)=arg max⁡θ1N+1∑(x,y)∈D∪(x,y)log⁡p(y∣x,θ)\hat\theta_{D\cup(x,y)} = \argmax_\theta \frac{1}{N+1}\sum_{(x,y)\in D\cup(x,y)}\log p(y\mid x,\theta).

Problem. The denominator requires training an MLE for every possible yy and then integrating over them — impossible twice over for a deep network.

Fix 1 — quantise. Floor each yy into one of KK bins, so the integral becomes a sum:   ∫yp(y∣x,θ^D∪(x,y)) dy≈B∑k=1Kp(⌊yk⌋∣x,θ^D∪(x,⌊yk⌋))\;\int_y p(y\mid x,\hat\theta_{D\cup(x,y)})\,dy \approx B\sum_{k=1}^K p\big(\lfloor y_k\rfloor \mid x, \hat\theta_{D\cup(x,\lfloor y_k\rfloor)}\big).

Fix 2 — amortise. Keep KK models and update them incrementally while optimising xx, rather than retraining from scratch at each iterate:

for t = 1 … T:
  for k = 1 … K:  D' ← D ∪ (x_t, ⌊y_k⌋);  θ^k ← θ^k + α_θ ∇ LogLik(θ^k, D')
  p̂_NML(y | x_t) ∝ p(y | x_t, θ^y) / Σ_k p(⌊y_k⌋ | x_t, θ^k)
  x_{t+1} ← x_t + α_x ∇_x E_{y ~ p̂_NML(y|x)}[ g(y) ]

Quantisation flattens the landscape and kills the gradient, so NEMO's head outputs one minus the CDF of a logistic distribution sampled at intervals of 1/K1/K and takes the mean; gradients then flow through the logistic mean μ(x)\mu(x), and Proposition 4.1 guarantees ⟨∇xμ(x),∇xymean(x)⟩≥0\langle\nabla_x\mu(x),\nabla_x y_{\text{mean}}(x)\rangle \ge 0 — the smooth surrogate gradient never points against the one we want.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based69 / 75
APPENDIXBackup slidesLecture 5

Backup — one COMs loss calculationfreeze the sampled candidates while inspecting the update

One measured design has target y=4y=4 and prediction u=3.5u=3.5. One adversarial design has prediction v=8v=8. Use α=0.2\alpha=0.2.

L=12(u−4)2+0.2(v−u)=0.125+0.9=1.025.L=\tfrac12(u-4)^2+0.2(v-u)=0.125+0.9=1.025.

At the measured design

∂L∂u=(u−4)−0.2=−0.7.\frac{\partial L}{\partial u}=(u-4)-0.2=-0.7.

Gradient descent increases uu, improving the fit and the relative data score.

At the adversarial design

∂L∂v=0.2.\frac{\partial L}{\partial v}=0.2.

Gradient descent decreases vv, reducing the unsupported high prediction.

Fit measured targets and shrink the score gap to tempting candidates. In a network the two updates share parameters, so each moves the other's prediction too.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based70 / 75
APPENDIXBackup slidesLecture 5

Backup — the tabular COMs solutionone free value per design, for intuition

Take a finite set of designs, one free value f^(x)\hat f(x) for each, data frequencies d(x)d(x) and attacker frequencies μ(x)\mu(x). The loss is a sum over designs, so each f^(x)\hat f(x) is solved on its own:

L=12∑xd(x)(f^(x)−y(x))2+α(∑xμ(x)f^(x)−∑xd(x)f^(x))L=\tfrac12\sum_x d(x)\big(\hat f(x)-y(x)\big)^2+\alpha\Big(\sum_x\mu(x)\hat f(x)-\sum_x d(x)\hat f(x)\Big)

Setting ∂L/∂f^(x)=d(x)(f^(x)−y(x))+α(μ(x)−d(x))=0\partial L/\partial \hat f(x)=d(x)\big(\hat f(x)-y(x)\big)+\alpha\big(\mu(x)-d(x)\big)=0:

f^(x)=y(x)−α(μ(x)d(x)−1)\hat f(x)=y(x)-\alpha\Big(\frac{\mu(x)}{d(x)}-1\Big)

Average the error under each distribution, using ∑xμ(x)=∑xd(x)=1\sum_x\mu(x)=\sum_x d(x)=1:

Eμ[f^−y]=−α(∑xμ(x)2d(x)−1)=−α∑x(μ(x)−d(x))2d(x)  ≤  0,Ed[f^−y]=0.\E_\mu\big[\hat f-y\big]=-\alpha\Big(\sum_x\frac{\mu(x)^2}{d(x)}-1\Big)=-\alpha\sum_x\frac{\big(\mu(x)-d(x)\big)^2}{d(x)}\;\le\;0,\qquad \E_d\big[\hat f-y\big]=0.
A lower bound on average under the attacker, unbiased under the data — not design by design, and only inside the data, where d(x)>0d(x)>0.

Assumed: μ and d are distributions on the same finite set, μ(x) > 0 only where d(x) > 0, y(x) is the mean measured value at x, and μ is held fixed. Where the attacker visits less often than the data, f̂ is pushed above y. If the attacker reaches a design with d(x) = 0 — genuinely out of distribution — the tabular loss has no minimum there at all: this explains the mechanism; it does not show that OOD is solved. The paper's Proposition 1 is the network version of the same average statement, under Lipschitz and kernel-style assumptions.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based71 / 75
APPENDIXBackup slidesLecture 5

Backup — RoMA's two stagesYu, Ahn, Song & Shin · NeurIPS 2021

Step 1 pre-trains under input noise and weight perturbation, but only smooths where the data is; so Step 2 re-adapts the model (yellow) at e
Step 1 pre-trains under input noise and weight perturbation, but only smooths where the data is; so Step 2 re-adapts the model (yellow) at every candidate x(t)x^{(t)} before the solution update. (Yu et al., 2021, Fig. 1)

Stage 1 — train it smooth

L(θ)=max⁡θ~∈B(θ) E(x,y)∼D, δ∼N(0,σ)[(f(x+δ;θ~)−y)2]L(\theta) = \max_{\tilde\theta\in B(\theta)}\ \E_{(x,y)\sim D,\ \delta\sim\mathcal N(0,\sigma)}\Big[\big(f(x+\delta;\tilde\theta)-y\big)^2\Big]

Noise on the inputs, worst-case perturbations of the weights, B(θ)={θ~:∥θl−θ~l∥F≤ϵ∥θl∥F}B(\theta)=\{\tilde\theta:\lVert\theta_l-\tilde\theta_l\rVert_F\le\epsilon\lVert\theta_l\rVert_F\}; the inner maximisation by projected gradient ascent.

Stage 2 — re-smooth at each step

θt=arg min⁡θ~∈B(θ)  {∥∇xf(x(t);θ~)∥2+α[f(x(t);θ~)−f(x(t);θt−1)]2}\begin{aligned} \theta_t=\argmin_{\tilde\theta\in B(\theta)}\;\Big\{&\lVert\nabla_x f(x^{(t)};\tilde\theta)\rVert_2\\ &+\alpha\big[f(x^{(t)};\tilde\theta)-f(x^{(t)};\theta_{t-1})\big]^2\Big\} \end{aligned}

Flatten the model at the current candidate, without moving its prediction there far.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based72 / 75
APPENDIXBackup slidesLecture 5

What the benchmark sayssource-reported best-of-batch task scores; Avg uses the source's normalised aggregate

method GFP Molecule Supercond. Hopper Ant DKitty Avg
Dataset max 3.152 6.558 73.90 1361.6 108.5 215.9 1.000
Gradient ascent 2.894 6.636 89.64 1050.8 399.9 390.7 1.237
MINs 3.315 6.508 80.23 746.1 388.5 352.9 1.304
CbAS 3.408 6.301 72.17 547.1 393.0 396.1 1.324
COMs 3.305 6.876 110.0 2395.7 378.8 341.4 1.589
NEMO 3.359 6.682 127.0 2130.1 393.7 431.6 1.687
RoMA 3.357 6.890 103.9 2466.5 468.5 384.3 1.705

Naive gradient ascent is not useless — it has the lowest aggregate score among the six methods shown, and on HopperController it returns less than the best trajectory already in the dataset. Every method that beats it does so by adding a constraint on what the surrogate is allowed to believe, not by searching harder.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based73 / 75
APPENDIXBackup slidesLecture 5

LCOMs — a conservative surrogate searched in a learned spaceLatent Conservative Objective Models · Qi et al., ICLR 2023 workshop on ML for materials

Chemical space is not a vector space, so a CD-VAE encoder ϕ(x,c)\phi(x,c) maps a crystal into one, and a conservative surrogate of the lattice energy is optimised inside that latent space, then decoded:

θ∗=arg min⁡θ E(x,c)∼D[(Eθ(ϕ(x,c),c)−E(x,c))2]−α Ex−∼Opt(Eθ)[Eθ(ϕ(x−,c),c)]\theta^*=\argmin_\theta\ \E_{(x,c)\sim\mathcal D}\big[(E_\theta(\phi(x,c),c)-E(x,c))^2\big]-\alpha\,\E_{x^-\sim\mathrm{Opt}(E_\theta)}\big[E_\theta(\phi(x^-,c),c)\big]

Mean energy improvement 2.252.25 against supervised learning's 1.101.10. A generative model supplies the coordinates; a conservative surrogate does the searching — the bridge Lecture 6 crosses.

Lecture 5 · Data-Driven Design Optimization — Surrogate-Based74 / 75
APPENDIXBackup slidesLecture 5

Five ways to optimise a black box, and what every one of them needswhat the source lecture spends fifteen slides establishing

method what it does what it costs
Gradient ascent on a proxy fit fθf_\theta to the data so far, step xt+1=xt+η∇xfθ(xt)x_{t+1} = x_t + \eta\nabla_x f_\theta(x_t), evaluate one query per step
Genetic algorithms population, truncation selection of the top EE, crossover, mutation NN queries per generation
CMA-ES sample from an adaptive Gaussian N(mt,σt2Ct)\mathcal N(\mathbf m_t,\sigma_t^2 C_t); update mean, covariance and step size nn queries per generation
Bayesian optimisation (Lec 4) GP posterior, then xt+1=arg max⁡xAt(x)x_{t+1} = \argmax_x A_t(x) one query per round
Policy gradient learn πθ(x)\pi_\theta(x) by ∇θEx∼πθ[f(x)]=E[∇θlog⁡πθ(x) f(x)]\nabla_\theta\E_{x\sim\pi_\theta}[f(x)] = \E[\nabla_\theta\log\pi_\theta(x)\,f(x)] nn queries per round
Every one of the five is a loop, and every loop closes through an evaluation of the real ff.
Lecture 5 · Data-Driven Design Optimization — Surrogate-Based75 / 75

Keys

→ / space
next reveal, then next slide
←
back
↑ ↓
skip a whole slide
R
reset this slide's widgets and quizzes
M
slide index
P
print → save as PDF (1280×720)
F
fullscreen