Home/Guides/Model Explainability
    Technical Deep-Dive

    Model Explainability: Methods, Comparison & Compliance

    A practitioner's guide to choosing, implementing, and documenting AI explainability methods. Covers SHAP, LIME, counterfactual explanations, and inherently interpretable models—with regulatory mapping for EU AI Act, GDPR, NIST, and FDA guidance.

    Why Explainability Is a Governance Imperative

    Explainability isn't just a nice-to-have—it's a regulatory requirement. The EU AI Act mandates that high-risk AI systems provide sufficient transparency for users to "interpret the system's output and use it appropriately" (Article 13). GDPR's Article 22 grants individuals the right to "meaningful information about the logic involved" in automated decisions with legal effects.

    Beyond compliance, explainability serves three critical governance functions: it enables human oversight of AI decisions, supports bias detection by revealing which features drive outcomes, and provides audit trails for regulatory investigations.

    Explainability is the bridge between AI capability and AI accountability. Without it, governance is performance—a checkbox exercise that offers no real oversight when decisions go wrong.

    —Glidepaths Research··

    Explainability Methods: A Practitioner's Comparison

    Each method has distinct strengths, limitations, and regulatory implications. Choose based on your model type, audience, and compliance requirements.

    SHAP

    SHapley Additive exPlanations

    Post-hoc, Model-agnostic

    Uses Shapley values from cooperative game theory to compute consistent feature contributions for each prediction.

    Strengths

    • Mathematically grounded (unique solution satisfying fairness axioms)
    • Provides both local and global explanations
    • Consistent: changing a model to rely more on a feature never decreases that feature's attribution

    Limitations

    • Computationally expensive for large models (KernelSHAP)
    • Assumes feature independence (unless using TreeSHAP)
    • Can be slow for real-time serving

    Best For

    Tabular data, tree-based models, regulatory audits requiring rigorous attribution

    Regulatory Fit

    Strong — meets EU AI Act documentation requirements

    LIME

    Local Interpretable Model-agnostic Explanations

    Post-hoc, Model-agnostic

    Generates local explanations by fitting a simple interpretable model (linear regression, decision tree) around each prediction.

    Strengths

    • Fast computation compared to SHAP
    • Intuitive visual explanations
    • Works with any model type
    • Good for text and image data

    Limitations

    • Explanations can be unstable (different runs, different results)
    • Sampling-based: may miss important feature interactions
    • Local fidelity doesn't guarantee global accuracy

    Best For

    Quick exploratory analysis, text/image models, customer-facing explanations

    Regulatory Fit

    Moderate — useful for transparency but may not satisfy rigorous audit requirements alone

    Counterfactual Explanations

    Contrastive/What-If Explanations

    Post-hoc, Model-agnostic

    Answers 'What would need to change for a different outcome?' by finding the minimal input changes that flip a prediction.

    Strengths

    • Highly intuitive for end-users ('If your income were $5K higher, you would be approved')
    • Actionable: tells people what to change
    • No need to reveal model internals

    Limitations

    • Multiple valid counterfactuals may exist
    • Can expose gaming strategies
    • Doesn't explain why the model works the way it does

    Best For

    Consumer-facing decisions (lending, insurance), GDPR right-to-explanation, adverse action notices

    Regulatory Fit

    Strong — aligns with adverse action requirements in financial services

    Attention Mechanisms

    Attention Weight Visualization

    Intrinsic (for transformer models)

    Visualizes which input tokens or regions the model 'attends to' when making predictions.

    Strengths

    • Built into transformer architecture (no extra computation)
    • Intuitive visualizations
    • Layer-by-layer analysis possible

    Limitations

    • Attention ≠ explanation (Jain & Wallace, 2019)
    • May not reflect causal reasoning
    • Only applies to attention-based architectures

    Best For

    NLP models, preliminary model understanding, research exploration

    Regulatory Fit

    Weak alone — should be supplemented with feature attribution methods

    Inherently Interpretable Models

    Decision Trees, Linear Models, Rule Lists, GAMs

    Intrinsic

    Models designed to be transparent by construction—the model IS the explanation.

    Strengths

    • No explanation gap: model logic is directly readable
    • Easiest to audit and validate
    • Preferred by some regulators
    • No post-hoc approximation errors

    Limitations

    • May sacrifice predictive accuracy for complex patterns
    • Decision trees can become unreadable when deep
    • GAMs miss high-order interactions

    Best For

    High-stakes decisions where transparency is paramount, insurance rate-making, medical triage

    Regulatory Fit

    Strongest — EU AI Act and NIST both prefer interpretable models where feasible

    Side-by-Side Comparison Matrix

    Quick reference for selecting the right explainability approach.

    DimensionSHAPLIMECounterfactualAttentionInterpretable
    Theoretical Rigor★★★★★★★☆☆☆★★★☆☆★★☆☆☆★★★★★
    Computational CostHighLowMediumNone (built-in)None
    StabilityHighLowMediumHighHigh
    User ComprehensionMediumHighVery HighMediumVery High
    Regulatory AcceptanceStrongModerateStrongWeakStrongest
    Model Agnostic?YesYesYesNoN/A

    Regulatory Explainability Requirements

    How major regulations define and mandate explainability obligations.

    EU AI Act

    Articles 13 & 14

    High-risk systems must provide sufficient transparency for users to interpret outputs and exercise human oversight. Technical documentation must explain model logic.

    GDPR

    Article 22, Recital 71

    Right to 'meaningful information about the logic involved' in solely automated decisions with legal or significant effects.

    NIST AI RMF

    GOVERN, MAP functions

    Organizations should select explainability approaches appropriate to the AI system's risk level and context of use.

    FDA AI/ML Guidance

    PCCP Framework

    Clinical AI systems must provide explanations interpretable by healthcare professionals to support clinical judgment.

    ISO/IEC 42001

    Clause 6.1, Annex B

    AI management systems must address transparency and explainability as part of AI-specific risk assessment.

    Choosing the Right Method: A Decision Framework

    Is the decision high-stakes and legally consequential?

    Start with inherently interpretable models. If complex models are necessary, use SHAP for rigorous feature attribution and counterfactuals for adverse action notices.

    Do you need real-time explanations at serving time?

    Use LIME for fast approximate explanations, or pre-compute SHAP values. Attention weights are free for transformer models but insufficient alone.

    Is the explanation for regulators or end-users?

    Regulators prefer SHAP (rigor) and documentation of model logic. End-users respond better to counterfactual explanations ('If X were different, the outcome would change').

    Are you working with tabular, text, or image data?

    Tabular: SHAP (especially TreeSHAP for tree models). Text: LIME or attention + SHAP. Images: Grad-CAM, LIME, or integrated gradients.

    Frequently Asked Questions

    What is model explainability in AI?

    Model explainability (also called interpretability or XAI) is the ability to understand, interpret, and communicate how an AI system arrives at its decisions. It encompasses both the technical capacity to trace model decisions back to input features and the ability to present those explanations in a meaningful way to different stakeholders.

    What is the difference between SHAP and LIME?

    SHAP (SHapley Additive exPlanations) provides mathematically guaranteed consistent feature attributions based on cooperative game theory. LIME (Local Interpretable Model-agnostic Explanations) creates local approximations using simpler models. SHAP offers stronger theoretical guarantees but is computationally expensive; LIME is faster but less consistent across similar inputs.

    Which regulations require AI explainability?

    The EU AI Act requires transparency and human oversight for high-risk systems (Articles 13-14). GDPR's Article 22 grants a right to 'meaningful information about the logic involved' in automated decisions. The NIST AI RMF emphasizes explainability in its GOVERN and MAP functions. FDA guidance requires clinical explainability for AI/ML-based medical devices.

    Should I use inherently interpretable models or post-hoc explanations?

    It depends on your use case. Inherently interpretable models (decision trees, linear models, rule lists) provide built-in transparency but may sacrifice predictive power. Post-hoc methods (SHAP, LIME, counterfactuals) can explain complex models but add computational cost and may not perfectly represent the model's true reasoning. For high-stakes regulated decisions, the EU AI Act and NIST recommend starting with interpretable models where feasible.

    Related Resources

    Need Help Implementing Explainability?

    Use our Compliance Checker to identify your explainability obligations, or explore our integration guides for implementing SHAP and LIME in your ML pipeline.