IntroductionIn recent years, immune checkpoint inhibitors (ICIs) have substantially improved the survival of cancer patients1. ICIs have been used to treat a wide spectrum of cancers, such as melanoma2, breast cancer3, and esophageal squamous4. These inhibitors boost the patient’s immune system, enabling it to effectively recognize and attack cancer cells. However, 60% to 80% of treated patients do not exhibit a favorable response to immunotherapy5. This highlights the urgent need to discover highly sensitive and specific biomarkers that can predict response prior to treatment or facilitate the development of combination therapies to overcome resistance to ICIs.Current predictive biomarkers for ICIs response, such as programmed cell death-ligand 1 (PD-L1) expression, have been clinically validated but are not sufficiently robust6,7. Due to this limitation, researchers have increasingly focused on gene sets, which have shown greater robustness and accuracy in predicting ICIs responses. For instance, a pan-cancer stemness signature has been successfully used to predict responses to immunotherapy across multiple cancer types8. Kong et al. utilized the expression levels of multiple biological pathways as biomarkers combined with a logistic regression model to predict ICIs response9. Similarly, Lapuente-Santana et al. demonstrated the strong predictive power of 14 signaling pathway activities in response to ICIs10. Nevertheless, the prediction performance remains limited, and further exploration of additional gene sets is required to enhance the prediction of ICIs responses.Hallmark gene sets from the molecular signature database (MSigDB)11 represent well-defined biological states or processes, offering valuable molecular signatures for distinguishing different conditions. Previous researches have proved the potential of Hallmark gene sets in the classification of diseases or subtypes. For example, Targonski et al. demonstrated that Hallmark gene sets possess significant potential for effectively differentiating tumor samples relative to normal tissues12. Guo et al. leveraged the activity of Hallmark gene sets to classify hepatocellular carcinoma into two distinct molecular subtypes with different prognostic outcomes13. These findings underscore the utility of Hallmark gene sets in identifying molecular signatures linked to various biological states, suggesting their potential for predicting responses to immunotherapy. However, further exploration is warranted to maximize their predictive capabilities for ICIs response.In addition, combination therapy is a promising therapeutic strategy to enhance the efficacy of ICIs. Numerous studies have investigated combining ICIs with other treatment modalities, such as chemotherapy and targeted therapies, to improve ICIs effectiveness14. For instance, the combination of pembrolizumab, a PD-1 inhibitor, with platinum-based drug has been widely approved for treating non-small-cell lung cancer (NSCLC)15. Another example is the combination of avelumab, a PD-L1 inhibitor, with the VEGF inhibitor axitinib for the treatment of advanced renal cell carcinoma16. The Library of Integrated Network-based Cellular Signatures (LINCS) L100017 provided a rich resource of small molecule-induced transcriptomes, which could help identify novel drugs or drug combinations. For example, Xia et al. used the LINCS L1000 database to predict candidate compounds to boost ICIs treatment efficacy18. Thus, predicting drugs for effective combination offers opportunities for overcoming ICIs resistance.In this study, we introduced HAPIR, a machine learning model which leverages the activity of seven refined Hallmark gene sets to predict response to ICIs. We firstly refined seven Hallmark gene sets, enriched with 400 differentially expressed (DE) genes between responders and non-responders, to construct a logistic regression model. Ten-fold cross-validation of HAPIR demonstrated the superior predictive performance with an area under the receiver operating characteristics curve (AUROC) of 0.778, outperforms well-known ICIs prediction biomarkers, such as PD-1 (0.678) and PD-L1 (0.54). Validation across multiple cohorts, including melanoma, NSCLC, and stomach adenocarcinoma (STAD), confirmed HAPIR’s robustness, with AUROCs exceeding 0.8. In comparison with other existing ICIs response biomarkers, HAPIR showed higher AUROC and accuracy, surpassing those based on multiple melanoma-specific and pan-cancer markers. Furthermore, HAPIR outperformed gene-based models, including those based on 400 DE genes and 77 pathway-enriched DE genes, as well as gene set-based models using un-refined Hallmark gene sets and tumor microenvironment (TME) gene sets. HAPIR also demonstrated a significant association with patient survival, with low-predicted resistance probabilities linked to better outcomes. Additionally, it offers valuable insights into the immune microenvironment, aiding in the identification of potential therapeutic targets and drugs to overcome immunotherapy resistance. Overall, HAPIR represents a powerful tool for both predicting ICIs response and identifying new therapeutic strategies, advancing personalized cancer treatment.ResultsOverview of HAPIRHAPIR is a machine learning model used for predicting response to ICIs. The HAPIR workflow mainly consists of four parts: (1) Extracting refined Hallmark gene sets; (2) Constructing ICIs response prediction model; (3) Evaluating performance of the model; (4) Predicting potential targets and drugs. Briefly, we extracted Hallmark gene sets enriched in DE genes between responders and non-responders, and refined these gene sets by retaining only the DE genes. Then, we calculated the activity levels of the refined Hallmark gene sets using AUCell, and applied logistic regression to train a model for predicting responses to ICI therapy. Next, we performed model evaluation by internal and external validation. Finally, we identified potential targets and predicted drugs to increase sensitivity to ICI therapy (Fig. 1).Fig. 1: Schematic illustration for HAPIR to predict ICIs response.A Extracting refined Hallmark gene sets. B Constructing ICI response prediction model. C Evaluating performance of the model. D Predicting potential target and drug.Full size imageRefined Hallmark gene setsTo identify the feature genes related to ICIs immunotherapy response, we focused on Riaz et al. cohort, which contains 20 ICIs responders and 78 non-responders of melanoma. The top 200 significantly (P