Taken together, our study unravels a previously unappreciated CD4+ T cell-derived IL-21–BATF axis that could provide therapeutic insights to enhance effector CD8+ T cell function to fight cancer. This evidence concerns the gene CD4 and cancer.