Large Language Models for Biomedical Article Classification
Organizations: Institute of Computer Science, Warsaw University of Technology, Nowowiejska 15/19, 00-665 Warsaw, Poland
Abstract
This work presents a systematic and in-depth investigation of the utility of large language models as text classifiers for biomedical article classification. The study uses several small and mid-size open source models, as well as selected closed source ones, and is more comprehensive than most prior work with respect to the scope of evaluated configurations: different types of prompts, output processing methods for generating both class and class probability predictions, as well as few-shot example counts and selection methods. The performance of the most successful configurations is compared to that of conventional classification algorithms. The obtained average PR AUC over 15 challenging datasets above 0.4 for zero-shot prompting and nearly 0.5 for few-shot prompting comes close to that of the naïve Bayes classifier (0.5), the random forest algorithm (0.5 with default settings or 0.55 with hyperparameter tuning) and fine-tuned transformer models (0.5). These results confirm the utility of large language models as text classifiers for non-trivial domains and provide practical recommendations of the most promising setups, including in particular using output token probabilities for class probability prediction.
Figures & tables
| Ref. | Data | Models | Prompts | Example Selection | Evaluation |
| [ 52 ] | sentiment phrases, movie reviews, news articles | GPT-3 DaVinci | zero-shot, few-shot; vanilla, CoT, CARP | random, SimCSE [ 22 ] and fine-tuned SimCSE embedding | accuracy; train-test split |
| [ 59 ] | COVID-19 tweets, economic and e-commerce texts, SMS spam detection | Llama-2-70B-Instruct, GPT-3.5 Turbo, GPT-4 | zero-shot; vanilla | - | accuracy, F1 |
| [ 11 ] | tweets and Facebook comments on US elections | FLAN-T5 XXL, Mistral-7B, Llama-3-8B, Llama-3-70B, GPT-3 Ada, GPT-3 DaVinci, GPT-4o (all except GPT-4o fine-tuned) | zero-shot and one/few-shot (one-shot for threads); varying complexity | random, with class balancing | F1; bootstrapping |
| [ 58 ] | COVID-19 tweets, economic and e-commerce texts, SMS spam detection | GPT-3.5 Turbo, GPT-4, Gemini-pro, Llama-3-8B Instruct (fine-tuned), Qwen-Chat 7B (fine-tuned), Qwen-Chat 14B, Vicuna v1.5 7B and 13B | zero-shot, few-shot; vanilla | manual | accuracy, F1, uncertainty-error rate (custom metric of LLM’s refusals to answer); train-test split |
| [ 21 ] | tweets, news articles, movie reviews, Wikipedia comments, medical abstracts, legislation documents, safeguarding reports | Llama-1-7B, Llama-2-7B, Flan-T5 780M, GPT-3.5 Turbo | zero-shot, few-shot with one example per class; varying scope of task/domain description | random, with class balancing | F1; train-test split |
| [ 26 ] | healthcare-related tweets | GPT-3.5, GPT-4 | zero-shot; vanilla | - | precision, recall, F1; k-CV |
| Topic | # of samples | Positive class % | Avg. # of words in sample |
| ACEInhibitors | |||
| ADHD | |||
| Antihistamines | |||
| AtypicalAntipsychotics | |||
| BetaBlockers | |||
| CalciumChannelBlockers |
| Prompt | Complexity | System message | User message |
| A | simple | question about task | only article abstract |
| B | simple | expected model role | question about task article abstract |
| C | medium | expected model role information about task | only article abstract |
| D | medium | expected model role information about task | question about task article abstract |
| E | complex | expected model role information about task | only article abstract |
| F | complex | expected model role information about task | question about task article abstract |
| Prompt | A | B | C | D | E | F |
| ACEInhibitors | ||||||
| ADHD | ||||||
| Antihistamines | ||||||
| AtypicalAntipsychotics | ||||||
| BetaBlockers | ||||||
| CalciumChannelBlockers |
| Output | Word | JSON | Score | Token-Word | Token-JSON |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Examples | 0 | 1 | 2 | 3 | 4 |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Method | random | minilm | distroberta | mpnet | mpnet-bal |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Method | random | minilm | distroberta | mpnet | mpnet-bal |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Variant | base-zs | base-fs | chu | chu-fs | cot1 | cot2 | tot |
| ACEInhibitors | |||||||
| ADHD | |||||||
| Antihistamines | |||||||
| AtypicalAntipsychotics | |||||||
| BetaBlockers | |||||||
| CalciumChannelBlockers |
| Variant | base-zs | base-fs | chu | chu-fs | cot1 | cot2 | tot |
| ACEInhibitors | |||||||
| ADHD | |||||||
| Antihistamines | |||||||
| AtypicalAntipsychotics | |||||||
| BetaBlockers | |||||||
| CalciumChannelBlockers |
| Alg | gemm | ll-70b | ll-8b | mistr | gptmi | gptna | nb | rf-d | rf-t | debe | scid |
| Ace | |||||||||||
| Adh | |||||||||||
| Ant | |||||||||||
| Aty | |||||||||||
| Bet | |||||||||||
| Cal |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Name | Role | Message content |
|---|---|---|
| A | system | Is this an abstract of a high-quality article on {topic}? Answer yes or no. |
| user | {text} | |
| B | system | You are a helpful assistant. |
| user | Is this an abstract of a high-quality article on {topic}? Answer yes or no. ”{text}” | |
| C | system | You are an expert on medical articles classification. You are going to help classify article abstracts. The user will pass in a text and you should answer yes if it is an abstract of a high-quality article on the topic of {topic} and no otherwise. |
| user | {text} |
| Name | Role | Message content |
|---|---|---|
| B (Score) | system | You are a helpful assistant. |
| user | Is this an abstract of a high-quality article on {topic}? Rank the article on a scale from 0 to 5, where 5 means that it is a high-quality article on {topic}. ”{text}” | |
| F (Score) | system | You are an AI assistant and you are very good at text classification. You are going to help classify medical article abstracts. You will be given an abstract of an article considered for inclusion in a review of scientific articles on the topic of {topic}. |
| user | Should the article the following abstract describes be included in the review on {topic}? ”{text}” Rank the article on a scale from 0 to 5, where 0 means ”should not be included” and 5 means ”should definitely be included”. | |
| B (JSON) | system | You are a helpful assistant. |
| user | Is this an abstract of a high-quality article on {topic}? Answer in JSON format: {”high_quality”: false} or {”high_quality”: true}. ”{text}” |
| Name | Role | Message content |
|---|---|---|
| B (few-shot) | system | You are a helpful assistant. |
| user | Is this an abstract of a high-quality article on {topic}? Answer yes or no. ”{example_text}” | |
| assistant | {example_answer} | |
| user | Is this an abstract of a high-quality article on {topic}? Answer yes or no. ”{text}” |
| Name | Role | Message content |
|---|---|---|
| CoT (1 call) | system | You are an AI assistant and you are very good at text classification. You are going to help classify medical article abstracts. You will be given an abstract of an article considered for inclusion in a review of scientific articles on the topic of {topic}. |
| user | Should the article the following abstract describes be included in the review on {topic}? ”{text}” Answer in JSON format: {”included”: false} or {”included”: true}. | |
| assistant | Let’s think step by step. | |
| CoT (2 calls) Model | system | You are an AI assistant and you are very good at text classification. You are going to help classify medical article abstracts. You will be given an abstract of an article considered for inclusion in a review of scientific articles on the topic of {topic}. |
| user | From this abstract, extract phrases that could point towards the article containing high quality evidence or a lack thereof. ”{text}” Give your answer as a JSON list. | |
| assistant | [” |
| Output | Word | JSON | Score | Token-Word | Token-JSON |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Examples | 0 | 1 | 2 | 3 | 4 |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Method | random | minilm | distroberta | mpnet | mpnet-bal |
| ACEInhibitors | |||||
| ADHD | |||||
| Antihistamines | |||||
| AtypicalAntipsychotics | |||||
| BetaBlockers | |||||
| CalciumChannelBlockers |
| Alg | gemm | ll-70b | ll-8b | mistr | gptmi | gptna | nb | rf-d | rf-t | debe | scid |
| Ace | |||||||||||
| Adh | |||||||||||
| Ant | |||||||||||
| Aty | |||||||||||
| Bet | |||||||||||
| Cal |
| Prompt | Model | Accuracy | Recall | Precision | F1 Score | MCC |
| A | Gemma 2 9B | |||||
| Llama 3.1 70B | ||||||
| Llama 3.1 8B | ||||||
| Mistral 7B | ||||||
| Average | ||||||
| B | Gemma 2 9B |
| Prompt | Output | Model | Acc | Rec | Prec | F1 | MCC | AUPRC |
| B | Word | Gemma 9B | ||||||
| Llama 70B | ||||||||
| Llama 8B | ||||||||
| Mistral 7B | ||||||||
| Average | ||||||||
| B | JSON | Gemma 9B |
| Examples | Model | Acc | Rec | Prec | F1 | MCC | AUPRC |
| 0 | Gemma 2 9B | ||||||
| Llama 3.1 70B | |||||||
| Llama 3.1 8B | |||||||
| Mistral 7B | |||||||
| Average | |||||||
| 1 | Gemma 2 9B |
| Method | Model | Acc | Rec | Prec | F1 | MCC | AUPRC |
| random | Gemma 2 9B | ||||||
| Llama 3.1 70B | |||||||
| Llama 3.1 8B | |||||||
| Mistral 7B | |||||||
| Average | |||||||
| minilm | Gemma 2 9B |
| Variant | Model | Acc | Rec | Prec | F1 | MCC | AUPRC |
| base-zs | Gemma 2 9B | ||||||
| Llama 3.1 70B | |||||||
| Llama 3.1 8B | |||||||
| Mistral 7B | |||||||
| Average | |||||||
| base-fs | Gemma 2 9B |
| Algorithm | Accuracy | Recall | Precision | F1 Score | MCC | AUPRC |
| gemm | ||||||
| ll-70b | ||||||
| ll-8b | ||||||
| mistr | ||||||
| gptmi | ||||||
| gptna |