Inferensys

Glossary

Local Fidelity

A measure of how accurately an interpretable surrogate model approximates the behavior of the underlying black-box model in the immediate neighborhood of the instance being explained.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
SURROGATE MODEL ACCURACY

What is Local Fidelity?

Local fidelity measures how accurately an interpretable surrogate model mimics the black-box model's predictions within a specific neighborhood around the instance being explained.

Local fidelity is a metric quantifying the faithfulness of a local surrogate model's approximation to the underlying black-box model in the immediate vicinity of a target instance. It ensures the interpretable explanation accurately reflects the complex model's decision boundary locally, rather than capturing global behavior.

High local fidelity is the primary objective of techniques like LIME, achieved by weighting perturbed samples by proximity. The fidelity-interpretability trade-off acknowledges that a perfectly faithful local approximation may require a complex surrogate, undermining the goal of human readability.

DEFINITIONAL PRECISION

Key Characteristics of Local Fidelity

Local fidelity is the foundational metric for local explanation methods, quantifying the faithfulness of the surrogate model to the black-box model's behavior in a specific neighborhood.

01

Definition and Core Mechanism

Local fidelity measures how accurately an interpretable surrogate model (e.g., a sparse linear model) mimics the predictions of the underlying black-box model for perturbed samples in the immediate vicinity of the target instance. It is the primary optimization objective in LIME. A high-fidelity explanation ensures that the simple model's logic is a trustworthy proxy for the complex model's local decision boundary, not just a convenient simplification.

02

The Fidelity-Interpretability Trade-off

This is the central tension in local explanation. A highly complex surrogate could achieve near-perfect local fidelity, but it would no longer be human-interpretable. The goal is to find a Pareto optimal point where the surrogate is simple enough to understand (e.g., a linear model with few features) while maintaining sufficient fidelity to be useful. Kernel width and explanation regularization are the primary levers for navigating this trade-off.

03

Measuring Local Fidelity

Fidelity is typically operationalized as the R-squared (coefficient of determination) of the surrogate model on the locally weighted, perturbed sample set. A high R-squared value indicates the surrogate's predictions closely match the black-box's outputs on those samples. An alternative metric is the mean squared error (MSE) between the black-box's predicted probabilities and the surrogate's predictions on the neighborhood samples.

04

The Role of the Exponential Kernel

The exponential kernel is the mechanism that enforces locality. It assigns a weight to each perturbed sample based on its proximity to the original instance. Samples very close to the original get a weight near 1, while distant samples get a weight near 0. This ensures the surrogate model prioritizes fitting the black-box's behavior exactly where it matters most, directly defining the scope of the local decision boundary being approximated.

05

Stability vs. Fidelity

A high-fidelity explanation is not necessarily a stable one. An overly narrow kernel width can produce a high R-squared on a tiny, tightly-fit neighborhood, but the explanation may change drastically with a different random seed. OptiLIME and Bayesian LIME are advanced frameworks designed to automatically find the kernel width that maximizes fidelity while guaranteeing a minimum level of explanation stability across multiple runs.

06

Global Fidelity via Submodular Pick

While local fidelity concerns a single instance, the Submodular Pick algorithm aggregates local explanations to provide a global view. It selects a diverse set of individual explanations that collectively maximize coverage of the model's overall behavior. The global fidelity of this set is measured by how well the selected local surrogate models, when combined, represent the black-box's decision logic across the entire input space.

LOCAL FIDELITY EXPLAINED

Frequently Asked Questions

Explore the core metric that governs the trustworthiness of local surrogate explanations. These answers dissect how local fidelity is measured, optimized, and traded off against interpretability in techniques like LIME.

Local fidelity is a measure of how accurately an interpretable surrogate model approximates the behavior of the underlying black-box model in the immediate neighborhood of the instance being explained. It quantifies the faithfulness of a local explanation. A surrogate model with high local fidelity correctly mimics the complex local decision boundary of the black-box model for predictions on perturbed samples near the target instance. This is crucial because a highly interpretable explanation that does not accurately reflect the model's actual decision logic is misleading. Local fidelity is typically measured using metrics like R-squared on a held-out set of neighborhood samples, ensuring the simple model's predictions closely match the complex model's outputs in that specific region.

EXPLANATION ACCURACY COMPARISON

Local Fidelity vs. Global Fidelity

A comparison of how accurately an interpretable surrogate model captures the behavior of a black-box model at different scales of approximation.

FeatureLocal FidelityGlobal Fidelity

Scope of Approximation

Immediate neighborhood around a single instance

Entire input space and all possible predictions

Surrogate Model Complexity

Simple linear model or shallow decision tree

Complex model often required to capture full behavior

Accuracy of Approximation

High within the defined local region

Low to moderate; averages over diverse regions

Primary Use Case

Explaining individual predictions for debugging or auditing

Understanding overall model behavior and feature trends

Sensitivity to Instance Location

Highly dependent on the specific instance being explained

Independent of any single instance

Computational Cost per Explanation

Low; requires only local perturbation sampling

High; requires sampling across the entire feature space

Susceptibility to Model Non-Linearity

Low; complex boundaries appear locally linear

High; global summaries obscure sharp decision boundaries

Typical Method

LIME, SHAP, Anchor Explanations

Partial Dependence Plots, Global Surrogate Models, Feature Importance

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.