Open-source solution for evaluation and benchmarking of large language models for public health
Preprint
Abstract
Large language models (LLMs) have demonstrated remarkable capabilities in various natural language processing tasks, including text classification, information extraction, and sentiment analysis. However, most existing benchmarks are general-purpose and lack relevance for domain-specific applications such as public health. To address this gap, the objective of this study is to develop and test an open-source solution enabling intuitive, easy and rapid benchmarking of popular LLMs in public health contexts. An LLM prediction prototype was developed, supporting multiple popular LLMs. It enables users to upload datasets, apply prompts, and generate structured JSON outputs for LLM tasks. The application prototype built with R and the Shiny library facilitates automated LLM evaluation and benchmarking by computing key performance metrics for categorical and variables. We tested these prototypes on four public health use cases: stance detection towards vaccination in tweets and Facebook posts, detection of vaccine adverse reaction in BabyCenter forum posts, and extraction of epidemiological quantitative features from the World Health Organization Disease Outbreak News. Results revealed high variability in LLM performance depending on the task, dataset, and model, with no single LLM consistently outperforming others across all tasks. While larger models generally excelled, smaller models performed competitively in specific scenarios, highlighting the importance of task-specific model selection. This study contributes to the effective LLM integration in public health by providing a structured, user-friendly and scalable solution for LLM prediction, evaluation and benchmarking. Our findings underline the relevance of standardised and task-specific evaluation methods and model selection, and the use of clear and structured prompts to improve LLM performance in domain-specific use cases.Keywords
This publication has 12 references indexed in Scilit:
- Large language models for data extraction from unstructured and semi-structured electronic health records: a multiple model performance evaluationBMJ Health & Care Informatics, 2025
- Use of large language models as a scalable approach to understanding public health discoursePLOS Digital Health, 2024
- Evaluating large language models for health-related text classification tasks with public social media dataJournal of the American Medical Informatics Association, 2024
- Automated stance detection in complex topics and small languages: The challenging case of immigration in polarizing news mediaPLOS ONE, 2024
- A Review on Large Language Models: Architectures, Applications, Taxonomies, Open Issues and ChallengesIEEE Access, 2024
- Attention Is All You NeedarXiv, 2023
- Evaluating large language models for use in healthcare: A framework for translational value assessmentInformatics in Medicine Unlocked, 2023
- Moral Narratives Around the Vaccination Debate on Facebook2023
- Detecting adherence to the recommended childhood vaccination schedule from user-generated content in a US parenting forumPLOS Computational Biology, 2021
- EventEpi—A natural language processing framework for event-based surveillancePLOS Computational Biology, 2020