Related Experiment Video
Updated: Aug 11, 2026

Augmenting Large Language Models via Vector Embeddings to Improve Domain-Specific Responsiveness
Published on: December 6, 2024
Prompt Engineering of Large Language Models for Medication Dose Calculation
Max Weaver1, Natasha J Petry1,2, Jeremy Cauwels3,4
1Sanford Imagenetics, Sanford Health, Sioux Falls, South Dakota, USA.
Large language models (LLMs) accurately extract medication dosing from electronic health records (EHRs). This framework demonstrates LLMs
Area of Science:
- Health Informatics
- Artificial Intelligence in Medicine
- Pharmacology
Background:
- Electronic Health Records (EHRs) contain vast amounts of medication data.
- Manual extraction of medication dosing from EHRs is time-consuming and prone to errors.
- Automated methods are needed to efficiently and accurately capture dosing information.
Purpose of the Study:
- To design and validate a large language model (LLM) framework for systematic medication dose extraction from EHR data.
- To evaluate the performance of five different LLMs in extracting medication dosing information across multiple therapeutic classes.
- To assess the impact of prompt engineering on the accuracy of LLM-based dose extraction.
Main Methods:
- Manual dose annotations were performed on 4295 medications across nine therapeutic classes.
- Five LLMs (Mistral-small, Llama 3-70B, Nova lite, DeepSeek, Claude 3.5 Sonnet) were tested using iterative prompt engineering.
- Performance was evaluated using R2 and classification accuracy, comparing model-derived doses against manual annotations.
Main Results:
- Claude 3.5 Sonnet and DeepSeek demonstrated the highest performance, with Claude achieving R2 of 99.32% and accuracy of 92.36% on training data.
- Prompt optimization led to minor improvements in Claude and DeepSeek, and significant gains in Nova lite, Llama, and Mistral-small.
- In testing data, Claude and DeepSeek achieved R2 of 99.74% and 95.58% respectively, indicating high accuracy in automated medication dose extraction.
Conclusions:
- LLMs show high accuracy and potential for automated medication dose extraction from EHR data.
- The developed LLM framework can augment clinical practice through improved medication reconciliation.
- This study provides a foundation for leveraging LLMs to enhance clinical research and data analysis.
Related Concept Videos
Impact of Pharmacokinetic–Pharmacodynamic Models: Regulatory Decisions
Pharmacokinetic Models: Comparison and Selection Criterion
Physiological models take a detailed approach by considering specific molecular processes. They can predict drug distribution, metabolism, and elimination changes, providing a comprehensive understanding of how drugs interact with the body.
Model Approaches for Pharmacokinetic Data: Distributed Parameter Models
The distributed parameter models are specifically designed to account for variations and differences in some drug classes. This model is particularly useful for assessing regional concentrations of anticancer or...
Determination of Multiple Dosing Parameters: Loading and Maintenance Doses
Dosage Regimen Designs: Nomograms and Tabulations
Dosage Regimens: Designs and Approaches