Compress, then regress: a surrogate for the solved game
Learning the solution of 501 for any throw, with principal components and Gaussian processes, and what the components turn out to mean

Contents
Why a surrogate?
Every strategy in this series comes from an exact solve: value iteration over every state of a leg of , for one particular way of throwing. A solve takes several seconds, and produces numbers: the expected number of visits Alice needs to finish from every reachable state.
This works well when we know how Alice throws, but not when we don’t. In the last post, the belief about Alice’s throw was a cloud of candidate throws, each needing its own solution at every decision. In an app, moving a slider that changes the shape of the throw needs a new solution every time. Neither can wait several seconds for each throw.
This is a familiar problem in the computer experiments literature: an expensive, deterministic simulator, with a low-dimensional input and a high-dimensional output, that we want to evaluate quickly anywhere in its input space. The standard answer is an emulator (or surrogate): fit a statistical model to a few hundred runs of the simulator, and use the model instead. This post describes the one I built for , which compresses the solutions with principal components and regresses each component on the throw with a Gaussian process. It is accurate enough that decisions made from it lose visits per aim, its error bars can be trusted, and its components turn out to have clean interpretations: one of them has rediscovered the geometry of the double ring.
What to learn, and what not to
A state of the game is the score left, which dart of the visit is in Alice’s hand, and the score the visit started on. For a throwing distribution , the expected number of visits to finish after aiming at point is
where:
- is the outcome of the dart, and is the state it leads to,
- is the cost of the dart: one at the start of a visit, and nothing otherwise,
- is the value of each state under optimal play.
Only two pieces of this depend on the throwing distribution, and they are very different:
- The outcome probabilities are physics: the throwing density convolved with the board. They can be computed exactly for any throw with a handful of FFTs, in well under a second.
- The values are the expensive part, a full solve of the Markov decision process. But they are a fixed-length vector of numbers, and they should be a smooth function of .
So the surrogate learns only, and every decision combines learned values with exact probabilities. A good surrogate for then makes exactly the decisions an exact solve would, as long as its errors do not change which aim minimises .
There is one more thing that never needs to be learned. If Alice’s darts are pulled by , aiming at lands where aiming at would land without the pull, so
The pull is a translation of the aiming point, and the surrogate is equivariant to it for free.
The inputs
A throwing distribution here is a bivariate Gaussian or Student- with covariance (or scale matrix) and degrees of freedom . We can describe it with four numbers :
| Input | Meaning | Range |
|---|---|---|
| size: , the geometric mean of the two axis spreads | to mm | |
| shape and lean: , where is the angle of the major axis | up to , any lean | |
| tail weight; is the Gaussian | to () |
These are chosen so that the function being learned is as smooth as possible in them:
- Size enters as a logarithm, so that a change in spread is the same step whether Alice is a mm or a mm thrower.
- Shape uses the doubled angle. In polar coordinates (ratio, angle), the angle is undefined for a round group and wraps around every . The doubled-angle coordinates have neither problem: the shapes fill a disc, with round at its centre.
- Tail weight enters as , so the Gaussian is an ordinary point at , rather than the limit .
In fact, are exactly the free entries of the matrix logarithm of the throw:
so the three inputs are the log-Euclidean coordinates of the covariance matrix.
The design
The training throws are a scrambled Sobol sequence over this region: throws, with the shape coordinates mapped so that they are uniform over the disc, and every eighth throw placed exactly at , so that the Gaussian edge is pinned down. Each was solved exactly. A further throws, drawn independently, were solved as a held-out test set. Every input is scaled to before regression.
Compress
Stack the value vectors into a matrix , subtract the mean vector , and take its singular value decomposition, . The rows of are the principal components , and each throw’s coordinates on them are its component scores .
![]() |
|---|
| Left: the share of the variation between throws that the first components leave out. Right: the resulting rms error over all values of every design throw. |
How compressible are the value tables? The first component alone carries of the variation between throws. Ten components reconstruct the values of the design throws with an rms error of visits, and forty with visits. The surrogate keeps forty, so the problem becomes learning smooth scalar functions of four inputs, instead of .
What the components mean
Before regressing anything, it is worth asking what these components actually represent. Correlating each throw’s component scores with its inputs gives a clear picture of the first four:
| Component | Share of variance | Correlation with | with | with | with |
|---|---|---|---|---|---|
| PC1 | |||||
| PC2 | |||||
| PC3 | |||||
| PC4 |
(The signs of the components are arbitrary, so in the figures each one is flipped so that its score increases with the input that drives it.)
Size, and an arch
The first component, PC1, represents the size of the throwing distribution. Its loadings have the same sign on every value, and grow with the score: making a player worse costs visits from everywhere, and more from further away. Its score is a smooth but strongly curved function of (a straight line explains of its variation, a cubic ). Tail weight mostly enters here too: at the same scale, a heavier tail is simply a worse player.
PC2 also represents size, but it is not a new factor. Its loadings have opposite signs on long scores and on checkouts, so it moves visits between the scoring and finishing phases of the leg. But its score is almost a function of PC1’s: for the Gaussian throws, a quadratic in the PC1 score explains of it.
![]() |
|---|
| Left: the loadings of PC1 and PC2 on the visits to finish from the start of a visit, for every score. The dotted line is . Right: each design throw’s PC2 score against its PC1 score, coloured by size. |
This is the arch (or horseshoe) effect, familiar from ecology and multidimensional scaling. As a throw gets bigger, its value vector traces a smooth curve through . PCA can only describe that curve with straight lines: the first component follows its overall direction, the second its curvature, and so on. PC5 is the next term: for Gaussian throws it, too, is a function of the PC1 score ( for a quadratic), but across all throws it isn’t (), so it also carries how the tail bends the curve.
So the effective dimension of the solutions is small, close to the number of inputs, but the solutions lie on a curved surface, not a flat one. A linear method needs several components to follow it, and that is part of why forty components are needed for visits of accuracy, even though the first carries almost everything. Whether the curve can be straightened is the subject of a later section.
Shape, and the double ring
PC3 represents the shape of the group (tall versus wide), and PC4 its lean. Their scores correlate at with and respectively, and their loadings are almost zero above about : the shape of a group barely matters when scoring, and matters a lot when finishing. Where they matter most is the doubles, and the board suggests what to look for there.
The double ring is thin radially and long around the board, so an elongated group should do well at the doubles where its long axis runs along the ring, and badly where it runs across it. If this is what the components capture, each double’s loading should follow the second angular harmonic of its position on the board, which is also the harmonic that the shape coordinates use. Taking as each double’s angle from the top of the board:
- PC3’s loadings on the twenty doubles correlate at with ;
- PC4’s correlate at with ;
- the two harmonics together explain about two thirds of the variation across the doubles. Most of the rest comes from the fallbacks that each finish has: missing double inside the board leaves double , and no harmonic of position can capture that.
![]() |
|---|
| The change in visits to finish from each double when a mm group is made , as the surrogate predicts it. The grey ellipse at the centre is the group. Left: wide. Right: leaning. |
Making a mm group wide makes the doubles at the top and bottom of the board cheaper (double by visits, double by ), and the doubles at the sides dearer (double by , double by ). Leaning the same group rotates the pattern by . As a check, the same change computed from two exact solves agrees with the surrogate’s at across the twenty doubles, with the largest difference visits.
It is worth emphasising that the model was never told about the double ring, or where it is: it found the board’s second harmonic from solutions alone.
Shape and size also interact. The length scales below hint at this, and a direct check confirms it: the PC3 score of a group is largest for to mm players, but the total effect of that shape on the values grows with size, from visits rms at mm to at mm. For weak players, much of the effect of shape is simply to make them effectively bigger, and so it moves into the size components.
Regress
Each of the forty component scores is now a scalar function of the four inputs, , known at the design throws. Each gets its own Gaussian process:
with the Matérn- correlation
A few notes on these choices:
- Matérn- gives functions that are twice differentiable, rather than the infinitely smooth functions of the squared-exponential kernel, which is often too smooth for real simulators. The value function does have kinks in principle (each value is a minimum over aims, so its derivative jumps where the best aim changes), but they are small once spread across thousands of states.
- One length scale per input (automatic relevance determination) allows each component to vary at its own rate in each direction, and makes the fitted model interpretable.
- The nugget is a small white-noise term. The solves are deterministic, so it is not modelling noise; it absorbs the numerical error of the solver and keeps the covariance matrix well conditioned.
- Hyperparameters are fitted by maximising the log marginal likelihood (below), with the targets standardised first and the optimiser restarted twice from random initial values. Fitting all forty processes takes about a minute (scikit-learn).
- The processes are independent. The component scores are uncorrelated over the design, by construction, but they are not independent functions (PC2 is nearly a function of PC1). Modelling them jointly would need a multi-output kernel. As we’ll see, the calibration suggests the independent model is good enough.
The log marginal likelihood maximised for each process, with the covariance matrix of the design throws, is
A prediction for a new throw uses each process’s posterior mean,
where is the vector of covariances between and the design throws. That is kernel evaluations against design throws and one multiplication by a matrix: about ms for one throw, or about ms each in a batch of .
What the processes learned
The fitted length scales are in units of each input’s full range, so a length scale above means “smooth across the whole region”:
| Component | size | tail | ||
|---|---|---|---|---|
| PC1 | 7.4 | 36 | 37 | 60 |
| PC2 | 1.5 | 6.3 | 5.4 | 10 |
| PC3 | 1.35 | 2.2 | 2.0 | 6.8 |
| PC4 | 1.1 | 1.7 | 1.3 | 6.5 |
| PC5 to PC10 | 0.6 to 1.1 | 1.0 to 3.5 | 0.9 to 2.7 | 4.0 to 7.3 |
This matches the interpretation above. PC1 depends on size, smoothly, and effectively on nothing else. PC3 and PC4 depend on their shape coordinate, but also have short length scales in size: that is the interaction. Tail weight is the smoothest input for every component. Later components vary faster in every direction, which is what you’d expect of the higher-order terms of a curved surface.
![]() |
|---|
| The posterior mean of the first four processes along one input at a time, with the other inputs held at a round, Gaussian throw (PC1 also for a heavy tail, and PC3 and PC4 at four sizes). The posterior bands ( sd) are drawn, but are too narrow to see at this scale. |
Does it know what it doesn’t know?
An emulator’s uncertainty matters as much as its mean: it shows where to run the simulator next, and how far a prediction can be trusted. The processes give a predictive variance for each score. If the components were the whole story, the variance of each predicted value would be .
But they are not the whole story: forty components cannot represent everything, and the processes’ variance does not account for what is left out. So the surrogate adds, for each value, the variance that the forty kept components leave unexplained across the design throws:
![]() |
|---|
| The share of held-out values whose error is within predicted standard deviations. A calibrated Gaussian model follows the dashed line. |
On the held-out throws, the processes’ variance alone is overconfident: of errors are within two standard deviations, against for a calibrated model, and within one, against . With the truncation term added, these become and , and the median standardised error is , against an ideal of . The truncation term is estimated in-sample, which could have made it optimistic; with design throws, it isn’t. With fewer, it is: at throws, only to of held-out errors fall within two standard deviations, and that estimating the truncation by 5-fold cross-validation restores to .
Judge it by its decisions
The obvious way to measure a surrogate is the error in its outputs. On the held-out throws, the predicted values are within visits on average, and at the single worst of values. However, Alice does not play darts with the values directly; what matters is whether the aims chosen using them are as good as the aims chosen using exact values.
Instead, for each held-out throw, we can take situations: every start-of-visit score from to , and random mid-visit situations at low scores, where the decisions are hardest. In each, the surrogate’s aim is the one minimising with the exact outcome probabilities and the predicted values. Its decision loss is how many visits that aim costs more than the best one, both priced with the exact solution:
where the surrogate’s aim is
![]() |
|---|
| Mean error in the values against the mean decision loss per aim, on the held-out throws, for the surrogate with different amounts of data and components, and for the crudest alternative: the values of the nearest solved design throw. |
| Model | Value error, mean | Decision loss per aim, mean | Worst throw | Worst single aim |
|---|---|---|---|---|
| nearest solved throw | 0.741 | 0.00116 | 0.00514 | 0.152 |
| 64 throws, 40 components | 0.017 | 0.00022 | 0.00222 | 0.049 |
| 128 throws, 40 components | 0.009 | 0.00012 | 0.00111 | 0.031 |
| 256 throws, 20 components | 0.007 | 0.00020 | 0.00122 | 0.037 |
| 256 throws, 40 components | 0.005 | 0.00010 | 0.00066 | 0.024 |
There are several interesting observations:
- The decisions are much better than the values. An aim is only affected by the differences between the values of the states that it can lead to, so any error shared by those states costs nothing. A decision loss of visits per aim means a few thousandths of a visit over a whole leg.
- Value error does not predict decision quality. With components, the values are more accurate than with throws and components ( against visits), but the decisions are almost twice as bad ( against visits per aim). Whatever the last twenty components carry, it matters more for decisions than their tiny share of the variance suggests.
- Regression beats lookup by a factor of ten. Using the nearest solved throw gets the values wrong by three quarters of a visit on average, and costs ten times as much in decisions. In four dimensions, throws are far apart.
- More data helps steadily. , and throws give , and visits per aim.
- The weakest region is the edge of the design. The three worst held-out throws are all tight ( to mm), strongly elongated and Gaussian, where the region ends in two directions at once.
Can we straighten the curve?
The arch suggests an obvious improvement. If the values were transformed so that they changed more linearly with the throw, PCA would need fewer components, and the processes would have simpler functions to learn. Let’s try four transforms of the values before compressing them:
- log, after counting the visit in progress, so that every value is at least (the two entries for scores and are always zero, and are left alone);
- relative: each throw’s values divided by its visits from , so that PCA is given only the shape of the value function;
- log-relative: both;
- standardised: each value scaled to unit variance across the design, which changes how PCA weights the values rather than their geometry.
To measure compression alone, the components are learned on the design throws, the held-out throws are projected onto them and transformed back, and the error is measured in visits. The relative transforms were given each held-out throw’s true visits from , so they had a head start.
![]() |
|---|
| Held-out reconstruction error against the number of components. Left: transforming the values before PCA. Right: separate components for overlapping windows of size. |
None of the transforms beats the raw values, at any number of components from upwards. At components, the held-out error is visits for the raw values, standardised, relative, for the log and for the log-relative values. Power transforms (the Box–Cox family, of which the log is the case ) do no better: and both give visits, and gives .
In hindsight, this was guaranteed on the design throws. By the Eckart–Young theorem, PCA of the raw values is the best rank- linear approximation in squared error, measured in visits: exactly the error being measured. A transform optimises a different error. The log, for example, spends its components on relative accuracy, which matters most for the small values near the end of a leg. A transform could only win by making the data genuinely lower rank, and none did: the arch survives every one of them, with PC2 still to explained by a quadratic in PC1.
So the curvature is not a matter of scale. A better player does not simply need proportionally fewer visits from everywhere: the shape of the value function changes, as more of the cost moves into finishing. No transform applied to each value separately can straighten that. (The log does make PC1 more linear in the inputs, with rising from to , but it compresses worse.)
What about local components? If the curve cannot be straightened, it can at least be followed piecewise, using separate components for overlapping windows of size, with each held-out throw assigned to the window containing its size. With six windows, components per window reconstruct the values as well as global ones do ( against visits). With per window, the error falls to . So the curvature roughly doubles the number of linear components needed.
As a full surrogate, three windows reduce the held-out value error by about , from to visits rms. Each window has about design throws, and the predictions are blended linearly in between the windows’ centres, so that they do not jump at the boundaries. Its uncertainty becomes slightly conservative ( of errors within two standard deviations, against the global surrogate’s ), because the blend adds the windows’ disagreement to the variance. The gain is small because each window’s processes are fitted to fewer throws, so the regression error grows and takes back most of what the compression gained.
A polynomial trend
A different kind of polynomial does straighten the curve. Instead of transforming the values, fit them by least squares on polynomial features of the inputs, and do PCA on what is left. PC2 was almost a quadratic in PC1, and PC1 is a smooth curve in size, so a polynomial in the inputs should absorb much of the arch exactly, with no truncation at all. The Gaussian processes then model the components of the remainder. This is a vector-valued form of what the kriging literature calls universal kriging: a regression trend, plus a Gaussian process for the residual.
| Trend removed before PCA | Held-out error: 5 components | 20 components | 40 components | Full surrogate, 40 components | Within 2 sd |
|---|---|---|---|---|---|
| none | 0.0251 | 0.0088 | 0.0048 | 0.0073 | 0.953 |
| cubic in size ( terms) | 0.0217 | 0.0082 | 0.0048 | ||
| cubic in size, linear in the rest ( terms) | 0.0170 | 0.0075 | 0.0046 | 0.0070 | 0.943 |
| full cubic in all four inputs ( terms) | 0.0098 | 0.0057 | 0.0041 | 0.0091 | 0.924 |
Rms errors in visits on the held-out throws: reconstruction after removing the trend, and the full surrogate (trend plus Gaussian processes).
For compression alone, this works well. With a full cubic trend removed, components reconstruct the held-out throws times more accurately than before, and components more accurately ( visits): not quite what local PCA achieved (), but without splitting the data.
As a full surrogate, however, it does not help. The small trend gains , and the full cubic makes things worse. The reconstruction test projected each held-out throw’s true remainder onto the components, which absorbs the trend’s own errors without revealing them; in the surrogate, the Gaussian processes have to predict that remainder, and two things go wrong:
- A -term polynomial fitted to throws oscillates, particularly towards the edges of the region: on its own, it is out by visits rms on the held-out throws. Subtracting it from the smooth value function leaves a remainder that is rougher, and harder to learn, than the original.
- The trend’s uncertainty is not modelled. Its coefficients are treated as known, so the surrogate becomes overconfident: of errors within two standard deviations, rather than .
The underlying reason is that the Gaussian processes were already modelling the curve, non-linearly, in the inputs. A parametric trend only helps if it is simple enough to be right everywhere, and the one that is right everywhere is too simple to remove much curvature. (Gaussian processes with explicit basis functions would put a prior on the trend’s coefficients and carry their uncertainty into the predictions, which should fix the calibration, but I wouldn’t expect more than a few percent in accuracy.)
Where the error actually is
The truncation error lies outside the span of the components, and the regression error inside it, so the two are orthogonal and their squared errors add exactly. That makes it easy to see where the global surrogate’s held-out error comes from:
![]() |
|---|
| The share of the held-out squared error due to truncation (what the components can’t represent), and to each group of components’ regression error. |
Truncation is of the error, and regression . Most of the regression error is in the two size components: PC1 accounts for of it and PC2 for . PC1’s score is predicted to within of its spread, but it carries so much of the variance that even dominates.
So is the regression missing a better feature? The obvious candidates for the size components are size in millimetres rather than its logarithm (the visits from grow roughly linearly in ), and an explicit linear trend in the kernel. In millimetres, their regression error falls from to visits; the trend adds nothing. The processes are already flexible enough in the size direction. The limiting factor is data: with , and design throws, the mean value error roughly halved with each doubling (, and visits).
So what can we conclude? The curvature is real and intrinsic, and it costs about a factor of two in components, which at components is cheap. The single most effective improvement would be more exact solves, placed where the surrogate is least certain. And none of it would change much at the level of decisions: at visits per aim, there is very little left to gain.
What it was for
The surrogate made it possible to put a belief over the whole throw (size, shape, lean, tail and pull) and act on it during a game: each decision combined exact outcome probabilities at a few representative throws from the belief with the surrogate’s values. As described in the last post, the answer was mostly negative: from scores alone, shape and pull are learned too slowly to be worth the uncertainty about them. That’s a finding about darts, not about the surrogate, which did its job: in that experiment, a belief using its values made almost exactly the same decisions as one using exact solves on a grid.
What’s next
What have we learned about the surrogate?
- The solved game is extremely compressible: the first principal component carries of the variation between throwing distributions, and components reconstruct the values with an rms error of visits.
- The components have clear meanings: size, the curvature of the size direction, and two shape components that follow the double ring’s second harmonic.
- Judged by its decisions, the surrogate is very accurate, losing visits per aim, and its uncertainty is calibrated once the truncation error is included.
- Its remaining error is split between truncation and regression, and more exact solves, rather than cleverer transforms of the values, are the best way to reduce it.
The section above suggests that more data would help most, and the original design was fixed in advance. But the surrogate’s own uncertainty shows where new solves would be most useful (the tight, elongated edge of the region), so it can be used to choose them. Growing the design in batches, each chosen to reduce the surrogate’s integrated variance, needs about half as many solves for the same value accuracy, and ends better at throws ( against visits rms). But the decision loss stays at visits per aim whichever way the solves are chosen, and choosing them more carefully doesn’t change that.
There are also two directions I haven’t tried yet:
- A non-linear compression. Local PCA shows the curvature costs about a factor of two in linear components. A genuinely non-linear method, such as a Gaussian process latent variable model or an autoencoder, could follow the curve with fewer dimensions, but it would lose PCA’s simple, exact way of carrying the uncertainty through to the values.
- Running it in the browser. The fitted model is just arrays: the mean, forty components, and for each process its design points, weights and hyperparameters. That is about MB, and a prediction is fast enough for an interactive figure: drag the size, shape and tail of a throw and watch the value of every finish change.
The code is in the DartsStrats repository: the surrogate in darts/surrogate.py, the exact solves in results/surrogate/, its evaluation in notebooks/experiments/28-a-surrogate-for-the-solved-game.ipynb, choosing the solves in notebooks/experiments/30-choosing-the-solves.ipynb, and the figures for this post in notebooks/Posts/2026-12-surrogate.ipynb.







