Explainable Ai Tools In Banking .
I. Why Tools Needed - Regulatory Threshold
EU AI Act Annex III 5(b) + Art. 13 + Art. 86 + GDPR Art. 22 + CJEU SCHUFA C-634/21 + D&B C-203/22:
- Bank must be able to explain model to supervisor - BdE - global explainability
- Must explain individual decision to client in plain language - local explainability - not algorithm
Banco de España doctrine - Occasional Paper 2105 Alonso-Robisco & Carbó 2021 + Working Paper 2222 2022:
We study performance of several ML models for credit default prediction using unique anonymized database from major Spanish bank. Compare Logistic Regression with Lasso, CART, Random Forest, XGBoost, Deep Neural Networks.
Finding: XGBoost best AUC, but black-box. Deep learning can produce illogical, unexplainable results - e.g., higher income → higher default.
Second paper 2022 - Accuracy of explanations of ML models for credit decisions:
We run empirical example synthetic datasets resembling underwriting and credit rating datasets, binary variable default. Use non-interpretable ML models like deep learning to predict default, then explain results using SHAP and permutation Feature Importance FI. Results suggest SHAP is better at interpreting.
Conclusion by BdE: Use post hoc evaluation techniques on ML predictions - apply SHAP and permutation FI to uncover importance of features.
Equifax Project in Spanish Regulatory Sandbox - NeuroDecision Technology and xAI for Credit Risk Management - BdE conclusion:
Use of Machine Learning algorithms with monotonic constraints can produce logical, explainable results.
So BdE approves: Monotonic XGBoost + SHAP + LIME + Counterfactual.
II. Tool Taxonomy - 6 Tools Recognized
| Tool | Type | What it does | Strength | Weakness | BdE Approval | Use for Art.86 |
|---|---|---|---|---|---|---|
| SHAP - SHapley Additive exPlanations | Global + Local, model-agnostic, game theory | Assigns each feature Shapley value - contribution to gap between prediction and average. Values add up exactly to prediction. | Consistent, legally defensible, works per decision, additive | Heavy compute at scale | YES - best per BdE Working Paper 2222 | YES - top 3 adverse reasons |
| LIME - Local Interpretable Model-agnostic Explanations | Local, model-agnostic | Approximates model locally around single case with interpretable linear model or decision tree | Fast, intuitive for loan officer | Can be unstable, different sample different explanation | YES - complementary | YES for loan officer explanation |
| Permutation Feature Importance - FI | Global | Shuffles feature, measures drop in performance | Simple, regulator understands | No local explanation | YES - BdE baseline | NO - only global |
| Counterfactual Explanations - DiCE, Alibi | Local, actionable | Shows minimal change to flip decision - "If income +€500, approved" | Actionable, meets EU recital for influenceability | Can generate unrealistic counterfactuals | YES - required for Art.86 actionable | YES - required |
| Monotonic Constraints + GAM - Generalized Additive Models | Inherently interpretable | Forces model: if income ↑ then risk ↓, via XGBoost monotone_constraints | Prevents illogical results, BdE sandbox approved | Lower AUC vs unconstrained | YES - NDT project approved | YES - best practice |
| Partial Dependence Plots - PDP / ICE | Global / Local | Shows marginal effect of feature | Visual | Ignores interaction | YES - for validation | Secondary |
III. Deep Dive - How Banks Implement
1. SHAP Framework for Credit - Standard Implementation
From reproducible SHAP framework for AML real-time:
- For credit default XGBoost:
- Train XGBoost with monotone constraints: monotone_constraints = (1,-1,0...) - income negative correlation with default.
- Compute SHAP values: shap.TreeExplainer(model).shap_values(X)
- Global: Summary plot - feature importance - BdE expects debt ratio, payment history top.
- Local: For denied applicant Mr. Jain - SHAP waterfall: base value 5% default, +15% due to 2 missed payments, +10% debt/income 52%, -3% tenure, final 27% → deny.
Case Study Leading Global Bank - Fraud Detection: Using SHAP system generates comprehensive explanations that highlight: transaction amount deviation, location mismatch, device change - used to justify blocking to regulator and client.
Legal defensibility: SHAP values add up exactly, consistent - satisfies CJEU C-203/22 requirement of procedure and principles actually applied - not just formula.
Spanish code example BdE expects:
Python
# Banco de España compliantmodel = xgboost.XGBClassifier(monotone_constraints={'income':-1,'debt_ratio':1})model.fit(X_train,y_train)explainer = shap.TreeExplainer(model)shap_values = explainer(X_test)
3 lines hidden
2. LIME - For Loan Officer Interface
Tool for local explanation, focusing why single prediction made.
- Perturbs applicant data around neighborhood, fits linear model.
- Example: Why did system decline loan of Mr. Jain? LIME: debt ratio >50% and recent late payment raised risk score most - simple linear weights.
Weakness: Can be manipulated - different random seed → different explanation - BdE warns. Use SHAP for final letter, LIME for internal triage.
3. Counterfactual - For Right to Influenceability - SCHUFA Reform Principle
SCHUFA stated new score developed around 4 principles: explainability, transparency, influenceability - Beeinflussbarkeit, fairness.
Counterfactual implements influenceability:
- Algorithm: "What minimal change would approve?"
- Example: Current: debt_ratio 52% → deny. Counterfactual: If debt_ratio 35% and utilization <70%, approve.
- Must ensure feasible - cannot suggest "be 10 years older".
Required for Art. 86 meaningful explanation + Spanish Digital Rights.
4. Monotonic Constraints + Explainable Boosting Machine
BdE Sandbox Equifax NDT - IA explicable en la gestión de Riesgos:
- Unconstrained ML can produce illogical - higher income = higher default due to spurious correlation.
- Solution: Constrain monotonic: income, seniority negative; delinquencies positive.
- Result: Model still 95% of unconstrained AUC but logical.
Regulatory approval: BdE concluded use of ML algorithms with monotonic constraints can...
This is now required for BdE model validation.
IV. Case Laws Defining Which Tool is Enough
1. CJEU C-634/21 SCHUFA - 7 Dec 2023 - Score = Automated Decision
Facts: OQ denied credit, bank relied heavily on SCHUFA score automated mathematical-statistical without human.
Holding: Where credit score transferred to third party and third party relies heavily, processing constitutes automated decision Art. 22.
Tool implication: Bank cannot say "We just used score, explainability is SCHUFA's job". Bank itself must provide SHAP explanation of score if relies heavily. SCHUFA now must provide SHAP-based reasons.
2. CJEU C-203/22 Dun & Bradstreet Austria - 27 Feb 2025 - Trade Secret vs Explainability
Facts: CK requested Art. 15(1)(h) logic, D&B withheld as trade secret.
Holding:
- Meaningful information requires explanation of procedure and principles actually applied in individual case, concise, transparent, intelligible, easily accessible.
- No obligation to disclose algorithm itself - para.59 - Trade secret preserved.
- Mere communication of complex mathematical formula insufficient.
Tool mapping:
- SHAP top 3 factors + principles = sufficient - meets threshold.
- Disclosing full XGBoost trees or SHAP exact values for 100 features = not required and would violate trade secret.
- LIME linear approximation acceptable if explains procedure.
3. Banco de España Working Paper 2222 - Accuracy of Explanations
Empirical synthetic datasets resembling underwriting datasets, binary default. Non-interpretable models deep learning, explain with SHAP and permutation FI.
Result: SHAP better at interpreting than FI, because FI only global, SHAP local + global.
Regulatory guidance: BdE supervisory evaluation will ask bank to demonstrate SHAP accuracy - does SHAP highlight drivers that actually cause default per economic logic? If SHAP highlights illogical drivers - e.g., postal code proxy for ethnicity - model rejected for bias.
4. Spanish Sandbox Equifax Case - NDT
BdE concluded NDT with monotonic constraints + SHAP passes sandbox, allowed to go live for credit scoring. First approved XAI credit model in Spain.
Conditions: Must log SHAP values for each decision, retain 5 years, provide to client on request within Art.86.
V. Production Architecture for Spanish Bank - 2026 Compliant
Layer 1 - Model Training - Global Explainability:
- XGBoost with monotone_constraints
- Validation: PDP, permutation FI, SHAP summary - submit to BdE model risk
Layer 2 - Decision Time - Local Explainability:
- Compute SHAP values real-time - <200ms with TreeExplainer
- Store: applicant_id, score, shap_values vector in logs - DORA requirement
- Generate adverse action reasons: Sort SHAP absolute values, map to human reason codes - e.g., feature missed_payments → code "Number of missed payments"
Layer 3 - Client Letter - Art.86 + GDPR Art.15(1)(h):
Code
We evaluated your application using an AI system.Main elements: Payment history 45%, debt/income 30%, utilization 15%.Your application: 2 missed payments last 12m increased risk significantly.If debt/income were 35% instead of 52%, application could be approved.You have right to human review: [link]
No formula, no algorithm.
Layer 4 - Human Oversight - Art.14:
Loan officer dashboard shows LIME local linear approximation + counterfactual + override button.
Tools to avoid:
- Pure deep neural net without SHAP - BdE will reject - illogical results
- LIME alone for client letter - unstable, not legally defensible per BdE paper

comments