Skip to content
AI.info

Research

Towards Robust and Fair Next Visit Diagnosis Prediction under Noisy Clinical Notes with Large Language Models

Overview Research area: Clinical natural language processing — specifically the robustness and fairness of large language models (LLMs) used for clinical decision support, applied to the task of next-

arXiv
2511.18393
Published
2025-11-23
Authors
Heejoon Koo

AI summary

Overview

Research area: Clinical natural language processing — specifically the robustness and fairness of large language models (LLMs) used for clinical decision support, applied to the task of next-visit diagnosis prediction from hospital discharge summaries.

Technical level: Intermediate. The paper assumes familiarity with LLM prompting (zero-shot, chain-of-thought), recall/precision metrics, AUPRC, and standard group-fairness metrics (TPR, FPR), but the core ideas are explained in plain clinical and NLP terms.

Scope: A single-author systematic evaluation of two state-of-the-art LLMs (Gemini-2.0-Flash and GPT-4o-mini) on the MIMIC-IV dataset under four simulated clinical-note corruption types, with a proposed method called NECHO v3 that combines label reduction and hierarchical chain-of-thought prompting to improve robustness and subgroup equity.

What This Paper Is About

Clinical notes are frequently degraded by human error, hurried documentation, and automated pipelines such as speech recognition and optical character recognition. This paper asks whether such degradation harms LLM-based next-visit diagnosis prediction, and — more importantly — whether it harms different demographic subgroups unevenly.

The goal is two-fold: to quantify the robustness and fairness costs of realistic text corruption, and to propose a prompting and label-design strategy (NECHO v3) that reduces those costs.

Key Contributions

  1. A joint robustness-and-fairness evaluation protocol for next-visit diagnosis prediction on the public MIMIC-IV dataset, testing state-of-the-art LLMs under text corruptions that mimic real clinical documentation artifacts while measuring both predictive performance and subgroup-level fairness.

  2. NECHO v3, a framework combining (a) a clinically grounded label-reduction mapping that collapses the diagnostic label space to 17 parental-level diagnostic systems and 46 child-level clinical sub-categories, and (b) a hierarchical chain-of-thought (CoT) prompting strategy that first hypothesises parental-level diagnostic categories and then enumerates likely child-level diagnoses within them.

  3. A stratified subgroup analysis across race (White, Black, Hispanic/Latino, Other, Asian, Unknown), age (18–40, 41–60, 61+), and sex (F, M), using bootstrap-derived 95% confidence intervals to quantify instability in addition to mean performance.

  4. Ablation and per-disease analyses isolating the contribution of hierarchical CoT, demographic information, and the label-mapping strategy, plus per-disease AUPRC for long-tailed conditions in minority subgroups.

Main Findings

  • Overall performance was largely stable under corruption. For Gemini-2.0-Flash, Recall@10 moved from 0.4787 on the original notes to 0.4781 (lab-value erasure), 0.4799 (prior-note duplication), 0.4808 (OCR jittering), and 0.4804 (homophone substitution); Precision@10 moved from 0.3918 to 0.3908, 0.3924, 0.3939, and 0.3940. For GPT-4o-mini, Recall@10 was 0.3629 originally and 0.3630, 0.3608, 0.3623, 0.3636 respectively; Precision@10 was 0.2961 and 0.2957, 0.2944, 0.2957, 0.2961. The authors describe the corruptions as behaving like "mild data augmentation."

  • Gemini-2.0-Flash outperformed GPT-4o-mini consistently across both Recall@10 and Precision@10 under every corruption setting — for example, 0.4787 vs. 0.3629 Recall@10 on original notes.

  • Minority racial subgroups showed greater volatility. In the appendix tables, the relative widths of 95% confidence intervals were noticeably larger for smaller subgroups than for White patients. Under Gemini-2.0-Flash on original notes, Recall@10 95% CI relative widths were 0.0205 for White, 0.0436 for Black, 0.0850 for Hispanic/Latino, 0.1005 for Other, 0.1004 for Asian, and 0.1114 for Unknown; Precision@10 relative widths were 0.0245, 0.0546, 0.0972, 0.1142, 0.1245, and 0.1343 respectively. The paper states this instability persists even after controlling for cohort size.

  • Fairness metrics mirrored performance instability. TPR and FPR varied substantially more for minority racial groups under corruption, with both means and error bars showing greater volatility — indicating, per the authors, that models appearing equitable on clean inputs can mask disparities under realistic perturbations.

  • Age showed a different pattern of resilience. Older patients (61+) maintained the most stable performance and fairness metrics (balanced TPR/FPR with narrower error bounds) even under severe perturbation, while the 18–40 group showed the greatest volatility and wider uncertainty intervals, with 41–60 falling between the two. The authors attribute the younger-group instability to training data imbalance rather than sample size.

  • Sex subgroups were largely unaffected. Female and male patients achieved nearly identical Recall@10 and Precision@10 with minimal fluctuation and tight confidence intervals, and TPR/FPR remained stable and closely aligned — no subgroup appeared disproportionately affected by corruption along this dimension.

  • Ablations showed the label mapping mattered most. On GPT-4o-mini under OCR jittering, overall parental-level performance on original notes was 0.3629 for full NECHO v3, 0.3580 without hierarchical CoT, 0.3425 without demographic information, and 0.1085 without the label mapping. Under corruption the corresponding numbers were 0.3623, 0.3571, 0.3473, and 0.0957. Similar ordering held for the Unknown-race and 18–40 subgroups on both performance and fairness criteria. A separate "comparative study" column is reported in the same table (for example, 0.9874 overall on original notes), but the text does not identify what metric or baseline it represents.

  • Long-tailed diagnoses remained hard even without noise. Per-disease AUPRC for GPT-4o-mini stayed low for rare conditions; for example, among the 18–40 age group, Hematologic and Endocrine Cancers dropped from 0.3646 on original notes to 0.2092 under lab-value omission, and Postpartum and Puerperal Complications sat at approximately 0.0335 across all settings. Among patients with Unknown race, Cerebrovascular Disorders ranged from 0.1457 to 0.1635 and Gastrointestinal Cancers from 0.1977 to 0.2218.

  • Diagnostic profiles differed by subgroup. White patients most often presented with nutritional, metabolic, hypertensive, and heart diseases plus renal, endocrine, and diabetic disorders; Hispanic/Latino patients showed a similar cardiometabolic profile but heightened mood, anxiety, and cognitive disorders; patients with Unknown race labels showed more injury-related categories and other external causes. Younger adults (18–40) presented most with mood, anxiety, and cognitive disorders, symptoms-based visits, and injuries, shifting toward metabolic, hypertensive, and endocrine/diabetic conditions in the 41–60 group and hypertensive, heart, renal, and metabolic disorders in the 61+ group.

Methodology in Plain English

The task is next-visit diagnosis prediction: given a patient's longitudinal clinical records (here, discharge summaries plus basic demographics), predict the set of diagnoses that will be coded at the following hospital visit. Because each patient has roughly nine true diagnoses on average and the label space is large, the authors first compress the label space using the HCUP Clinical Classifications Software (CCS) hierarchy — derived from ICD-9-CM — which originally has 17 multi-level diagnostic chapters and 295 single-level categories. After merging sparse or overlapping categories with the help of an ICD ontology, they arrive at 17 parental-level diagnostic systems and 46 child-level clinical sub-categories.

The model is then prompted in two stages, in a way meant to imitate clinician reasoning: first hypothesise plausible parental-level diagnostic categories, then pick the most likely child-level diagnoses inside those categories. The model receives all of a patient's notes and basic demographic information and returns structured JSON.

To stress-test robustness, the researchers apply one corruption per note (never stacked) at the following rates: lab-value omission at 20–30%, prior-note duplication at 30–40%, homophone substitution at 5–15%, and OCR jittering at 5–15%. These correspond to privacy masking or hurried omission, copy-forward documentation artifacts, speech-recognition errors (e.g., pain → pane, ileum → ilium), and character-level OCR confusions (e.g., history → h1story, O ↔ 0, l ↔ 1, rn ↔ m).

Evaluation uses both LLMs under an identical prompt, input schema, and output format, with temperature set to 0.0 and max_tokens to 1024. Performance is measured by Recall@10 and Precision@10 (with k fixed at 10, given the average of 9 true diagnoses per patient) plus per-disease AUPRC. Fairness is measured through TPR and FPR. Bootstrapping generates empirical distributions of these metrics, from which 95% confidence intervals are derived, and the relative widths of those intervals serve as an indicator of subgroup instability.

The cohort is restricted to patients with at least two visits, considering only their most recent five visits and excluding records with non-positive lengths of stay. A sample of 8,000 patients was drawn to balance API cost against subgroup distribution. Only discharge summaries were used, pre-processed following the Clinical Longformer pipeline (removing de-identification placeholders, normalising punctuation and non-alphanumeric symbols, lowercasing, trimming whitespace), and sex information was removed from notes for the fairness quantification.

Demographic composition of the sample: White 5,742 (71.78%), Black 1,153 (14.41%), Hispanic/Latino 381 (4.76%), Other 263 (3.29%), Asian 240 (3.00%), Unknown 221 (2.76%); age 61+ 4,488 (56.10%), 41–60 2,404 (30.05%), 18–40 1,108 (13.85%); sex F 4,035 (50.44%), M 3,965 (49.56%).

Why This Matters

Impact on research. Most prior work on LLM robustness to text corruption and most prior work on fairness in clinical prediction treat the two issues separately. This paper argues they should be studied jointly, showing that near-identical aggregate metrics can coexist with substantial subgroup instability — meaning headline benchmark numbers can conceal deployment risk. It also positions itself as an extension of prior fairness work in diagnosis prediction by adding longitudinal multi-label next-visit prediction, realistic corruption simulation, and a clinically grounded label-reduction and hierarchical CoT design.

Real-world applications:

  • Silent-failure monitoring in deployed clinical decision support: the finding that minority subgroups have wider CI widths under corruption could inform alerting thresholds.
  • Pipeline design for documentation systems: knowing that lab-value omission, copy-forward duplication, ASR homophones, and OCR jittering behave like mild augmentation rather than catastrophic corruption helps prioritise which pipeline errors need urgent fixing.
  • Subgroup-aware validation before deployment, particularly for race and age strata — the paper argues subgroup stability should be treated as a central aspect of fairness, not an afterthought.
  • Prompting design for diagnosis prediction, where the label-reduction plus hierarchical CoT template can be reused by teams facing large, heterogeneous diagnosis code spaces.

Industry relevance. Any organisation building LLM-based clinical documentation, coding, or triage tools faces exactly the conditions simulated here — noisy, incomplete, machine-processed notes. The paper's message that equitable performance on clean data can mask inequity on degraded data has direct implications for regulatory submissions, post-market surveillance, and internal model governance in health systems and health-AI vendors.

Future Directions

  1. Multi-dataset validation. The authors note the analysis relies on a single dataset (MIMIC-IV) from one institution and may not generalise to other clinical settings; replicating the protocol across other health systems or EHRs is a direct next step.

  2. Beyond zero-shot evaluation. Real-world systems often incorporate local fine-tuning, which could shift both performance and fairness outcomes. Testing whether fine-tuning removes or amplifies the observed subgroup instability is left open.

  3. Interacting and stacked corruptions. Real-world noise typically arises from multiple interacting sources simultaneously, while this study

Authors’ abstract

A decade of rapid advances in artificial intelligence (AI) has opened new opportunities for clinical decision support systems (CDSS), with large language models (LLMs) demonstrating strong reasoning abilities on timely medical tasks. However, clinical texts are often degraded by human errors or failures in automated pipelines, raising concerns about the reliability and fairness of AI-assisted decision-making. Yet the impact of such degradations remains under-investigated, particularly regarding how noise-induced shifts can heighten predictive uncertainty and unevenly affect demographic subgroups. We present a systematic study of state-of-the-art LLMs under diverse text corruption scenarios, focusing on robustness and equity in next-visit diagnosis prediction. To address the challenge posed by the large diagnostic label space, we introduce a clinically grounded label-reduction scheme and a hierarchical chain-of-thought (CoT) strategy that emulates clinicians' reasoning. Our approach improves robustness and reduces subgroup instability under degraded inputs, advancing the reliable use of LLMs in CDSS. We release code at https://github.com/heejkoo9/NECHOv3.

Read the original paper