Module 18 · Lesson 18.4
Surrogates, and who is accountable
A fast approximation to a slow analysis — what it buys, what it costs off the edge of its data, and the rule that governs its use.
Why this matters
The most genuinely useful application of machine learning in structural engineering is the surrogate: fit a fast approximation to a slow analysis, then explore a design space in seconds that would have taken days.
It is also the application where the failure mode is most dangerous, because the surrogate's output looks identical whether it is interpolating within its data or extrapolating far outside it.
By the end of this lesson you should be able to
- Explain what a surrogate is for and what it replaces
- Quantify the interpolation and extrapolation error and compare them
- Explain why nothing in the output signals extrapolation
- State and apply the deterministic-check rule
- Say what a recommendation must carry to be reviewable
What a surrogate is for
A nonlinear analysis takes twenty minutes. You want to explore two hundred parameter combinations. That is nearly three days of computation, which is more than the design programme allows.
So: run forty combinations properly, fit a model to those results, and evaluate the model two hundred times in a second. Then run the promising combinations properly to confirm.
That last sentence is the whole discipline. The surrogate narrows the search; the deterministic analysis confirms the answer. Skip the confirmation and the surrogate has stopped being a search tool and become the analysis.
Inside and outside
The library fits a cubic surrogate to a genuinely nonlinear function over the range 0 to 6, then evaluates it out to 14:
| Error | |
|---|---|
| Inside 0 to 6 (interpolation) | 0.066 |
| Outside 6 to 14 (extrapolation) | 45.85 |
That is a factor of about 695.
Inside its data the surrogate is excellent — accurate enough to rank designs reliably and explore with confidence. Outside it, it is a cubic polynomial doing what cubic polynomials do, which is diverge.
Nothing in the output says which
This is the part that matters.
Ask the surrogate for a value at 3 and it returns a number. Ask it at 13 and it returns a number. Both are ordinary floating-point values, formatted identically, delivered with the same speed and the same absence of caveat.
The model has no representation of 'where my data was'. It is a function, defined everywhere.
So the boundary has to be enforced by the engineer, and it has to be enforced explicitly: record the range of every input in the training set, and refuse — or at minimum flag — any query outside it. That is a piece of bookkeeping, not a piece of cleverness, and it is the difference between a useful tool and a confident liar.
The rule
Where a deterministic check exists, it must have been run.
Not 'should ideally'. A recommendation whose deterministic check is available and unrun may not be acted on, whatever the confidence attached to it, because confidence is a property of the model's fit and not evidence about the structure.
The library enforces exactly this: a recommendation with an available-but-unrun check returns allowed: false, with the reason.
What a recommendation must carry
Four things, and none is optional:
Evidence. What the recommendation is based on. Without it there is nothing to review.
Uncertainty. Stated honestly, including that a confidence figure is not a probability of being right.
What would make it wrong. The condition under which the recommendation fails. This is the most useful field and the most often omitted — it is what lets a reviewer check the one thing that matters.
The deterministic check, and whether it has been run.
Then a named human reviews it and records a decision. Not because a process requires it, but because:
The qualified engineer remains accountable for the decision, whatever tool informed it. No tool accepts that accountability, and none can.
Try it
Surrogate model explorer
Fit a fast approximation to a slow function over one range, then query it outside. The error rises by orders of magnitude and nothing about the output changes.
Underlying function
- Query at
- 13.00
- Inside the trained range?
- no — trained only to 6
- Surrogate says
- 101.1853
- True value
- 26.2105
- Error at this query
- 74.9747
- Interpolation error (RMS)
- 0.0660
- Extrapolation error (RMS)
- 45.85
- Extrapolation penalty
- × 695
The surrogate returned 101.185 in the same format, at the same speed, with no warning. It has no representation of where its data was — it is a function, defined everywhere.
What the engineer has to do
- Record the range of every input in the training set. That is bookkeeping, not cleverness, and it is the only defence.
- Check every query against it, and refuse or flag anything outside.
- Confirm the promising candidates with the deterministic analysis. The surrogate searches; the analysis answers.
- Try the cubic function: when the truth is in the surrogate's own family, extrapolation is nearly free. That is a fact about that function, not a general licence.
What this shows: Nothing in a surrogate's output distinguishes an interpolation from an extrapolation — the boundary has to be enforced by the engineer.
Try it
Human approval workflow
A recommendation with evidence, uncertainty and a deterministic check. Try to get it approved with the check unrun.
Evidence recorded
Deterministic check
Human review
Recommendation
Increase the transfer beam from a 762 UB to an 838 UB
- Confidence
- 94 % — which describes how well the model fits its training data, and is not a probability that this is right.
- Evidence
- Comparable spans in the training set used a deeper section; Deflection is the governing check in 8 of 10 similar cases
- What would make it wrong
- The floor zone cannot accommodate the extra 76 mm of depth
- Deterministic check
- Available and not run.
- May this be acted on?
- no
- Blockers
- 2
Why not
- A deterministic check exists for this and has not been run. Confidence is not evidence where a calculation is available.
- No human review recorded.
Try this
- Set the confidence to 100 % with the check unrun. It still cannot be acted on — confidence is not a substitute for a calculation that could have been done.
- Set the check to 'none exists'. Now confidence and evidence and a review are what you have, which is the situation where a recommendation genuinely helps.
- Remove the evidence. Without it there is nothing for a reviewer to examine, so the review would be a formality.
- Reject at review. A recorded rejection is as useful as an acceptance — it says the question was considered.
What this shows: Where a deterministic check exists it must have been run — confidence is a property of the model's fit, not evidence about the structure.
Worked example
A surrogate used just outside its range
Given
- A surrogate fitted over spans of 6 to 12 m from 40 nonlinear analyses
- Interpolation error within that range: about 0.07 in the objective's units
- The same surrogate queried at a 15 m span, because a late design change extended one bay
Find
What the surrogate returns and what should happen
Practice
A surrogate has an interpolation error of 0.066 and an extrapolation error of 45.85. By what factor is extrapolation worse? Give the factor to the nearest ten.
Practice
A nonlinear analysis takes 20 minutes. A study needs 200 combinations. A surrogate is fitted from 40 real runs and used for the rest, with the best 10 confirmed properly. How many minutes of analysis does that take, against running all 200?
Check yourself
A recommendation carries 94 % confidence, full evidence, a named reviewer who has accepted it — and a deterministic check that exists and has not been run. May it be acted on?
Practice
A surrogate runs in 0.02 seconds against a full analysis at 40 seconds. How many times faster is it?
Practice
Building a surrogate needs 200 full analyses at 40 seconds each. How many minutes of computation is that?
Check yourself
What does a surrogate model's output tell you about whether it is extrapolating?
Check yourself
Who is accountable for a design decision made on the strength of an AI recommendation?
Summary
- A surrogate narrows the search; the deterministic analysis confirms the answer
- Interpolation error 0.066, extrapolation error 45.85 — a factor of about 695
- Nothing in the output distinguishes the two, because a fitted function is defined everywhere
- Record the training range and check queries against it — bookkeeping, not cleverness
- Where a deterministic check exists, it must have been run
- A recommendation carries evidence, uncertainty, what would make it wrong, and the check
- The qualified engineer remains accountable, and no tool accepts that accountability
This is educational material. It uses simplified examples to teach principles, and must not be relied on for real design or safety-critical decisions. Module overview and checkpoint