Protein language model embeddings improve HIV drug resistance prediction: a comprehensive benchmark with attention-based interpretability
Open Access
- 3 May 2026
- journal article
- Published by Oxford University Press (OUP) in Bioinformatics
- Vol. 42 (5)
Abstract
Motivation: Accurate prediction of HIV drug resistance from viral sequences is critical for optimizing antiretroviral therapy. Traditional machine-learning approaches using binary mutation encoding achieve strong accuracy but may fail to capture epistatic interactions and structural features relevant to resistance mechanisms. Protein language models (PLMs) offer learned representations encoding evolutionary and structural information, but have not been systematically benchmarked for HIV resistance prediction across the modern antiretroviral drug set. Results: We evaluated ESM-2 (650 M parameters) with attention-weighted pooling for predicting resistance to 18 drugs across three classes (protease inhibitors, NRTIs, NNRTIs) on the Stanford HIVDB dataset (n = 6308 sequences). Attention-weighted ESM-2 embeddings significantly outperformed XGBoost baselines with binary mutation encoding (mean AUC 0.968 versus 0.955, P = .0017), with gains across 15 of 18 drugs and the largest improvements for drugs with complex resistance patterns. Attention weights showed 2.48-fold enrichment at known drug-resistance-mutation positions (P < .05 for 63% of drugs; NRTIs strongest at 4.20-fold). External validation on a 20% holdout showed minimal degradation (AUC 0.934). Benchmarking against ESM C 600M and ESM-1v confirmed performance is robust to PLM choice (mean AUC 0.942–0.946 across backbones). Performance was maintained across HIV-1 subtypes (B 0.924; B-divergent 0.900; non-B 0.884) and a temporal holdout (AUC 0.930). Availability and implementation: Source code is available at https://github.com/hayden-farquhar/HIV-ESM-2 under an MIT license and archived at https://doi.org/10.5281/zenodo.19466629. Stanford HIVDB genotype–phenotype data are publicly available at https://hivdb.stanford.edu/.Keywords
This publication has 23 references indexed in Scilit:
- Transfer learning on protein language models improves antimicrobial peptide classificationScientific Reports, 2025
- Predicting Antimicrobial Peptides Using ESMFold-Predicted Structures and ESM-2-Based Amino Acid Features with Graph Deep LearningJournal of Chemical Information and Modeling, 2024
- PLM-ARG: antibiotic resistance gene identification using a pretrained protein language modelBioinformatics, 2023
- HIV infectionNature Reviews Disease Primers, 2023
- Drug resistance mutations in HIV: new bioinformatics approaches and challengesCurrent Opinion in Virology, 2021
- Structure and Function of HIV-1 Reverse Transcriptase: Molecular Mechanisms of Polymerization and InhibitionJournal of Molecular Biology, 2009
- Genotypic predictors of human immunodeficiency virus type 1 drug resistanceProceedings of the National Academy of Sciences of the United States of America, 2006
- Rationale and Uses of a Public HIV Drug‐Resistance DatabaseThe Journal of Infectious Diseases, 2006
- Web Resources for HIV Type 1 Genotypic-Resistance Test InterpretationClinical Infectious Diseases, 2006
- The causes and consequences of HIV evolutionNature Reviews Genetics, 2004