Systematic Benchmarking and Optimization of Retrieval-Augmented Generation (RAG) for Clinical Phenotyping: A Type II Diabetes Case Study in an ICD-Screened Cohort
H. Park, M. Rees, N. Kruger, K. Fuse, V. M. Castro, V. Gainer, N. Wattanasin, B. Benoit,
Key points
From the paper's conclusion- We systematically evaluated these design choices for type 2 diabetes mellitus (T2DM) phenotyping in an ICD-screened cohort.
Abstract
Traditional EHR phenotyping methods can require substantial disease-specific development and long-term maintenance. While integrating large language models (LLMs) with Retrieval-Augmented Generation (RAG) is promising, the impact of RAG configurations remains underexplored. We systematically evaluated these design choices for type 2 diabetes mellitus (T2DM) phenotyping in an ICD-screened cohort. Using GPT-4o, we processed 170,678 clinical notes from 275 patients. We evaluated seven embedding models and three prompt strategies (baseline, improved zero-shot, and few-shot). Using the improved zero-shot prompt, we tested 350 embedding model-chunk size-retrieval depth combinations on the training set and selected eight optimized configurations for test-set evaluation. Combined with three prompts, these yielded 24 prompt-configuration combinations for comparison with ICD codes and the institutional PheNorm method. RAG achieved a mean sensitivity of 0.9019 (95% CI: 0.8866-0.9172), specificity of 0.7907 (0.7749-0.8066), PPV of 0.9405 (0.9365-0.9445), NPV of 0.6967 (0.6653-0.7281), and F1-score of 0.9204 (0.9124-0.9283). All combinations achieved higher PPV than ICD codes (0.7838). Compared with PheNorm, sensitivity was significantly higher (Holm-adjusted p < 0.001), while specificity differences were not significant. Paired bootstrap analyses showed higher NPV and F1-score , with no significant PPV difference. General-purpose embeddings showed higher sensitivity, whereas biomedical embeddings exhibited higher specificity and PPV. Few-shot prompting increased specificity and PPV but reduced sensitivity. Token usage varied substantially across embedding models. These findings suggest the importance of aligning RAG design with task-specific clinical priorities and token efficiency.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Richer database context improves LLM-generated EHR phenotyping algorithms.medRxiv : the preprint server for health sciences · 2026
- Integrating Chain‐of‐Thought and Retrieval Augmented Generation Enhances Rare Disease Diagnosis From Clinical NotesMedicine Bulletin · 2026
- Low-energy small language models with retrieval-augmented generation can surpass large-model performance in rheumatologyFrontiers in Medicine · 2026
- Assessing Retrieval-Augmented Large Language Models for Medical Coding.NEJM AI · 2025
- Can Retrieval-Augmented Generation Improve the Potential of the LLMs in Diabetes Health Management? An Assessment Based on Health Management Tasks and Question Complexity.Journal of medical systems · 2026
- HEAL-RAG: A Hybrid Evolving Retrieval-Augmented Generation Framework for Explainable Biomedical Data Analysis and Clinical Decision SupportAlgorithms · 2026