Large language models (LLMs) are emerging as valuable tools to support clinicians in routine decision making. This study aims to evaluate the current state of LLMs for HIV management, examining their strengths and limitations. We developed HIVMedQA, a benchmark for evaluating open-ended medical question answering in the context of HIV patient management. We assessed seven general-purpose LLMs and three medically specialized LLMs, using prompt engineering to optimize performance.
This study aims to evaluate the performance of current LLMs in the context of curbside consults for HIV care and provide actionable insights for their future development Specifically, we focus on:
To set up the two separate environments needed to run inference and scoring components of the medical_LLM_evaluation project.
transformers_llm.yml — installs dependencies required for running inference with various large language models.scispacy_env.yml — sets up scispaCy and related tools necessary for computing biomedical F1 scores and entity extraction.Run the following commands to create both Conda environments:
conda env create --file transformers_llm.yml
conda env create --file scispacy_env.yml
To install the scispacy model manually:
pip install scispacy
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.4/en_core_sci_sm-0.5.4.tar.gz
There are 3 main python files to obtain the scoring of the models answer:
get_model_answers_and_prompt_generation.py : loads a model (either from Hugging Face for open-source models or via an API) and generates responses using prompts.
Use this script in environments with GPU support. To run across multiple GPUs or nodes, utilize:
Example (multi-GPU/cluster):
# For general LLMs
sbatch generate_answers.sh
# Alternative script targeting NVLM model (requires more GPU)
sbatch generate_answers-NVLM.sh
f1_score.py: obtains the different modalities of f1 score from different the 3 different sources: SNOMED CT from PyMedtermino 2, WordNet and custom GPT dictionary, and applaying lemmatization.
conda activate scispacy_env
python f1_score.py
scores.py: computes MedGPT score and averages results over iterations and questions of the same category.
conda activate transformers_llm
python scores.py
Contributions are welcome! Please open an issue or pull request. Include tests and follow best practices when extending functionality.
MIT License © [2025] [Gonzalo Cardenal Antolin] See LICENSE file for details.
20 commits
Python
56.3%
Jupyter Notebook
40.6%
Shell
3.2%
Large language models (LLMs) are emerging as valuable tools to support clinicians in routine decision making. This study aims to evaluate the current state of LLMs for HIV management, examining their strengths and limitations. We developed HIVMedQA, a benchmark for evaluating open-ended medical question answering in the context of HIV patient management. We assessed seven general-purpose LLMs and three medically specialized LLMs, using prompt engineering to optimize performance.
This study aims to evaluate the performance of current LLMs in the context of curbside consults for HIV care and provide actionable insights for their future development Specifically, we focus on:
To set up the two separate environments needed to run inference and scoring components of the medical_LLM_evaluation project.
transformers_llm.yml — installs dependencies required for running inference with various large language models.scispacy_env.yml — sets up scispaCy and related tools necessary for computing biomedical F1 scores and entity extraction.Run the following commands to create both Conda environments:
conda env create --file transformers_llm.yml
conda env create --file scispacy_env.yml
To install the scispacy model manually:
pip install scispacy
pip install https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.5.4/en_core_sci_sm-0.5.4.tar.gz
There are 3 main python files to obtain the scoring of the models answer:
get_model_answers_and_prompt_generation.py : loads a model (either from Hugging Face for open-source models or via an API) and generates responses using prompts.
Use this script in environments with GPU support. To run across multiple GPUs or nodes, utilize:
Example (multi-GPU/cluster):
# For general LLMs
sbatch generate_answers.sh
# Alternative script targeting NVLM model (requires more GPU)
sbatch generate_answers-NVLM.sh
f1_score.py: obtains the different modalities of f1 score from different the 3 different sources: SNOMED CT from PyMedtermino 2, WordNet and custom GPT dictionary, and applaying lemmatization.
conda activate scispacy_env
python f1_score.py
scores.py: computes MedGPT score and averages results over iterations and questions of the same category.
conda activate transformers_llm
python scores.py
Contributions are welcome! Please open an issue or pull request. Include tests and follow best practices when extending functionality.
MIT License © [2025] [Gonzalo Cardenal Antolin] See LICENSE file for details.
20 commits
Python
56.3%
Jupyter Notebook
40.6%
Shell
3.2%