Skip to main content
Journal of the American Medical Informatics Association: JAMIA logoLink to Journal of the American Medical Informatics Association: JAMIA
. 2025 Aug 4;32(10):1505–1516. doi: 10.1093/jamia/ocaf128

MMRAG: multi-mode retrieval-augmented generation with large language models for biomedical in-context learning

Zaifu Zhan 1, Jun Wang 2, Shuang Zhou 3, Jiawen Deng 4, Rui Zhang 5,
PMCID: PMC12451925  PMID: 40760905

Abstract

Objectives

To optimize in-context learning in biomedical natural language processing by improving example selection.

Materials and Methods

We introduce a novel multi-mode retrieval-augmented generation (MMRAG) framework, which integrates 4 retrieval strategies: (1) Random Mode, selecting examples arbitrarily; (2) Top Mode, retrieving the most relevant examples based on similarity; (3) Diversity Mode, ensuring variation in selected examples; and (4) Class Mode, selecting category-representative examples. This study evaluates MMRAG on 3 core biomedical NLP tasks: Named Entity Recognition (NER), Relation Extraction (RE), and Text Classification (TC). The datasets used include BC2GM for gene and protein mention recognition (NER), DDI for drug-drug interaction extraction (RE), GIT for general biomedical information extraction (RE), and HealthAdvice for health-related text classification (TC). The framework is tested with 2 large language models (Llama-2-7B and Llama-3-8B) and 3 retrievers (Contriever, MedCPT, and BGE-Large) to assess performance across different retrieval strategies.

Results

The results from the Random Mode indicate that providing more examples in the prompt improves the model’s generation performance. Meanwhile, Top Mode and Diversity Mode significantly outperform Random Mode on the RE (DDI) task, achieving an F1 score of 0.9669—a 26.4% improvement. Among the 3 retrievers tested, Contriever outperformed the other 2 in a greater number of experiments. Additionally, Llama 2 and Llama 3 demonstrated varying capabilities across different tasks, with Llama 3 showing a clear advantage in handling NER tasks.

Conclusion

MMRAG effectively enhances biomedical in-context learning by refining example selection, mitigating data scarcity issues, and demonstrating superior adaptability for NLP-driven healthcare applications.

Keywords: large language model, retrieval augmented generation, in-context learning

Introduction

Large language models (LLMs) such as the GPT series1,2 and Llama models3 are now playing an increasingly pivotal role in healthcare,4 demonstrating remarkable capabilities in processing biomedical text and electronic health records (EHRs).5–7 Their applications include extracting clinical insights,8,9 supporting patient monitoring,10 performing clinical text classification,11 addressing natural language inference,12 and facilitating medical information extraction.13–15

However, due to the need to protect patient privacy,16 research in medical NLP faces significant challenges related to insufficient training data.17,18 Although hospitals and healthcare institutions often possess large amounts of raw EHR data, much of these data are unstructured and unlabeled.4 The process of curating, annotating, and structuring this data into usable formats for training machine learning models is time-consuming, money-consuming, and resource-intensive. Furthermore, for rare diseases19,20—such as genetic disorders, orphan diseases, and conditions with limited geographic or demographic prevalence—the lack of documented cases exacerbates the data scarcity issue. These conditions inherently have fewer reported instances, making it difficult to collect even raw EHR data, let alone labeled datasets. Finally, privacy regulations such as HIPAA or GDPR further restrict access to sensitive patient information,21,22 making it even harder to obtain and share data for research purposes. As a result, novel approaches are urgently needed to address these challenges.

Given these considerations, in-context learning (ICL) offers a promising approach. Along with the development of LLMs, the size of these models has grown significantly, the amount of training data has increased, and the length of prompts has expanded.23 As a result, LLMs have begun to demonstrate the ability to learn from context, a capability known as ICL.24 This approach allows the model to learn patterns from a few examples provided within the prompt, enabling it to deliver high-quality responses. ICL has several advantages. First, it eliminates the need for training or fine-tuning, which requires substantial computational resources and large amounts of data; instead, ICL only requires a few examples.25 Second, designing prompts is much simpler than training a model,26 making this approach accessible to individuals without specialized knowledge of LLMs, such as doctors in hospitals. Third, providing examples aligns with the human brain’s natural way of thinking—learning through analogy. This paradigm allows for the seamless incorporation of human knowledge into LLMs by simply adjusting demonstrations and templates.27,28 Finally, a single model can address a wide range of tasks by designing different prompts and providing corresponding examples, showcasing its remarkable versatility.29 Therefore, ICL is indispensable in the field of healthcare.

By leveraging the ability of large language models to learn patterns from a few carefully designed examples embedded in the prompt, ICL could mitigate the insufficient data challenges in the biomedical domain. However, despite its potential, the process of selecting relevant examples from existing verified or labeled data for ICL remains underexplored.30 The careful curation of examples is crucial in biomedical contexts, as the examples not only encapsulate rich medical knowledge—such as clinical guidelines, rare disease manifestations, or treatment pathways—but also significantly influence the quality and accuracy of the model’s responses based on their relevance to the input.25,27,30 Therefore, developing effective methodologies for selecting high-quality examples becomes essential to unlocking the full potential of ICL in medical NLP.

Several studies have explored the selection of examples for ICL. For instance, Liu et al. proposed kNN-augmented in-context example selection to improve ChatGPT-3’s performance. Kumari et al.31 developed an end-to-end submodular framework to enhance the example selection process. Zhang et al.25 formulated example selection for ICL as a sequential decision problem and introduced a reinforcement learning approach for identifying generalizable policies to select demonstration examples. Li et al.32 presented LENS, which finds informative in-context examples for better performance. Similarly, Mavromatis et al.30 proposed AdaICL to improve example diversity. However, to the best of our knowledge, no one has yet explored this area in the biomedical domain.

Fortunately, retrieval-augmented generation (RAG),33,34 a technique designed to extract information directly relevant to an input query, offers a promising approach to address this challenge. RAG can enhance the example selection process by efficiently retrieving contextually similar data points,35,36 making it a natural complement to ICL. To further advance the application of ICL in medical NLP, we propose an innovative multi-mode retrieval-augmented generation (MMRAG) framework that leverages RAG techniques to extract and select similar examples using different strategies tailored to diverse use cases. This framework introduces 4 distinct and independent modes for example selection: (1) Random Mode, where examples are selected without any specific prioritization; (2) Top Mode, which retrieves the most relevant examples based on similarity metrics; (3) Diverse Mode, which ensures a broad range of examples to increase diversity; and (4) Class Mode, which focuses on selecting examples representative of specific categories or conditions. Each mode corresponds to a unique rule for selecting examples, providing flexibility and adaptability to a variety of medical NLP tasks. By integrating these strategies, the proposed framework offers a systematic and effective approach to maximize the potential of ICL in addressing critical challenges in medical NLP, particularly in domains constrained by data scarcity and privacy considerations. Our key contributions are summarized as follows:

  • To the best of our knowledge, this is the first study to investigate the selection of examples in the biomedical domain for ICL.

  • We propose a novel RAG-based framework with 4 distinct modes (Random, Top, Diverse, and Class) to optimize example selection and explore the potential of ICL in biomedical contexts.

  • We conduct extensive experiments, evaluating the framework across 2 LLMs on 4 datasets with 3 retrievers, providing comprehensive insights into its performance.

Methods

Overview of methods

This study introduces MMRAG (multi-mode retrieval-augmented generation) framework, designed to enhance ICL in biomedical NLP by optimizing example selection. MMRAG employs 4 retrieval strategies: Random Mode (arbitrary selection), Top Mode (most similar examples), Diversity Mode (balanced similarity and variation), and Class Mode (representative examples from different categories). The framework integrates RAG with LLMs (Llama-2-7B37 and Llama3-8B38) and 3 retrievers (Contriever,39 MedCPT,40 and BGE-Large41) to systematically evaluate retrieval effectiveness. Our experiments cover Named Entity Recognition (NER), Relation Extraction (RE), and Text Classification (TC) using 4 biomedical datasets (BC2GM,42 DDI,43 GIT,44 and HealthAdvice45). This framework demonstrates how tailored retrieval strategies can significantly improve ICL performance in biomedical NLP, addressing challenges such as data scarcity and privacy constraints.

Tasks and datasets

In this work, we focus on 3 core information extraction tasks in the biomedical domain: NER, RE, and TC. The primary objective of these tasks is to extract meaningful information from raw, unstructured text, thereby transforming it into structured data suitable for downstream applications. Detailed statistics and representative examples of each dataset used can be found in Supplemental Material 1.

Named Entity Recognition (NER)—BC2GM 42 : The BC2GM dataset is a widely used benchmark for biomedical named entity recognition (NER), specifically targeting gene and protein mentions in scientific literature. Derived from the BioCreative II Gene Mention task, it comprises manually annotated gene mentions sourced from PubMed abstracts. This dataset plays a crucial role in biomedical text mining by supporting the development and evaluation of NER models capable of accurately identifying gene-related entities.

Relation Extraction (RE)—DDI 43 : The DDI (Drug-Drug Interaction) dataset is a key resource for relation extraction in the biomedical domain, particularly designed to identify and classify drug-drug interactions from text. It includes sentences from biomedical literature and drug product information sources, annotated with drug entities and their interactions. This dataset is crucial for pharmacovigilance and drug safety, as accurate extraction of drug interactions supports clinical decision-making, prevents adverse drug reactions, and enhances patient safety.

Relation Extraction (RE)—GIT 44 : The GIT (General BioMedical and Complementary and Integrative Health Triples) dataset is a high-quality biomedical triple extraction dataset specifically focused on non-drug therapies. It is characterized by its high-quality annotations and comprehensive coverage of relation types, making it a valuable resource for biomedical relation extraction. The dataset includes 22 relation types derived from SemMedDB, providing structured representations of relationships within biomedical texts. By supporting the extraction of meaningful entity-relation triples, GIT facilitates advancements in knowledge graph construction, automated reasoning, and biomedical text mining applications related to non-drug interventions.

Text Classification (TC)—HealthAdvice 45 : The HealthAdvice dataset is designed for text classification tasks related to health information and advisory content. It consists of a diverse collection of health-related advice. The dataset is structured to facilitate automatic classification of health advice into relevant categories, supporting applications such as misinformation detection, personalized health recommendations, and automated triaging of medical inquiries. By leveraging this dataset, researchers can enhance natural language processing (NLP) models tailored for health communication and decision support.

The combination of these datasets—BC2GM for entity recognition, DDI and GIT for relation extraction, and HealthAdvice for text classification—provides a comprehensive foundation for biomedical NLP research. These datasets enable the development of advanced NLP models capable of extracting critical biomedical knowledge from vast textual sources. By improving the accuracy of entity recognition, relationship extraction, and health-related text classification, they contribute significantly to biomedical informatics, clinical decision support, and evidence-based medicine.

MMRAG framework

The motivation for the proposed framework is to release the potential of ICL using the RAG technique for biomedical information extraction with LLMs. As depicted in Figure 1, the retrieval process begins by embedding both the training set sentences and the input sentence. Differed from traditional RAG, our MMRAG framework uses training set as the external knowledge database. A retriever then ranks the training sentences based on similarity scores. The selection mode determines how the final examples are chosen from this ranked list. Finally, the retrieved examples are integrated with the input sentence in a prompt which then was fed into LLM to get response. In this paper, we introduced 4 different modes for selecting examples: Random Mode, Top Mode, Diversity Mode, and Class Mode. These modes determine how retrieved sentences are selected based on their similarity rankings, striking different balances between similarity and diversity.

Figure 1.

The figure highlights the differences between the conventional RAG method and our proposed MMRAG framework. MMRAG incorporates four strategies for example selection: Random Mode, Top Mode, Diversity Mode, and Class Mode.

An overview of the multi-mode retrieval-augmented generation framework. Compared with the traditional retrieval-augmented generation framework, our new MMRAG framework introduces 4 independent modes for better in-context learning.

Random Mode (Few-shot): Random Mode selects examples arbitrarily from the training set without considering similarity ranking. This introduces randomness, which can improve model generalization but may result in irrelevant examples. While this mode maximizes diversity, it does not ensure the selection of highly relevant sentences.

Top Mode: Top Mode selects the most similar examples by directly choosing the top-ranked sentences. This ensures high contextual similarity between the input sentence and the retrieved examples. However, it may lead to redundancy, as the examples are often very similar to each other, limiting the diversity of information. In this paper, we used cosine similarity to measure the similarity between the input sentence and examples.

Diversity Mode: Diversity Mode introduces a skip-step selection mechanism, where examples are picked at intervals from the ranked list instead of consecutively selecting the top sentences. By skipping certain highly ranked examples, this method ensures that the retrieved examples maintain relevance while increasing the diversity of information.

Class Mode: Class Mode selects the most relevant example from each predefined class rather than purely ranking by similarity. This ensures that different types of sentences are represented in the final selection, improving coverage across multiple categories. While it maintains relevance, some selected examples may have slightly lower similarity scores compared to those chosen in Top Mode.

Each mode provides a different trade-off between similarity and diversity. Random Mode cannot guarantee diversity and relevance, but it represents the most common method. Top Mode guarantees high similarity but lacks diversity. Diversity Mode balances both by selecting non-consecutive similar examples. Class Mode further enhances diversity by ensuring category coverage. Choosing the appropriate mode depends on the specific requirements of the retrieval task.

Prompts

In retrieval-augmented ICL, prompt design plays a crucial role in guiding LLMs to understand the task and generate appropriate outputs. While our MMRAG framework maintains consistent procedures for retrieval, generation, and evaluation across tasks, the task-specific prompt templates vary slightly depending on the nature of the NLP task. For each task—NER, RE, and TC—we constructed different instruction in prompts as follows:

  • Please do a named entity recognition task. You need to accurately recognize and label these entities for the input sentence. The input sentence has been divided into a list form. The response should be a list and each element is corresponding to each word and sign in the input sentence. Response should follow this rule: {\”no disease\”: 0 , \”first token of a disease\”: 1 , \”the subsequent disease tokens\”: 2}

  • Please do a relation extraction task. You need to extract the relation type from the input sentence. The response should be in predefine set: {'NA', 'advise’, 'effect’, 'int’, 'mechanism’}.

  • Please do a classification task. You need to answer the question based on the input sentence. The response should be in predefine set: {'yes’, 'no’}.

Experimental settings

Our experiments were conducted using 2 large language models, Llama-2-7B[38] and Llama-3-8B,38 both of which have demonstrated strong performance in natural language processing tasks. To retrieve relevant examples, we employed 3 different retrievers: Contriever,39 a dense retriever trained with contrastive learning for general-purpose retrieval; MedCPT,40 a retriever optimized for medical and clinical text retrieval; and BGE-Large,41 an embedding-based retriever known for its effectiveness in similarity search. These retrievers were chosen to test the adaptability of our framework across different retrieval strategies.

All experiments were performed on NVIDIA A100 GPUs with 40GB memory, ensuring sufficient computational resources for training and inference. The batch size per device was set to 4 for both training and evaluation, and the inference was carried out sentence by sentence to optimize efficiency. To make sure the output of LLM following the same format, we applied Low-Rank Adaptation,46 a parameter-efficient fine-tuning method, with a rank of 64, alpha set to 32, and a dropout rate of 0.1, to fine-tune the model. The models were optimized using the AdamW optimizer with a learning rate of 1e-5. Fine-tuning was conducted for 5000 steps, with evaluations performed every 1000 steps, and the best-performing model was selected for inference.

For evaluation, we adopted Micro Precision, Micro Recall, and Micro F1-score, in line with established studies.36,47,48 A prediction was considered correct only if the entire output exactly matched the ground truth, ensuring a strict and reliable assessment of model performance. This evaluation approach allowed us to measure the effectiveness of different retrieval strategies and selection modes in a controlled and reproducible manner.

Results

Performance in Random Mode

Table 1 shows the mean and standard deviation of F1 scores for different tasks and datasets since the Random Mode introduces huge randomness. For the NER task on BC2GM, Llama-2-7B achieved an F1 score of 0.8766 with one example, improving to 0.9172 with 10 examples. Llama-3-8B showed superior performance, reaching 0.9660 with one example and further increasing to 0.9782 with 10 examples. In the RE task on the DDI dataset, Llama-2-7B fluctuated between 0.7049 and 0.7050 across different example counts, while Llama-3-8B exhibited marginal improvement, achieving a maximum F1 score of 0.7114 with 5 examples. In text classification on HealthAdvice, Llama-2-7B increased from 0.8954 (1 example) to 0.9171 (10 examples), while Llama-3-8B ranged from 0.8848 to 0.9084. These results indicate that while Random Mode can yield reasonable performance improvements, it lacks the reliability and control of retrieval-based selection.

Table 1.

Comparison of 2 LLMs across 3 datasets in Random Mode.

Tasks Datasets Models Examples Precision Recall F1
NER BC2GM Non-ICL-based SOTA49 0.980
ICL-based SOTA50 0.856
Llama-2-7B 1 0.9232 ± 0.0001 0.8345 ± 0.0007 0.8766 ± 0.0004
5 0.9267 ± 0.0008 0.8878 ± 0.0032 0.9069 ± 0.0018
10 0.9318 ± 0.0007 0.9032 ± 0.0006 0.9172 ± 0.0006
Llama-3-8B 1 0.9733 ± 0.0006 0.9589 ± 0.0008 0.9660 ± 0.0001
5 0.9806 ± 0.0001 0.9712 ± 0.0004 0.9759 ± 0.0003
10 0.9814 ± 0.0007 0.9749 ± 0.0010 0.9782 ± 0.0004
RE DDI Non-ICL-based SOTA51 0.864 0.788 0.824
ICL-based SOTA52 0.8392 ± 0.0002
Llama-2-7B 1 0.7049 ± 0.0031 0.7049 ± 0.0031 0.7049 ± 0.0031
5 0.7081 ± 0.0002 0.7081 ± 0.0002 0.7081 ± 0.0002
10 0.7036 ± 0.0128 0.7064 ± 0.0083 0.7050 ± 0.0105
Llama-3-8B 1 0.7004 ± 0.0018 0.7004 ± 0.0018 0.7004 ± 0.0018
5 0.7114 ± 0.0045 0.7114 ± 0.0045 0.7114 ± 0.0045
10 0.7005 ± 0.0066 0.7005 ± 0.0066 0.7005 ± 0.0066
TC HealthAdvice Non-ICL-based SOTA6 0.91 0.91 0.91
Llama-2-7B 1 0.8954 ± 0.0027 0.8954 ± 0.0027 0.8954 ± 0.0027
5 0.9154 ± 0.0017 0.9159 ± 0.0020 0.9156 ± 0.0018
10 0.9171 ± 0.0021 0.9171 ± 0.0021 0.9171 ± 0.0021
Llama-3-8B 1 0.8848 ± 0.0025 0.8848 ± 0.0025 0.8848 ± 0.0025
5 0.9040 ± 0.0019 0.9040 ± 0.0019 0.9040 ± 0.0019
10 0.9084 ± 0.0006 0.9084 ± 0.0006 0.9084 ± 0.0006

The reported values represent the mean and standard deviation over 3 repeated experiments. The bolded numbers denote the highest scores in each setting.

Performance in Top Mode

Table 2 presents the results for this mode, demonstrating notable performance improvements over Random Mode. In NER, Llama-2-7B reached an F1 score of 0.9098 with 5 examples when using the Contriever retriever, while Llama-3-8B achieved a peak score of 0.9726. The MedCPT retriever also contributed to strong results, with Llama-3-8B scoring 0.9706. For RE on the DDI dataset, Contriever retrieval led to the highest F1 score of 0.9669 for Llama-2-7B and 0.9573 for Llama-3-8B. Similarly, for text classification, Top Mode improved performance, with Llama-2-7B reaching 0.8969 and Llama-3-8B achieving 0.8923 when using Contriever. These results confirm that retrieval-driven selection significantly enhances model effectiveness, particularly when using domain-optimized retrievers.

Table 2.

Comparison of 2 LLMs across 3 datasets using 3 retrievers in Top Mode.

Tasks Datasets Retrievers Num Llama 2
Llama 3
Precision Recall F1 Precision Recall F1
NER BC2GM BGE-Large 1 0.9187 0.7310 0.8142 0.9573 0.9365 0.9468
5 0.9154 0.7318 0.8134 0.9080 0.8820 0.8948
10 0.9130 0.7197 0.8049 0.9052 0.8763 0.8905
Contriever 1 0.9030 0.7755 0.8344 0.9468 0.9180 0.9322
5 0.9242 0.8958 0.9098 0.9747 0.9686 0.9716
10 0.9167 0.8633 0.8892 0.9780 0.9672 0.9726
MedCPT 1 0.8608 0.7302 0.7902 0.9500 0.9204 0.9350
5 0.9324 0.8527 0.8908 0.9784 0.9629 0.9706
10 0.9228 0.8828 0.9024 0.9803 0.9493 0.9646
RE DDI BGE-Large 1 0.7358 0.7358 0.7358 0.7305 0.7305 0.7305
5 0.7745 0.7745 0.7745 0.7589 0.7589 0.7589
10 0.8026 0.8026 0.8026 0.7795 0.7795 0.7795
Contriever 1 0.9662 0.9662 0.9662 0.7532 0.7550 0.7541
5 0.9504 0.9649 0.9576 0.9646 0.9646 0.9646
10 0.9669 0.9669 0.9669 0.9573 0.9573 0.9573
MedCPT 1 0.8146 0.8149 0.8148 0.7050 0.7106 0.7078
5 0.8152 0.8152 0.8152 0.8205 0.8205 0.8205
10 0.8264 0.8264 0.8264 0.8175 0.8175 0.8175
TC HealthAdvice BGE-Large 1 0.8836 0.8836 0.8836 0.8180 0.8180 0.8180
5 0.8906 0.8906 0.8906 0.8612 0.8612 0.8612
10 0.8998 0.8998 0.8998 0.8646 0.8646 0.8646
Contriever 1 0.8900 0.8900 0.8900 0.8116 0.8116 0.8116
5 0.8892 0.8969 0.8930 0.8923 0.8923 0.8923
10 0.8969 0.8969 0.8969 0.8571 0.8606 0.8589
MedCPT 1 0.7454 0.7454 0.7454 0.7028 0.7028 0.7028
5 0.7999 0.8128 0.8063 0.8243 0.8243 0.8243
10 0.7797 0.7869 0.7833 0.7954 0.8105 0.8029

The bolded numbers denote the highest scores in each setting.

Performance in Diversity Mode

Table 3 presents the results, demonstrating that this approach improved model robustness across datasets. In NER, the highest F1 scores were achieved using the Contriever retriever, with Llama-2-7B reaching 0.9134 and Llama-3-8B achieving 0.9731 with 10 examples. For the DDI dataset, Diversity Mode yielded stable results, with Llama-2-7B reaching 0.9666 and Llama-3-8B scoring 0.9623 using Contriever retrieval. Text classification results remained competitive, with Llama-2-7B achieving an F1 score of 0.8980 and Llama-3-8B reaching 0.8765. The results indicate that Diversity Mode helps mitigate overfitting while maintaining high task relevance.

Table 3.

Comparison of 2 LLMs across 3 datasets using 3 retrievers in Diversity Mode.

Tasks and datasets Retrievers Gap Llama2 (5 examples)
Llama2 (10 examples)
Llama3 (5 examples)
Llama3 (10 examples)
Precision Recall F1 Precision Recall F1 Precision Recall F1 Precision Recall F1
NER, BC2GM BGE-Large 1 0.9154 0.7318 0.8134 0.9130 0.7197 0.8049 0.9080 0.8820 0.8948 0.9052 0.8763 0.8905
2 0.9145 0.7360 0.8156 0.9147 0.7235 0.8079 0.9109 0.8815 0.8960 0.9059 0.8762 0.8908
3 0.9125 0.7415 0.8182 0.9133 0.7192 0.8047 0.9081 0.8828 0.8953 0.9052 0.8797 0.8923
Contriever 1 0.9242 0.8958 0.9098 0.9167 0.8633 0.8892 0.9747 0.9686 0.9716 0.9780 0.9672 0.9726
2 0.9292 0.8980 0.9134 0.9192 0.8710 0.8945 0.9712 0.9710 0.9711 0.9788 0.9675 0.9731
3 0.9288 0.8798 0.9036 0.9168 0.8921 0.9043 0.9747 0.9636 0.9691 0.9782 0.9688 0.9735
MedCPT 1 0.9324 0.8527 0.8908 0.9228 0.8828 0.9024 0.9784 0.9629 0.9706 0.9803 0.9493 0.9646
2 0.9411 0.8386 0.8869 0.9206 0.8615 0.8900 0.9780 0.9601 0.9690 0.9811 0.9520 0.9663
3 0.9408 0.8272 0.8804 0.9159 0.8481 0.8807 0.9751 0.9440 0.9593 0.9762 0.9634 0.9698
RE, DDI BGE-Large 1 0.7745 0.7745 0.7745 0.8026 0.8026 0.8026 0.7589 0.7589 0.7589 0.7795 0.7795 0.7795
2 0.7811 0.7811 0.7811 0.7768 0.7768 0.7768 0.7450 0.7450 0.7450 0.7385 0.7385 0.7385
3 0.7666 0.7666 0.7666 0.7611 0.7611 0.7611 0.7440 0.7440 0.7440 0.7487 0.7487 0.7487
Contriever 1 0.9504 0.9649 0.9576 0.9669 0.9669 0.9669 0.9646 0.9646 0.9646 0.9573 0.9573 0.9573
2 0.9666 0.9666 0.9666 0.9669 0.9669 0.9669 0.9623 0.9623 0.9623 0.9334 0.9334 0.9334
3 0.9659 0.9659 0.9659 0.9649 0.9662 0.9656 0.9613 0.9613 0.9613 0.8574 0.8583 0.8579
MedCPT 1 0.8152 0.8152 0.8152 0.8264 0.8264 0.8264 0.8205 0.8205 0.8205 0.8175 0.8175 0.8175
2 0.8199 0.8199 0.8199 0.8170 0.8170 0.8170 0.8136 0.8136 0.8136 0.8228 0.8228 0.8228
3 0.8252 0.8252 0.8252 0.8211 0.8211 0.8211 0.8162 0.8162 0.8162 0.8319 0.8319 0.8319
TC, HealthAdvice BGE-Large 1 0.8906 0.8906 0.8906 0.8998 0.8998 0.8998 0.8612 0.8612 0.8612 0.8646 0.8646 0.8646
2 0.8796 0.8796 0.8796 0.8940 0.8940 0.8940 0.8606 0.8606 0.8606 0.8445 0.8445 0.8445
3 0.8894 0.8894 0.8894 0.8980 0.8980 0.8980 0.8583 0.8583 0.8583 0.8623 0.8623 0.8623
Contriever 3 0.8888 0.8934 0.8911 0.8899 0.8899 0.8899 0.9062 0.9067 0.9064 0.8762 0.8767 0.8765
1 0.8892 0.8969 0.8930 0.8969 0.8969 0.8969 0.8923 0.8923 0.8923 0.8571 0.8606 0.8589
2 0.8779 0.8825 0.8802 0.8928 0.8928 0.8928 0.9026 0.9026 0.9026 0.8562 0.8675 0.8618
MedCPT 1 0.7999 0.8128 0.8063 0.7797 0.7869 0.7833 0.8243 0.8243 0.8243 0.7954 0.8105 0.8029
2 0.8179 0.8203 0.8191 0.8154 0.8173 0.8164 0.8324 0.8324 0.8324 0.8397 0.8416 0.8406
3 0.8084 0.8116 0.8100 0.7522 0.7752 0.7636 0.8101 0.8111 0.8106 0.8393 0.8393 0.8393

The bolded numbers denote the highest scores in each setting.

Performance in Class Mode

Table 4 compares Llama2 and Llama3 across 3 datasets using 3 retrievers in Class Mode. Llama3 generally outperforms Llama2, especially in RE (GIT) where its F1-score with MedCPT reaches 0.6129, significantly higher than Llama2’s 0.3786. In RE (DDI), Contriever achieves the best performance for both models, with Llama3 scoring 0.7060. For TC (HealthAdvice) both models perform well, with Llama2 slightly ahead using random retrieval, but Llama3 excels with Contriever (0.8917 F1-score). These results highlight Llama3’s superior retrieval utilization and the impact of effective retrievers like MedCPT and Contriever on model performance.

Table 4.

Comparison of 2 LLMs across 3 datasets using 3 retrievers in Class Mode.

Tasks, datasets, examples Retrievers Llama 2
Llama 3
Precision Recall F1 Precision Recall F1
RE, DDI, examples: 4 Random 0.6725 0.6725 0.6725 0.6738 0.6738 0.6738
MedCPT 0.6825 0.6825 0.6825 0.6841 0.6841 0.6841
Contriever 0.6915 0.6917 0.6916 0.7060 0.7060 0.7060
BGE-Large 0.6739 0.6755 0.6747 0.6881 0.6881 0.6881
RE, GIT, examples: 22 Random 0.3004 0.3004 0.3004 0.5075 0.5075 0.5075
MedCPT 0.3786 0.3786 0.3786 0.6129 0.6129 0.6129
Contriever 0.2354 0.2354 0.2354 0.5978 0.5978 0.5978
BGE-Large 0.3143 0.3143 0.3143 0.6108 0.6108 0.6108
TC, HealthAdvice, examples: 3 Random 0.8733 0.8733 0.8733 0.8658 0.8658 0.8658
MedCPT 0.8986 0.8986 0.8986 0.8842 0.8842 0.8842
Contriever 0.8940 0.8940 0.8940 0.8917 0.8917 0.8917
BGE-Large 0.8865 0.8865 0.8865 0.8785 0.8785 0.8785

The bolded numbers denote the highest scores in each setting.

Discussion

The proposed MMRAG framework is particularly valuable for the biomedical domain, where labeled data are scarce due to privacy constraints and annotation costs. Biomedical NLP tasks require high precision, as errors in entity recognition or relation extraction can lead to misinformation in clinical settings. By integrating retrieval-augmented generation, this framework improves ICL by dynamically selecting relevant and diverse examples. The results demonstrate that Top Mode provided the highest F1 scores in precision-sensitive tasks such as NER and RE, demonstrating that high-relevance retrieval improves performance. However, the Diversity Mode achieved more stable generalization across datasets while preserving task relevance. Class Mode, while slightly reducing F1 scores in some cases, ensured broader category representation, which is crucial for classification and multi-relation extraction tasks. Unlike traditional fine-tuning, this approach allows models to adapt to evolving biomedical knowledge. Its flexibility makes it suitable for applications in clinical decision support, drug discovery, and genomic research.

Figure 2 illustrates the impact of different numbers of examples on model performance in Random Mode. For the NER (BC2GM) and TC (HealthAdvice) tasks, an increase in the number of examples generally improves performance. However, the performance gain from 5 to 10 examples is noticeably smaller compared to the significant improvement observed from 1 to 5 examples. This suggests that while the jump from 1 to 5 examples provides substantial additional information, the marginal benefit of increasing from 5 to 10 examples is limited. Interestingly, the trend for RE (DDI) is different. The model’s performance declines when increasing from 5 to 10 examples. This can be attributed to the random selection of examples, which may include irrelevant or misleading instances. As a result, these less informative or even contradictory examples could lead the model to make incorrect predictions, ultimately degrading performance.

Figure 2.

We plotted a line chart to illustrate the F1 scores across varying numbers of examples. The results demonstrate a positive correlation: as the number of examples increases, the F1 score consistently improves.

Performance comparison across 3 datasets evaluated under Random Mode (Few-shot). The mean and standard deviation values are computed from 3 experimental repetitions for each configuration.

Figure 3 presents the F1-score comparison across different numbers of examples and retrievers in Top Mode. The results reveal that Llama3 significantly outperforms Llama2 on the NER (BC2GM) task. However, in contrast, Llama2 performs better than Llama3 on the TC (HealthAdvice) and RE (DDI) tasks. In terms of retriever performance, all 3 retrievers are well-suited for NER (BC2GM). For TC (HealthAdvice), Contriever and BGE-Large outperform MedCPT, indicating their stronger retrieval effectiveness in this task. In the RE (DDI) task, Contriever demonstrates superior performance compared to the other retrievers. Overall, these findings highlight that the effectiveness of different models and retrievers varies across tasks, emphasizing the importance of choosing the appropriate combination for optimal results.

Figure 3.

We conducted a comparison of three different retrievers across two models and three distinct tasks to evaluate their retrieval effectiveness under various settings.

Performance comparison of 2 models under the Top Mode across 3 datasets and 3 few-shot settings.

Figures 4 present the results for Diversity Mode with different gap values using 5 examples. Across most experiments, we observe that the gap parameter causes slight fluctuations in performance, but the variations are generally small. This is because Diversity Mode still retrieves examples that are highly similar to the input sentence. However, the nature of these similar examples can influence performance in different ways. If the retrieved examples contain useful and relevant information, they contribute positively, leading to performance improvements. Conversely, if they contain irrelevant or misleading information, they may slightly degrade model performance. Regardless of the gap value, the most similar example is always included as one of the retrieved examples, ensuring that the performance variation remains anchored to the Top Mode baseline with one example setting.

Figure 4.

We plotted the changes in F1 score with respect to the gap for different models and retrievers across various tasks.

Trend of the gap parameter increase in Diversity Mode when 5 examples are provided in the prompt.

Class Mode results, as shown in Figure 5, demonstrate its effectiveness in classification and relation extraction tasks. While the absolute F1 scores are slightly lower than those in Top Mode, this approach ensures that the retrieved examples cover a broader range of biomedical categories, providing a more diverse reference set for model inference. The retrieval strategy in Class Mode closely resembles human thinking. In real-world classification tasks, people tend to perform better when they have observed a sufficient number of examples across all categories. However, current LLMs and most NLP algorithms are primarily trained for next-word prediction, which limits their ability to generalize in classification scenarios. Enhancing LLM inference by aligning it more closely with human reasoning processes could significantly improve performance. Therefore, we can anticipate that if future LLMs evolve to better mimic human cognitive patterns, strategies like Class Mode could further enhance their effectiveness in complex classification tasks.

Figure 5.

The figure presents a comparison of different retrievers under the class mode setting. It also includes results across multiple models to highlight performance differences in various configurations.

Class Mode performance comparison across 3 datasets on 2 models.

Statistical analysis

Based on the results from Tables 1-4, we further use boxplots to present a statistical comparison across different datasets, models, and retrievers, as illustrated in Figure 6. From the DDI dataset (Figure 6, A-D), we can see that the Top Mode and Diversity Mode perform best. On the health advice dataset, all 4 modes deliver competitive results. Notably, on the health advice dataset under Llama2, the Random Mode surpasses the others, whereas under Llama3, the Top Mode performs worse than the other modes. Meanwhile, Figure 6, E-H compares the 2 models under the 4 modes, revealing that overall, both models achieve a relatively similar level of performance. Lastly, Figure 6, I-K shows the statistical results for different retrievers. Here, Contriever achieves comparatively strong performance across all 3 tasks, standing out noticeably on the RE task. In contrast, BGE-large and MedCPT both underperform the other 2 retrievers on NER and TC, respectively.

Figure 6.

We employed box plots to illustrate the statistical differences across various modes, models, and retrievers, providing a comprehensive comparison of their performance distributions.

Statistical comparison by datasets, models, and retrievers.

Error analysis

Diving deeper into these promising results, our observations of the generated outputs reveal that LLMs mainly suffer from the following 2 errors:

  • Generation Errors: These include misclassifying entities, incorrectly assigning relationships between head and tail entities, and extracting non-entity words as entities. Example 1: LLMs wrongly identify the word “Genetic” as gene type but it is not. Example 2: for sentence “[‘Bort’, ‘-‘, ‘dex’, ‘was’, ‘an’, ‘effective’, ‘salvage’, ‘treatment’, ‘for’, ‘MM’]”, the correct response should be [1, 0, 1, 0, 0, 0, 0, 0, 0, 2]. However, the generated response was [1, 0, 1, 0, 0, 0, 0, 2], which missed some tokens.

  • Over-Extraction: Due to our strict evaluation criteria, extracting additional entities beyond the ground truth or producing boundary errors in entity spans can lead to a decline in performance scores. Example 1: The term “CRE-binding-protein” might be tokenized as [‘CRE’, ‘-’, ‘binding’, ‘-’, ‘protein’], but the LLM may not recognize the hyphens as part of the entity. As a result, it predicts “CRE binding protein” as the disease entity, which does not exactly match the annotated “CRE-binding-protein.” Example 2: The correct disease entity is “depressive disorder,” but the LLM predicts “major depressive disorder,” resulting in an over-extraction beyond the ground truth.

Limitations and future directions

While this study focuses on example retrieval strategies, several limitations remain:

  • Limited retriever diversity: Although the MMRAG framework is compatible with all retrievers, this study only evaluates 3 retrievers. Future work should explore the effectiveness of retrieval strategies across a wider range of retrievers, including dense and sparse retrievers.

  • Fixed prompt format: the integration of retrieved examples into prompts lacks systematic exploration of formatting strategies, which can influence LLM performance. Future work should investigate how to improve the performance by sophisticated designed prompt format.

  • Four modes in our framework are evaluated separately. In the future, weighing or prioritization mechanisms could be considered to integrate these 4 modes.

By addressing these limitations, retrieval-augmented ICL can be further enhanced for broader applications in AI-driven biomedical and other large-scale NLP tasks.

Conclusion

In this study, we proposed MMRAG, a novel multi-mode retrieval-augmented framework that enhances ICL in biomedical NLP by optimizing example selection. By systematically evaluating 4 retrieval strategies—Random, Top, Diversity, and Class Mode—our approach demonstrates superior adaptability across multiple biomedical tasks. The results show that retrieval-enhanced selection significantly improves information extraction, particularly in precision-critical tasks. As AI-driven healthcare evolves, MMRAG provides a flexible and efficient method to address data scarcity and privacy challenges, paving the way for future advancements in clinical decision support, drug discovery, and biomedical text processing.

Supplementary Material

ocaf128_Supplementary_Data

Acknowledgments

We would like to express our sincere gratitude to the reviewers for their valuable comments.

Contributor Information

Zaifu Zhan, Department of Electrical and Computer Engineering, University of Minnesota, Minneapolis, MN 55455, United States.

Jun Wang, Division of Computational Health Sciences, Department of Surgery, University of Minnesota, Minneapolis, MN 55455, United States.

Shuang Zhou, Division of Computational Health Sciences, Department of Surgery, University of Minnesota, Minneapolis, MN 55455, United States.

Jiawen Deng, Department of Computer Science and Engineering, University of Minnesota, Minneapolis, MN 55455, United States.

Rui Zhang, Division of Computational Health Sciences, Department of Surgery, University of Minnesota, Minneapolis, MN 55455, United States.

Author contributions

Zaifu Zhan (Conceptualization, Methodology, Software, Data curation, Formal analysis, Writing – original draft, Visualization), Jun Wang (Writing – review & editing), Shuang Zhou (Writing – review & editing), Jiawen Deng (Writing – review & editing), Rui Zhang (Conceptualization, Supervision, Project administration, Funding acquisition, Writing – review & editing)

Supplementary material

Supplementary material is available at Journal of the American Medical Informatics Association online.

Funding

This work was supported by the National Institutes of Health’s National Center for Complementary and Integrative Health (grant numbers R01AT009457 and U01AT012871), the National Institute on Aging (grant number R01AG078154), the National Cancer Institute (grant number R01CA287413), the National Institute of Diabetes and Digestive and Kidney Diseases (grant number R01DK115629), and the National Institute on Minority Health and Health Disparities (grant number 1R21MD019134-01).

Conflicts of interest

The authors have no competing interests to declare.

Data availability

All the datasets in this paper are public. Readers could find them in the following links:

BC2GM: https://biocreative.bioinformatics.udel.edu/tasks/

Health Advice: https://huggingface.co/datasets/medalpaca/medical_meadow_health_advice

DDI: https://github.com/isegura/DDICorpus

GIT: https://github.com/ToneLi/BIoMedRAG/tree/main/dataset/0_GM-CIHT

References

  • 1. Radford A. Improving language understanding by generative pre-training. Meta AI. 2018. Accessed Jan 1, 2025. https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf
  • 2. Radford A, Wu J, Child R, Luan D, Amodei D,Sutskever I. Language models are unsupervised multitask learners. Meta AI. 2019. Accessed Jan1, 2025. https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf
  • 3. Touvron H, Lavril T, Izacard G, et al.  2023. Llama: Open and efficient foundation language models. arXiv, arXiv:2302.13971, preprint: not peer reviewed.
  • 4. Zhou S, Xu Z, Zhang M, et al.  Large language models for disease diagnosis: a scoping review. NPJ Artif Intell. 2025;1:9. 10.1038/s44387-025-00011-z [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 5. Shickel B, Tighe PJ, Bihorac A, Rashidi P.  Deep EHR: a survey of recent advances in deep learning techniques for electronic health record (EHR) analysis. IEEE J Biomed Health Inform. 2018;22:1589-1604. 10.1109/JBHI.20172767063 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6. Zhan Z, Zhang R. Towards better multi-task learning: a framework for optimizing dataset combinations in large language models. In: Chiruzzo L, Ritter A, Wang L, eds. In: Findings of the Association for Computational Linguistics: NAACL.  2025;5373-5386. Association for Computational Linguistics.
  • 7. Li M, Zhan Z, Yang H, Xiao Y, Huang J, Zhang R. 2024. Benchmarking retrieval-augmented large language models in biomedical NLP: application, robustness, and self-awareness. arXiv, arXiv:2405.08151, preprint: not peer reviewed.
  • 8. Wu J, Wu X, Qiu Z, et al.  Large language models leverage external knowledge to extend clinical insight beyond language boundaries. J Am Med Inform Assoc. 2024;31:2054-2064. 10.1093/jamia/ocae079. https://academic.oup.com/jamia/article-pdf/31/9/2054/58868121/ocae079.pdf [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Cesario E, Comito C, Zumpano E.  A survey of the recent trends in deep learning for literature based discovery in the biomedical domain. Neurocomputing. 2024;568:127079. 10.1016/j.neucom.2023.127079 [DOI] [Google Scholar]
  • 10. Yang X, Huang K, Yang D, Zhao W, Zhou X.  Biomedical big data technologies, applications, and challenges for precision medicine: a review. Glob Chall. 2024;8:2300163. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11. Beltagy I, Lo K, Cohan A.  SciBERT: a pretrained language model for scientific text. In: Inui K, Jiang J, Ng V, Wan X, eds. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). Association for Computational Linguistics. 2019:3615-3620. 10.18653/v1/D19-1371 [DOI] [Google Scholar]
  • 12. Mitchell E, et al.  Enhancing self-consistency and performance of pre-trained language models through natural language inference. In: Goldberg Y, Kozareva Z, Zhang Y, eds. Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. 2022:1754-1768. 10.18653/v1/2022.emnlp-main.115 [DOI] [Google Scholar]
  • 13. Hong T,Kim D, Ji M, Hwang W, Nam D, Park S. BROS: a pre-trained language model focusing on text and layout for better key information extraction from documents. Proc AAAI Conf Artif Intell  2022;36:10767-10775. [Google Scholar]
  • 14. Fan Y, He L, Pakhomov SV, Melton GB, Zhang R.  Classifying supplement use status in clinical notes. AMIA Jt Summits Transl Sci Proc. 2017;2017:493-501. [PMC free article] [PubMed] [Google Scholar]
  • 15. Fan Y, Zhang R.  Using natural language processing methods to classify use status of dietary supplements in clinical notes. BMC Med Inform Decision Making. 2018;18:15-22. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16. Jonnagaddala J, Wong ZS-Y.  Privacy preserving strategies for electronic health records in the era of large language models. NPJ Digit Med. 2025;8:34. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17. Spasic I, Nenadic G.  Clinical text data in machine learning: systematic review. JMIR Med Inform. 2020;8:e17984. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 18. Chapman WW, et al. Overcoming barriers to NLP for clinical text: the role of shared tasks and the need for additional creative solutions. Journal of the American Medical Informatics Association  2011;18:540–543. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19. Ullah E, Parwani A, Baig MM, Singh R.  Challenges and barriers of using large language models (LLM) such as ChatGPT for diagnostic medicine with a focus on digital pathology—a recent scoping review. Diagn Pathol. 2024;19:43. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20. Chen X, et al. RareBench: can LLMs serve as rare diseases specialists? In: Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2024:4850-4861. Association for Computing Machinery.
  • 21. Gangwal A, Ansari A, Ahmad I, Azad AK, Sulaiman WMAW.  Current strategies to address data scarcity in artificial intelligence-based drug discovery: a comprehensive review. Comput Biol Med. 2024;179:108734. [DOI] [PubMed] [Google Scholar]
  • 22. Upadhyay AK, Bhandari AK.  Advances in deep learning models for resolving medical image segmentation data scarcity problem: a topical review. Arch Computat Methods Eng. 2024;31:1701-1719. [Google Scholar]
  • 23. Jin H, Han X, Yang J, et al.  2024. LLM maybe LongLM: self-extend LLM context window without tuning. Proceedings of Machine Learning Research. 2024;235:22099-22114.
  • 24. Dong Q, Li L, Dai D, et al.  A survey on in-context learning. In: Al-Onaizan Y, Bansal M, Chen Y-N, eds. Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics; 2024:1107-1128. 10.18653/v1/2024.emnlp-main.64 [DOI] [Google Scholar]
  • 25. Zhang Y, Feng S, Tan C.  Active example selection for in-context learning. In: Goldberg Y, Kozareva Z, Zhang Y, eds. Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics. 2022:9134-9148. 10.18653/v1/2022.emnlp-main.622 [DOI] [Google Scholar]
  • 26. Liu P, et al.  Pre-train, prompt, and predict: a systematic survey of prompting methods in natural language processing. ACM Comput Surv. 2023;55:1-35. [Google Scholar]
  • 27. Wu Z, Wang Y, Ye J, Kong L.  Self-adaptive in-context learning: an information compression perspective for in-context example selection and ordering. In: Rogers A, Boyd-Graber J, Okazaki N, eds. Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics. 2023:1423-1436. 10.18653/v1/2023.acl-long.79 [DOI] [Google Scholar]
  • 28. Liu J, et al.  What makes good in-context examples for GPT-3? In: Agirre E, Apidianaki M, Vulic I, eds. Proceedings of Deep Learning Inside Out (DeeLIO 2022): The 3rd Workshop on Knowledge Extraction and Integration for Deep Learning Architectures. Association for Computational Linguistics. 2022:100-114. 10.18653/v1/2022.deelio-1.10 [DOI] [Google Scholar]
  • 29. Xiong Z, Cai Z, Copper J, et al.  2024. Everything everywhere all at once: LLMs can in-context learn multiple tasks in superposition. arXiv, arXiv:2410.05603, preprint: not peer reviewed.
  • 30. Mavromatis C, Srinivasan B, Shen Z, et al.  2023. Which examples to annotate for in-context learning? Towards effective and efficient selection. arXiv, arXiv:2310.20046, preprint: not peer reviewed.
  • 31. Kumari L, Wang S, Das A, Zhou T, Bilmes J. An end-to-end submodular framework for data-efficient in-context learning. In: Findings of the Association for Computational Linguistics: NAACL 2024. 2024:3293-3308. Association for Computational Linguistics.
  • 32. Li X, Qiu X. Finding support examples for in-context learning. In Findings of the Association for Computational Linguistics: EMNLP 2023; 6219–6235, Singapore. Association for Computational Linguistics.
  • 33. Fan W, Ding Y, Ning L, et al. A survey on RAG meeting LLMs: Towards retrieval-augmented large language models. In: Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining.  2024:6491-6501. Association for Computing Machinery.
  • 34. Lewis P, Perez E, Piktus A, et al.  Retrieval-augmented generation for knowledge-intensive NLP tasks. In: Larochelle H, Ranzato M, Hadsell R, Balcan M, Lin H, eds. Advances in Neural Information Processing Systems. Curran Associates, Inc.; 2020;33:9459-9474. [Google Scholar]
  • 35. Yu H, et al. Evaluation of retrieval-augmented generation: a survey. In: Zhu W, Xiong H, Cheng X, Cui L, Dou Z, Dong J, Pang S, Wang L, Kong L, Chen Z, eds. In: CCF Conference on Big Data. Springer; 2024:102-120.
  • 36. Zhan Z, Zhou S, Li M, Zhang R.  RAMIE: retrieval-augmented multi-task information extraction with large language models on dietary supplements. J Am Med Inform Assoc  2025;32:545-554. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37. Touvron H, Martin L, Stone K, et al.  2023. Llama 2: open foundation and fine-tuned chat models. arXiv, arXiv:2307.09288, preprint: not peer reviewed.
  • 38. Grattafiori A, Dubey A, Jauhri A, et al.  2024. The Llama 3 herd of models. arXiv, arXiv:2407.21783, preprint: not peer reviewed.
  • 39. Izacard G, Caron M, Hosseini L, et al.  2022. Unsupervised dense information retrieval with contrastive learning. Transactions on Machine Learning Research.
  • 40. Jin Q, Kim W, Chen Q, et al.  MedCPT: contrastive pre-trained transformers with large-scale PubMed search logs for zero-shot biomedical information retrieval. Bioinformatics. 2023;39:btad651. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41. Xiao S, Liu Z, Zhang P, Muennighoff N.  2023. C-pack: packaged resources to advance general Chinese embedding. In Proceedings of the 47th international ACM SIGIR conference on research and development in information retrieval, 2024;641-649. Association for Computing Machinery.
  • 42. Smith L, Tanabe LK, Ando RJ, et al.  Overview of BioCreative II gene mention recognition. Genome Biol. 2008;9 Suppl 2:S2. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43. Segura-Bedmar I, Martínez P, Herrero-Zazo M.  SemEval-2013 task 9: extraction of drug-drug interactions from biomedical texts (DDIExtraction 2013). In: Manandhar S, Yuret D, eds. Second Joint Conference on Lexical and Computational Semantics (SEM), Volume 2: Proceedings of the Seventh International Workshop on Semantic Evaluation (SemEval 2013). Association for Computational Linguistics. 2013:341-350. [Google Scholar]
  • 44. Li M, Zhou H, Zhang R.  2024. Benchingmaking large language models in biomedical triple extraction. arXiv, arXiv:2310.18463, preprint: not peer reviewed.
  • 45. Yu B, Li Y, Wang J. Detecting causal language use in science findings. In: Inui K, Jiang J, Ng V, Wan X, eds. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). Association for Computational Linguistics; 2019:4664-4674. [Google Scholar]
  • 46. Hu EJ, Shen Y, Wallis P, et al. LoRA: low-rank adaptation of large language models. International Conference on Learning Representations (ICLR). 2022. Accessed Jan1, 2025. https://openreview.net/forum? id=nZeVKeeFYf9
  • 47. Zhan Z, Zhou S, Zhou X, et al. Retrieval-augmented in-context learning for multimodal large language models in disease classification. arXiv, arXiv:2505.02087, preprint: not peer reviewed.
  • 48. Zhan Z, Zhou S, Zhou H, et al. An evaluation of DeepSeek models in biomedical natural language processing. arXiv, arXiv:2503.00624, preprint: not peer reviewed.
  • 49. Peng L, Luo G, Zhou S, et al.  An in-depth evaluation of federated learning on biomedical natural language processing for information extraction. NPJ Digit Med. 2024;7:127. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 50. Su L, Chen J, Peng Y, Sun C. Demonstration-based learning for few-shot biomedical named entity recognition under machine reading comprehension. J Biomed Inform. 2024;159:104739. [DOI] [PubMed] [Google Scholar]
  • 51. Zaikis D, Vlahavas I.  TP-DDI: transformer-based pipeline for the extraction of drug-drug interactions. Artif Intell Med. 2021;119:102153. [DOI] [PubMed] [Google Scholar]
  • 52. Moscato V, Napolano G, Postiglione M, Sperlı G.  Multi-task learning for few-shot biomedical relation extraction. Artif Intell Rev. 2023;56:13743-13763. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

ocaf128_Supplementary_Data

Data Availability Statement

All the datasets in this paper are public. Readers could find them in the following links:

BC2GM: https://biocreative.bioinformatics.udel.edu/tasks/

Health Advice: https://huggingface.co/datasets/medalpaca/medical_meadow_health_advice

DDI: https://github.com/isegura/DDICorpus

GIT: https://github.com/ToneLi/BIoMedRAG/tree/main/dataset/0_GM-CIHT


Articles from Journal of the American Medical Informatics Association : JAMIA are provided here courtesy of Oxford University Press

RESOURCES