Clinician expertise and prompt engineering enhance cancer information extraction in electronic health records by small language models
Real-world data (RWD) in unstructured electronic health records (EHRs) is crucial for understanding complex diseases like cancer, but extracting structured information is challenging due to linguistic variability, semantic complexity, and privacy concerns. This study evaluates the performance of four small, locally deployable language models for information extraction from Italian EHRs. We examine three prompting strategies (zero-shot, few-shot, and annotated few-shot) across English and Italian, involving clinicians with varying expertise to assess the impact of prompt design on accuracy. We evaluate the performance of four open-source small language models (SLMs) for clinical information extraction from Italian electronic health records (EHRs) in the APOLLO 11 trial on non-small cell lung cancer (NSCLC). The extraction protocol involves four steps: problem definition, data preprocessing, Large Language Model (LLM)-based information extraction, and output evaluation. We show that general-purpose models (e.g., LLaMA 3.1 8B) outperform biomedical models in most tasks, particularly in extracting binary features. Multiclass variables such as TNM (Tumor, Node, Metastasis) staging, PD-L1 (Programmed death-ligand 1), and ECOG-PS (Eastern Cooperative Oncology Group-Performance Status) are more difficult due to implicit language and lack of standardization. Few-shot prompting and native-language inputs significantly improve performance and reduced hallucinations. Clinical expertise enhances consistency in the extraction, particularly among students using annotated examples. The study confirms that privacy-preserving SLMs can be deployed locally for efficient and secure cancer data extraction. Findings highlight the need for hybrid systems combining SLMs with expert input and underline the importance of aligning clinical documentation practices with SLM capabilities. This is the first study to benchmark SLMs on Italian EHRs and investigate the role of clinical expertise in prompt engineering, offering valuable insights for the future integration of SLMs into real-world clinical workflows. This study aimed to explore how a type of computational models called small language models (SLMs) can help extract important information from patients’ medical records. We tested four different models, three different ways to prompt the models to analyse the medical records and records in English and Italian. We found some models were better at extracting information than others. As far as we are aware, this is the first study to benchmark SLMs on Italian EHRs and investigate the role of clinical expertise in prompt engineering, offering valuable insights for the future integration of SLMs into real-world clinical workflows. Corso et al. evaluate small, locally deployable language models for clinical information extraction from Italian Electronic Health Records. General purpose models outperform biomedical models and combining few-shot prompting with clinical expertise enhances accuracy and reduces hallucinations.
Authors
- Andra Diana Dumitrascu
- Fabian Wolf (ORCID: https://orcid.org/0000-0001-8842-3718)
- Luana Passos (ORCID: https://orcid.org/0000-0002-5470-7349)
- Isabella C. Wiest (ORCID: https://orcid.org/0009-0004-4848-614X)
- Giulia Montelatici
- Paolo Baili (ORCID: https://orcid.org/0000-0003-0335-2418)
- Alessandra Pedrocchi (ORCID: https://orcid.org/0000-0001-9957-2786)
- Chiara Cavalli (ORCID: https://orcid.org/0000-0001-5568-8365)
- Claudia Proto (ORCID: https://orcid.org/0000-0003-0287-9787)
- Federica Corso (ORCID: https://orcid.org/0000-0002-4947-9628)
- Laura Mazzeo (ORCID: https://orcid.org/0000-0001-9226-8861)
- Alessandra Russo (ORCID: https://orcid.org/0000-0002-3318-8711)
- Monica Ganzinelli (ORCID: https://orcid.org/0000-0002-0526-0835)
- V. Miskovic (ORCID: https://orcid.org/0000-0003-1475-0243)
- Roberta Serino
- C. Agosta
- Simone Rota (ORCID: https://orcid.org/0000-0002-6839-1488)
- Claudia Giani (ORCID: https://orcid.org/0000-0001-8630-4037)
- Rebecca Romanò (ORCID: https://orcid.org/0000-0002-1644-1981)
- Arsela Prelaj (ORCID: https://orcid.org/0000-0002-3863-088X)
- Jakob Nikolas Kather (ORCID: https://orcid.org/0000-0002-3730-5348)
- Giulia Corrao (ORCID: https://orcid.org/0000-0002-5757-6073)
- Giuseppe Lo Russo (ORCID: https://orcid.org/0000-0003-3224-2728)
- Teresa Beninato (ORCID: https://orcid.org/0000-0003-0388-6655)
- Paola Andena
- Stefano Natangelo (ORCID: https://orcid.org/0009-0002-3021-3085)
- A. Ferrarin
- Marco Meazza Prina
- Rosa Maria Di Mauro
- Giorgia Di Liberti
- C. Bonalume
- V. Peppoloni
- Tommaso Capoccia
- Ambrosini Paolo (ORCID: https://orcid.org/0009-0003-8200-2623)
- Michele Borracino
- Filippo de Braud
- Justin Armanini (ORCID: https://orcid.org/0009-0003-3173-4971)
- Marta De Ponti
- Mario Occhipinti
- giuseppe leone (ORCID: https://orcid.org/0009-0008-9931-9332)
- Giulia Stasi
- Marta Brambilla
- Andrea Spagnoletti
- Leonardo Provenzano
Institutions
- University of Leeds (GB)
- University of Milan (IT)
- Heidelberg University (DE)
- University Hospital Heidelberg (DE)
- National Center for Tumor Diseases (DE)
- Fondazione IRCCS Istituto Nazionale dei Tumori (IT)
- University Hospital Carl Gustav Carus (DE)
- Else Kröner Fresenius Center for Digital Health (DE)
- University of Milano-Bicocca (IT)
- Politecnico di Milano (IT)
- University of Minho (PT)
Publication Details
- Journal
- Communications Medicine
- Published
- 2026-07-16
- DOI
- https://doi.org/10.1038/s43856-026-01790-5
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Institute for Health and Care Research
- Department of Health and Social Care
- European Commission
- Deutscher Akademischer Austauschdienst
- Deutsche Forschungsgemeinschaft
- Ministero dell’Istruzione, dell’Università e della Ricerca
- Deutsche Krebshilfe
- Gemeinsame Bundesausschuss
- National Institutes of Health
- HORIZON EUROPE Framework Programme
- Leeds Biomedical Research Centre