Spending to the Frontier: Optimization
How Bayesian optimization searched the budget, what it found and how it compares with simpler and exact methods
How Bayesian optimization works
Bayesian optimization is built for problems where each evaluation is expensive. It fits a cheap statistical stand-in for the simulator (the surrogate, here a Gaussian process) to the runs so far. An acquisition rule, expected improvement, then picks the next allocation where improvement is most likely or the surrogate is least sure. The example below shows this on a one-lever problem. Whether this problem is expensive enough to need it is tested below.
Display code
if (is.null(res$surrogate_demo)) missing_result("surrogate_demo") else plot_surrogate_steps(res$surrogate_demo)How to read the plot. Each panel is one stage of the search. The horizontal axis is the share of the $3M budget given to resilience, with the rest going to privileged access. The circles are simulator runs. The navy line and gray band are the surrogate’s best guess and its uncertainty. The amber area at the bottom is expected improvement, and the amber vertical line is the run it picks next.
What the plot tells you. With four runs the surrogate is unsure between them, so expected improvement is spread out. After 9 runs the band is narrow near the bottom of the curve and the search is closing in on the true best share of about 36%. The method spends runs where they can still change the answer, not evenly across the range. The full search applies the same idea in more dimensions.
The three study variants
| Variant | Question | Budget | Objectives (minimized) | Method |
|---|---|---|---|---|
| V1 | How should the fixed budget be split? | $3.0M | TVaR95, the board measure | Expected improvement (EI); confidence-bound (CB) and random-forest checks |
| V2 | What is the trade-off between average and worst-year loss at that budget? | $3.0M | Expected annual loss, TVaR95 | ParEGO and SMS-EGO |
| V3 | How much worst-year loss does each extra dollar buy? | Up to $5M | Spend, TVaR95 | Fixed-budget searches at 21 budgets, plus ParEGO and SMS-EGO |
V1 minimizes TVaR95 at the fixed budget, and the recommendation is chosen on TVaR95 with expected loss as the tie-break. Fixed-budget searches move over the budget simplex through a stick-breaking map. A uniform point in the search space gives a uniformly random split, and any split that puts more than 40% on one lever is penalized. Every run starts from a 24-point Latin hypercube design and uses up to 120 simulator runs; V1 also stops after 20 runs without improvement. The surrogate is a Gaussian process with a Matérn 5/2 kernel and a small fixed noise term, because the common random numbers make each allocation’s score exact. Expected improvement is maximized approximately, over 10,000 random candidates.
V1: the recommended allocation
The five best allocations from every fixed-budget method (the Bayesian optimization runs, random search, space filling, greedy allocation, the exact expected-loss optimum and the top of the full grid) were re-scored on 10 fresh sets of simulated years, so the recommendation does not depend on which search happened to do best. The recommendation has the lowest average TVaR95; among finalists within one standard error of it, the one with the lower expected loss wins. The recommendation brings TVaR95 to $3.76M and expected annual loss to $0.188M. The study’s search found 24 allocations within 1% of the best TVaR95, shown below as a range.
Display code
if (is.null(rg) || is.null(fin)) missing_result("region") else range_table(rg, fin$recommended_alloc, cfg)| Lever | Recommended |
Near-optimal allocations
|
||
|---|---|---|---|---|
| Lowest | Median | Highest | ||
| Configuration hardening | $0.70M | $0.50M | $0.60M | $0.80M |
| Privileged access management | $0.65M | $0.40M | $0.60M | $0.80M |
| EDR and managed response | $0.15M | $0.00M | $0.20M | $0.40M |
| Logging, monitoring and SOC | $0.65M | $0.40M | $0.60M | $0.80M |
| Patch velocity | $0.45M | $0.25M | $0.40M | $0.60M |
| Resilience: backups and IR | $0.30M | $0.15M | $0.30M | $0.50M |
| Identity and MFA | $0.15M | $0.10M | $0.20M | $0.40M |
How to read the table. Each row is one control lever. Recommended is the amount the confirmed recommendation puts on it, rounded to the nearest $0.05M. The three range columns cover every allocation the study evaluated, from all searches and the full grid, whose TVaR95 is within 1% of the best found. They give the lowest, median and highest amount on that lever. A wide range means the lever’s exact amount barely matters.
What the table tells you. The recommendation leans on configuration hardening (23%), logging, monitoring and SOC (21%) and privileged access management (21%). The ranges are wide: 24 near-optimal allocations differ by up to $0.42M on a single lever, so the split is a region, not a point. Ranges for EDR and managed response include zero. No lever exceeds 23% of the budget, so the 40% cap does not bind on the recommendation.
Display code
if (is.null(fin)) missing_result("finalists") else {
ft <- fin$table
d <- data.frame(Finalist = ft$finalist, search = ft$search_value / 1e6, mean = ft$mean_tvar / 1e6,
se = ft$se_primary / 1e6, ale = ft$mean_ale / 1e6,
top = vapply(fin$allocations, top_levers_text, "", cfg = cfg, n = 2), source = fin$source,
Recommended = ifelse(ft$recommended, "Yes", ""))
gt_house(d) |>
gt::fmt_currency(c(search, mean, se), decimals = 3, pattern = "{x}M") |>
gt::fmt_currency(ale, decimals = 4, pattern = "{x}M") |>
gt::cols_label(search = "TVaR95 in search", mean = "Mean TVaR95 on fresh years", se = "Standard error",
ale = "Mean expected loss", top = "Largest shares", source = "Found by") |>
gt::tab_style(gt::cell_text(weight = "bold"), gt::cells_body(rows = Recommended == "Yes"))
}| Finalist | TVaR95 in search | Mean TVaR95 on fresh years | Standard error | Mean expected loss | Largest shares | Found by | Recommended |
|---|---|---|---|---|---|---|---|
| 1 | $3.756M | $3.864M | $0.027M | $0.1936M | logging, monitoring and SOC (23%) and configuration hardening (20%) | Greedy | |
| 2 | $3.758M | $3.858M | $0.026M | $0.1933M | configuration hardening (23%) and logging, monitoring and SOC (21%) | Exact ALE optimum | Yes |
| 3 | $3.761M | $3.869M | $0.027M | $0.1938M | configuration hardening (20%) and privileged access management (20%) | Full grid | |
| 4 | $3.765M | $3.874M | $0.027M | $0.1941M | logging, monitoring and SOC (27%) and configuration hardening (20%) | Full grid | |
| 5 | $3.767M | $3.888M | $0.028M | $0.1947M | logging, monitoring and SOC (26%) and configuration hardening (20%) | Space filling |
How to read the table. Each row is one of the five best allocations found by any method; Found by names the method or methods. TVaR95 in search is its worst-year loss on the base-case simulated years. The next two columns come from re-running it on 10 new sets of 1,000,000 years: the mean and its standard error. Mean expected loss is the tie-break, and Largest shares names the allocation’s two biggest levers.
What the table tells you. The finalists differ by $29K in mean TVaR95, about 1.1 standard errors, so the data cannot rank them on worst-year loss alone. Several different mixes are near-equivalent, consistent with the wide ranges in the table above. The board can treat the recommendation as one member of a family of good allocations. Its exact amounts are not precise.
V2: average loss against worst-year loss
Display code
if (is.null(v2) || is.null(bl)) missing_result("v2") else plot_pareto(list(runs = v2$runs, front = v2f), pts)How to read the plot. Each gray point is one allocation of the $3.0M budget evaluated during the V2 search. The horizontal axis is expected annual loss and the vertical axis is TVaR95, so lower-left is better on both. The navy line is the Pareto front: allocations that no other allocation beats on both measures at once. The colored markers are the recommendation and the comparison methods.
What the plot tells you. V2 is degenerate under this calibration: the front is a single allocation, so the allocation that minimizes average loss also minimizes worst-year loss. The gray cloud rises steadily: cutting average loss also cuts worst-year loss, because the same large incidents drive both. The real trade-off is between spend and worst-year loss, which V3 maps.
V3: the board frontier
The frontier was rebuilt from fixed-budget TVaR95 minimizations at every $0.25M from zero to $5M. Each budget uses greedy allocation followed by a warm-started search, and each also tries its neighbors’ best splits. These points were combined with the ParEGO and SMS-EGO searches and every V1 allocation, then reduced to the points nothing else beats.
Display code
if (is.null(fr)) missing_result("frontier") else plot_board_frontier(fr, app, zero_tvar = cal$tvar)How to read the plot. The horizontal axis is annual spend on new controls and the vertical axis is TVaR95, the average loss in the worst 1-in-20 years. The navy step line is the best result found at each spend level. The dashed amber line is the board’s $10M appetite. Circles mark three budget levels. The diamond is the knee: the first budget at which an extra dollar cuts TVaR95 by less than $2.
What the plot tells you. Spending $1.5M brings TVaR95 to $4.71M; $3.0M brings it to $3.76M and $5.0M to $3.19M. The knee sits at $0.50M. It depends on the rate chosen: $1.25M at a rate of 1; $0.50M at a rate of 2; $0.00M at a rate of 4. Beyond it, each extra dollar cuts TVaR95 by less than $2.
Display code
if (is.null(fr)) missing_result("frontier") else plot_allocation_mix(fr, cfg)How to read the plot. Each bar is the best split found at one budget, ordered from the lowest spend at the bottom to the highest at the top. The label gives its total spend and the TVaR95 it achieves. Each colored segment is the amount on one lever, so a segment’s length is that lever’s spend and the bar’s length is the total.
What the plot tells you. At $1M the best split leans on configuration hardening (40%) and privileged access management (30%). At $3M it leans on logging, monitoring and SOC (23%) and privileged access management (20%), and at $5M on logging, monitoring and SOC (26%) and configuration hardening (20%). The mix changes with the budget rather than scaling up, because diminishing returns make the first dollars on each lever the most valuable.
Comparison with simpler and exact methods
Display code
if (is.null(bl) || is.null(g6)) missing_result("baselines") else {
mt <- methods_table_data(res)
gt_house(mt) |>
gt::fmt_number(evals, decimals = 0) |>
gt::fmt_currency(tvar, decimals = 3, pattern = "{x}M") |>
gt::fmt_currency(ale, decimals = 4, pattern = "{x}M") |>
gt::fmt_percent(c(excess_tvar, excess_ale), decimals = 2) |>
gt::sub_missing(missing_text = "analytic") |>
gt::cols_label(method = "Method", runs = "Seeds", evals = "Simulator runs (median)", tvar = "TVaR95",
ale = "Expected annual loss", excess_tvar = "Excess TVaR95", excess_ale = "Excess expected loss")
}| Method | Seeds | Simulator runs (median) | TVaR95 | Expected annual loss | Excess TVaR95 | Excess expected loss |
|---|---|---|---|---|---|---|
| Bayesian optimization (EI) | 5 | 44 | $3.878M | $0.1943M | 3.24% | 3.26% |
| Bayesian optimization (CB) | 3 | 44 | $3.861M | $0.1934M | 2.78% | 2.80% |
| Bayesian optimization (forest surrogate) | 1 | 44 | $3.901M | $0.1954M | 3.86% | 3.87% |
| Bayesian optimization on total cost of risk | 1 | 44 | $3.901M | $0.1954M | 3.86% | 3.87% |
| Random search | 5 | 120 | $3.833M | $0.1920M | 2.04% | 2.06% |
| Space filling | 5 | 120 | $3.776M | $0.1892M | 0.52% | 0.55% |
| Greedy (steps on simulated TVaR95) | 1 | 210 | $3.756M | $0.1882M | 0.00% | 0.00% |
| Exact ALE optimum (analytic) | 1 | analytic | $3.758M | $0.1883M | 0.05% | 0.05% |
| Equal split | 1 | 1 | $3.889M | $0.1948M | 3.54% | 3.54% |
| Full grid (33,390 points) | 1 | 33,390 | $3.761M | $0.1884M | 0.14% | 0.14% |
How to read the table. Each row is one way of choosing an allocation of the $3.0M budget. Seeded searches report the median, over seeds, of each seed’s best. Greedy spends the budget in $100K steps, each going to the lever that cuts TVaR95 most. The exact ALE optimum solves expected loss exactly. The full grid scores every split on a 7% step. Excess columns compare each row with the best value in the table.
What the table tells you. Every method lands within a few percent of the best split known. Greedy allocation and the exact expected-loss optimum are within 0.05% of it, and the full grid within 0.14%, limited by its $200K step. Bayesian optimization with expected improvement leaves 3.24%, random search 2.04% and the equal split 3.54%. Simple methods beat Bayesian optimization here, and allocation matters much less than how much to spend.
Ground truth and search efficiency
Two ground truths were used. The full grid over all 7 levers scored all 33,390 splits in steps of $0.2M, and the best allocation known combines it with the exact, greedy and search results. A reduced three-lever problem (configuration hardening, EDR and managed response, resilience: backups and IR) was gridded at 1%, 231 points, and searched 10 times with 40 runs per method.
Display code
if (is.null(eff)) missing_result("efficiency") else plot_convergence(eff)How to read the plot. The horizontal axis counts simulator runs and the vertical axis is the excess TVaR95 of the best allocation found so far, on a log scale. Lines are medians across seeds; shaded bands span the best to the worst seed. Runs that stopped early keep their last value. The top panel measures against the exact three-lever grid optimum, the bottom against the best allocation known with all levers.
What the plot tells you. With all 7 levers, the median Bayesian optimization seed ends 3.24% above the best allocation known, after 44 runs, when its early-stopping rule fires. Random search ends 2.04% above it and space filling 0.52%, each after 120 runs. On the three-lever problem, which spans only 3.3% in TVaR95, the methods are hard to tell apart. The three-lever optimum lies inside the cap.
Display code
if (is.null(eff)) missing_result("efficiency") else ground_truth_comparison(eff)| Method |
Median excess TVaR95
|
Speed (median over seeds)
|
||||
|---|---|---|---|---|---|---|
| After 10 runs | After 20 runs | After 40 runs | Runs to within 1% | Runs to within 0.1% | Seeds reaching 0.1% | |
| Bayesian optimization | 0.780% | 0.143% | 0.023% | 8.0 | 20.5 | 80% |
| Random search | 0.460% | 0.031% | 0.025% | 1.0 | 13.0 | 90% |
| Space filling | 0.060% | 0.044% | 0.030% | 1.0 | 9.5 | 100% |
How to read the table. Each row is one search method on the three-lever problem. The first three columns give the median excess TVaR95 of its best allocation after 10, 20 and 40 runs. The speed columns give the median number of runs needed to come within 1% and 0.1% of the exact optimum, and the share of seeds that ever reached 0.1%. A negative excess means the search found a split between grid points that beats the best grid point.
What the table tells you. To reach 0.1%, Bayesian optimization needs a median of 20.5 runs, against 13 for random search and 9.5 for space filling. It reaches 0.1% in 80% of seeds, against 90% and 100%. With 10 seeds per method, differences of one or two seeds are not statistically meaningful. On a problem this flat, every method is good enough for a budget decision.
Display code
if (is.null(v2) || is.null(res$v3)) missing_result("v3") else {
h <- rbind(cbind(variant = "V2 (expected loss, TVaR95)", v2$hv$final), cbind(variant = "V3 (spend, TVaR95)", res$v3$hv$final))
h$method <- c(parego = "ParEGO", smsego = "SMS-EGO")[h$method]
gt_house(h) |> gt::fmt_number(c(mean, se), decimals = 3) |>
gt::cols_label(variant = "Variant", method = "Method", n = "Seeds", mean = "Mean hypervolume", se = "Standard error")
}| Variant | Method | Seeds | Mean hypervolume | Standard error |
|---|---|---|---|---|
| V2 (expected loss, TVaR95) | ParEGO | 5 | 0.664 | 0.003 |
| V2 (expected loss, TVaR95) | SMS-EGO | 5 | 0.669 | 0.005 |
| V3 (spend, TVaR95) | ParEGO | 5 | 0.638 | 0.033 |
| V3 (spend, TVaR95) | SMS-EGO | 5 | 0.540 | 0.081 |
How to read the table. Hypervolume measures how much of the objective space a set of solutions dominates; bigger is better. Both objectives are rescaled to a common 0-to-1 range using fixed best and worst values set in the configuration. The reference point sits just beyond the worst value, so the numbers are comparable across methods within a variant. Each row is one method on one variant, averaged over its seeds.
What the table tells you. On V3, ParEGO averages 0.638 and SMS-EGO 0.540, a gap of 1.1 combined standard errors, so neither method clearly dominates. V2’s front is close to a single point, so its hypervolume mostly reflects how quickly each method found it. The reported frontier relies mainly on the fixed-budget searches.
When Bayesian optimization pays off
This study used roughly 122,000 simulator runs in all. Each takes about 0.16 seconds, so the full grid of 33,390 splits costs about 91 CPU-minutes. Expected loss has a closed form and can be optimized exactly in seconds. Here, then, Bayesian optimization is a demonstration of the method rather than a necessity: grids, greedy allocation and exact optimization are cheap and at least as accurate. It pays off when one simulation takes minutes or hours, for example a multi-year model, an adaptive attacker or correlated incidents across many business units, so that a grid is out of reach.
Controls or insurance?
The fixed budget can also buy risk transfer. An annual aggregate cyber cover attaching at $5.00M costs 2 times its expected recovery, with limits up to $100.00M. The rest of the budget goes to controls, using the frontier’s best split for that amount.
Display code
if (is.null(res$transfer)) missing_result("transfer") else {
tr <- res$transfer
d <- data.frame(premium = tr$premium / 1e6, controls = tr$controls / 1e6, limit = tr$limit / 1e6,
ale = tr$ale / 1e6, tvar = tr$tvar / 1e6, spend = tr$spend / 1e6, ratcor = tr$ratcor / 1e6)
gt_house(d) |>
gt::fmt_currency(c(premium, controls, spend, ratcor, tvar), decimals = 2, pattern = "{x}M") |>
gt::fmt_currency(limit, decimals = 0, pattern = "{x}M") |>
gt::fmt_currency(ale, decimals = 3, pattern = "{x}M") |>
gt::cols_label(premium = "Premium paid", controls = "Controls", limit = "Limit bought", ale = "Expected net loss",
tvar = "TVaR95 after recoveries", spend = "Total spend", ratcor = "Risk-adjusted cost")
}| Premium paid | Controls | Limit bought | Expected net loss | TVaR95 after recoveries | Total spend | Risk-adjusted cost |
|---|---|---|---|---|---|---|
| $0.00M | $3.00M | $0M | $0.188M | $3.76M | $3.00M | $3.54M |
| $0.20M | $2.50M | $100M | $0.100M | $1.99M | $2.70M | $2.99M |
| $0.22M | $2.00M | $100M | $0.107M | $2.14M | $2.22M | $2.53M |
| $0.24M | $1.50M | $100M | $0.118M | $2.33M | $1.74M | $2.08M |
How to read the table. Each row splits the $3M budget between an insurance premium and controls. Premium paid can fall short of the amount offered when the largest available limit costs less. Limit bought is the cover above the attachment point. The loss columns are after insurance recoveries. Risk-adjusted cost adds a 10% cost of capital on the gap between worst-year and expected loss to expected loss and total spend.
What the table tells you. Insurance cuts worst-year loss far more cheaply than controls in this model. A premium of $0.20M buys $100M of cover and takes TVaR95 from $3.76M to $1.99M. Large losses are rare, so expected recoveries, and therefore premiums, are small, and the unspent budget is returned. The loading, attachment and limit are design assumptions; real quotes, which carry higher loadings for large limits, would decide this comparison.




