TL;DR
When we evaluate, explain, or audit a machine learning model on a fixed test set, we are mostly just computing simple averages. Yet the true population-level quantities we actually care about—expected deployment risk, SHAP values, counterfactuals, and continuous calibration—secretly harbor notoriously hard continuous and combinatorial math problems. By analyzing these metrics at the bit-precision level, this paper draws a sharp map between ML explanations and safety certificates we can genuinely compute efficiently, and those where Monte Carlo sampling hits an exponential wall.
What Problem Does This Paper Address?
Imagine it’s late, your model is trained, and you run a script to compute test loss, SHAP attributions, or calibration error. On a finite dataset, these are straightforward sums and averages. However, these finite numbers are merely stand-ins for population quantities over continuous deployment distributions.
While statisticians ask how many samples we need to estimate these population targets, this paper asks a deeper computational question: Even if we had exact oracle access to the true underlying data density and the model, could we actually compute these metrics efficiently?
When auditing a model for safety certification or legal recourse, rough Monte Carlo estimates aren't always enough. A standard Monte Carlo estimator takes $O(1/\varepsilon^2)$ samples to get within error $\varepsilon$. If you want $m$ certified bits of precision (meaning $\varepsilon = 2^{-m}$), that sample cost explodes exponentially to $\Omega(2^{2m})$. Achieving true "bit-polynomial" time—cost polynomial in the number of requested bits $m$—separates genuinely tractable audit metrics from intractable ones.
Methods
To analyze algorithms operating on continuous objects like probability densities and neural networks, the author turns to Kawamura-Cook second-order complexity theory (a framework from computable analysis).
Instead of passing finite bit-strings into a standard Turing machine, continuous functions are supplied via a "certified interface" (formally called a name). This interface acts as an oracle giving the algorithm three things:
- Evaluation: Approximations of the function at dyadic rational points to any requested precision.
- Continuity modulus: How fine a grid is needed to guarantee the output doesn't jump by more than $2^{-n}$.
- Range bounds: A safe numerical box containing the outputs.
What’s standard here is the computable analysis backbone, where real integration ($\mathrm{INT}$) is linked to counting complexity ($\#\mathrm{P}$) and maximization ($\mathrm{MAX}$) is linked to $\mathrm{NP}$ optimization. What’s novel is building uniform, second-order polynomial-time reductions ($\le_2^p$) that embed hard analytical primitives directly into valid ML models, normalized probability distributions, and bounded loss functions.
Datasets
Not discussed in the paper. Because this is a purely theoretical complexity paper proving mathematical reductions and worst-case bounds, no empirical datasets or benchmarks are used.
Key Insights and Ideas
- The Integrated Gradients dimension jump: In 1D, Integrated Gradients is trivial—by the fundamental theorem of calculus, the path integral collapses to subtracting two endpoints, $F(b) - F(a)$. Step up to just two dimensions, however, and computing the attribution for a single feature becomes equivalent to full real integration. Intriguingly, summing all feature attributions is still easy (endpoint evaluation), even when isolating just one feature is integration-hard!
- Untangling SHAP’s twin bottlenecks: Practitioners often conflate two difficulties in SHAP. This paper cleanly separates them: computing the background expectation makes interventional SHAP integration-hard with just two features, whereas summing over feature coalitions makes succinct coalitional SHAP $\#\mathrm{P}$-hard as feature count grows. A fast, certified SHAP algorithm must tame both.
- Recourse is global search in disguise: Finding the nearest counterfactual explanation isn't hard because of weird discontinuities. Even for rational ReLU networks and smooth $C^\infty$ arithmetic circuits, approximating the nearest recourse threshold is $\mathrm{NP}$-hard, revealing why local gradient-descent heuristics lack worst-case guarantees.
- Calibration splits into $\mathrm{INT}$ and $\mathrm{MAX}$: Continuous Expected Calibration Error (ECE) encodes integration hardness, Maximum Calibration Error (MCE) encodes maximization hardness, and Interval Calibration chains both together—integrating to get a primitive, then maximizing to find its range.
Key Results
The central achievement of the paper is a formal operator taxonomy mapping population-level ML quantities to fundamental complexity classes:
- Exact Equivalences & Hardness: Population risk is integration-complete ($\mathrm{Risk}_d \equiv_2^p \mathrm{INT}_d$). Coordinate Integrated Gradients in $d=2$ is equivalent to 1D integration ($\mathrm{IG}_{1,2} \equiv_2^p \mathrm{INT}_1^{[0,1]}$). Approximating counterfactual cost on a $(r+1)$-dimensional ReLU network within an additive error of $r/4$ is $\mathrm{NP}$-hard.
- Sampling Lower Bound: Any black-box sampling algorithm estimating a Bernoulli mean to additive error $2^{-(m+2)}$ (with $\ge 2/3$ success probability) requires $\Omega(2^{2m})$ samples in the worst case.
- Paths to Tractability: Generic hardness collapses to polynomial time when extra structure is promised—such as explicit finite empirical support, supplied antiderivatives (primitives), rational affine models with weighted $\ell_1$ costs (which reduce to Linear Programming), or tree-structured/decomposable models under product distributions.
Limitations and Future Work
Because the reductions establish worst-case complexity over general represented functions and densities, they describe what happens without restrictive structural assumptions. In practice, tractability depends jointly on the model architecture and data distribution (for instance, tree ensembles allow polynomial-time SHAP under independent features, though dependent backgrounds break this). As a promising future direction, the author suggests tailoring these second-order reductions specifically to foundation-model architectures, their input representations, and realistic deployment distributions.
Summary updated