Curlscape logo

Surrogate models: where millisecond predictions can be trusted

Surrogate models: where millisecond predictions can be trusted

A surrogate model does one thing: it replaces a slow simulation with a fast approximation. You run a CFD, thermal, or structural solver a few hundred times across a design space, train a model on those results, and from then on you can predict the quantity of interest in milliseconds instead of hours.

That speed is what makes design-space search possible. The propeller optimization we ran put thousands of evaluations inside a genetic algorithm. That only worked because each evaluation was cheap. A surrogate is one way to make it cheap. But a fast wrong answer is worse than a slow right one, so the real engineering is knowing when the surrogate can be trusted and when it cannot.

I spent seven years at Ansys building fast-model and optimization systems for electronics thermal design. The lesson that stuck: surrogates are extremely useful and extremely easy to misuse, and most of the difference is whether you stayed inside the envelope you trained over.

What a surrogate is good for

The core value is throughput. A single high-fidelity thermal or CFD run might take an hour. An optimizer or a design sweep wants thousands of evaluations. You cannot run thousands of hours of solver time for every study. A surrogate trained on a few hundred runs turns each subsequent evaluation into a millisecond evaluation, which is what makes optimization loops, sensitivity studies, and real-time what-if exploration feasible.

To be clear: the surrogate does not replace your solver. It compresses the expensive results you already computed into a fast approximation, and you still need the solver to build it and to check it.

Which approximation you pick matters, because everything below depends on it. At a few hundred runs and a handful of parameters, a Gaussian process is usually the right default: it fits small datasets well and returns a predictive variance you can steer sampling with, at the cost of training that scales roughly cubically in sample count. Neural surrogates need more data than a CAE budget usually allows and give you no uncertainty for free, but they scale to high-dimensional inputs and to field outputs rather than scalars. Polynomial response surfaces are the cheapest to fit and the most likely to hide a bad fit behind a good-looking R². One more distinction worth keeping straight: with mesh or residual noise in your solver output you generally want a regressor with a nugget or some regularisation, not an exact interpolant that honours every wobble in the training data.

When can you trust a surrogate? Interpolation inside the envelope

A surrogate is reliable when you ask it about designs that sit inside the region you sampled. If you trained across inlet velocities of 5 to 20 m/s and power dissipations of 10 to 50 W, the model is on solid ground predicting a case at 12 m/s and 30 W. That is interpolation, and interpolation between well-sampled points is where surrogates pay for themselves.

One caveat bites people badly here. Being inside each parameter's range is not the same as being inside the sampled region. With two or three parameters those are close enough to identical. Past five or six, most of the bounding box contains no samples at all, so a design that passes every min/max check can still sit a long way from anything you actually solved. Check distance to the nearest training points, not just the ranges.

Inside the trained envelope, on smooth response surfaces, a good surrogate matches the solver closely enough that the error does not change your decision. That is the bar: not "exact," but "accurate enough that the ranking of designs is the same as the solver would give."

Where they degrade: extrapolation and discontinuities

Two things break surrogates, and both are predictable.

Extrapolation. Ask the model about a design outside the sampled range and most surrogates will still return a confident number, because a polynomial fit, an RBF interpolator, or a neural network has no notion of where its data ended. That number is a guess with no support behind it. A Gaussian process is the partial exception: its predictive variance grows as you move away from the training points, so it will at least tell you it is unsure. Read that as a distance-from-data signal rather than an error bar. GP variance is epistemic and computed under an assumed kernel, so it goes quiet exactly where the kernel is wrong, which tends to be the same place the physics is doing something you did not model. A surrogate trained up to 20 m/s has no idea what happens at 30 m/s.

Discontinuities and sharp physics. Smooth response surfaces interpolate well. Physical regime changes do not. Flow separation, phase change such as boiling or condensation, and contact in structural problems all introduce discontinuities or steep gradients where the quantity of interest jumps or kinks. A surrogate with samples on both sides of a separation onset will happily draw a smooth curve straight through it, predicting values that no real operating point produces. Near those transitions, sample density matters enormously, and even then you should be suspicious.

Building the training set: DOE and space-filling

The quality of a surrogate is set before you train anything, by where you place your samples. You want the design of experiments (DOE) to cover the space evenly rather than cluster. Space-filling designs spread samples so no large region is left unsampled, which is what makes it likely that your later queries are interpolating. Plain Latin hypercube sampling only guarantees even coverage of each parameter one at a time; it can still leave clumps and voids in the joint space. Optimised LHS (maximin or centred-L2) and low-discrepancy sequences such as Sobol are the better default, and Sobol has the practical advantage that you can extend the sequence later without throwing away the runs you already paid for.

Two practical rules. First, add samples at the corners and edges of your parameter ranges, not just the interior, because that is where your interpolation support is thinnest. Beyond about six parameters you cannot sample all 2^d corners, so pick the ones on axes the response is most sensitive to and accept that the rest of the boundary is soft. Second, add samples where the physics is nonlinear. A uniform grid wastes runs on the flat regions and under-resolves the interesting ones. Adaptive sampling does this for you: run a first batch, find where the surrogate is least certain or the response is steepest, then spend the next batch there. Note what "least certain" requires, though. It needs a model that produces uncertainty in the first place, such as a Gaussian process or an ensemble. A single neural network will not give you that, and training-set residuals are not a substitute.

Quantifying accuracy: held-out error and physical sanity

You do not get to trust a surrogate because it fit the training data. You trust it because it predicts data it never saw.

Held-out error. Keep a fraction of your runs out of training and measure the surrogate's error against them. That out-of-sample error is your honest accuracy estimate. With only a few hundred expensive runs, k-fold cross-validation usually beats a single hold-out, though it flatters you twice: the surviving folds still bracket the point you left out, and any hyperparameter you tuned on those folds has already seen them. Then report the number that matches the decision you are making. R² looks excellent on almost any space-filling DOE with a wide response range and tells you close to nothing. Worst-case absolute error over the held-out set is what decides whether you can act on a single prediction. And if you are ranking designs, measure rank correlation against the solver, because that is the bar set above.

Physical sanity. Numerical error is not the only failure mode. Check that the surrogate respects the physics: monotonic where the response must be monotonic, correct signs, sensible limits at the boundaries of the space. A surrogate with low held-out error that still predicts a temperature dropping as power rises is telling you that either your sampling or your model form missed something. Over-smoothing and a badly chosen kernel produce that symptom just as readily as a gap in the DOE.

When should you fall back to the full solver?

The discipline that makes surrogates safe is knowing when not to use them:

  • Validation and final sign-off. Optimize with the surrogate, then confirm the chosen design with a full high-fidelity run. This is the same two-tier pattern as the propeller optimization study: search cheap, validate expensive.
  • Out-of-envelope queries. If the design drifts outside the sampled range, stop trusting the surrogate and run the solver, or extend the training set and retrain.
  • Near discontinuities. When you are close to separation, phase change, or contact, treat surrogate predictions as hints and verify with simulation.
  • Certification and high-stakes decisions. Anywhere the cost of being wrong is high, the surrogate narrows the search but the solver makes the call.

What this means in practice

Surrogate models are one of the most useful tools in simulation-driven design, and they are also one of the easiest to oversell. Used inside their envelope, with held-out error measured and a fallback to full simulation at the boundaries, they can turn a week-long optimization study into an afternoon one, once the training runs are paid for. That bill is real: a few hundred runs at roughly an hour each is a few hundred core-hours, so a surrogate only wins if you will query it thousands of times, or reuse it across studies. Used blindly, they produce fast, confident, wrong answers.

To put a number on the solver time a surrogate would save you, run your case through the simulation cost calculator. If you want us to build and validate one against your solver, that is what our surrogate modelling service does: tell us the parameters and the quantity of interest and we will tell you whether it is worth it.

The rule: trust the millisecond prediction inside the envelope, verify with simulation everywhere else.

Building AI into an engineering or product team?

We build AI systems for engineering and enterprise teams. Get in touch and you'll be talking to engineers, not a sales desk.

Get in touch

Written by

Aniket Kulkarni

Aniket Kulkarni is the founder of Curlscape, an AI consulting firm that helps companies build and ship production AI systems. With experience spanning voice agents, LLM evaluation harnesses, and bespoke AI solutions, he works at the intersection of engineering and applied machine learning. He writes about practical AI implementation, model selection, and the tools shaping the AI ecosystem.

View all posts →

Frequently Asked Questions

When can you trust a surrogate model's prediction?

Inside the trained envelope, on smooth response surfaces, where you are interpolating between well-sampled points. There the surrogate typically matches the solver closely enough that the ranking of designs is unchanged. Note that being inside each parameter's range is not the same as being inside the sampled region once you have more than about three parameters. Trust degrades on extrapolation outside the sampled range and near discontinuities such as flow separation, phase change, and contact.

How do you validate a surrogate model's accuracy?

Measure held-out (out-of-sample) error by keeping a fraction of your runs out of training, or use k-fold cross-validation on small datasets, remembering that CV estimates the error of the procedure rather than the shipped model. Report the metric that matches the decision: worst-case absolute error if you will act on a single prediction, rank correlation if you are ranking designs. R-squared flatters almost any wide-range DOE. Then apply physical-sanity checks for monotonicity, correct signs, and sensible limits. Fall back to the full simulation for validation and sign-off, out-of-envelope queries, predictions near discontinuities, and any certification or high-stakes decision.

Does a Gaussian process tell you when it is extrapolating?

Partly. A GP's predictive variance grows as you move away from the training points, so unlike a polynomial fit or a neural network it does signal that it is unsure. Treat it as a distance-from-data measure, not an error bar. The variance is epistemic and computed under an assumed kernel, so it becomes unreliable exactly where the kernel is misspecified, which is often the same place the physics changes regime.

Related reading

Latest from the blog

Book a free consultation