With a matched cohort of NSCLC samples from PWH and from people without HIV (PWOH), we used imaging mass cytometry, a linear mixed-effects model, and an artificial intelligence–based (AI-based) PageRank mathematical algorithm based on spectral graph theory to demonstrate that HIV-associated tumors have differential distribution of tumor-infiltrating CD8+ and CD4+ T cells, enriched for the expression of programmed cell death 1 (PD-1) and lymphocyte-activating gene 3 (LAG3), as well as activation and proliferation markers. The gene discussed is CD4; the disease is non-small cell lung carcinoma.