A Weighted Voting Approach for Traditional Chinese Medicine Formula Classification Using Large Language Models: Algorithm Development and Validation Study
- PMID: 40705933
- PMCID: PMC12292024
- DOI: 10.2196/69286
A Weighted Voting Approach for Traditional Chinese Medicine Formula Classification Using Large Language Models: Algorithm Development and Validation Study
Abstract
Background: Several clinical cases and experiments have demonstrated the effectiveness of traditional Chinese medicine (TCM) formulas in treating and preventing diseases. These formulas contain critical information about their ingredients, efficacy, and indications. Classifying TCM formulas based on this information can effectively standardize TCM formulas management, support clinical and research applications, and promote the modernization and scientific use of TCM. To further advance this task, TCM formulas can be classified using various approaches, including manual classification, machine learning, and deep learning. Additionally, large language models (LLMs) are gaining prominence in the biomedical field. Integrating LLMs into TCM research could significantly enhance and accelerate the discovery of TCM knowledge by leveraging their advanced linguistic understanding and contextual reasoning capabilities.
Objective: The objective of this study is to evaluate the performance of different LLMs in the TCM formula classification task. Additionally, by employing ensemble learning with multiple fine-tuned LLMs, this study aims to enhance classification accuracy.
Methods: The data for the TCM formula were manually refined and cleaned. We selected 10 LLMs that support Chinese for fine-tuning. We then employed an ensemble learning approach that combined the predictions of multiple models using both hard and weighted voting, with weights determined by the average accuracy of each model. Finally, we selected the top 5 most effective models from each series of LLMs for weighted voting (top 5) and the top 3 most accurate models of 10 for weighted voting (top 3).
Results: A total of 2441 TCM formulas were curated manually from multiple sources, including the Coding Rules for Chinese Medicinal Formulas and Their Codes, the Chinese National Medical Insurance Catalog for proprietary Chinese medicines, textbooks of TCM formulas, and TCM literature. The dataset was divided into a training set of 1999 TCM formulas and test set of 442 TCM formulas. The testing results showed that Qwen-14B achieved the highest accuracy of 75.32% among the single models. The accuracy rates for hard voting, weighted voting, weighted voting (top 5), and weighted voting (top 3) were 75.79%, 76.47%, 75.57%, and 77.15%, respectively.
Conclusions: This study aims to explore the effectiveness of LLMs in the TCM formula classification task. To this end, we propose an ensemble learning method that integrates multiple fine-tuned LLMs through a voting mechanism. This method not only improves classification accuracy but also enhances the existing classification system for classifying the efficacy of TCM formula.
Keywords: TCM formula classification; algorithm development; ensemble learning; large language models; traditional Chinese medicine.
© Zhe Wang, Keqian Li, Suyuan Peng, Lihong Liu, Xiaolin Yang, Keyu Yao, Heinrich Herre, Yan Zhu. Originally published in JMIR Medical Informatics (https://medinform.jmir.org).
Conflict of interest statement
Figures




Similar articles
-
Evaluating and Improving Syndrome Differentiation Thinking Ability in Large Language Models: Method Development Study.JMIR Med Inform. 2025 Jun 20;13:e75103. doi: 10.2196/75103. JMIR Med Inform. 2025. PMID: 40540614 Free PMC article.
-
Oral traditional Chinese medication for adhesive small bowel obstruction.Cochrane Database Syst Rev. 2012 May 16;2012(5):CD008836. doi: 10.1002/14651858.CD008836.pub2. Cochrane Database Syst Rev. 2012. PMID: 22592734 Free PMC article.
-
Use of Large Language Models to Classify Epidemiological Characteristics in Synthetic and Real-World Social Media Posts About Conjunctivitis Outbreaks: Infodemiology Study.J Med Internet Res. 2025 Jul 2;27:e65226. doi: 10.2196/65226. J Med Internet Res. 2025. PMID: 40601927 Free PMC article.
-
Interventions to improve safe and effective medicines use by consumers: an overview of systematic reviews.Cochrane Database Syst Rev. 2014 Apr 29;2014(4):CD007768. doi: 10.1002/14651858.CD007768.pub3. Cochrane Database Syst Rev. 2014. PMID: 24777444 Free PMC article.
-
Enhancing Pulmonary Disease Prediction Using Large Language Models With Feature Summarization and Hybrid Retrieval-Augmented Generation: Multicenter Methodological Study Based on Radiology Report.J Med Internet Res. 2025 Jun 11;27:e72638. doi: 10.2196/72638. J Med Internet Res. 2025. PMID: 40499132 Free PMC article.
References
-
- Deng Z. Formulary Version 1. China Press of Chinese Medicine; 2017.
Publication types
MeSH terms
Substances
LinkOut - more resources
Full Text Sources