Comprehensive testing of large language models for extraction of structured data in pathology

Bastian Grothey, Jan Odenkirchen, Adnan Brkic, Birgid Schömig‐Markiefka, Alexander Quaas, Reinhard Büttner, Yuri Tolkach

View at source ↗Article54 citations

Abstract

BACKGROUND: Pathology departments generate large volumes of unstructured data as free-text diagnostic reports. Converting these reports into structured formats for analytics or artificial intelligence projects requires substantial manual effort by specialized personnel. While recent studies show promise in using advanced language models for structuring pathology data, they primarily rely on proprietary models, raising cost and privacy concerns. Additionally, important aspects such as prompt engineering and model quantization for deployment on consumer-grade hardware remain unaddressed. METHODS: We created a dataset of 579 annotated pathology reports in German and English versions. Six language models (proprietary: GPT-4; open-source: Llama2 13B, Llama2 70B, Llama3 8B, Llama3 70B, and Qwen2.5 7B) were evaluated for their ability to extract eleven key parameters from these reports. Additionally, we investigated model performance across different prompt engineering strategies and model quantization techniques to assess practical deployment scenarios. RESULTS: Here we show that open-source language models extract structured data from pathology reports with high precision, matching the accuracy of proprietary GPT-4 model. The precision varies significantly across different models and configurations. These variations depend on specific prompt engineering strategies and quantization methods used during model deployment. CONCLUSIONS: Open-source language models demonstrate comparable performance to proprietary solutions in structuring pathology report data. This finding has significant implications for healthcare institutions seeking cost-effective, privacy-preserving data structuring solutions. The variations in model performance across different configurations provide valuable insights for practical deployment in pathology departments. Our publicly available bilingual dataset serves as both a benchmark and a resource for future research.

Abstract of "Comprehensive testing of large language models for extraction of structured data in pathology" by Bastian Grothey, Jan Odenkirchen, Adnan Brkic et al., https://doi.org/10.1038/s43856-025-00808-8, used under its Creative Commons Attribution license (CC-BY); markup removed, otherwise unmodified.

Record

Archive ID
doi:10.1038/s43856-025-00808-8
Published
Mar 31, 2025
Venue
Communications Medicine
DOI
10.1038/s43856-025-00808-8
PubMed
40164789
Categories
Machine Learning in Healthcare
License
cc-by
Provenance
openalex

Topics