Inferensys

Glossary

Local Accuracy

The SHAP property guaranteeing that an explanation model matches the original model's output for a specific input instance.
ML engineer running AI model benchmarks, performance charts on multiple screens, late night home office setup.
EXPLANATION FIDELITY

What is Local Accuracy?

Local accuracy is the fundamental SHAP property ensuring that the explanation model's output exactly matches the original model's prediction for the specific instance being explained.

Local accuracy (also known as local fidelity) requires that the sum of all feature attributions plus the baseline value equals the original model's prediction f(x). This guarantees the explanation is a faithful, additive decomposition of the output for that single input, not an approximation.

This property is enforced by the Efficiency axiom of Shapley values. When g(x') is the explanation model and f(x) is the original prediction, local accuracy demands f(x) = g(x') = φ₀ + Σ φᵢ. This ensures no contribution is lost or double-counted in the attribution.

PRECISION Q&A

Frequently Asked Questions

Targeted answers to the most common technical questions about the local accuracy property in SHAP explanations, designed for engineers and data scientists who need precise, actionable definitions.

Local accuracy is the efficiency property of additive feature attribution methods that guarantees the sum of all feature attributions exactly equals the difference between the model's prediction for a specific instance and the baseline value. Mathematically, if f(x) is the original model's output and φ₀ is the expected prediction over the background dataset, then f(x) = φ₀ + Σᵢ φᵢ, where φᵢ is the SHAP value for feature i. This property ensures the explanation model g(x') perfectly matches the complex model f(x) when all features are present (x' = 1). Unlike global surrogate models that approximate behavior across a distribution, local accuracy enforces exact fidelity at the single prediction being explained. This is what distinguishes SHAP from methods like LIME, where the linear surrogate is only approximately correct locally. The property is inherited directly from the Shapley value axioms in cooperative game theory, specifically the efficiency axiom requiring that the total payout distributed to players equals the grand coalition's value.

EXPLANATION FIDELITY

Key Characteristics of Local Accuracy

Local accuracy is the foundational property that ensures an explanation model perfectly matches the original model's output for the specific instance being explained.

01

Definition and Core Principle

Local accuracy requires that the explanation model g(x') equals the original model f(x) when evaluated at the instance x. This means the sum of all feature attributions plus a baseline value exactly reconstructs the model's prediction. It guarantees the explanation is faithful to the model's output at that specific point, even if the explanation model is a simple linear function.

02

Mathematical Formulation

For an instance x and its simplified binary representation x', local accuracy is expressed as:

  • f(x) = g(x') = φ₀ + Σᵢ φᵢ where φ₀ is the baseline expected prediction and φᵢ are the Shapley value attributions for each feature. This additive decomposition ensures no information is lost or fabricated in the explanation process.
03

Relationship to the Efficiency Property

Local accuracy is synonymous with the efficiency property in Shapley value theory. Efficiency states that the total gain distributed among players equals the total value created by the grand coalition. In SHAP, this translates to the sum of all feature attributions exactly equaling the difference between the model's prediction f(x) and the baseline value φ₀.

04

Distinction from Global Fidelity

Local accuracy guarantees fidelity only at a single instance, not across the entire input space. An explanation can be locally accurate while failing to capture the model's global behavior. This contrasts with global surrogate models that aim for overall fidelity but may sacrifice precision at individual points. Local accuracy prioritizes the specific prediction under audit.

05

Practical Implications for Auditing

In high-stakes applications like credit denial or medical diagnosis, local accuracy ensures that the explanation provided to a stakeholder accounts for every factor influencing their specific outcome. If the sum of attributions does not match the prediction, the explanation is mathematically inconsistent, undermining trust and regulatory compliance.

06

Enforcement in SHAP Implementations

KernelSHAP and TreeSHAP enforce local accuracy by design. In KernelSHAP, the weighted linear regression is constrained so the intercept captures the baseline and coefficients sum to the prediction difference. In TreeSHAP, the algorithm's recursive structure ensures exact additive decomposition for every leaf path, guaranteeing local accuracy without approximation error.

PROPERTY COMPARISON

Local Accuracy vs. Related SHAP Properties

How the Local Accuracy axiom relates to and differs from other fundamental SHAP properties

PropertyLocal AccuracyEfficiencyMissingnessConsistency

Matches original model output for specific instance

Sum of attributions equals prediction minus baseline

Applies to single-instance explanations

Applies globally across all instances

Requires features absent from input to have zero attribution

Guarantees attribution monotonicity when model changes

Additive decomposition: f(x) = φ₀ + Σ φᵢ

Violated by LIME without proper constraints

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.