The limits of debiased clinical language models for cross-hospital generalization Authors: Angyang Guo, Wenna Chen, Yan Zhang, Mingxia Ji, Bin Fang, Hongbin Huang Published: 2026 ABSTRACT AbstractAs clinical language models are increasingly deployed across healthcare institutions, ensuring equitable predictions for all demographic groups becomes critical. While fairness interventions have shown promise in medical AI, a fundamental question remains underexplored: do models that achieve fairness at one hospital maintain that fairness when deployed elsewhere? We investigated this question through extensive cross-database experiments on ICU mortality prediction, fine-tuning ClinicalBERT on MIMIC-IV and evaluating on eICU-CRD. Our findings reveal that debiasing can backfire: fairness-only training achieves the best in-domain equalized odds gap (0.039) but the worst out-of-domain fairness (0.182), representing a striking 4.7× degradation that completely reverses the intended intervention. We find evidence consistent with a domain leakage mechanism, whereby hospital-specific documentation patterns encoded in learned representations can interact unpredictably with demographic signals across sites, such that in-domain fairness constraints may fail or even reverse when deployed out-of-domain. Crucially, we find that domain leakage, not demographic leakage, is most strongly associated with fairness transfer failures (Pearson r=0.89). To address this challenge, we propose a leakage-aware training framework combining domain confusion, group robustness, and equalized odds penalties, along with MDLS (Minimum-Domain-Leakage Selection), a model selection criterion requiring no out-of-domain labels. Our method reduces the out-of-domain equalized odds gap to 0.064 while improving AUROC from 0.741 to 0.802. These results demonstrate that debiasing without domain awareness can produce models that are locally fair yet globally unfair, underscoring the necessity of domain-aware auditing before cross-institutional deployment of clinical NLP systems.Keywords: Clinical natural language processing, Algorithmic fairness, Distribution shift, Domain generalization, Electronic health recordsSubject terms: Computational biology and bioinformatics, Health care, Mathematics and computing, Medical research Introduction As artificial intelligence (AI) models are increasingly deployed in real-world clinical settings1–3, it is crucial to evaluate not only model performance but also potential biases toward specific demographic groups4,5. Although deep learning has achieved impressive capabilities in clinical natural language processing (NLP) tasks ranging from clinical note summarization to mortality prediction6–8, existing literature indicates a tendency for these models to manifest existing biases in the data, causing performance disparities between protected subgroups9–11. For instance, chest X-ray classifiers trained to predict the presence of disease systematically underdiagnose Black patients11, potentially leading to delays in care. Similarly, a widely deployed algorithm for population health management was found to systematically disadvantage Black patients by using healthcare costs as a proxy for health needs10. To ensure the responsible and equitable deployment of such models, it is essential to understand the source of such biases and, where feasible, take actions to correct them12,13. Recent studies in medical imaging have unveiled the surprising ability of deep models to predict demographic information from medical data, achieving performance far beyond that of human clinicians14. These insights raise the concern of disease prediction models leveraging demographic features as heuristic “shortcuts”—correlations that are present in the data but have no real clinical basis15,16. Shortcut learning occurs when models exploit spurious correlations rather than clinically meaningful patterns, leading to predictions that fail under distribution shift15. Most concerning, Yang et al.17 demonstrated that fairness interventions optimized in-domain can fail, or even reverse, under distribution shift in medical imaging, with models achieving demographic parity in-domain exhibiting the worst fairness gaps out-of-domain. In other words, debiasing can backfire. Whether analogous backfire effects exist for clinical language, where domain shift manifests through documentation styles, electronic health record (EHR) templates, and institutional vocabularies rather than imaging characteristics, remains an open question with significant implications for the responsible deployment of clinical NLP systems18,19. In this work, we investigated four research questions (RQs): RQ1: Do clinical language models trained for mortality prediction use demographic information as shortcuts, and do such demographic shortcuts result in biased predictions? Deep models in medical imaging have been shown to learn demographic shortcuts from clinical data14, but whether clinical language models exhibit analogous shortcut behavior remains unexplored. RQ1: Do clinical language models trained for mortality prediction use demographic information as shortcuts, and do such demographic shortcuts result in biased predictions? Deep models in medical imaging have been shown to learn demographic shortcuts from clinical data14, but whether clinical language models exhibit analogous shortcut behavior remains unexplored. RQ2: To what extent can state-of-the-art debiasing methods remove such shortcuts and create “locally optimal” models that are fair within their training distribution? Existing benchmarks have evaluated fairness interventions primarily in the in-domain setting20,21, leaving open the question of whether such gains persist under deployment. RQ2: To what extent can state-of-the-art debiasing methods remove such shortcuts and create “locally optimal” models that are fair within their training distribution? Existing benchmarks have evaluated fairness interventions primarily in the in-domain setting20,21, leaving open the question of whether such gains persist under deployment. RQ3: In real-world clinical deployment settings, does local (in-domain) fairness transfer when models are deployed out-of-distribution (OOD) at new hospital sites? Distribution shift is a well-documented challenge for model robustness22,23, but its interaction with fairness in clinical NLP remains underexplored. RQ3: In real-world clinical deployment settings, does local (in-domain) fairness transfer when models are deployed out-of-distribution (OOD) at new hospital sites? Distribution shift is a well-documented challenge for model robustness22,23, but its interaction with fairness in clinical NLP remains underexplored. RQ4: Which algorithms and model selection criteria can lead to “globally optimal” models that maintain both performance and fairness in OOD settings? Schrouff et al.24 proposed diagnostic tools for fairness transfer in imaging; we build on this direction for clinical text. RQ4: Which algorithms and model selection criteria can lead to “globally optimal” models that maintain both performance and fairness in OOD settings? Schrouff et al.24 proposed diagnostic tools for fairness transfer in imaging; we build on this direction for clinical text. We hypothesize that cross-database fairness failures in clinical NLP stem from a specific, previously uncharacterized mechanism: domain leakage. Learned representations encode not only task-relevant clinical signals but also hospital-specific documentation patterns—including note templates, abbreviation conventions, and section structures—that are spuriously correlated with both the prediction target and demographic attributes25. When a model is deployed at a new site with different documentation practices and demographic compositions, these domain-specific shortcuts interact unpredictably with demographic signals, causing fairness constraints optimized in-domain to transfer poorly or even reverse26,27. This offers a plausible explanation for why debiasing can backfire: reducing demographic information in representations (the standard approach to fair representation learning28) is insufficient when domain-specific confounds remain unaddressed. To investigate this hypothesis and develop practical solutions, we propose a leakage-aware training and model selection framework. Our approach combines three components: (1) lightweight probes that quantify domain and demographic leakage in learned representations, enabling diagnosis of potential transfer failures29; (2) a training objective that jointly optimizes for task performance, domain invariance, group robustness, and equalized odds30,31; and (3) MDLS (Minimum-Domain-Leakage Selection), a model selection criterion that identifies checkpoints likely to maintain fairness under distribution shift without requiring any out-of-domain labels. We evaluated our framework on cross-database ICU mortality prediction, fine-tuning ClinicalBERT on MIMIC-IV32 and testing on eICU-CRD33. Our experiments reveal a striking and counterintuitive finding: fairness-only training (equalized odds penalty alone) achieves the best in-domain fairness (equalized odds gap = 0.039) but the worst out-of-domain fairness (equalized odds gap = 0.182), representing a 4.7× degradation that completely reverses the intended intervention. This is the backfire effect in action. In contrast, our leakage-aware approach achieves an OOD equalized odds gap of 0.064, the lowest among all methods, with transfer stability , while simultaneously improving predictive performance (AUROC: 0.741 → 0.802). These results provide the first empirical demonstration that debiasing can backfire in clinical NLP, producing models that are locally fair yet globally unfair, with important implications for the responsible deployment of such systems34,35. Our original contributions are as follows. First, we provide the first empirical demonstration that debiasing can backfire in clinical NLP, extending prior findings from medical imaging17 to clinical text, where domain shift operates through fundamentally different mechanisms (documentation templates, institutional vocabularies, and abbreviation conventions). Second, we identify domain leakage as the primary mechanism underlying fairness transfer failures in clinical text and demonstrate that it is a stronger predictor of OOD fairness failures than demographic leakage. Third, we propose a leakage-aware training objective that combines domain confusion, group robustness, and equalized odds penalties to jointly address domain and demographic shortcuts. Fourth, we introduce MDLS (Minimum-Domain-Leakage Selection), a practical model selection criterion that requires no OOD labels, enabling deployment-ready fairness auditing. Methods Data sources We used two publicly available ICU databases. MIMIC-IV32,36 contains ICU data from Beth Israel Deaconess Medical Center (BIDMC), a single academic medical center in Boston, MA. The database includes comprehensive clinical notes, laboratory values, vital signs, and demographic information for over 40,000 ICU admissions. eICU-CRD33 aggregates ICU data from 208 hospitals across the United States via the Philips eICU program, exhibiting substantial heterogeneity in documentation styles, EHR templates, and patient populations. The databases differ in outcome prevalence (11.2% vs. 9.8%), demographic composition, and documentation heterogeneity (Table 1). Table 1Dataset statistics after preprocessing. The two databases differ in scale, outcome prevalence, and demographic composition. MIMIC-IV represents a single academic medical center with consistent documentation practices, while eICU-CRD aggregates data from 208 hospitals with heterogeneous documentation styles. All counts refer to admissions remaining after exclusion of those with ICU stays <24 hours, missing clinical notes, or missing demographic/outcome labels (see Methods for the full exclusion cascade).StatisticMIMIC-IVeICU-CRDAdmissions (after preprocessing)23,45618,234Unique patients19,87215,946Hospitals1208Mortality rate11.2%9.8%Male56.3%54.1%Age ≥ 6548.7%52.3%White68.4%71.2% Dataset statistics after preprocessing. The two databases differ in scale, outcome prevalence, and demographic composition. MIMIC-IV represents a single academic medical center with consistent documentation practices, while eICU-CRD aggregates data from 208 hospitals with heterogeneous documentation styles. All counts refer to admissions remaining after exclusion of those with ICU stays <24 hours, missing clinical notes, or missing demographic/outcome labels (see Methods for the full exclusion cascade). Both MIMIC-IV and eICU-CRD are publicly available, fully de-identified critical-care databases distributed via PhysioNet37. To obtain credentialed access, we completed the Collaborative Institutional Training Initiative (CITI) Program courses on “Human Research and Data” and “Specimen-Only Research” (Record ID: 72513184) and signed the corresponding data use agreements. All methods reported in this manuscript were carried out in accordance with the relevant guidelines and regulations, including the ethical principles of the Declaration of Helsinki (as revised in 2024), and the manuscript was prepared in accordance with the TRIPOD+AI reporting guideline38. Ethical approval for this study, including all experimental protocols, was obtained from the Ethics Committee of Yiwu Central Hospital. The establishment and public release of MIMIC-IV were independently approved by the Institutional Review Boards (IRBs) of BIDMC (No. 2001-P-001699/14) and the Massachusetts Institute of Technology (MIT, No. 0403000206), with a waiver of informed consent because all protected health information had been de-identified and the secondary use did not impact clinical care32,36. For eICU-CRD, all tables have been de-identified to meet the Safe Harbor provision of the US Health Insurance Portability and Accountability Act (HIPAA), with all protected health information removed, and the re-identification risk was certified to meet HIPAA Safe Harbor standards by an independent privacy expert (Privacert, Cambridge, MA) under Certification No. 1031219-233. Written informed consent for participation was therefore not required for our study, in accordance with the upstream consent waivers and de-identification authorizations under which the source databases were publicly released. The Ethics Committee of Yiwu Central Hospital reviewed and confirmed this position for the present retrospective secondary analysis, given that all patient information had been anonymized prior to public release and that the present work involves no direct interaction with human subjects and no collection of new patient data. Data pre-processing Starting from 73,181 ICU admissions in MIMIC-IV and 200,859 in eICU-CRD, we applied the following exclusion criteria: (1) ICU stays shorter than 24 hours were excluded because the model input uses clinical notes from the first 24 hours of ICU admission, which conditions the cohort on having at least 24 hours of documentation (MIMIC-IV: 31,402 excluded; eICU-CRD: 139,287 excluded); (2) admissions lacking clinical notes were removed (MIMIC-IV: 12,847 excluded; eICU-CRD: 38,219 excluded); and (3) admissions with missing demographic information (age, sex, or race) or outcome labels were excluded (MIMIC-IV: 5,476 excluded; eICU-CRD: 5,119 excluded). Outcome labels were defined as in-hospital death within 48 hours of ICU admission, computed from ICU admission timestamps and recorded time-of-death information available in each database. After exclusion, 23,456 admissions (from 19,872 unique patients) remained from MIMIC-IV and 18,234 admissions (from 15,946 unique patients) from eICU-CRD. The patient counts reported in Table 1 refer to admissions after preprocessing. A detailed exclusion cascade is provided in Supplementary Table S1. We split each dataset into 70% train, 15% validation, and 15% test sets at the patient level (ensuring that all admissions from the same patient appear in the same split to prevent data leakage). For the leave-one-database-out (LODO) setting, models were trained and selected using only MIMIC-IV (train/validation). eICU-CRD outcome labels were used only for final reporting on the held-out eICU-CRD test split; when a method required unlabeled target notes (e.g., DANN-style domain confusion and our approach), we used the eICU-CRD training split without accessing its outcome labels. We extracted demographic information following established protocols for handling race and ethnicity in clinical research13,39. Task definition We studied early ICU mortality prediction: given clinical notes from the first 24 hours of ICU admission, predict whether the patient dies in-hospital within 48 hours of ICU admission40–42. Because the input window requires 24 hours of notes, this task should be interpreted as predicting mortality by 48 hours among admissions with at least 24 hours of documentation. Clinical notes were concatenated chronologically and truncated to 512 tokens (the maximum input length for ClinicalBERT), preprocessed following established clinical NLP protocols including lowercasing, de-identification token preservation, and removal of formatting artifacts6,7. We defined three sets of protected groups for fairness evaluation: Age (<65 vs. ≥65), Sex (Male vs. Female), and Race (White vs. Non-White)11,39. For each demographic attribute, we identified subgroups with sufficient sample sizes: age groups “≥65” (n = 11,439) and “<65” (n = 12,017); sex groups “female” (n = 10,489) and “male” (n = 12,967); and race groups “White” (n = 16,054) and “Non-White” (n = 7,402). Choice of base model We selected ClinicalBERT6 as our base encoder for three reasons. First, ClinicalBERT was pre-trained on clinical notes from MIMIC-III, making it the most domain-appropriate publicly available model for ICU clinical text processing. Alternative biomedical language models such as BioBERT8 were pre-trained on PubMed abstracts and PMC full-text articles, which differ substantially in vocabulary, style, and content from clinical notes written during patient care. Similarly, BioMedRoBERTa43 and SurgicBERTa44 target biomedical literature rather than clinical documentation. Second, ClinicalBERT remains the most widely adopted encoder for clinical NLP tasks involving EHR notes, facilitating comparison with prior work on fairness in clinical prediction4,20. Third, ClinicalBERT’s architecture (BERT-base, 110M parameters) allows end-to-end fine-tuning on a single GPU, which is important for reproducibility in clinical settings where computational resources may be limited. We emphasize that our framework (leakage probing, domain confusion, and MDLS) is architecture-agnostic and could in principle be applied to any encoder-based model. We discuss the generalizability of our findings to larger language models in the Limitations section. Fairness criterion Following Hardt et al.30, we adopt equalized odds as our primary fairness criterion. Equalized odds is a widely used group fairness metric that requires a classifier to perform equally well for all demographic groups, conditional on the true outcome45. Formally, a classifier satisfies equalized odds if, for all demographic groups : where is the model’s binary prediction (1 = predicted to die within 48 hours, 0 = predicted to survive), is the true outcome label (1 = actually died, 0 = actually survived), A denotes a specific value of the sensitive (demographic) attribute (for example, or ), and is the set of all demographic groups for that attribute (for example, ). In our implementation, the model produces a predicted mortality risk , and we form a binary decision using a fixed threshold τ = 0.5 for all methods. This criterion requires equal true positive rates and false positive rates across groups4: We quantify violations via the equalized odds gap46: In our experiments, each demographic attribute is binary, so the maximum reduces to the single pairwise subgroup comparison. As a concrete example, if the model’s TPR is 0.85 for male patients and 0.78 for female patients, and the FPR is 0.10 for males and 0.15 for females, then the equalized odds gap is |0.85 - 0.78| + |0.10 - 0.15| = 0.07 + 0.05 = 0.12. A gap of zero indicates that the model treats both groups equally (perfect fairness with respect to equalized odds). Larger gaps indicate greater disparities in how the model performs across demographic groups. Leakage quantification To diagnose why fairness fails to transfer across sites, we quantified two types of information leakage in learned representations using lightweight probing classifiers, following the methodology of Gichoya et al.14 for demographic probing and extending it to domain probing. Let denote the representation (hidden state) learned by the ClinicalBERT encoder for an input clinical note x. Domain leakage quantifies how much database (site) identity can be predicted from these representations17: where is the database identity label and is a probe classifier trained to predict d from h. A DomainLeak AUROC of 0.5 would indicate that the representation contains no database-identifying information, while values approaching 1.0 indicate strong encoding of database-specific documentation patterns. Because eICU-CRD aggregates multiple hospitals, we treat database identity as an operational domain label and interpret DomainLeak as cross-database (documentation-style) leakage rather than recovery of a specific hospital identifier. Demographic leakage is defined analogously for sensitive attribute a (e.g., sex or race)29, measuring how much demographic information remains encoded in the representation after training. We emphasize that probe AUROC is an operational leakage measure of predictive recoverability by a fixed-capacity classifier, not an exact information-theoretic quantity such as mutual information. Because probe-based leakage can depend on probe capacity and optimization, we keep the probe architecture and training procedure fixed across all methods and checkpoints and interpret DomainLeak/DemoLeak comparatively (relative changes and rankings) rather than as absolute information content. Both probes are two-layer multi-layer perceptrons (MLPs) with hidden dimension 256 and ReLU activation. For each checkpoint, we froze the encoder weights and trained a domain probe to predict database identity using a balanced mixture of representations from the MIMIC-IV and eICU-CRD training splits (using only d, not outcome labels). We report DomainLeak AUROC on a held-out mixture of MIMIC-IV and eICU-CRD validation splits. We trained a demographic probe on representations from the MIMIC-IV training split and report DemoLeak AUROC on the MIMIC-IV validation split. Probes were trained for 10 epochs using the Adam optimizer with learning rate . Freezing the encoder during probing ensures that probes measure information already present in the representations, rather than information that could be extracted through further optimization of the encoder14. Research questions and experimental design We addressed our four research questions through the following experimental designs: RQ1 (Demographic shortcuts and fairness gaps): We fine-tuned ClinicalBERT on MIMIC-IV for mortality prediction using empirical risk minimization (ERM)40,47, then froze the encoder weights and trained probe classifiers on penultimate-layer representations to predict sensitive attributes (age group, sex, race), following the probing approach of Gichoya et al.14. This allowed us to quantify demographic encoding without modifying the learned representations. Datasets: MIMIC-IV (training and in-domain evaluation). Methods: ERM training followed by attribute probing. Metrics: Attribute prediction AUROC, equalized odds gap, Pearson correlation between attribute encoding and fairness gap. RQ2 (Debiasing creates locally optimal models): We compared ERM to state-of-the-art debiasing and robustness methods in the in-domain setting: Fair-ERM (ERM with an equalized odds penalty term30), DANN (domain-adversarial neural network that adversarially removes domain information from representations48), and GroupDRO (distributionally robust optimization that minimizes worst-case loss over demographic groups31). Datasets: MIMIC-IV (training, in-domain evaluation). Methods: ERM, Fair-ERM, DANN, GroupDRO. Metrics: AUROC, equalized odds gap. RQ3 (Fairness transfer under distribution shift): We adopted the Leave-One-Database-Out (LODO) protocol introduced by Yang et al.17: all models were trained on MIMIC-IV and evaluated on eICU-CRD, with no labeled data from eICU-CRD available during training or model selection. This reflects realistic deployment scenarios where a clinical NLP model developed at one institution is deployed at another without site-specific fine-tuning22. We assessed whether in-domain fairness improvements persisted out-of-domain. Datasets: MIMIC-IV (training), eICU-CRD (OOD evaluation). Methods: All four methods above. Metrics: OOD AUROC, OOD equalized odds gap, stability (), DomainLeak AUC, DemoLeak AUC. RQ4 (Globally optimal models): We proposed our leakage-aware training framework and MDLS model selection criterion (described below) and evaluated whether they achieve models that maintain both performance and fairness in OOD settings. Datasets: MIMIC-IV (training), eICU-CRD (OOD evaluation). Methods: Our leakage-aware approach, compared against all baselines. Metrics: OOD AUROC, OOD equalized odds gap, stability, worst-group AUPRC, ECE, DomainLeak AUC. In total, our analysis encompassed models trained across four demographic attributes (age, sex, race, and their intersection), five algorithms (ERM, Fair-ERM, DANN, GroupDRO, and our method), and multiple hyperparameter settings. Figure 1 summarizes the experimental pipeline. Overview of our leakage-aware framework for cross-database clinical fairness. The pipeline operates in three stages. Top row: Source-site training and leakage auditing on MIMIC-IV, including representation learning with leakage control (ClinicalBERT encoder with domain confusion, group-robust optimization, and equalized odds penalty), leakage probes that quantify domain and demographic information encoded in representations, and MDLS (Minimum-Domain-Leakage Selection) that selects models with minimum domain leakage among near-optimal checkpoints using only source-site labels. Bottom row: Deployment to target EHR database (eICU-CRD) with multi-center data exhibiting domain shift in templates, documentation styles, and demographics. Results demonstrate improved OOD performance and more stable calibration under shift. The key finding “local fairness ≠ global fairness” is illustrated: fairness training can worsen OOD equalized odds gap, while our method achieves safer deployment with improved worst-group performance. Training objective Our leakage-aware training objective combines four terms to jointly address task performance, fairness, domain invariance, and group robustness30,31,48: where is binary cross-entropy for mortality prediction, is a differentiable surrogate for equalized odds that explicitly conditions on the true label (approximating FPR and TPR parity)30, is a domain confusion loss that encourages domain-invariant representations via a domain-adversarial objective48, and is the GroupDRO worst-case loss that up-weights the loss on the worst-performing demographic group (following Sagawa et al.31). We define our EO surrogate as: where is the model-predicted mortality risk. Conditioning on Y is essential: without conditioning (i.e., using ), the penalty would instead encourage demographic parity rather than equalized odds. For domain confusion, we follow DANN48 by attaching an auxiliary domain discriminator and applying a gradient reversal layer (GRL) to the encoder representation h, so that minimizing encourages h to be uninformative about the domain label d. Hyperparameters were set to , , based on validation performance on MIMIC-IV (Fig. 2). Comprehensive experimental results. (a) ID versus OOD AUROC comparison showing our method achieves superior OOD performance (0.802) while maintaining comparable ID performance. Error bars indicate 95% CI via patient-level bootstrap (n = 1,000). (b) Fairness generalization: dumbbell plot showing ID→OOD equalized odds gap changes, with stability (Δ) annotated. Fair-ERM achieves best ID fairness but worst OOD stability (Δ = 0.143); our method maintains stable transfer (Δ = 0.018). (c) Leakage diagnosis: bubble plot showing domain leakage AUC (x-axis) versus demographic leakage AUC (y-axis); bubble size indicates OOD AUROC. Critically, Fair-ERM achieves low demographic leakage but high domain leakage, consistent with its poor OOD fairness despite best ID fairness. Our method achieves lowest domain leakage with highest OOD performance. (d) Ablation study: radar plot showing normalized metrics across five dimensions (OOD fairness, OOD AUROC, calibration, domain invariance); domain confusion and MDLS are critical components. (e) MDLS selection frontier: checkpoints plotted by validation AUROC and domain leakage AUC. The shaded region indicates the near-best validation band (tolerance δ). MDLS (star) selects the checkpoint with minimum domain leakage, achieving better OOD fairness than standard selection (best validation AUROC with high leakage). MDLS: Minimum-Domain-Leakage Selection Standard model selection chooses the checkpoint with the best validation AUROC, which can inadvertently favor models that achieve marginal in-domain gains by exploiting domain-specific shortcuts and therefore have high domain leakage. MDLS is our proposed alternative: among checkpoints that are near-optimal for source performance, it selects the one with minimum domain leakage, motivated by the invariance perspective in domain generalization49,50 and prior observations that in-domain fairness can be a poor proxy for OOD fairness17. MDLS operates as follows: (1) compute validation AUROC and DomainLeak AUROC for all saved checkpoints; (2) identify checkpoints within a small tolerance δ = 0.005 of the best validation AUROC (the “near-optimal band”); (3) among these near-optimal checkpoints, select the one with minimum domain leakage. We set δ = 0.005 (absolute AUROC) to reflect typical validation uncertainty (Table 2); δ controls the performance–invariance trade-off (with δ =0 reducing to standard selection). This procedure requires no OOD labels, making it practical for real-world deployment. Table 2LODO performance and calibration results. All methods achieve comparable ID performance, but OOD performance varies substantially. Our method achieves the highest OOD AUROC (0.802) and lowest OOD ECE (0.082). Values are mean ± 95% CI via patient-level bootstrap (n = 1,000). Bold indicates best.MethodID (Val)OOD (Test)AUROCECEAUROCECEERM.872±.004.061±.006.741±.010.124±.012Fair-ERM.868±.004.066±.006.733±.011.139±.014DANN.869±.004.058±.005.768±.010.103±.011GroupDRO.866±.005.064±.006.759±.010.112±.012Ours.870±.004.054±.005.802±.009.082±.009 LODO performance and calibration results. All methods achieve comparable ID performance, but OOD performance varies substantially. Our method achieves the highest OOD AUROC (0.802) and lowest OOD ECE (0.082). Values are mean ± 95% CI via patient-level bootstrap (n = 1,000). Bold indicates best. Overall workflow To provide a complete view of how the fairness criterion, leakage quantification, training objective, and MDLS model selection are combined, we present the full experimental workflow in Algorithm 1 and the MDLS selection procedure in Algorithm 2. Leakage-aware training and evaluation workflow MDLS: Minimum-Domain-Leakage Selection Training details We used the publicly available pre-trained ClinicalBERT weights6 (originally pre-trained on clinical notes from MIMIC-III by Alsentzer et al.) as the base encoder and fine-tuned it end-to-end on MIMIC-IV data51. We emphasize that we performed fine-tuning of the pre-trained model, not full pre-training from scratch. We trained for 10 epochs with the AdamW optimizer, learning rate , linear warmup for 10% of training steps, and batch size 3252. Checkpoints were saved every 500 steps for MDLS selection. All experiments used mixed-precision training (FP16) on a single NVIDIA A100 GPU. Maximum mean discrepancy (MMD) on ClinicalBERT representations confirmed substantial domain shift between the two databases (), consistent with prior work demonstrating significant distributional differences across healthcare institutions25. Evaluation metrics We evaluated models across five dimensions, with each metric defined and interpreted as follows: Predictive performance. AUROC (Area Under the Receiver Operating Characteristic Curve) measures the model’s ability to discriminate between patients who die and those who survive, across all possible classification thresholds. An AUROC of 1.0 indicates perfect discrimination, while 0.5 indicates performance no better than random guessing. AUPRC (Area Under the Precision–Recall Curve) is an alternative discriminative metric that is particularly informative when the outcome is rare (as in ICU mortality), because it focuses on the model’s ability to correctly identify positive cases without generating excessive false alarms4. Calibration. Expected Calibration Error (ECE) measures how well the model’s predicted probabilities match observed outcome frequencies53. For instance, among patients assigned a 30% mortality risk, approximately 30% should actually die. Lower ECE indicates better calibration. We computed ECE using 10 equal-width probability bins. Fairness. Equalized odds (EO) gap quantifies the maximum disparity in TPR and FPR across demographic groups (defined above). Worst-group AUPRC reports the AUPRC for the demographic subgroup with the lowest performance, capturing whether the model fails disproportionately for any group. Stability, defined as , measures how much fairness changes when the model is deployed out-of-domain30. Because equalized odds constraints can distort calibration and the two notions are generally not simultaneously achievable across groups54,55, we report both EO gap and ECE and visualize the resulting trade-offs (Fig. 3c). Calibration and worst-group analysis. (a) ID versus OOD calibration error (ECE): percentages indicate degradation from ID to OOD. Fair-ERM shows 111% degradation; our method shows 52%, demonstrating more stable calibration under distribution shift. Error bars indicate 95% CI. (b) OOD worst-group AUPRC: our method achieves 0.312, a 15.1% improvement over the best baseline (GroupDRO: 0.271). Higher worst-group AUPRC indicates better performance on underrepresented demographic subgroups, which are often at highest risk of algorithmic harm. (c) Performance-calibration trade-off: arrows show ID→OOD trajectory for each method. The ideal region (high AUROC, low ECE) is indicated. Our method achieves the best trade-off in OOD settings, lying closest to the ideal region while other methods shift toward higher ECE. Leakage. DomainLeak AUC and DemoLeak AUC measure how much database identity (MIMIC-IV vs. eICU-CRD) and demographic information, respectively, can be predicted from learned representations (defined above)14. Point estimates were computed using scikit-learn56. We report 95% confidence intervals (CIs) computed via a patient-level nonparametric bootstrap (1,000 resamples), resampling patients with replacement to account for within-patient correlation57. Statistical analysis We report both Pearson (r) and Spearman rank (ρ) correlations to assess associations between leakage metrics and fairness outcomes. Because some correlation analyses are performed over a small number of method-level points (e.g., n=5 in Table 4), we interpret correlations descriptively and emphasize effect sizes and consistency with ablation analyses rather than causal claims. When reported, 95% CIs for Pearson correlation coefficients were computed via Fisher’s z-transformation. Differences in OOD fairness gap between model selection criteria were assessed using paired, two-sided Wilcoxon signed-rank tests (α = 0.05). Table 4Leakage audit results. DomLeak = DomainLeak AUROC (how well database identity, MIMIC-IV vs. eICU-CRD, can be predicted from representations; lower is better). DemoLeak = DemoLeak AUROC (how well the protected attribute can be predicted from representations; lower is better). Fair-ERM reduces DemoLeak but not DomLeak, resulting in poor OOD fairness. Our method achieves lowest domain leakage and best OOD outcomes. Bold indicates best.MethodDomLeakDemoLeakOOD EOOOD AUCERM.924.781.147.741Fair-ERM.910.701.182.733DANN.703.764.098.768GroupDRO.891.722.121.759Ours.642.709.064.802 Leakage audit results. DomLeak = DomainLeak AUROC (how well database identity, MIMIC-IV vs. eICU-CRD, can be predicted from representations; lower is better). DemoLeak = DemoLeak AUROC (how well the protected attribute can be predicted from representations; lower is better). Fair-ERM reduces DemoLeak but not DomLeak, resulting in poor OOD fairness. Our method achieves lowest domain leakage and best OOD outcomes. Bold indicates best. Results RQ1: Clinical language models encode demographic shortcuts that lead to fairness gaps The penultimate layer of different mortality prediction models contained significant information about demographic attributes (age prediction AUROC: 0.72 ± 0.03; sex prediction AUROC: 0.68 ± 0.02; race prediction AUROC: 0.65 ± 0.03), consistent across different model configurations (Fig. 2c). These findings parallel observations in medical imaging14,17 but, to our knowledge, have not been systematically demonstrated in clinical text19, suggesting that demographic encoding is a general phenomenon across clinical AI modalities rather than a modality-specific artifact. We then assessed model fairness across demographic subgroups using equalized odds. In all configurations, models displayed biased performance, as evidenced by equalized odds disparities4. The baseline ERM model exhibited an equalized odds gap of 0.081 ± 0.010 (95% CI via patient-level bootstrap, n = 1,000). Critically, stronger encoding of demographic information was associated with stronger model unfairness (Pearson r = 0.82, two-sided P < 0.001), indicating that models using demographic encodings as heuristic shortcuts also have larger fairness disparities. This correlation between demographic encoding and fairness gaps has been observed in medical imaging15,16,58; our results demonstrate that the same relationship holds for clinical text. RQ2: Debiasing methods create locally optimal models As shown in Fig. 2a, all methods achieved comparable ID performance (AUROC ≈ 0.87). ERM models exhibited large fairness gaps (equalized odds gap ≈ 8% between demographic groups). By applying debiasing methods, the resulting models were able to reduce the fairness gap while achieving similar AUROCs. Results held when using worst-group AUROC as the performance metric46. The Fair-ERM method, which directly penalizes equalized odds violations, achieved the best ID equalized odds gap of 0.039 ± 0.007 (Table 3), consistent with the theoretical expectation that explicit fairness constraints reduce in-distribution disparities30,54. GroupDRO (0.051 ± 0.008) and DANN (0.072 ± 0.009) also reduced fairness gaps relative to ERM (0.081 ± 0.010). These results, consistent with findings by Zong et al.20 and Zhang et al.21 in medical imaging, confirm that existing fairness-aware algorithms can effectively create “locally optimal” models—models that are fair within their training distribution. Table 3Fairness generalization results. Stability is . Fair-ERM achieves best ID fairness but worst OOD fairness, a striking reversal demonstrating that debiasing can backfire. Our method achieves best OOD fairness and transfer stability. Bold indicates best in each column.MethodID EOOOD EOStabilityERM.081±.010.147±.016.066Fair-ERM.039±.007.182±.018.143DANN.072±.009.098±.012.026GroupDRO.051±.008.121±.014.070Ours.046±.008.064±.010.018 Fairness generalization results. Stability is . Fair-ERM achieves best ID fairness but worst OOD fairness, a striking reversal demonstrating that debiasing can backfire. Our method achieves best OOD fairness and transfer stability. Bold indicates best in each column. RQ3: Local fairness does not transfer under distribution shift—debiasing can backfire Figure 2a shows that while all methods achieved comparable ID performance, OOD performance on eICU-CRD varied substantially, with our method achieving the highest OOD AUROC (0.802). Table 3 reveals the central finding of this work: debiasing can backfire under distribution shift. Fair-ERM achieved the best ID equalized odds gap (0.039 ± 0.007) yet exhibited the worst OOD equalized odds gap (0.182 ± 0.018) and the worst stability (0.143). This represents a 4.7× degradation in fairness from ID to OOD, a striking reversal of the intended intervention. This backfire effect was first observed in medical imaging by Yang et al.17; our results demonstrate that it extends to clinical text, confirming that fairness transfer failures are a general challenge for clinical AI systems34. The fact that the backfire effect occurs in clinical NLP, where domain shift operates through documentation templates and institutional vocabularies rather than imaging characteristics, suggests that the phenomenon is not specific to any single data modality. Across 16 combinations of method and demographic attribute, five settings exhibited a negative correlation between ID and OOD fairness, and three additional settings exhibited only a weak (r < 0.5) positive correlation. This is consistent with findings by Schrouff et al.24, who developed diagnostic tools for fairness transfer and observed similar instabilities in dermatology and radiology settings, and by Yang et al.17, who reported analogous findings for chest X-ray classifiers. Our work extends these observations to clinical text. Figure 2b visualizes this phenomenon using a dumbbell plot, with Fair-ERM showing the largest degradation (Δ = 0.143) and our method achieving stable transfer (Δ = 0.018). Domain leakage is associated with OOD fairness failures. To disentangle the mechanisms underlying OOD fairness failures, we quantified both domain leakage and demographic leakage using probing classifiers (Table 4, Fig. 2c). Two key findings emerged. First, across the five methods in Table 4, DomainLeak AUROC showed a strong positive association with OOD equalized odds gap (Pearson r = 0.887, Spearman ρ = 0.90) and a strong negative association with OOD AUROC (Pearson r = -0.906, Spearman ρ = -0.90), indicating that methods with lower domain leakage tended to achieve better OOD performance and fairness (Fig. 4a,b). Given the small number of methods (n=5), we interpret these correlations descriptively; importantly, the same pattern is supported by our ablation study, where removing domain confusion substantially increases DomLeak (0.642 → 0.903) and worsens OOD EO gap (0.064 → 0.109) (Table 5). Second, demographic leakage alone was insufficient for predicting OOD fairness: Fair-ERM achieved the lowest DemoLeak AUROC (0.701) yet the worst OOD fairness (0.182 equalized odds gap). This suggests why debiasing can backfire—reducing demographic information in representations (the approach taken by standard fair representation learning methods28,45) is necessary but not sufficient for fairness transfer when domain-specific confounds remain unaddressed25. Leakage-performance-fairness relationship. (a) Domain leakage versus OOD AUROC across the five methods in Table 4: strong negative association (Pearson r = -0.906, Spearman ρ = -0.90) suggests that lower domain leakage coincides with better OOD performance. The shaded region indicates 95% CI for the linear fit (). Our method (star) achieves lowest leakage and highest OOD AUROC. (b) Domain leakage versus OOD equalized odds gap: positive association (Pearson r = 0.887, Spearman ρ = 0.90) suggests that lower domain leakage coincides with better OOD fairness. Notably, Fair-ERM achieves low demographic leakage but high domain leakage, resulting in worst OOD fairness despite best ID fairness. (c) ID versus OOD fairness scatter plot demonstrating that “local fairness ≠ global fairness.” The dashed line indicates perfect transfer (Δ = 0). Fair-ERM (square) lies far from this line with Δ = 0.143, while our method (star) achieves Δ = 0.018, closest to perfect transfer. Together, these results highlight domain leakage as a practical diagnostic signal for OOD fairness transfer. Table 5Ablation results. Domain confusion and MDLS contribute most to OOD fairness and performance. Removing domain confusion causes the largest degradation (+0.045 OOD EO gap). Each component provides complementary benefits. Bold indicates best (full method).VariantOOD AUCOOD EODomLeakOurs (full).802.064.642w/o domain conf..771.109.903w/o group-robust.786.088.651w/o EO penalty.798.079.646w/o MDLS.784.092.675 Ablation results. Domain confusion and MDLS contribute most to OOD fairness and performance. Removing domain confusion causes the largest degradation (+0.045 OOD EO gap). Each component provides complementary benefits. Bold indicates best (full method). RQ4: Leakage-aware training and MDLS improve OOD fairness Table 2 presents LODO performance results. All methods achieved comparable in-domain performance (AUROC ≈ 0.87), but OOD performance varied substantially. Our method achieved the highest OOD AUROC (0.802 ± 0.009), a relative improvement of 8.2% over ERM (0.741) and 4.4% over DANN (0.768). Calibration followed a similar pattern53,55: our method achieved OOD ECE of 0.082, compared to 0.124 for ERM, representing a 34% reduction in miscalibration (Fig. 3a). Our method achieved an OOD equalized odds gap of 0.064 ± 0.010, the lowest among all methods, with stability 0.018 (Table 3). This represents a 2.3× improvement in fairness transfer stability compared to Fair-ERM. Our method also achieved the highest OOD worst-group AUPRC (0.312 ± 0.015), a 15.1% improvement over the best baseline (GroupDRO: 0.271), as shown in Fig. 3b. This is clinically significant: higher worst-group AUPRC indicates better performance on underrepresented demographic subgroups, which are often at highest risk of algorithmic harm11,59. Figure 3c illustrates the performance-calibration trade-off, showing that our method achieves the best balance (high AUROC, low ECE) in OOD settings. MDLS enables practical model selection without OOD labels. Standard model selection (best validation AUROC) chooses checkpoints with high domain leakage, while MDLS selects from the near-optimal band the checkpoint with minimum domain leakage (Fig. 2e). Across all evaluated demographic attributes and hyperparameter settings, selecting checkpoints by minimum domain leakage yielded consistently lower OOD fairness gaps than selecting by minimum ID fairness gap, consistent with findings by Schrouff et al.24 in imaging. This supports minimum domain leakage as a practical selection signal for OOD fairness without requiring any OOD labels17,27. Ablation study. Table 5 presents ablation results, and Fig. 2d provides a visual summary. Removing domain confusion caused the largest degradation: OOD AUROC dropped from 0.802 to 0.771, and OOD equalized odds gap increased from 0.064 to 0.109, highlighting the critical role of domain-invariant representations (following the domain adversarial approach of Ganin et al.48). MDLS selection provided consistent improvements over standard model selection: +0.018 OOD AUROC and −0.028 OOD equalized odds gap. The group-robust31 and equalized odds30 components provided complementary benefits, with their combination achieving the best overall results across all five evaluation dimensions. Discussion Summary of findings Our study investigated whether debiasing interventions for clinical language models maintain their fairness benefits when models are deployed across hospital sites, and our findings are organized around four research questions. For RQ1, we demonstrated that clinical language models encode demographic information as shortcuts in their learned representations, extending prior findings from medical imaging14 to clinical text. For RQ2, we showed that existing debiasing methods can effectively create locally optimal models that reduce fairness gaps in-domain. For RQ3, we revealed the central finding: debiasing can backfire under distribution shift, with fairness-only training achieving the best in-domain fairness (equalized odds gap = 0.039) but the worst out-of-domain fairness (0.182), a 4.7× degradation. For RQ4, we demonstrated that our leakage-aware training framework and MDLS model selection criterion can achieve models that maintain both performance and fairness in OOD settings. Why does debiasing backfire? A plausible mechanism centers on domain leakage25. Standard debiasing approaches (such as equalized odds penalties30) successfully reduce demographic information in learned representations, as evidenced by Fair-ERM achieving the lowest demographic leakage (DemoLeak AUC = 0.701). However, these approaches leave domain-specific confounds intact26,27. Hospital documentation patterns—including note templates, abbreviation conventions, and section structures—remain encoded in representations and are spuriously correlated with both outcomes and demographics. Crucially, these correlations differ between source and target sites. When a model optimized for fairness at Hospital A is deployed at Hospital B, the demographic-outcome relationships it learned are confounded by documentation patterns that no longer apply49,50. The fairness constraints can become misaligned, leading to reversed fairness gaps. While this explanation is supported by our leakage analysis and ablation results (Tables 4 and 5), we note that our experiments involved only two databases. Further studies on additional datasets and clinical tasks would be needed to confirm that domain leakage is the dominant mechanism underlying fairness transfer failures in other clinical contexts. Implications Our results have several implications. First, they offer a cautionary tale on the efficacy of eliminating demographic shortcuts in clinical NLP models5,12. Removing shortcuts addresses ID fairness, which is crucial for fair clinical decision-making10. However, the resulting non-transferability to OOD settings raises questions about the long-term utility of this approach in isolation34. This is particularly complex in healthcare, where the relationship between demographics and outcomes is multifaceted and demographic categories themselves can be unreliable13,39, and distribution shifts are difficult to quantify23. Second, we present evidence that domain leakage, rather than demographic leakage, is a stronger predictor of OOD fairness failures. This finding extends recent work in medical imaging by Yang et al.17 to clinical text, where domain shift operates through fundamentally different mechanisms (documentation templates, institutional vocabularies, abbreviation conventions)18,19. Our results suggest that standard fair representation learning approaches that focus solely on demographic attributes28,45 are insufficient for ensuring fairness under deployment; domain-specific confounds must be explicitly addressed26,48. Third, we present a preliminary decomposition for diagnosing OOD model fairness changes, by expressing it as a function of the ID fairness gap and the per-group performance change17,29. The disparate impact of distribution shift on per-group performance is a major contributor to lack of fairness in OOD settings11,59. Our work suggests that for practitioners aiming to achieve fairness in models deployed across domains, mitigating ID fairness is at least as important as mitigating the impact of distribution shift on particular groups24. However, building models robust to arbitrary domain shifts remains a challenging open problem22,49. Having some knowledge or data about how distributions may shift, or the ability to collect data for particular groups, may be necessary50. Fourth, our findings have important regulatory implications. The US Food & Drug Administration (FDA), as the primary regulatory body for medical technologies in the United States, does not currently require external validation of clinical AI models, relying instead on assessment by the product creator60. However, as Dubey et al.61 have argued, while the FDA is essential to the regulation of AI in healthcare, additional specialized oversight mechanisms are needed to address the unique challenges presented by AI technologies, including the fairness transfer failures we document. Our findings directly support this argument: developer-side testing at a single site may yield optimistic fairness assessments that do not generalize to deployment sites, creating a dangerous gap between regulatory assurance and real-world performance. At the international level, the European Union AI Act (EU AI Act) classifies medical AI systems as “high-risk” and mandates ongoing post-market monitoring, risk management, and bias testing throughout the product lifecycle. Our work addresses several requirements under the EU AI Act, including data governance with examination and mitigation of possible biases in training data (Article 10), transparency and documentation of system limitations and performance across specific demographic groups for deployers (Article 13), and appropriate levels of accuracy and robustness (Article 15). The backfire effect we identify—where a model certified as fair at one site becomes unfair at another—highlights a concrete failure mode that current regulatory frameworks must account for. More broadly, our results underscore the necessity for regular evaluation of model performance and fairness under distribution shift22,23, challenging the assumption that a single fair model can serve all clinical settings62. We recommend that regulatory bodies consider requiring cross-site fairness auditing, domain leakage assessment, and real-world performance monitoring as part of the approval and post-market surveillance process for clinical AI systems63. When a model is deployed in any clinical environment, both its overall and per-group performance should be continuously monitored35,64. Finally, we note important caveats about fairness metrics. Enforcing group fairness definitions such as equalized odds can lead to worse utility and performance for all groups54, and other definitions may be better suited to specific clinical settings55. Equalized odds is incompatible with calibration by group53,54, and enforcing it often leads to the “leveling down” effect in overall performance21,46. We present Pareto curves (Figure 4c) showing the tradeoff between fairness and accuracy, and we encourage practitioners to choose a fairness definition suited to their use case4,58. The impact of minimizing algorithmic bias on real-world health disparities is complex12, and there is no guarantee that deploying a fair model will lead to equitable outcomes5. We do not advocate for deployment of these models in real-world clinical settings without practitioners carefully testing models on their data and considering other factors (e.g., privacy, regulation, and interpretability)2,3. Limitations The current study has several limitations. First, we focused on ClinicalBERT (BERT-base architecture, 110M parameters) and did not evaluate larger language models such as GPT-4, Med-PaLM, or MedGemma, which may exhibit different backfire dynamics; increased capacity could amplify domain-specific shortcuts and domain leakage, while broader pretraining may improve cross-site robustness. However, we chose ClinicalBERT because it remains the most widely used encoder for clinical NLP tasks on EHR data and enables controlled experimentation with debiasing objectives during end-to-end fine-tuning. Moreover, while our framework (leakage probing, domain confusion, and MDLS) is architecture-agnostic for encoder models, extending it to autoregressive LLMs would require methodological adaptations (e.g., probing intermediate hidden states rather than a single pooled representation). Second, our evaluation was limited to two databases (MIMIC-IV and eICU-CRD) and one clinical task (48-hour ICU mortality prediction), so generalization to other endpoints, note types, and source–target pairs remains to be established; nonetheless, this setting reflects a realistic single-center vs. multi-center deployment shift. Third, we operationalized race using a binary categorization (White vs. Non-White), which is standard in the fairness literature but collapses meaningful heterogeneity among racial and ethnic groups and may obscure subgroup-specific disparities; future work should investigate finer-grained and context-appropriate demographic groupings when sample sizes permit. Acknowledgements We thank the assistance of the Central Core Facility and Animal Facility of the National Center for Protein Sciences at Peking University in Beijing, China, and the State Key Laboratory of Membrane Biology at Peking University in Beijing, China. Author contributions A.G. and W.C. performed all experiments and analyzed the data. Y.Z., B.F. and H.H. conceptualized the study, performed analyses, and drafted the manuscript with inputs from all authors. All authors have read and approved the final manuscript. Funding This work was supported by the Zhejiang Provincial Natural Science Foundation of China (Grant No. LTGY24H090001), the Ministry of Science and Technology Innovation 2030-Major Program of “Brain Science and Brain-like Research” (2022ZD0211800), Beijing Natural Science Foundation Major Grant (Daxing Joint Initiative Grant, L246003), Beijing Life Science Academy (BLSA) Fund (2024100CB0090, 2024100CB0220), Qidong-SLS Innovation Fund and Yifu Life Science Fund. Data availability MIMIC-IV and eICU-CRD are available from PhysioNet (https://physionet.org/) after completion of a data use agreement and a credentialing procedure: MIMIC-IV at https://physionet.org/content/mimiciv/ and eICU-CRD at https://physionet.org/content/eicu-crd/. Code availability Code that supports the findings of this study is available online at https://anonymous.4open.science/r/fairness-E572/. Declarations Competing interests The authors declare no competing interests. All authors declare no actual or potential conflicts of interest, including any financial, personal or other relationships, with other people or organizations within three years of beginning the work submitted that could inappropriately influence (bias) their work. Ethical approval and consent to participate This study is a retrospective secondary analysis of the publicly available, fully de-identified MIMIC-IV and eICU-CRD critical-care databases, with no direct interaction with human subjects and no collection of new patient data. The use of these data for our study, including all experimental protocols, was reviewed and approved by the Ethics Committee of Yiwu Central Hospital. The establishment and public release of MIMIC-IV were independently approved by the Institutional Review Boards (IRBs) of BIDMC (No. 2001-P-001699/14) and the Massachusetts Institute of Technology (MIT, No. 0403000206), with a waiver of informed consent because all protected health information had been de-identified and the secondary use did not impact clinical care. For eICU-CRD, all tables have been de-identified to meet the Safe Harbor provision of the US Health Insurance Portability and Accountability Act (HIPAA), with all protected health information removed, and the re-identification risk was certified to meet HIPAA Safe Harbor standards by an independent privacy expert (Privacert, Cambridge, MA) under Certification No. 1031219-2. Written informed consent for participation was therefore not required for this study, in accordance with the upstream consent waivers and de-identification authorizations under which the source databases were publicly released. The Ethics Committee of Yiwu Central Hospital reviewed and confirmed this position for the present retrospective secondary analysis. All methods were carried out in accordance with the relevant guidelines and regulations, including the ethical principles of the Declaration of Helsinki, and the manuscript was prepared in accordance with the TRIPOD+AI reporting guideline38. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. These authors contributed equally to this work: Angyang Guo and Wenna Chen. Contributor Information Mingxia Ji, Email: jmxyw94@163.com. Bin Fang, Email: ywszxyyfb@wmu.edu.cn. Hongbin Huang, Email: zjywhhb@163.com. References Associated Data Data Availability Statement MIMIC-IV and eICU-CRD are available from PhysioNet (https://physionet.org/) after completion of a data use agreement and a credentialing procedure: MIMIC-IV at https://physionet.org/content/mimiciv/ and eICU-CRD at https://physionet.org/content/eicu-crd/. Code that supports the findings of this study is available online at https://anonymous.4open.science/r/fairness-E572/.