TrustShift: Shift Type, Not Shift Magnitude, Determines Machine-Learning Failure Modes
One pre-registered audit across four dissimilar domains: the type of distribution shift — not its magnitude — determines which axis of trustworthiness fails at deployment.
The discovery in one figure

The paper in five minutes
A machine-learning model is trained on yesterday's data and then released into a world that keeps changing. Everyone knows performance can drop — but not all drops are alike. Sometimes the model still ranks people correctly but its probability estimates become dishonest; sometimes it fails one demographic group; sometimes it collapses entirely. This paper studies four completely different fields at once — medicine, social-media language, mortgage lending, and network attacks — under one identical audit, and finds that the kind of change in the world, not the amount of change, decides what breaks. Better still, the kind is detectable in advance, from unlabeled data, so the right repair can be chosen before anyone is harmed.
The research question
ML systems are audited domain by domain, and deployment failures are usually attributed to how large the distribution shift is. Whether the kind of shift predicts the kind of failure had not been tested across domains under one protocol.
How the audit works
A single pre-registered audit protocol applied to four real-world domains — clinical risk (NHANES→BRFSS), mental-health NLP (Kaggle→Reddit/Twitter), mortgage lending (42M HMDA applications), and network security (CIC-DDoS2019→CICIDS2017). Discrimination, calibration, and subgroup reliability are measured with DeLong and bootstrap confidence intervals (N = 2000) and Benjamini–Hochberg FDR control, then explained by three cheap, label-free shift probes: prevalence shift, domain-classifier AUC, and importance-reweighting residual.
- 01Deployment shiftone trained model per domain meets a changed population
- 02Three label-free probesprevalence shift · domain-classifier AUC · reweighting residual
- 03Shift-type diagnosislabel, covariate, or concept shift — before outcomes arrive
- 04Failure taxonomywhich axis breaks: discrimination, calibration, or subgroups
- 05Matched remediationrecalibrate · reweight · retrain — chosen by diagnosis
The evidence, domain by domain
Same protocol, four worlds. If magnitude determined damage, the biggest shifts would always hurt most. They don't — the kind of shift decides which axis breaks.
Clinical
NHANES → BRFSS- ΔAUC
−0.031- ECE
0.168 → 0.276- Subgroup gap Δ
−0.066 [−0.113, −0.016], p = 0.011
Discrimination barely moves; calibration and the age-subgroup gap take the hit.
Mental-health NLP
Kaggle → Reddit · Twitter- AUC
0.983–0.987 → 0.596–0.703- ΔAUC
0.282–0.388- Target ECE
0.100–0.275
Every axis degrades at once — the worst-case shift signature.
Lending
HMDA temporal · geographic- ΔAUC (temporal)
−0.028 … −0.012 (improves)- Domain-classifier AUC
0.688–0.804 — shift clearly present- Pre-recalibration ECE
≈ 0.24
The counter-example: large detectable shift, intact discrimination — magnitude is not damage. Only calibration fails.
Network security
CIC-DDoS2019 → CICIDS2017- AUC
1.000 → 0.635- ECE
0.001 → 0.451- Unseen-family recall
0.052 – 0.355
New attack families the model never saw: discrimination collapses outright.
All values verbatim from results JSONs regenerated by run_all.py — see repository.
What a label-cheap fix can — and cannot — repair
Isotonic recalibration on a small calibration split. Toggle it: calibration error is repaired everywhere; discrimination almost never moves.
| Domain → target | ECE | AUC |
|---|---|---|
| Clinical → BRFSS | 0.757 | |
| NLP → Reddit | 0.648 | |
| NLP → Twitter | 0.592 | |
| Lending → 2022 | 0.805 | |
| Lending → 2023 | 0.821 | |
| Lending → 2024 | 0.819 | |
| Security → CICIDS2017 | 0.634 |
Read: calibration failure is cheap to fix without labels. Discrimination failure is not — except security's partial recovery (0.634 → 0.708), the exception that proves the taxonomy.
Figures from the paper



Figures generated by the paper's own pipeline — reproducible from the repository.
What this changes
It converts post-hoc deployment surprises into a pre-deployment diagnostic: an auditor can anticipate the failure axis before labels arrive, and it binds clinical, NLP, lending, and security evidence into one reproducible benchmark.
Reproduce it
git clone https://github.com/Rajveer-code/trustshift
cd trustshift
pip install -r requirements.txt
python run_all.py # regenerates every table and figureA fresh-clone reproduction of the master table was verified byte-identical, and the full pipeline re-run completed with exit 0. Prediction parquets and result JSONs are mirrored onHugging Face.
Themes
- Trustworthy ML
- Deployment Shift
- Healthcare AI
- NLP · LLMs
- Fairness
Citation
Manuscript under review — citation will be posted on acceptance. Reach me at rajveerpall04@gmail.com.