Related Experiment Video
Updated: Sep 10, 2025

Augmenting Large Language Models via Vector Embeddings to Improve Domain-Specific Responsiveness
Published on: December 6, 2024
Medication information extraction using local large language models
Phillip Richter-Pechanski1, Marvin Seiferling2, Christina Kiriakou3
1Section of Bioinformatics and Systems Cardiology, Klaus Tschira Institute for Integrative Computational Cardiology, Im Neuenheimer Feld 669, 69120 Heidelberg, DE, Germany; Department of Internal Medicine III, University Hospital, Im Neuenheimer Feld 410, 69120 Heidelberg, DE, Germany; German Center for Cardiovascular Research (DZHK) - Partner site Heidelberg/Mannheim, Im Neuenheimer Feld 669, 69120 Heidelberg, DE, Germany; Informatics for Life, Im Neuenheimer Feld 669, 69120 Heidelberg, DE, Germany; Department of Computational Linguistics, Heidelberg University, Im Neuenheimer Feld 325, 69120 Heidelberg, DE, Germany.
Objective:
Medication information is crucial for clinical routine and research. However, a vast amount is stored in unstructured text, such as doctor's letters, requiring manual extraction - a resource-intensive, error-prone task. Automating this process comes with significant constraints in a clinical setup, including the demand for clinical expertise, limited time-resources, restricted IT infrastructure, and the demand for transparent predictions. Recent advances in generative large language models (LLMs) and parameter-efficient fine-tuning methods show potential to address these challenges.
Methods:
We evaluated local LLMs for end-to-end extraction of medication information, combining named entity recognition and relation extraction. We used format-restricting instructions and developed an innovative feedback pipeline to facilitate automated evaluation. We applied token-level Shapley values to visualize and quantify token contributions, to improve transparency of model predictions.
Results:
Two open-source LLMs - one general (Llama) and one domain-specific (OpenBioLLM) - were evaluated on the English n2c2 2018 corpus and the German CARDIO:DE corpus. OpenBioLLM frequently struggled with structured outputs and hallucinations. Fine-tuned Llama models achieved new state-of-the-art results, improving F1-score by up to 10 percentage points (pp.) for adverse drug events and 6 pp. for medication reasons on English data. On the German dataset, Llama established a new benchmark, outperforming traditional machine learning methods by up to 16 pp. micro average F1-score.
Conclusion:
Our findings show that fine-tuned local open-source generative LLMs outperform SOTA methods for medication information extraction, delivering high performance with limited time and IT resources in a real-world clinical setup, and demonstrate their effectiveness on both English and German data. Applying Shapley values improved prediction transparency, supporting informed clinical decision-making.
More Related Videos
Related Concept Videos
Local Anesthetics: Pharmacokinetics
Local Anesthetics: Chemistry and Structure-Activity Relationship
Drug Nomenclature
Local Anesthetics: Mechanism of Action
Local anesthetics are amphiphilic molecules consisting of a hydrophobic aromatic part linked to a hydrophilic group by an ester or amide linkage. They are weak bases and are usually available as salts, which increases their solubility and stability. Once administered, LAs exist in the body either...
Pharmacokinetic Models: Overview
There are three primary types of models: empirical, compartment, and physiological. Empirical models, with minimal...
Local Anesthetics: Common Agents and Their Applications
Cocaine is an ester of benzoic acid and methylecgogine. It is used to anesthetize and vasoconstrict locally. Currently, it is used primarily for topical applications. It is beneficial for surgeries on the upper respiratory tract, providing anesthesia and shrinking the mucosa. Cocaine in the form of cocaine hydrochloride is...

