- Open Access
How Different are Self and Nonself?
PRX Life 4, 013027 – Published 4 March, 2026
DOI: https://doi.org/10.1103/fbct-vzwm
Abstract
Biological and artificial networks routinely make reliable distinctions between similar inputs, and the rules for making these distinctions are learned. In some ways, self/nonself discrimination in the immune system is similar, being both reliable and (partly) learned through thymic selection. In contrast to other examples, we show that the distributions of self- and nonself-peptides are nearly identical but strongly inhomogeneous. Reliable discrimination is possible only because self-peptides are a particular finite sample drawn from this distribution, and T cells can target the “spaces” between these samples. In conventional learning problems, this would constitute memorization or overfitting and lead to disaster. Here, the strong inhomogeneities imply instead that the immune system gains by targeting peptides that are similar to self, with maximum sensitivity for sequences just one or two substitutions away. This model of the structure of the underlying distribution in sequence space predicts, for example, the observed ability of the immune system to respond to mutation-derived cancer neoantigens.
Physics Subject Headings (PhySH)
Article Text
References (81)
- T. N. Schumacher and R. D. Schreiber, Neoantigens in cancer immunotherapy, Science 348, 69 (2015).
- W. Yu et al., Clonal deletion prunes but does not eliminate self-specific CD8+ T lymphocytes, Immunity 42, 929 (2015).
- M. Łuksza et al., A neoantigen fitness model predicts tumour response to checkpoint blockade immunotherapy, Nature (London) 551, 517 (2017).
- H. Matsushita et al., Cancer exome analysis reveals a T-cell-dependent mechanism of cancer immunoediting, Nature (London) 482, 400 (2012).
- A. Ribas and J. D. Wolchok, Cancer immunotherapy using checkpoint blockade, Science 359, 1350 (2018).
- D. K. Wells et al., Key parameters of tumor epitope immunogenicity revealed through a consortium approach improve neoantigen prediction, Cell 183, 818 (2020).
- M. Łuksza et al., Neoantigen quality predicts immunoediting in survivors of pancreatic cancer, Nature (London) 606, 389 (2022).
- L. A. Rojas et al., Personalized RNA neoantigen vaccines stimulate T cells in pancreatic cancer, Nature (London) 618, 144 (2023).
- P. Mehta et al., A high-bias, low-variance introduction to machine learning for physicists, Phys. Rep. 810, 1 (2019).
- G. Carleo, I. Cirac, K. Cranmer, L. Daudet, M. Schuld, N. Tishby, L. Vogt-Maranto, and L. Zdeborova, Machine learning and the physical sciences, Rev. Mod. Phys. 91, 045002 (2019).
- T. C. Butler, M. Kardar, and A. K. Chakraborty, Quorum sensing allows T cells to discriminate between self and nonself, Proc. Natl. Acad. Sci. USA 110, 11833 (2013).
- F. P. Legoux et al., CD4+ T cell tolerance to tissue-restricted self antigens is mediated by antigen-specific regulatory T cells rather than deletion, Immunity 43, 896 (2015).
- M. M. Davis, Not-so-negative selection, Immunity 43, 833 (2015).
- I. M. N. Wortel, C. Kesmir, R. J. De Boer, J. N. Mandl, and J. Textor, Is T cell negative selection a learning algorithm? Cells 9, 690 (2020).
- E. T. Jaynes, Information theory and statistical mechanics, Phys. Rev. 106, 620 (1957).
- A. Berger, S. A. Della Pietra, and V. J. Della Pietra, A maximum entropy approach to natural language processing, Comput. Linguist. 22, 39 (1996).
- A. Radford et al., Language models are unsupervised multitask learners, OpenAI blog 1, 9 (2019).
- A. Madani et al., Large language models generate functional protein sequences across diverse families, Nat. Biotechnol. 41, 1099 (2023).
- Y. Nagano et al., Contrastive learning of T cell receptor representations, Cell Syst. 16, 101165 (2025).
- E. Schneidman, M. J. Berry, R. Segev, and W. Bialek, Weak pairwise correlations imply strongly correlated network states in a neural population, Nature (London) 440, 1007 (2006).
- O. Moaz, G. Tkačik, M. Esteki, R. Kiani, and E. Schneidman, Learning probabilistic neural representations with randomly connected circuits, Proc. Natl. Acad. Sci. USA 117, 25066 (2020).
- L. Meshulam, J. L. Gauthier, C. D. Brody, D. W. Tank, and W. Bialek, Successes and failures of simplified models for a network of real neurons, arXiv:2112.14735.
- L. Meshulam and W. Bialek, Statistical mechanics for networks of real neurons, Rev. Mod. Phys. 97, 045002 (2025).
- A. Lapedes, B. Giraud, L. Liu, and G. Stormo, A maximum entropy formalism for disentangling chains of correlated sequence positions, Proc. IMS 236 (1998).
- W. Bialek and R. Ranganathan, Rediscovering the power of pairwise interactions, arXiv:0712.4397.
- M. Weigt, R. A. White, H. Szurmant, J. A. Hoch, and T. Hwa, Identification of direct residue contacts in protein–protein interaction by message passing, Proc. Natl. Acad. Sci. USA 106, 67 (2009).
- S. Cocco, C. Feinauer, M. Figliuzzi, R. Monasson, and M. Weigt, Inverse statistical physics of protein sequences: A key issues review, Rep. Prog. Phys. 81, 032601 (2018).
- D. Marks et al., Protein 3D structure computed from evolutionary sequence variation, PLoS ONE 6, e28766 (2011).
- W. Bialek et al., Statistical mechanics for natural flocks of birds, Proc. Natl. Acad. Sci. USA 109, 4786 (2012).
- J. Lehmann, A. Libchaber, and B. D. Greenbaum, Fundamental amino acid mass distributions and entropy costs in proteomes, J. Theor. Biol. 410, 119 (2016).
- D. H. Ackley, G. E. Hinton, and J. Sejnowski, A learning algorithm for Boltzmann machines, Cognitive Sciene 9, 147 (1985).
- J. Marchi et al., Size and structure of the sequence space of repeat proteins, PLoS Comput. Biol. 15, e1007282 (2019).
- D. Hoyos et al., Fundamental immune–oncogenicity trade-offs define driver mutation fitness, Nature (London) 606, 172 (2022).
- T. M. Cover, Elements of Information Theory (John Wiley & Sons, New York, NY, 1999).
- W. L. Hamilton et al., Extreme mutation bias and high AT content in Plasmodium falciparum, Nucleic Acids Res. 45, 1889 (2017).
- C. Maguire et al., Molecular mimicry as a mechanism of viral immune evasion and autoimmunity, Nat. Commun. 15, 9403 (2024).
- J. J. Calis et al., Properties of MHC class I presented peptides that enhance immunogenicity, PLoS Comput. Biol. 9, e1003266 (2013).
- M. Yarmarkovich, J. M. Warrington, A. Farrel, and J. M. Maris, Identification of SARS-CoV-2 vaccine epitopes predicted to induce long-term population-scale immunity, Cell Rep. Med. 1, 100036 (2020).
- S. K. Mohanty, S. K. Mohanty, and K. S. Leela, Textbook of Immunology (J&P Medical Ltd., Vienna, 2013).
- H. B. Barlow et al., Possible principles underlying the transformation of sensory messages, Sens. Commun. 1, 217 (2012).
- W. Bialek, Thinking about the brain, in Physics of Bio-molecules and Cells. Physique Des Biomolécules et Des Cellules, edited by F. Flyvbjerg, F. Jülicher, P. Ormos, and F. David (Springer, Berlin, Heidelberg, 2002), pp. 485–578.
- R. Vita et al., The immune epitope database (IEDB): 2018 update, Nucleic Acids Res. 47, D339 (2019).
- F. Prugnolle et al., Pathogen-driven selection and worldwide HLA class I diversity, Curr. Biol. 15, 1022 (2005).
- C. C. Brown and A. Y. Rudensky, Spatiotemporal regulation of peripheral T cell tolerance, Science 380, 472 (2023).
- Y. K. Kohanim, A. Tendler, A. Mayo, N. Friedman, and U. Alon, Endocrine autoimmune disease as a fragility of immune surveillance against hypersecreting mutants, Immunity 52, 872 (2020).
- J.-B. Lalanne and P. François, Chemodetection in fluctuating environments: Receptor coupling, buffering, and antagonism, Proc. Natl. Acad. Sci. USA 112, 1898 (2015).
- P. François and G. Altan-Bonnet, The case for absolute ligand discrimination: Modeling information processing and decision by immune T cells, J. Stat. Phys. 162, 1130 (2016).
- Q. Huang, D. Szklarczyk, M. Wang, M. Simonovic, and C. von Mering, Paxdb 5.0: Curated protein quantification data suggests adaptive proteome changes in yeasts, Mol. Cell. Proteomics 22, 100640 (2023).
- J. T. George, D. A. Kessler, and H. Levine, Effects of thymic selection on T cell recognition of foreign and tumor antigenic peptides, Proc. Natl. Acad. Sci. USA 114, E7875 (2017).
- N. Vrisekoop, J. P. Monteiro, J. N. Mandl, and R. N. Germain, Revisiting thymic positive selection and the mature T cell repertoire for antigen, Immunity 41, 181 (2014).
- B. Koncz et al., Self-mediated positive selection of T cells sets an obstacle to the recognition of nonself, Proc. Natl. Acad. Sci. USA 118, e2100542118 (2021).
- C. P. Ratliff, B. G. Borghuis, Y.-H. Kao, P. Sterling, and V. Balasubramanian, Retina is structured to process an excess of darkness in natural scenes, Proc. Natl. Acad. Sci. USA 107, 17368 (2010).
- M. Polonsky et al., Induction of CD4 T cell memory by local cellular collectivity, Science 360, eaaj1853 (2018).
- H. W. Kessels et al., The impact of self-tolerance on the polyclonal CD8+ T cell repertoire, J. Immunol. 172, 2324 (2004).
- B. D. Greenbaum, S. Cocco, A. J. Levine, and R. Monasson, Quantitative theory of entropic forces acting on constrained nucleotide sequences applied to viruses, Proc. Natl. Acad. Sci. USA 111, 5054 (2014).
- P. Šulc et al., Repeats mimic pathogen-associated patterns across a vast evolutionary landscape, Cell Genomics 5, 101011 (2025).
- J. D. Farmer, N. H. Packard, and A. S. Perelson, The immune system, adaptation, and machine learning, Physica D 22, 187 (1986).
- A. Mayer, V. Balasubramanian, T. Mora, and A. M. Walczak, How a well-adapted immune system is organized, Proc. Natl. Acad. Sci. USA 112, 5950 (2015).
- A. Mayer, V. Balasubramanian, A. M. Walczak, and T. Mora, How a well-adapting immune system remembers, Proc. Natl. Acad. Sci. USA 116, 8815 (2019).
- H. W. Lin and M. Tegmark, Criticality in formal languages and statistical physics, Entropy 19, 299 (2017).
- https://github.com/jonlevi/self_not_self.
- https://github.com/andim/peptidome.
- The Uniprot-Consortium, UniProt: The universal protein knowledgebase in 2021, Nucleic Acids Res. 49, D480 (2021).
- G. Schwarz, Estimating the dimension of a model, Ann. Stat. 6, 461 (1978).
- M. Stone, Comments on model selection criteria of Akaike and Schwarz, J. R. Stat. Soc. B 41, 276 (1979).
- https://scikit-learn.org/stable/modules/generated/sklearn.manifold.MDS.html#sklearn.manifold.MDS.
- https://github.com/jonlevi/self_not_self?tab=readme-ov-file#downloading-the-data.
- N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller, and E. Teller, Equation of state calculations by fast computing machines, J. Chem. Phys. 21, 1087 (1953).
- W. K. Hastings, Monte Carlo sampling methods using Markov chains and their applications, Biometrika 57, 97 (1970).
- E. H. Simpson, Measurement of diversity, Nature (London) 163, 688 (1949).
- P. R. Hunter and M. A. Gaston, Numerical index of the discriminatory ability of typing systems: An application of Simpson's index of diversity, J. Clin. Microbiol. 26, 2465 (1988).
- F. F. Gonzalez-Galarza et al., Allele frequency net database (AFND) 2020 update: Gold-standard data classification, open access genotype data and new query tools, Nucleic Acids Res. 48, D783 (2019).
- L. Gragert, A. Madbouly, J. Freeman, and M. Maiers, Six-locus high resolution HLA haplotype frequencies derived from mixed-resolution DNA typing for the entire US donor registry, Human Immunology 74, 1313 (2013).
- M. Andreatta and M. Nielsen, Gapped sequence alignment using artificial neural networks: Application to the MHC class I system, Bioinformatics 32, 511 (2016).
- T. Chotisorayuth and A. Tiffeau-Mayer, Lightning-fast adaptive immune receptor similarity search by symmetric deletion lookup, arXiv:2403.09010.
- https://github.com/andim/pyrepseq.
- http://www.iedb.org/downloader.php?file_name=doc/tcell_full_v3.zip.
- A. Bonertz et al., Antigen-specific Tregs control T cell responses against a limited repertoire of tumor antigens in patients with colorectal carcinoma, J. Clin. Invest. 119, 3311 (2009).
- https://pax-db.org/dataset/5833/3599693021/.
- https://pax-db.org/downloads/5.0/paxdb-uniprot-links-v5.0.zip.
- https://github.com/LukszaLab/NeoantigenEditing.