Inferensys

Glossary

Local vs. Global Explanations

Local explanations justify a single prediction for a specific instance, while global explanations describe the overall behavior or logic of a machine learning model across many instances.
ML engineer managing model training cluster on laptop, GPU utilization visible, technical deep learning setup.
EXPLAINABLE AI

What is Local vs. Global Explanations?

A fundamental distinction in Explainable AI (XAI) that categorizes methods based on the scope of the model's behavior they elucidate.

Local explanations justify a single prediction for a specific input instance by identifying the features, data points, or graph structures most influential for that particular output. In contrast, global explanations describe the overall behavior, logic, or decision boundaries of a machine learning model across its entire input domain or a representative dataset. This scope dichotomy is critical for deploying auditable AI, as local justifications satisfy individual right to explanation demands, while global insights inform model validation and improvement.

Local methods, such as LIME or instance-specific SHAP values, are typically model-agnostic and post-hoc. Global explanations may involve extracting symbolic rules, analyzing aggregate feature importance, or visualizing the model's latent space. For knowledge graph-based models, a local explanation might highlight a crucial subgraph, whereas a global one could summarize the ontological concepts the model consistently relies upon, directly supporting algorithmic explainability governance.

EXPLAINABILITY METHODS

Local vs. Global Explanations: Key Differences

A comparison of two fundamental approaches for interpreting machine learning models, particularly relevant for knowledge graph-based AI systems.

Feature / DimensionLocal ExplanationGlobal Explanation

Scope of Explanation

A single prediction for a specific data instance.

The overall logic, behavior, or decision boundaries of the entire model.

Primary Question Answered

"Why did the model make this specific prediction for this specific input?"

"How does the model generally work? What are its core rules or important features?"

Fidelity & Accuracy

High fidelity to the model's behavior for the specific instance.

Lower fidelity; provides an approximate, often simplified, overview of model behavior.

Computational Complexity

Typically lower; analyzes one data point.

Typically higher; requires analysis across the dataset or model structure.

Representative Techniques

LIME, SHAP (instance-level), Counterfactual Explanations, Saliency Maps.

Partial Dependence Plots, Feature Importance (global), Rule Extraction, Model Distillation.

Use Case in Knowledge Graphs

Explaining why a specific entity was classified a certain way or why a particular link was predicted.

Explaining the general patterns the GNN learned across the graph or the overall importance of relationship types.

Audience

End-users subject to a decision, auditors verifying a specific case.

Model developers, regulators, business stakeholders, data scientists.

Connection to XAI Governance

Addresses the "Right to Explanation" for individuals. Provides audit trails for specific decisions.

Supports model validation, bias detection, and certification. Informs model documentation and trust.

EXPLAINABLE AI VIA KNOWLEDGE GRAPHS

Core Characteristics of Local and Global Explanations

In Explainable AI (XAI), explanations are categorized by their scope: local explanations justify a single prediction for a specific instance, while global explanations describe the overall behavior or logic of a machine learning model across its entire operating domain.

01

Scope of Explanation

The fundamental distinction lies in the scope of the analysis.

  • Local Explanation: Focuses on a single data instance (e.g., one loan application, one molecule, one graph node). It answers: "Why did the model make this specific prediction for this specific input?"
  • Global Explanation: Characterizes the model's overall logic or average behavior across the entire dataset or population. It answers: "What general patterns or rules does the model follow?" or "Which features are most important on average?"
02

Primary Use Cases

The choice between local and global explanations is driven by the stakeholder's goal.

Local explanations are critical for:

  • Debugging individual predictions (e.g., Why was this transaction flagged as fraud?)
  • Providing actionable feedback to an end-user (Algorithmic Recourse).
  • Validating a single high-stakes decision in regulated domains (e.g., healthcare, finance).

Global explanations are essential for:

  • Model validation and trust during development and auditing.
  • Understanding learned representations and feature relationships.
  • Ensuring the model aligns with domain knowledge and business logic.
03

Common Techniques & Methods

Different technical methods are optimized for local or global analysis.

Local Explanation Methods:

  • LIME: Creates a local, interpretable surrogate model.
  • SHAP (local Shapley values): Attributes the prediction for an instance to each feature.
  • Counterfactual Explanations: Find minimal changes to alter the prediction.
  • Saliency/Attention Maps: Highlight important input regions (pixels, nodes, tokens).

Global Explanation Methods:

  • Global feature importance (e.g., mean absolute SHAP values).
  • Partial Dependence Plots (PDPs).
  • Rule extraction (e.g., mining decision rules from the model).
  • Concept Activation Vectors (CAVs) for understanding learned concepts.
04

Role of Knowledge Graphs

Knowledge Graphs (KGs) provide a structured semantic layer that enhances both local and global explanations.

  • For Local Explanations: A KG can ground the features of a specific instance (e.g., a 'patient' node) in a rich network of related entities (medications, conditions, procedures). The explanation can trace the prediction through this semantic subgraph, making it more intuitive.
  • For Global Explanations: The KG's ontology defines the concepts and relationships the model should respect. Global explanations can be validated against this ontology, and rule-based explanations can be expressed in the KG's formal language (e.g., OWL, SPARQL). This is a core tenet of Neuro-Symbolic AI.
05

Evaluation Metrics

The quality of explanations is measured differently based on scope.

Local Explanation Metrics:

  • Faithfulness/Fidelity: Does removing features deemed important by the explanation significantly change the local prediction?
  • Stability: Does the explanation remain consistent for similar inputs?
  • Actionability: Can the explanation guide a user to a desired outcome (recourse)?

Global Explanation Metrics:

  • Comprehensiveness: Does the explanation capture the model's major decision pathways?
  • Consistency with Domain Knowledge: Does the extracted logic align with expert rules or the KG ontology?
  • Representativeness: Is the explanation valid across diverse data subsets?
06

Trade-offs and Complementary Nature

Local and global explanations are not mutually exclusive; they offer complementary views.

Key Trade-offs:

  • Local explanations can be highly accurate for one case but may not reveal systemic model biases.
  • Global explanations provide the big picture but can oversimplify and miss local nuances or edge cases.

A robust XAI strategy requires both. For example:

  1. Use a global explanation to verify the model generally prioritizes clinically relevant features from a medical ontology.
  2. Use a local explanation to audit why it recommended a specific treatment for Patient X, tracing the reasoning through their connected health data in the KG. This dual approach satisfies both model auditing (global) and individual right to explanation (local) requirements.
EXPLAINABLE AI VIA KNOWLEDGE GRAPHS

Frequently Asked Questions

These questions address the core distinction between local and global explanations in machine learning, a critical concept for building transparent, auditable AI systems, especially when grounded in structured knowledge.

A local explanation justifies a single prediction for a specific input instance, while a global explanation describes the overall behavior or logic of a machine learning model across its entire operating domain.

  • Local Explanation: Answers "Why did the model predict this for that specific case?" It is instance-specific, often generated post-hoc using methods like LIME or SHAP, and is crucial for debugging individual decisions or providing recourse to an affected individual.
  • Global Explanation: Answers "How does this model generally make decisions?" It provides a holistic view, which might be an interpretable surrogate model (like a decision tree), a set of learned rules, or an analysis of feature importance across the dataset. This is essential for model validation, compliance auditing, and understanding broad model behavior.

When using a knowledge graph for grounding, a local explanation might trace the specific entities and relationships used for a single query, whereas a global explanation could describe the ontology or schema that consistently guides the model's reasoning.

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.