Why Attribution Stability Matters More Than Accuracy

SHAP attributions vary with background data. Learn why stability—not accuracy—is the key property for audit-ready AI in regulated industries.

miércoles, 29 de julio de 2026 • 8 min read • Q2BSTUDIO Team

Por qué la estabilidad importa más que la exactitud

In today's AI ecosystem, engineering teams treat SHAP and LIME explanations as absolute truths. However, the technical reality shows that these explanations are merely samples from a distribution that varies with background data, sampling strategy, and runtime conditions. For regulated AI — especially in sectors like banking, insurance, or compliance — the property that truly matters under audit is not whether the explanation is correct, but whether it is stable enough to be defended. A credit risk team at a UK retail bank deploys an imbalance-aware fraud detection model. It uses TreeSHAP to generate feature attributions for every flagged transaction, attached to the case file for compliance review. Six months later, a regulator challenges a specific decision. The team pulls the original case file, presents the attribution: 'the decision was driven by transaction velocity, geographic anomaly, and merchant category code.' The regulator asks to rerun the attribution. The team does so with the same model, same input, same TreeSHAP implementation. The ranked feature importance comes back slightly different. Transaction velocity drops two ranks. Merchant category jumps three. The team is left without arguments. The model did not change. The input did not change. What changed? The background sample. TreeSHAP — like all SHAP variants — computes attributions as conditional expectations over a reference distribution. That reference distribution is sampled from the training data. Sample a different background, get a different attribution. The model's actual decision did not shift; the explanation of the decision did. The team has produced an audit defense artifact that another draw of the same procedure can contradict. This is the gap that enterprise AI governance is about to discover, the hard way.

The conceptual foundation of SHAP attribution is cooperative game theory — specifically, Shapley values, which fairly distribute the contribution of each player to a team's outcome. Applied to machine learning, 'players' are features and 'outcome' is the prediction. SHAP attributes how much each feature contributed to the difference between the model's prediction for this specific input and the model's expected prediction over some reference distribution. That last clause matters more than it appears. The reference distribution is the background sample — typically a few hundred observations drawn from the training data. SHAP does not tell you 'feature X matters this much.' It tells you 'feature X contributed this much relative to what the model would have predicted on average over this specific background sample.' Different background sample, different baseline, different attribution.

For deterministic ML models with stable feature distributions, this dependency is small enough to be tolerable. But for models trained under class imbalance — where the minority class has been synthetically oversampled with SMOTE or similar techniques — the dependency becomes substantial. The training distribution and the deployment distribution diverge; the background sample's representativeness becomes unreliable; the attribution variance grows. This technical reality has a measurable name: σ_SHAP, the across-repeat variance of mean-absolute SHAP attribution under rotated background sampling. Formally, σ_SHAP = √(m⁻¹ Σⱼ Varₖ(|φⱼ,ₖ|)), where φⱼ,ₖ is the attribution for feature j computed against the k-th background sample draw, and the variance is taken across K independent background draws. The square root produces a scalar measure of attribution instability in the same units as the attributions.

In a recent work on imbalance-aware financial distress prediction, this σ_SHAP was measured over K=50 rotated background samples of 100 observations each, on the public Taiwan Bankruptcy Prediction benchmark. What the measurement revealed is consequential: the variance of SHAP attributions across rotated backgrounds is substantial, and — most importantly for production deployments — SMOTE-based imbalance handling materially amplifies the instability. Models trained on synthetic oversampled data produce attributions with higher variance under rotated backgrounds than models trained on the original imbalanced data. The standard production response to class imbalance — synthetic minority oversampling — degrades the audit-defense property of the resulting model. This is not a theoretical concern; it is a measured engineering reality on a public benchmark, with a public reproducibility package that any team can verify against their own production pipeline.

Why does this matter under regulatory challenge? Compliance teams reading the UK PRA's Supervisory Statement SS1/23 on model risk management notice the requirement for 'sufficient validation evidence' and 'effective challenge' of model decisions. They typically interpret this as a documentation requirement — generate explanations, attach them to case files, retain them for audit windows. Engineering teams implementing this interpret it as 'run SHAP once per decision and store the output.' Both interpretations miss what is coming. The PRA's enforcement mechanism is the right of supervisory challenge on specific decisions. A regulator selects a case, requests the firm to demonstrate the validation evidence, and tests whether the explanation is defensible. If the firm reruns the attribution and gets a materially different answer, the defense collapses — not because the model is wrong, but because the explanation was a point estimate from a distribution that the firm never measured. The European Banking Authority's machine learning guidelines apply similar pressure, requiring documented reasoning behind individual model decisions in credit risk applications. The EU AI Act's high-risk system requirements call out interpretability and reproducibility as compliance baselines. The FCA's emerging AI-in-financial-services guidance emphasizes decisions being reconstructible on challenge. None of these instruments specify 'measure attribution variance under rotated backgrounds.' They specify outcomes — and attribution variance is the property that determines whether those outcomes can actually be delivered.

The honest engineering implication is not that SHAP is broken or should not be used. It is that single-shot attribution as currently deployed in production is constructing audit artifacts that the underlying methodology does not support. Stable attribution requires three changes to the production deployment pattern: First, measure under variance, not as a point estimate. Production attribution pipelines should compute attributions across multiple background samples — typically 30 to 100 independent draws — and report not just the mean attribution but the variance across draws. A regulator should be able to see 'feature X contributes this much, with this much uncertainty' — not just a single number. Second, fixed background protocol for audit-defense artifacts. If a specific attribution is attached to a case file for compliance retention, the background sample used to generate it should be versioned, persisted, and reproducible. This converts attribution from a stochastic process into a deterministic one for audit purposes — the firm commits to a specific background, records its identity, and any re-run uses the same background. This is engineering discipline, not technical sophistication. Third, attribution stability as a model-selection criterion. When evaluating candidate models, attribution stability under realistic runtime conditions should be an evaluation dimension — alongside predictive accuracy, calibration, and fairness. Models that produce stable attributions under realistic deployment-time variation are operationally more valuable than models that produce slightly more accurate but materially less stable attributions. This trade-off is currently invisible in most model selection pipelines because nobody measures the stability dimension systematically.

In practice, implementing stable attribution requires modest infrastructure but explicit discipline. The engineering primitives include: Seeded background sampling (every background draw uses an explicitly seeded random state, recorded in the deployment fingerprint; reruns use the same seed); rotated background measurement at evaluation time (the model is evaluated not only on accuracy and calibration but also on σ_SHAP — variance of attributions across K rotated background draws — fixing K, background size, and rotation seed schedule); and persisted background identity at runtime (when attribution is computed for a production decision, the background sample identity — hash of the actual observations used — is persisted alongside the attribution, the model version, and the input; audit reruns use the persisted background). When a regulator challenges a specific decision, the firm reruns SHAP against the persisted background — not a fresh random sample — and the attribution reproduces exactly. None of these are computationally expensive; none require novel research; all require deliberate engineering choices that most production deployments currently are not making.

This is where Q2BSTUDIO comes in as a strategic ally. As a company specialized in custom software development, Q2BSTUDIO understands that regulated AI cannot rely on one-shot artifacts. Their teams integrate stability measurement best practices into the machine learning pipelines they build for clients, ensuring attributions are defensible under regulatory scrutiny. Additionally, the company offers cloud services on AWS and Azure that enable scaling these processes with the right infrastructure to persist background samples and perform rotated calculations without performance loss. Cybersecurity also plays a key role: the integrity of persisted backgrounds and traceability of executions are critical for external audits, and Q2BSTUDIO deploys cybersecurity solutions that protect these assets. In the business intelligence domain, the company uses Power BI to visualize attribution variance and help compliance teams understand uncertainty in explanations. And, of course, the development of AI agents enables automation of background rotation and stability reporting, freeing teams from repetitive tasks. In a scenario where accuracy and stability compete, Q2BSTUDIO advises its clients to make the operationally correct decision: prioritize models that, although slightly less accurate, offer attributions that hold firm under repetition. That is the key to truly auditable and defensible AI.

The trade-off is real: production deployments will report attributions alongside their uncertainty, and the uncertainty will sometimes be uncomfortably large. The honest engineering response is to measure the discomfort, report it, and design around it — not to suppress it by returning a point estimate that the underlying method does not support. Audit defense is not about producing better explanations. It is about producing explanations whose stability you can measure and defend. That is an engineering problem, not a governance problem. And it is solvable — if you measure what is actually happening, rather than what you wish were happening. Firms that get there first — by measuring attribution stability at deployment time, persisting background identities at runtime, and treating attribution as a measured property rather than a generated artifact — will have audit-defense capabilities the rest of the industry will be retrofitting in five years.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.