Immune checkpoint inhibitors (ICIs) have been shown to be beneficial for some patients with advanced non-small cell lung cancer (NSCLC). However, the underlying mechanisms mediating the limited response to ICIs remain unclear.We performed whole-exome sequencing on 198 advanced NSCLC tumors that had been sampled prior to anti-PD-1/PD-L1 therapy. Detailed clinical characteristics were collected on these patients. We designed a new method to estimate HLA-corrected tumor mutation burden (TMB), a modification which considers the loss of heterozygosity of human leukocyte antigen (HLA-LOH) from conventional TMB. We performed external validation of our findings utilizing 89 NSCLC samples and 110 melanoma samples from two independent cohorts of immunotherapy-treated patients.Homology-dependent recombination deficiency was identified in 37 patients (18.7%) and was associated with longer progression-free survival (PFS: P = 0.049). Using the HLA-corrected TMB, non-responders to ICIs were identified, despite having a high TMB (top 25%). Ten patients (21.3% of the high TMB group) were reclassified from the high TMB group into the low TMB group. The objective response rate (ORR), PFS, and overall survival (OS) were all lower in these patients compared with those of the high TMB group (ORR: 20% versus 59%, P = 0.0363, PFS: hazard ratio = 2.91, P = 0.007, OS: hazard ratio=3.43, P = 0.004). Multivariate analyses showed that high HLA-corrected TMB was associated with a significant survival advantage (hazard ratio = 0.44, P = 0.015), whereas high conventional TMB was not associated with a survival advantage (hazard ratio = 0.63, P = 0.118). Applying this approach to the independent cohorts of 89 NSCLC patients and 110 melanoma patients, TMB-based survival prediction was significantly improved.HLA-corrected TMB can reconcile the observed disparity in relationships between TMB and ICI responses, and is of predictive and prognostic value for ICI therapies.