An immune fitness model for tumours under checkpoint blockade immunotherapy is proposed, through which the authors show that the presentation and recognition properties of dominant neoantigens distributed over tumour subclones are predictive of response in melanoma and lung cancer cohorts. Response to immune checkpoint blockade is likely to depend on tumour-intrinsic and microenvironmental factors, and to be evolutionarily shaped by immune interactions. Marta Łuksza et al. use mathematical tumour fitness models adapted from infectious disease models as a framework for tumour-immune interactions. When applied to human melanoma and non-small-cell lung cancer data, the model can recreate the evolutionary dynamics of cancer cells under immune checkpoint blockade. Checkpoint blockade immunotherapies enable the host immune system to recognize and destroy tumour cells1. Their clinical activity has been correlated with activated T-cell recognition of neoantigens, which are tumour-specific, mutated peptides presented on the surface of cancer cells2,3. Here we present a fitness model for tumours based on immune interactions of neoantigens that predicts response to immunotherapy. Two main factors determine neoantigen fitness: the likelihood of neoantigen presentation by the major histocompatibility complex (MHC) and subsequent recognition by T cells. We estimate these components using the relative MHC binding affinity of each neoantigen to its wild type and a nonlinear dependence on sequence similarity of neoantigens to known antigens. To describe the evolution of a heterogeneous tumour, we evaluate its fitness as a weighted effect of dominant neoantigens in the subclones of the tumour. Our model predicts survival in anti-CTLA-4-treated patients with melanoma4,5 and anti-PD-1-treated patients with lung cancer6. Importantly, low-fitness neoantigens identified by our method may be leveraged for developing novel immunotherapies. By using an immune fitness model to study immunotherapy, we reveal broad similarities between the evolution of tumours and rapidly evolving pathogens7,8,9.