Exact estimation¶
The ExactEstimator lazily enumerates every
coalition, from the empty coalition to the grand coalition, and delegates
attribution to an estimand plugin. Use it as ground truth on tiny player sets
before trusting approximate samplers.
Enumeration scope¶
For \(n\) players the estimator evaluates every coalition:
Inside ExplainRunner the grand coalition \(v(N)\) is scored
from the base generation (the output for the unmasked prompt), so it is served
from the result store instead of a second backend call. With \(v(\emptyset)\) and
\(v(N)\) both present, Shapley values satisfy efficiency:
\(\sum_i \phi_i = v(N) - v(\emptyset)\). The run output exposes both
payoffs as base_value and
grand_value.
Complexity grows exponentially in \(n\); reserve exact estimation for toy models, sanity checks, and estimator validation.
Estimand delegation¶
Exact enumeration produces coalition payoffs \(v(S)\). The estimand plugin (Shapley or Banzhaf) applies coalition weights and marginal contributions:
Monte Carlo and Neyman estimators reuse the same estimand boundary — exact estimation establishes the reference path for validating approximate samplers.
Legacy parity¶
The implementation matches the Shapley values of PreciseShapExplainer from
legacy MLLM-Shap on additive characteristic
functions; both aggregate the full \(2^n\) table. See
Coming from legacy MLLM-Shap for the other differences.
Further reading¶
Estimand definitions: Estimands: Shapley vs Banzhaf
Cooperative-game foundations: Cooperative games
Usage: Using the exact estimator
API:
ExactEstimator