Full text 2026

Protein language model embeddings improve HIV drug resistance prediction: a comprehensive benchmark with attention-based interpretability

Farquhar H.

Full text

Loading PDF… Expand reader Download

Abstract

<h4>Motivation</h4>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.<h4>Results</h4>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).<h4>Availability and implementation</h4>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/.