Improving Retrieval Augmented Generation for Health Care by Fine-Tuning Clinical Embedding Models: Development and Evaluation Study
Authors:
- Kamyar ArzidehKAKamyar Arzideh
- Henning SchäferHSHenning Schäfer
- Ahmad Idrissi-YaghirAIAhmad Idrissi-Yaghir
- Cynthia Sabrina SchmidtCSCynthia Sabrina Schmidt
- Bahadir EryilmazBEBahadir Eryilmaz
- Mikel BahnMBMikel Bahn
- Amin T TurkiATAmin T Turki
- Olivia Barbara PollokOPOlivia Barbara Pollok
- Eva Maria HartmannEva Maria Hartmann
- Philipp WinnekensPWPhilipp Winnekens
- Katarzyna BorysKBKatarzyna Borys
- Johannes HauboldJHJohannes Haubold
Open Access
- 25 March 2026
- journal article
- research article
- Published by JMIR Publications Inc. in Journal of Medical Internet Research
- Vol. 28, e82997
Abstract
Background: Embedding models are critical components of Retrieval Augmented Generation (RAG) systems for retrieving and searching unstructured medical data. However, existing models are predominantly trained on publicly available English datasets, limiting their effectiveness in non-English health care settings. More importantly, these models lack training on real-world clinical documents, leading to inaccurate context retrieval when integrated into RAG systems for health care applications. This gap is particularly pronounced in specialized medical documentation containing domain-specific terminology, abbreviations, and nuanced clinical language. Objective: This retrospective study aimed to develop and validate embedding models specifically trained on real-world clinical documents from multiple medical specialties to improve medical information retrieval (IR) and RAG system performance in both German and English language contexts. Methods: We fine-tuned embedding models, so-called sentence transformers, using the multilingual-e5-large architecture as a foundation. Training data consisted of approximately 11 million question-answer pairs synthetically generated from 400,000 diverse clinical documents from a large German tertiary hospital, spanning 163,840 patients and 282,728 clinical cases between 2018 and 2023. The SauerkrautLM-SOLAR-Instruct large language model generated medically relevant questions and corresponding answers for each document. The dataset was additionally pseudonymized and translated into English to aim for broader applicability. Models were evaluated in 2 distinct scenarios: IR using questions with multiple relevant passages, and RAG system performance in both cross-patient and patient-centered contexts. Results: In the IR evaluation, the fine-tuned miracle model achieved a mAP@100 of 0.27, outperforming the multilingual-e5-large baseline (0.14) and state-of-the-art models such as bge-m3 (0.11). In the RAG evaluation, the model demonstrated robust performance comparable with the baseline in the constrained patient-centered scenario (BERTScore F1 0.781 vs 0.778) and showed moderate improvements in the unconstrained cross-patient setting (BLEURT 0.56 vs 0.53). Notably, the model trained on pseudonymized data achieved comparable retrieval performance (mAP@100 0.25) and the highest scores for patient-centered contextual precision (0.93). Performance gains were robust in the German dataset, while the translated English model demonstrated promising results as a proof of concept for cross-lingual transfer. Conclusions: By leveraging a comprehensive real-world dataset spanning multiple medical specialties and using large language models for synthetic question generation, we successfully created and validated domain-specific embedding models. These models can improve medical IR in large-scale search spaces and perform competitively in constrained RAG applications. By publishing the models trained on pseudonymized data, other health care institutions can integrate or adapt these embedding models to their needs. This work establishes a reproducible framework for developing domain-specific clinical embedding models, with the potential to improve data retrieval in medical settings.Keywords
This publication has 33 references indexed in Scilit:
- GERNERMED++: Semantic annotation in German medical NLP through transfer-learning, translation and word alignmentJournal of Biomedical Informatics, 2023
- Annotated dataset creation through large language models for non-english medical NLPJournal of Biomedical Informatics, 2023
- Evaluating the Performance of ChatGPT in OphthalmologyOphthalmology Science, 2023
- Speech disturbances in schizophrenia: Assessing cross-linguistic generalizability of NLP automated measures of coherenceSchizophrenia Research, 2022
- DI++: A deep learning system for patient condition identification in clinical notesArtificial Intelligence in Medicine, 2021
- Improved biomedical word embeddings in the transformer eraJournal of Biomedical Informatics, 2021
- Development and evaluation of novel ophthalmology domain-specific neural word embeddings to predict visual prognosisInternational Journal of Medical Informatics, 2021
- Domain specific word embeddings for natural language processing in radiologyJournal of Biomedical Informatics, 2020
- Deep‐learning approaches to identify critically Ill patients at emergency department triage using limited informationJACEP Open, 2020
- Eradicating Jargon-Oblivion—A Proposed Classification System of Medical JargonJournal of General Internal Medicine, 2019