EUVIMEDAvasta EUVIMED
Open access

An Empirical Evaluation of Prompting Strategies for Large Language Models in Zero-Shot Clinical Natural Language Processing: Algorithm Development and Validation Study

Sonish Sivarajkumar iD, Mark Kelley iD, Alyssa Samolyk-Mazzanti iD, Shyam Visweswaran iD, Yanshan Wang iD

JMIR Medical Informatics · 2024-04-08 · 12 · e55318

DOI: 10.2196/55318 ↗

At a glance

Journal article in JMIR Medical Informatics, published online on 2024-04-08. Written by Sonish Sivarajkumar and 4 co-authors. Institution: Intelligent Systems Program, University of Pittsburgh, Pittsburgh, PA, United States. Cited 240 times so far (Crossref); 36 references. The full text is freely available in PubMed Central. Funded by: NLM NIH HHS, NCATS NIH HHS.

AbstraktSubjectsBibliograafilised andmedCiteRelated studies

Abstract (original language)

Background

Large language models (LLMs) have shown remarkable capabilities in natural language processing (NLP), especially in domains where labeled data are scarce or expensive, such as the clinical domain. However, to unlock the clinical knowledge hidden in these LLMs, we need to design effective prompts that can guide them to perform specific clinical NLP tasks without any task-specific training data. This is known as in-context learning, which is an art and science that requires understanding the strengths and weaknesses of different LLMs and prompt engineering approaches.

Objective

The objective of this study is to assess the effectiveness of various prompt engineering techniques, including 2 newly introduced types—heuristic and ensemble prompts, for zero-shot and few-shot clinical information extraction using pretrained language models.

Methods

This comprehensive experimental study evaluated different prompt types (simple prefix, simple cloze, chain of thought, anticipatory, heuristic, and ensemble) across 5 clinical NLP tasks: clinical sense disambiguation, biomedical evidence extraction, coreference resolution, medication status extraction, and medication attribute extraction. The performance of these prompts was assessed using 3 state-of-the-art language models: GPT-3.5 (OpenAI), Gemini (Google), and LLaMA-2 (Meta). The study contrasted zero-shot with few-shot prompting and explored the effectiveness of ensemble approaches.

Results

The study revealed that task-specific prompt tailoring is vital for the high performance of LLMs for zero-shot clinical NLP. In clinical sense disambiguation, GPT-3.5 achieved an accuracy of 0.96 with heuristic prompts and 0.94 in biomedical evidence extraction. Heuristic prompts, alongside chain of thought prompts, were highly effective across tasks. Few-shot prompting improved performance in complex scenarios, and ensemble approaches capitalized on multiple prompt strengths. GPT-3.5 consistently outperformed Gemini and LLaMA-2 across tasks and prompt types.

Conclusions

This study provides a rigorous evaluation of prompt engineering methodologies and introduces innovative techniques for clinical information extraction, demonstrating the potential of in-context learning in the clinical domain. These findings offer clear guidelines for future prompt-based clinical NLP research, facilitating engagement by non-NLP experts in clinical NLP advancements. To the best of our knowledge, this is one of the first works on the empirical evaluation of different prompt engineering approaches for clinical NLP in this era of generative artificial intelligence, and we hope that it will inspire and inform future research in this area.

Subjects

Author keywords

BARDGPTGeminiLLMLLMsLLaMA-2NLPclinical dataclinical informationensembleevaluationextractionfew shotheuristicin-context learning

Authors and institutions

  • Intelligent Systems Program, University of Pittsburgh, Pittsburgh, PA, United States.
  • Department of Health Information Management, University of Pittsburgh, Pittsburgh, PA, United States.
  • Department of Biomedical Informatics, University of Pittsburgh, Pittsburgh, PA, United States.

ORCID profiles: Sonish Sivarajkumar, Mark Kelley, Alyssa Samolyk-Mazzanti, Shyam Visweswaran, Yanshan Wang

Funding

  • NLM NIH HHS
  • NCATS NIH HHS

Cite

APA

Sivarajkumar, S., Kelley, M., Samolyk-Mazzanti, A., Visweswaran, S., & Wang, Y. (2024). An Empirical Evaluation of Prompting Strategies for Large Language Models in Zero-Shot Clinical Natural Language Processing: Algorithm Development and Validation Study. JMIR Medical Informatics, 12, e55318. https://doi.org/10.2196/55318

Vancouver

Sivarajkumar S, Kelley M, Samolyk-Mazzanti A, Visweswaran S, Wang Y. An Empirical Evaluation of Prompting Strategies for Large Language Models in Zero-Shot Clinical Natural Language Processing: Algorithm Development and Validation Study. JMIR Medical Informatics. 2024;12:e55318. doi:10.2196/55318

BibTeX
@article{Sivarajkumar2024,
  author = {Sivarajkumar, Sonish and Kelley, Mark and Samolyk-Mazzanti, Alyssa and Visweswaran, Shyam and Wang, Yanshan},
  title = {An Empirical Evaluation of Prompting Strategies for Large Language Models in Zero-Shot Clinical Natural Language Processing: Algorithm Development and Validation Study},
  journal = {JMIR Medical Informatics},
  year = {2024},
  volume = {12},
  pages = {e55318},
  doi = {10.2196/55318}
}
Start for free →