Agentic LLM reasoning in pediatric diabetes outcome prediction from multimodal medical records
Organizations: Quantitative and Computational Biosciences, Baylor College of Medicine, Houston, Texas, USA · Department of Pediatrics, Baylor College of Medicine, Houston, Texas, USA · Jan and Dan Duncan Neurological Research Institute, Texas Children’s Hospital, Houston, Texas, USA · Data Science Center, Texas Children’s Hospital, Houston, Texas, USA ·
Abstract
Large language model (LLM) agents are proposed for clinical prediction but are untested in pediatrics, where cohorts are small and outcomes are uncommon. Using records from 2,489 youth with type 2 diabetes (T2D) and 4,018 with type 1 diabetes (T1D), spanning structured data, note-derived social determinants and, in T1D, continuous glucose monitoring data, we predicted seven T2D outcomes, four also in T1D, at 24 months from 18 months of follow-up. CEDAR (Clinical Evidence-Driven Agent for Risk-prediction), an evidence-citing, self-auditing LLM pipeline, outperformed trained machine learning in both cohorts (pooled area under the receiver operating characteristic curve 0.815 versus 0.656 to 0.700 in T2D and 0.756 versus 0.603 to 0.631 in T1D), most on the sparsely screened outcomes. Only 4 of 70,246 values it cited did not match the chart. Reading only the evidence and reasoning cited by CEDAR, two pediatric endocrinologists reached the same prediction as CEDAR in about nine of ten cases, agreeing with each other on 90.5%.
Figures & tables
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
| Outcome | T1D | T2D |
|---|---|---|
| Optimal glycemic control | 561 / 2544 (22.1%) | 512 / 1059 (48.3%) |
| Hypertension | 118 / 2531 (4.7%) | 102 / 1144 (8.9%) |
| Microalbuminuria | 58 / 280 (20.7%) | 217 / 849 (25.6%) |
| Dyslipidemia | 168 / 684 (24.6%) | 396 / 675 (58.7%) |
| Insulin independence | — | 381 / 1038 (36.7%) |
| Metformin response | — | 200 / 597 (33.5%) |
| Characteristic | T1D | T2D |
|---|---|---|
| ( ) | ( ) | |
| Demographics | ||
| Age at diagnosis (yr) | ||
| Diabetes duration (yr) | ||
| Sex, male | 2052 (51.1%) | 1036 (41.6%) |
| Race, White | 2525 (62.8%) | 1575 (63.3%) |
| T1D | T2D | |||||
|---|---|---|---|---|---|---|
| Measure | Miss v1 | Miss ever | Miss v1 | Miss ever | ||
| HbA1c | 3802 | 19.0 | 5.4 | 2437 | 13.1 | 2.1 |
| Glucose | 3812 | 18.1 | 5.1 | 2446 | 12.7 | 1.7 |
| BMI z-score | 3801 | 19.6 | 5.4 | 2423 | 14.1 | 2.7 |
| Total cholesterol | 1554 | 91.2 | 61.3 | 1399 | 70.0 | 43.8 |
| UACR ratio | 1425 | 97.2 | 64.5 | 2095 | 47.7 | 15.8 |
| (a) Pooled family comparisons (Mann–Whitney ) | ||||
| Comparison | Cohort | (group 1 / 2) | Exact | |
| Cedar vs. ML family | T2D | 7 / 56 | 352 | |
| Cedar vs. classical ML | T2D | 7 / 21 | 123 | 0.007 |
| Cedar vs. temporal ML | T2D | 7 / 35 | 229 | |
| Cedar vs. ML family | T1D | 4 / 32 | 115 | 0.007 |
| Cedar vs. classical ML | T1D | 4 / 12 | 40 | 0.058 |
| Cohort | Outcome | Best ML model | Best ML | Cedar | Difference | Separated |
|---|---|---|---|---|---|---|
| T2D | Optimal glycemic control | XGBoost-Temporal | 0.811 [0.764, 0.866] | 0.838 [0.790, 0.884] | no | |
| T2D | Insulin independence | XGBoost-Temporal | 0.866 [0.815, 0.910] | 0.881 [0.833, 0.918] | no | |
| T2D | Metformin response | Logistic regression | 0.779 [0.721, 0.831] | 0.842 [0.785, 0.883] | no | |
| T2D | GLP-1RA response | Random forest | 0.665 [0.556, 0.782] | 0.739 [0.652, 0.826] | no | |
| T2D | Dyslipidemia | Random forest | 0.576 [0.499, 0.642] | 0.782 [0.731, 0.837] | yes | |
| T2D | Hypertension | Random forest | 0.732 [0.632, 0.820] | 0.778 [0.656, 0.891] | no |
| Outcome | Single LLM | Cedar +FE | AUC (paired) | Cost/patient |
|---|---|---|---|---|
| AUC | AUC | [95% CI] | (vanilla +FE) | |
| GLP-1RA response | 0.743 | 0.761 | [ , ] | \to0.115 |
| Hypertension a | 0.878 | 0.873 | [ , ] | \to0.106 |
| Dyslipidemia | 0.822 | 0.772 | [ , ] | \to0.102 |
| ROC-AUC | MCC | Brier | Flips caught | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Outcome | Orig. | Ref. | Orig. | Ref. | Orig. | Ref. | Orig. Ref. | ||
| Hypertension | 239 | 0.787 | 0.756 | 0.092 | 0.399 | 0.440 | 0.094 | 9/32 5/32 | |
| Microalbuminuria | 192 | 0.854 | 0.880 | 0.400 | 0.732 | 0.243 | 0.098 | 9/19 0/19 | |
| Dyslipidemia | 221 | 0.790 | 0.802 | 0.111 | 0.352 | 0.249 | 0.201 | 17/52 17/52 | |
| Optimal glycemic control | 241 | 0.837 | 0.837 | 0.485 | 0.545 | 0.174 | 0.167 | 6/54 2/54 | |
| Insulin independence | 241 | 0.890 | 0.884 | 0.579 | 0.596 | 0.138 | 0.140 | 0/45 0/45 | |
| Primary code, mechanism-first | |||||
| Outcome | Errors | Anchoring | Calibration | Polarity | No signal |
| Hypertension | 4 | 1 | 3 | 0 | 0 |
| Microalbuminuria | 6 | 2 | 1 | 1 | 2 |
| Dyslipidemia | 6 | 4 | 2 | 0 | 0 |
| Optimal glycemic control | 6 | 5 | 1 | 0 | 0 |
| Insulin independence | 6 | 6 | 0 | 0 | 0 |
| Flip ROC-AUC | Persistence | Cedar | ||||||
|---|---|---|---|---|---|---|---|---|
| Outcome | Prior | Full | AUC | MCC | AUC | MCC | MCC † | |
| Hypertension | 0.817 | 0.841 | 0.711 | 0.347 | 0.780 | 0.097 | 0.436 | |
| Microalbuminuria | 0.559 | 0.554 | 0.872 | 0.770 | 0.846 | 0.354 | 0.569 | |
| Dyslipidemia | 0.540 | 0.583 | 0.747 | 0.503 | 0.782 | 0.097 | 0.467 | |
| Optimal glycemic control | 0.552 | 0.618 | 0.777 | 0.556 | 0.833 | 0.472 | 0.532 | |
| Insulin independence | 0.591 | 0.689 | 0.804 | 0.604 | 0.885 | 0.565 | 0.561 | |
| R (readmit-30) | M-B (death-365) | M-A (in-hospital) | |||||||
| Model | AUC | AUPRC | MCC | AUC | AUPRC | MCC | AUC | AUPRC | MCC |
| Tier 0: published training-free scores (0 labels) | |||||||||
| Best published score a | 0.615 | — | — | 0.687 | — | — | 0.677 | — | — |
| Tier 1: training-free LLM (0 labels) | |||||||||
| Vanilla single LLM | 0.616 | 0.341 | 0.136 | 0.811 | 0.472 | 0.388 | 0.814 | 0.391 | 0.342 |
| Cedar | 0.645 | 0.389 | 0.185 | 0.852 | 0.570 | 0.425 | 0.810 | 0.435 | 0.353 |
| Condition | History only | Both | Difference | 95% CI |
| Dyslipidemia (clinical context only: 0.726) | ||||
| All labs, no codes | 0.683 | 0.753 | ∗ | [+0.015, +0.134] |
| Codes only | 0.801 | 0.815 | [-0.038, +0.070] | |
| Visit 1 | 0.719 | 0.780 | ∗ | [+0.007, +0.120] |
| Visit 2 | 0.708 | 0.766 | ∗ | [+0.006, +0.119] |
| Visit 3 | 0.735 | 0.789 | [-0.007, +0.117] | |
| Category | Count | Type | Examples |
| Labs & Vitals | 18 | Continuous | HbA1c, glucose, BMI z-score, lipid panel, ALT, AST, BUN, creatinine, C-peptide, UACR, -hydroxybutyrate, SBP/DBP (inpatient & outpatient) |
| Medications | 3 | Binary | Insulins, biguanide, GLP-1RA |
| Conditions | 4 | Binary | DKA, ketosis, retinopathy, neuropathy |
| Demographics | 9 | Mixed | Age at diagnosis, sex, Hispanic ethnicity, race (4 indicators), primary language, diabetes duration |
| SDOH | 13 | Mixed | Food insecurity, ACEs, housing instability, transportation, smoking, abuse (3 further binary indicators), insurance, parental education/employment, financial strain, family support |
| CGM (T1D only) | 20 | Continuous | Mean glucose, SD, CV, GMI, time-in/above/below-range, hypo episodes, reading counts, monitoring duration, % missing |
| Outcome | Excluded feature(s) |
|---|---|
| Optimal glycemic control | HbA1c |
| Hypertension | all blood-pressure features (SBP/DBP, inpatient & outpatient) |
| Dyslipidemia | lipid panel (TC, HDL, LDL, triglycerides) |
| Microalbuminuria | UACR ratio |
| Insulin independence | insulin (medication) |
| Metformin response | biguanide (medication), HbA1c |
| Snippet, exactly as prepended to the prompt | Attribution |
|---|---|
| Optimal glycemic control | |
| “ADA 2024: Target HbA1c 7% for youth with T2D; metformin + insulin are first-line therapies.” | ADA Standards of Care [ 20 ] |
| “ADA 2024: Youth-onset T2D is more aggressive than adult-onset; beta-cell decline is faster.” | ADA Standards of Care [ 20 ] |
| “ISPAD 2022: Intensive lifestyle intervention should accompany pharmacotherapy in pediatric T2D.” | ISPAD 2022 [ 21 ] |
| Hypertension | |
| “ADA 2024: Screen BP at every visit; hypertension in T2D youth often co-occurs with obesity.” | ADA Standards of Care [ 20 ] |
| Snippet, exactly as prepended to the prompt | Attribution |
|---|---|
| Optimal glycemic control | |
| “ADA 2024: Target HbA1c 7% for most pediatric T1D patients; individualize based on hypoglycemia risk.” | ADA Standards of Care [ 20 ] |
| “ISPAD 2022: CGM time-in-range 70% (70–180 mg/dL) correlates with HbA1c 7% and improved outcomes.” | ISPAD 2022 [ 21 ] |
| “Younger age at diagnosis and longer diabetes duration are associated with higher HbA1c trajectories.” | Accepted pathophysiology; no specific citation |
| Hypertension | |
| “ADA 2024: Screen BP at every visit; hypertension defined as BP 95th percentile for age/height/sex on 3 occasions.” | ADA Standards of Care [ 20 ] |
| Vanilla LLM | Cedar | |
|---|---|---|
| Prompt | Record + “return a probability” | Outcome-specific guideline snippets (S0) + a citation-forced reasoning schema (S1) |
| Model calls | 1 | 5 (S0 is prepended context, not a call; S1 grounded CoT S2 verify S3 self-consistency, ) |
| Output | Probability + brief free-text rationale | Probability + a structured FEATURE | VISIT | VALUE | DIRECTION | IMPORTANCE citation table with visit-tokened values |
| Evidence check | None | S2 auditor verifies every cited triple against the record and flags hallucinations |
| Probability stability | Single sample | Mean over resamples (variance reduction) |
| Failure mode addressed | — | Missing priors; ungrounded reasoning; hallucinated evidence; unstable probability |
| Analysis | per outcome | Rationale |
|---|---|---|
| Main benchmark, all families (Figure 2) | 50–250 (adaptive) | Sized to the eligible population per outcome to stabilize imbalanced estimates while capping LLM cost. |
| Modality ablation, all families (Supplementary Figure 11 ) | 100 (fixed) | A coarser “does adding a modality shift AUC?” question; a fixed matched set caps the per-family LLM call volume. |
| Faithfulness audit (Figure 3) | 10 (per outcome) | Per-citation, per-record manual-grade audit is labor-intensive; 70 records total suffice for grounding rates. |
| Late fusion & error analysis (Figure 4) | full held-out set | Combiners and error-correlation need the full set; no additional LLM calls beyond the main benchmark. |
| Feature-engineering PoC (Supplementary Table 6 ) | 60 (fixed) | Proof-of-concept on the three highest-headroom outcomes; small to bound the per-patient cost. |
| Information ablation (Figure 5) | 1,600; 100 per outcome | All T2D test patient-outcomes for the complete-history comparison; for the conditions, 50 positive and 50 negative patients per outcome, T1D and T2D pooled, to bound the eight-condition LLM cost (Methods, Section 11). |
| Cohort | Outcome | Diff. ( Cedar LLM) | 95% CI | Equiv. @.02 | @.025 | @.03 | Classification |
|---|---|---|---|---|---|---|---|
| T2D | Optimal Glycemic Control | to | No | Yes | Yes | Equivalent | |
| T2D | Insulin Independence | to | No | Yes | Yes | Equivalent | |
| T2D | Dyslipidemia | to | No | No | Yes | Equivalent | |
| T2D | Hypertension | to | No | No | No | Favors Cedar | |
| T2D | Metformin Response | to | No | No | No | Indeterminate | |
| T2D | GLP-1RA Response | to | No | No | No | Indeterminate |
| Metric | Statistical | LLM | Difference | LLM ahead | (family) | (best) |
|---|---|---|---|---|---|---|
| ROC-AUC | 0.652 | 0.789 | 11/11 | 0.001 | 0.005 | |
| MCC | 0.197 | 0.287 | 10/11 | 0.014 | 0.175 | |
| Balanced accuracy | 0.601 | 0.644 | 10/11 | 0.014 | 0.465 | |
| (positive) | 0.425 | 0.493 | 9/11 | 0.054 | 0.365 |
| Pooled subgroups | Paired, Cedar vs Vanilla | ||||
|---|---|---|---|---|---|
| Metric | Single LLM | Cedar | Cedar ahead | ||
| ROC-AUC | 0.782 | 0.793 | 0.264 | 7/11 | 0.175 |
| MCC | 0.275 | 0.285 | 0.759 | 7/11 | 0.695 |
| Balanced accuracy | 0.642 | 0.640 | 0.944 | 4/11 | 0.922 |
| (positive) | 0.485 | 0.486 | 0.953 | 4/11 | 0.922 |
| Item | Topic | Where reported |
|---|---|---|
| 1 | Title | Title page |
| 2 | Abstract | Abstract |
| 3a | Background and rationale | Introduction, paragraphs 1–5 |
| 3b | Target population, intended use and users | Introduction; Discussion, paragraph 1 |
| 3c | Known health inequalities | Introduction, paragraph 1 |
| 4 | Objectives | Introduction, the four questions and final paragraph |
Clinical Outcome Prediction
Clinical outcome prediction uses patient records, imaging, signals, and biomarkers to estimate risks, disease trajectories, treatment response, and survival.
See all 268 papers