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)
Three panels showing the surrogate after 4, 6 and 9 simulator runs. The uncertainty band narrows around the runs, the estimate converges on the dashed true curve near its minimum, and the expected-improvement area shrinks and concentrates near the best share.
Figure 1: Teaching example: splitting the budget between resilience and privileged access to minimize TVaR95. The navy line is the surrogate’s estimate, the gray band its uncertainty, the dashed line the true curve and the amber area the expected improvement; the amber line marks the next run.

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.

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)
A scatter of expected annual loss against TVaR95 for allocations of the fixed budget. Gray points form a rising cloud; the navy Pareto front sits at its lower left beside the V1 recommendation and the exact and greedy optima; the equal split, random search and space filling sit slightly up the cloud.
Figure 2: V2 trade-off at the fixed budget: every feasible allocation evaluated (gray), the Pareto front (navy) and the comparison methods.

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)
A falling step line from the zero-spend TVaR95 at the left down to the lowest worst-year loss at 5 million dollars of spend, with the appetite line, three marked budget points and an amber diamond at the knee.
Figure 3: Board frontier (V3): the lowest TVaR95 found at each level of annual control spend, with the appetite line, the three budget points and the knee.

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)
Horizontal stacked bars, one per budget from low to high spend. Each bar is split into colored segments for the levers; the bars lengthen with spend and the mix shifts as more levers are funded.
Figure 4: Allocation mix along the frontier: the best split at every $0.5M of spend.

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")
}
Table 3: Fixed-budget comparison: the best allocation each method found, scored on the same simulated years; excess is measured against the best allocation known.
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)
Two panels on a log scale showing excess TVaR95 falling as runs accumulate for Bayesian optimization, random search and space filling. In both panels the lines end between about 0.01% and 2% above the optimum, with wide overlapping bands; space filling ends lowest in the all-lever panel.
Figure 5: Convergence: excess TVaR95 of the best allocation found so far, by number of simulator runs (median line, band from best to worst seed).

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)
Table 4: Three-lever ground truth: excess TVaR95 and speed of each method against the exact grid optimum.
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")
}
Table 5: Normalized hypervolume of the V2 and V3 searches: mean and standard error across seeds.
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")
}
Table 6: Controls against insurance within the fixed budget: worst-year loss and risk-adjusted cost for each split between premium and controls.
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.