Leveraging Dynamic Prompting for Outcome Prediction of Cancer Patients Using Large Language Models and Electronic Health Record Notes
Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Outcome prediction from unstructured EHR notes remains challenging, especially for rare cancers with limited pre-training data. We present a dynamic prompting framework that retrieves semantically similar patient examples, constructs tailored few-shot prompts, and integrates note summaries to enhance large language model (LLM)-based outcome predictions. We evaluated this approach on a single-institution cohort of 503 breast and 475 glioma patients (EHR notes within 180 days post-diagnosis), with overall survival dichotomized at five years (breast cancer) and fourteen months (glioma). Using Llama-3 models (8B/70B), we compared zero-shot, dynamic prompting, summarization-only, and combined workflows. Dynamic prompting substantially improved glioma prediction performance, boosting accuracy by 12% and F1 by 11%, whereas gains for breast cancer were modest (<3%). The combined summarization-plus-prompting approach achieved the highest performance while maintaining prediction stability compared to GPT-4, addressing a critical deployment barrier. T-SNE visualizations confirmed that embeddings captured established prognostic markers. Dynamic prompting delivers maximal benefit when pre‑training exposure is low but can be safely applied across all tumor types without degrading performance on common cancers. This selective yet universal enhancement establishes dynamic prompting as a practical, scalable solution for deploying LLMs in clinical oncology, particularly for rare cancers where accurate outcome prediction can meaningfully inform treatment planning.