derivations

mathematical foundations for the sobol'/saltelli variance decomposition used in mojave-wmdp. from anova decomposition through radial sampling to bootstrap confidence intervals.

1. anova decomposition (hoeffding-sobol')

for a square-integrable function f(x) on the unit hypercube [0,1]k, there exists a unique decomposition:

f(x) = f₀ + Σᵢ fᵢ(xᵢ) + Σᵢ<ⱼ fᵢⱼ(xᵢ, xⱼ) + … + f₁₂…ₖ(x₁, …, xₖ)

where each term has zero mean over its complement variables. this gives the variance decomposition:

V(Y) = Σᵢ Vᵢ + Σᵢ<ⱼ Vᵢⱼ + … + V₁₂…ₖ

in our experiment, f maps a 6-dimensional configuration (prompt_template, system_prompt, decoding, choice_order, quantization, n_shot_frac) to benchmark accuracy.

2. sobol' indices

first-order index Si

fraction of total variance explained by axis i alone:

Sᵢ = Vᵢ / V(Y) = V[E(Y | Xᵢ)] / V(Y)

total-effect index STi

fraction of total variance attributable to axis i, including all interactions:

S_Ti = 1 − V[E(Y | X₋ᵢ)] / V(Y) = E[V(Y | X₋ᵢ)] / V(Y)

where X₋ᵢ denotes all axes except i. equivalently, STi = Si + all interaction terms involving i.

interpretation

conditionmeaning
Si ≈ STiaxis i acts additively (no interactions)
STi >> Siaxis i participates in interactions
Σ Si ≈ 1model is additive
Σ STi > 1interactions present (double-counting shared variance)

3. saltelli radial sampling

the saltelli (2002) scheme estimates both Si and STi from N(k+2) model evaluations rather than the N(2k+2) of the original sobol' (1993) scheme.

construction

  1. draw two independent N×k quasi-random matrices A and B (sobol' sequence)
  2. for each axis i, construct matrix AB(i): take A, replace column i with column i from B
  3. evaluate f on rows of A, B, and all k matrices AB(i)
total evaluations = N × (k + 2) = 512 × (6 + 2) = 4,096 cells

estimators (jansen 1999 / saltelli 2010)

V̂[E(Y|Xᵢ)] = (1/N) Σⱼ f(B)ⱼ · (f(A_B^(i))ⱼ − f(A)ⱼ) Ŝᵢ = V̂[E(Y|Xᵢ)] / V̂(Y) V̂[E(Y|X₋ᵢ)] = (1/2N) Σⱼ (f(A)ⱼ − f(A_B^(i))ⱼ)² Ŝ_Ti = V̂[E(Y|X₋ᵢ)] / V̂(Y)

our parameters

parametervaluenote
N512base sample size
k6perturbation axes
cells/eval4,096N × (k + 2)
total cells12,2883 benchmarks × 4,096

4. handling mixed axes

five of six axes are categorical (finite levels). the saltelli design operates on [0,1]k, so categorical axes use equal-width bins:

axislevelsmapping
prompt_template5[0, 0.2) → bare, [0.2, 0.4) → cot, …
system_prompt4[0, 0.25) → helpful, …
decoding3[0, 0.33) → greedy, …
choice_order2[0, 0.5) → original, [0.5, 1) → shuffled
quantization2[0, 0.5) → bf16, [0.5, 1) → fp8
n_shot_fraccontinuouslinear: u → u × 0.05

this preserves the quasi-random sampling properties of the sobol' sequence while respecting the discrete nature of categorical axes.

5. borgonovo δ (distribution-free sensitivity)

the borgonovo (2007) δ importance measure is a moment-independent sensitivity index based on the L1 distance between the unconditional and conditional output distributions:

δᵢ = (1/2) E[ ∫ |f_Y(y) − f_{Y|Xᵢ}(y)| dy ]

properties:

  • δi ∈ [0, 1]
  • δi = 0 iff Y and Xi are independent
  • no assumptions about model linearity or output distribution shape
  • captures effects invisible to variance-based indices (e.g., a factor that shifts shape but not variance)

in our implementation, δ is estimated via kernel density estimation on the conditional samples from the saltelli design.

6. bootstrap confidence intervals

all sobol' indices are reported with 95% confidence intervals computed via the percentile bootstrap method:

  1. resample the N base-sample rows with replacement (preserving the A/B/AB(i) structure)
  2. recompute all indices on the resampled data
  3. repeat 10,000 times
  4. report [2.5th percentile, 97.5th percentile] as the 95% CI
parametervalue
resamples10,000
ci methodpercentile
ci level95%

7. implementation

all gsa computation uses salib 0.1.1—a rust implementation of the saltelli/sobol'/borgonovo algorithms.

componenttool
design generationsalib-rs (sobol' sequence + saltelli construction)
index estimationsalib-rs (jansen/saltelli estimators)
borgonovo δsalib-rs (kde-based)
bootstrapsalib-rs (parallel resampling)
orchestrationmojave-gsa CLI binary

source: github.com/antimeme-ai/mojave