journal article·2026-02-27Open access

Feasibility of Using Large Language Models for Structured Medication Extraction from Clinical Text: A Comparative Analysis of Zero-Shot and Few-Shot Paradigms

Evan Schulte, Mohamed Abusharkh, Kushal Dahal, Michael Klepser, Minji Sohn

Applied Sciences· Volume 16· Issue 5

Abstract

The digitization of healthcare has been accompanied by a rapid expansion of electronic health records (EHRs); however, a significant proportion of critical patient data, specifically medication regimens, remains entrapped within unstructured clinical narratives. The inability to seamlessly compute this data hinders advancements in pharmacovigilance, clinical decision support, and population health management. This study presents a comprehensive, rigorous evaluation of the feasibility of deploying Large Language Models (LLMs) to automate the extraction of structured dosage information (Dose, Daily Frequency, Duration) from outpatient antimicrobial clinical notes sourced from the Collaboration to Harmonize Antimicrobial Registry Measures (CHARM) registry. We scrutinized the performance of five distinct open-weight architectures, namely GPT-OSS:20B, Gemma 2:9B, Mistral 7B, Qwen3:14B and Llama 3.2, across both Zero-Shot and Retrieval Augmented Generation (RAG)-based Few-Shot prompting paradigms. Our analysis reveals a fundamental architectural trade-off: the reasoning-optimized GPT-OSS:20B dominates the zero-shot landscape (F1 > 0.90) by leveraging abstract schema understanding, whereas the instruction-tuned Gemma 2:9B excels in the few-shot setting (F1 ~ 0.99), effectively utilizing examples as guardrails to surpass larger models. Conversely, smaller models (Mistral, Llama) exhibit a prohibitive “hallucination barrier,” rendering them unsafe for unsupervised clinical application. Furthermore, we identify “Inconsistent Unit Handling” and “Complex Temporal Logic” as persistent failure modes that resist simple scaling laws. This report provides a definitive framework for selecting model architectures based on the availability of few-shot examples and highlights the necessity of dynamic RAG strategies to achieve production-grade reliability in medical informatics.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Topic Modeling · Biomedical Text Mining and Ontologies · Pharmacovigilance and Adverse Drug Reactions

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Software Engineering, Ferris State University, Grand Rapids, MI 49503, USA

Collaboration to Advance Pharmacy Enterprises (CAPE), College of Pharmacy, Ferris State University, Grand Rapids, MI 49503, USA

References (33)

Show source-provided references
1. Clinician perceptions on the use of free-text communication orders
2. An electronic health record based on structured narrative10.1197/jamia.M2131 ↗
3. Ge, Y., Wang, J., Lai, T., Zhang, Y., and Li, F. (2025). Balancing natural language processing accuracy and normalisation in extracting medical insights. arXiv.
4. A comparative study of current clinical natural language processing systems on handling abbreviations and acronyms
5. Zhao, W.X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., and Dong, Z. (2023). A survey of large language models. arXiv.
6. Isaradech, N., Riedel, A., Sirikul, W., Kreuzthaler, M., and Schulz, S. (2024). Zero- and Few-shot Named Entity Recognition and Text Expansion in Medication Prescriptions using ChatGPT. arXiv.10.1016/j.artmed.2025.103165 ↗
7. Bélisle-Pipon, J.-C. (2024). Why we need to be careful with LLMs in medicine. Front. Med., 11.10.3389/fmed.2024.1495582 ↗
8. Information extraction from electronic medical documents: State of the art and future research directions10.1007/s10115-022-01779-1 ↗
9. Extracting medication information from clinical text10.1136/jamia.2010.003947 ↗
10. OpenAI (2026, January 29). Introducing GPT-OSS: The Open Source Successor to GPT-2. OpenAI 2024. Available online: https://openai.com/index/introducing-gpt-oss/.
11. Google (2024). Gemma 2: Improving open language models at a practical size [Model card]. arXiv.
12. Alibaba Cloud (2026, January 29). Qwen3-14B: A Versatile Large Language Model [Model Card]. Hugging Face 2025. Available online: https://huggingface.co/Qwen/Qwen3-14B.
13. Meta (2026, January 29). Llama 3.2: Lightweight Models for Edge Devices [Model Card]. Hugging Face 2024. Available online: https://huggingface.co/meta-llama/Llama-3.2-3B.
14. Jiang, A.Q., Sablayrolles, A., Mensch, A., Bamford, C., Chaplot, D.S., Casas, D.d.l., Bressand, F., Lengyel, G., Lample, G., and Saulnier, L. (2026, January 29). Mistral 7B [Model Announcement]. Mistral AI 2023. Available online: https://mistral.ai/news/announcing-mistral-7b/.
15. Assistant Secretary for Planning and Evaluation (ASPE) (1996). Health Insurance Portability and Accountability Act of 1996, ASPE. Pub. L. No. 104–191, 110 Stat. 1936.
16. European Union (2016). Regulation
17. (EU) 2016/679 of the European Parliament and of the Council of 27 April 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing Directive 95/46/EC (General Data Protection Regulation). Off. J. Eur. Union, L119, 1-88.
18. Medication information extraction using local large language models10.1016/j.jbi.2025.104898 ↗
19. MedEx: A medication information extraction system for clinical narratives10.1197/jamia.M3378 ↗
20. Mayo clinical Text Analysis and Knowledge Extraction System (cTAKES): Architecture, component evaluation and applications10.1136/jamia.2009.001560 ↗
21. Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013). Efficient estimation of word representations in vector space. arXiv.
22. Pennington, J., Socher, R., and Manning, C. (2014, January 25–29). GloVe: Global Vectors for Word Representation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar.10.3115/v1/D14-1162 ↗
23. Schmidt, R.M. (2019). Recurrent neural networks (RNNs): A gentle introduction and overview. arXiv.
24. Huang, Z., Xu, W., and Yu, K. (2015). Bidirectional LSTM-CRF models for sequence tagging. arXiv.
25. Extracting Drug Names and Associated Attributes From Discharge Summaries: Text Mining Study10.2196/24678 ↗
26. Extracting medications and associated adverse drug events using a natural language processing system combining knowledge base and deep learning10.1093/jamia/ocz141 ↗
27. Fornasiere, R., Brunello, N., Scotti, V., and Carman, M. (2024, January 19–20). Medical Information Extraction with Large Language Models. Proceedings of the 7th International Conference on Natural Language and Speech Processing (ICNLSP 2024), Trento, Italy.
28. Ferris State University (2026, February 13). CHARM Project. Available online: https://www.ferris.edu/cape/charm.htm.
29. Ollama (2026, February 13). Ollama: Get up and Running with Large Language Models. GitHub Repository. Available online: https://github.com/ollama/ollama.
30. Large language models are zero-shot reasoners
31. Language models are few-shot learners
32. A systematic analysis of performance measures for classification tasks10.1016/j.ipm.2009.03.002 ↗
33. Villanueva-Miranda, I., Gu, Z., Yang, D., Nezafati, K., Huang, J., Ruan, P., Zhan, X., Xiao, G., and Xie, Y. (December, January 30). ClinBench: A Standardized Multi-Domain Framework for Evaluating Large Language Models in Clinical Information Extraction. Proceedings of the NeurIPS 2025, San Diego, CA, USA.