Introduction

T cells typically recognize antigens presented on members of the MHC protein family via highly diverse heterodimeric T cell receptors (TCRs) expressed at their surface (Fig. 1). These antigens are commonly short peptide fragments of eight or more residues, the presentation of which is dictated in large part by the structural preferences of the MHC allele1. Lipid, metabolite and oligosaccharide T cell antigens have also been reported2,3,4. TCRs typically engage antigen–MHC complexes via one or more of their six complementarity-determining loops (CDRs), three contributed by each chain of the TCR dimer.

Fig. 1: Structure and function of the TCR.
figure 1

a, Cartoon illustrating cancer cell antigen presentation to a naive T cell; T cell activation and expansion and effector  T cell engagement of the cancer cell. b, Antigen recognition by conventional T cells through the interaction of the αβ T cell receptor (TCR) heterodimer with peptide antigen presented by an MHC class I molecule. c, Crystal structure of the affinity-enhanced A3A TCR engaging with melanoma-associated antigen 3 (MAGE-A3)-derived peptide presented by HLA-A*01 (ref. 101) (generated with data from ref. 101 and visualized with PyMOL (see Related links)).

The pivotal role of the TCR in surveillance and response to disease, and in the development of new vaccines and therapies, has driven concerted efforts to decode the rules by which T cells recognize cognate antigen–MHC complexes. However, cost and experimental limitations have restricted the available databases to just a minute fraction of the possible sample space of TCR–antigen binding pairs (Box 1). As we discuss later, these data sets5,6,7,8 are also poorly representative of the universe of self and pathogenic epitopes and of the varied MHC contexts in which they may be presented (Fig. 2).

Fig. 2: The current landscape of known TCR–antigen pairs.
figure 2

a, Number of T cell receptors (TCRs) containing α-chains, β-chains or paired chains, showing variation in numbers according to the data set (manually curated catalogue of pathology-associated TCR sequences (McPas-TCR), VDJ database (VDJdb), Immune Epitope Database (IEDB) and multiplex identification of TCR antigen specificity (MIRA)). b, Number of TCRs per antigen species of origin, showing that the majority of all antigens reported as binding a TCR are of viral origin. c, Cumulative frequency of antigens, showing that a group of 100 antigens makes up 70% of TCR–antigen pairs. d, Number of TCRs by HLA-A type, showing that known antigens are reported in complex with only a few common HLA alleles. e, Frequency histogram showing that most antigens have only one known cognate TCR in the combined data set5,6,7,8.

The research community has therefore turned to machine learning models as a means of predicting the antigen specificity of the so-called orphan TCRs having no known experimentally validated cognate antigen. Accurate prediction of TCR–antigen specificity can be described as deriving computational solutions to two related problems: first, given a TCR of unknown antigen specificity, which antigen–MHC complexes is it most likely to bind; and second, given an antigen–MHC complex, which are the most likely cognate TCRs?

A critical requirement of models attempting to answer these questions is that they should be able to make accurate predictions for any combination of TCR and antigen–MHC complex. These should cover both ‘seen’ pairs included in the data on which the model was trained and novel or ‘unseen’ TCR–epitope pairs to which the model has not been exposed9. Impressive advances have been made for specificity inference of seen epitopes in particular disease contexts. For example, clusters of TCRs having common antigen specificity have been identified for Mycobacterium tuberculosis10 and SARS-CoV-2 (ref. 11), providing possible avenues for new vaccine and pharmaceutical development. However, as discussed later, performance for seen epitopes wanes beyond a small number of immunodominant viral epitopes and is generally poor for unseen epitopes9,12. This matters because many epitopes encountered in nature will not have an experimentally validated cognate TCR, particularly those of human or non-viral origin (Fig. 2). In the text to follow, we refer to the case for generalizable TCR–antigen specificity inference, meaning prediction of binding for both seen and unseen antigens in any MHC context.

We must also make an important distinction between the related tasks of predicting TCR specificity and antigen immunogenicity. The former, and the focus of this article, is the prediction of binding between sets of TCRs and antigen–MHC complexes. The latter can be described as predicting whether a given antigen will induce a functional T cell immune response: a complex chain of events spanning antigen expression, processing and presentation, TCR binding, T cell activation, expansion and effector differentiation. Although great strides have been made in improving prediction of antigen processing and presentation for common HLA alleles, the nature and extent to which presented peptides trigger a T cell response are yet to be elucidated13. A significant gap also remains for the prediction of T cell activation for a given peptide14,15, and the parameters that influence pathological peptide or neoantigen immunogenicity remain under intense investigation16. We believe that only by integrating knowledge of antigen presentation, TCR recognition, context-dependent activation and effector function at the cell and tissue level will we fully realize the benefits to fundamental and translational science (Box 2).

State of the art

From deepening our mechanistic understanding of disease to providing routes for accelerated development of safer, personalized vaccines and therapies, the case for constructing a complete map of TCR–antigen interactions is compelling. We now explore some of the experimental and computational progress made to date, highlighting possible explanations for why generalizable prediction of TCR binding specificity remains a daunting task.

Experimental methods

The development of recombinant antigen–MHC multimer assays17 has proved transformative in the analysis of TCR–antigen specificity, enabling researchers to track and study T cell populations under various conditions and disease settings18,19,20. Nonetheless, critical limitations remain that hamper high-throughput determination of TCR–antigen specificity. We direct the interested reader to a recent review21 for a thorough comparison of these technologies and summarize some of the principal issues subsequently.

Antigen–MHC multimers may be used to determine TCR specificity using bulk (pooled) T cell populations, or newer single-cell methods. Bulk methods are widely used and relatively inexpensive, but do not provide information on αβ TCR chain pairing or function. As a result, single chain TCR sequences predominate in public data sets (Fig. 2). However, both α-chains and β-chains contribute to antigen recognition and specificity22,23. We shall discuss the implications of this for modelling approaches later. Multimodal single-cell technologies provide insight into chain pairing and transcriptomic and phenotypic profiles at cellular resolution, but remain prohibitively expensive, return fewer TCR sequences per run than bulk experiments and show significant bias towards TCRs with high specificity24,25,26. The appropriate experimental protocol for the reduction of nonspecific multimer binding, validation of correct folding and computational improvement of signal-to-noise ratios remain active fields of debate25,26. Indeed, concerns over nonspecific binding have led recent computational studies to exclude data derived from a 10× study of four healthy donors27.

Although bulk and single-cell methods are limited to a modest number of antigen–MHC complexes per run, the advent of technologies such as lentiviral transfection assays28,29 provides scalability to up to 96 antigen–MHC complexes through library-on-library screens. However, previous knowledge of the antigen–MHC complexes of interest is still required. This precludes epitope discovery in unknown, rare, sequestered, non-canonical and/or non-protein antigens30.

The advent of synthetic peptide display libraries (Fig. 3a) permits the extension of binding analysis to hundreds of thousands of peptides per TCR30,31,32,33. Using transgenic yeast expressing synthetic peptide–MHC constructs from a library of 2 × 108 peptides, Birnbaum et al.31 dissected the binding preferences of autoreactive mouse and human TCRs, providing clues as to the mechanisms underlying autoimmune targeting in multiple sclerosis. High-throughput library screens such as these provide opportunities for improved screening of the antigen–MHC space, but limit analysis to individual TCRs and rely on TCR–MHC binding instead of function. There remains a need for high-throughput linkage of antigen specificity and T cell function, for example, through mammalian or bead display34,35,36,37.

Fig. 3: Screening and computational methods.
figure 3

a, Multiplex analysis of T cell receptor (TCR)–peptide–MHC (pMHC) antigen specificity and synthetic peptide library screens for interrogation of peptide specificity of a single TCR. b, Representation of a deep neural network for supervised prediction of TCR–antigen specificity. c, Unsupervised clustering analysis of TCR–antigen specificity showing (centre) an example clustering visualization and (right) complementarity-determining loop 3 sequence logos.

As a result of these barriers to scalability, only a minuscule fraction of the total possible sample space of TCR–antigen pairs (Box 1) has been validated experimentally. At the time of writing, fewer than 1 million unique TCR–epitope pairs are available from VDJdb, McPas-TCR, the Immune Epitope Database and the MIRA data set5,6,7,8 (Fig. 2). Just 4% of these instances contain complete chain pairing information (Fig. 2a). About 97% of all antigens reported as binding a TCR are of viral origin, and a group of just 100 antigens makes up 70% of TCR–antigen pairs (Fig. 2b,c). Where the HLA context of a given antigen is known, the training data are dominated by antigens presented by a handful of common alleles (Fig. 2d). Many antigens have only one known cognate TCR (Fig. 2e). These limitations have simultaneously provided the motivation for and the greatest barrier to computational methods for the prediction of TCR–antigen specificity.

Computational methods

A comprehensive survey of computational models for TCR specificity inference is beyond the scope intended here but can be found in the following helpful reviews15,38,39,40,41,42. Broadly speaking, current models can be divided into two categories, which we dub supervised predictive models (SPMs) (Fig. 3b) and unsupervised clustering models (UCMs) (Fig. 3c) on account of their respective use of supervised learning and unsupervised learning. A non-exhaustive summary of recent open-source SPMs and UCMs can be found in Table 1.

Table 1 A non-exhaustive list of supervised and unsupervised models for inference of TCR epitope specificity published since 2020

Supervised predictive models

SPMs are those which attempt to learn a function that will correctly predict the cognate epitope for a given input TCR of unknown specificity, given some training data set of known TCR–peptide pairs. The past 2 years have seen an acceleration of publications aiming to address this challenge with deep neural networks (DNNs). Although there are many possible approaches to comparing SPM performance, among the most consistently used is the area under the receiver-operating characteristic curve (ROC-AUC). One would expect to observe 50% ROC-AUC from a random guess in a binary (binding or non-binding) task, assuming a balanced proportion of negative and positive pairs.

Performance by this measure surpasses 80% ROC-AUC for a handful of ‘seen’ immunodominant viral epitopes presented by MHC class I9,43. However, representation is not a guarantee of performance: 60% ROC-AUC has been reported for HLA-A2*01–CMV-NLVPMVATV44, possibly owing to the recognition of this immunodominant antigen by diverse TCRs. Critically, few models explicitly evaluate the performance of trained predictors on unseen epitopes using comparable data sets. Weber et al.12 achieved an average of 62 ± 6% ROC-AUC for TITAN, compared with 50% for ImRex on a reference data set of unseen epitopes from VDJdb and COVID-19 data sets. Values of 56 ± 5% and 55 ± 3% were reported for TITAN and ImRex, respectively, in a subsequent paper from the Meysman group45. Other groups have published unseen epitope ROC-AUC values ranging from 47% to 97%; however, many of these values are reported on different data sets (Table 1), lack confidence estimates following validation46,47,48,49 and have not been consistently reproducible in independent evaluations50.

Together, these results highlight a critical need for a thorough, independent benchmarking study conducted across models on data sets prepared and analysed in a consistent manner27,50. Until then, newer models may be applied with reasonable confidence to the prediction of binding to immunodominant viral epitopes by common HLA alleles. However, SPMs should be used with caution when generalizing to prediction of any epitope, as performance is likely to drop the further the epitope is in sequence from those in the training set9.

Unsupervised clustering models

Unlike SPMs, UCMs do not depend on the availability of labelled data, learning instead to produce groupings of the TCR, antigen or HLA input that reflect the underlying statistical variations of the data19,51 (Fig. 3c). Applied to TCR repertoires, UCMs take as their input single or paired TCR CDR3 amino acid sequences, with or without gene usage information, and return a mapping of sequences to unique clusters. Clustering is achieved by determining the similarity between input sequences, using either ‘hand-crafted’ features such as sequence distance or enrichment of short sub-sequences, or by comparing abstract features learnt by DNNs (Table 1).

Clustering provides multiple paths to specificity inference for orphan TCRs39,40,41. Epitope specificity can be predicted by assuming that if an unlabelled TCR is similar to a receptor of known specificity, it will bind the same epitope52. One may also co-cluster unlabelled and labelled TCRs and assign the modal or most enriched epitope to all sequences that cluster together51. Finally, DNNs can be used to generate ‘protein fingerprints’, simple fixed-length numerical representations of complex variable input sequences that may serve as a direct input for a second supervised model25,53.

As for SPMs, quantitative assessment of the relative merits of hand-crafted and neural network-based UCMs for TCR specificity inference remains limited to the proponents of each new model. Although some DNN-UCMs allow for the integration of paired chain sequences and even transcriptomic profiles48, they are susceptible to the same training biases as SPMs and are notably less easy to implement than established clustering models such as GLIPH and TCRdist19,54. However, these established clustering models scale relatively poorly to large data sets compared with newer releases51,55. Recent analyses27,53 suggest that there is little to differentiate commonly used UCMs from simple sequence distance measures. Here again, independent benchmarking analyses would be valuable, work towards which our group is dedicating significant time and effort.

Key challenges

Despite the exponential growth of unlabelled immune repertoire data and the recent unprecedented breakthroughs in the fields of data science and artificial intelligence, quantitative immunology still lacks a framework for the systematic and generalizable inference of T cell antigen specificity of orphan TCRs. Among the most plausible explanations for these failures are limitations in the data, methodological gaps and incomplete modelling of the underlying immunology.

Data

As we have set out earlier, the single most significant limitation to model development is the availability of high-quality TCR and antigen–MHC pairs. The need is most acute for under-represented antigens, for those presented by less frequent HLA alleles, and for linkage of epitope specificity and T cell function. Meanwhile, single-cell multimodal technologies have given rise to hundreds of millions of unlabelled TCR sequences8,56, linked to transcriptomics, phenotypic and functional information. However, these unlabelled data are not without significant limitations. Notably, biological factors such as age, sex, ethnicity and disease setting vary between studies and are likely to influence immune repertoires. Differences in experimental protocol, sequence pre-processing, total variation filtering (denoising) and normalization between laboratory groups are also likely to have an impact: batch correction may well need to be applied57. Therefore, thoughtful approaches to data consolidation, noise correction, processing and annotation are likely to be crucial in advancing state-of-the-art predictive models.

Modelling

The exponential growth of orphan TCR data from single-cell technologies, and cutting-edge advances in artificial intelligence and machine learning, has firmly placed TCR–antigen specificity inference in the spotlight. However, we believe that several critical gaps must be addressed before a solution to generalized epitope specificity inference can be realized.

First, models whose TCR sequence input is limited to the use of β-chain CDR3 loops and VDJ gene codes are only ever likely to tell part of the story of antigen recognition, and the extent to which single chain pairing is sufficient to describe TCR–antigen specificity remains an open question. Structural58 and statistical59 analyses suggest that α-chains and β-chains contribute equally to specificity, and incorporating both chains has improved predictive performance44. However, chain pairing information is largely absent (Fig. 2a), and many state-of-the-art SPMs and UCMs rely on single chain information alone (Table 1). Although CDR3 loops may be primarily responsible for antigen recognition, residues from CDR1, CDR2 and even the framework region of both α-chains and β-chains may be involved58. Subtle compensatory changes in interaction networks between peptide–MHC and TCR, altered binding modes and conformational flexibility in both TCR and MHC may underpin TCR cross-reactivity60,61. Explicit encoding of structural information for specificity inference has until recently been limited to studies of a limited set of crystal structures19,62. However, the advent of automated protein structure prediction with software programs such as RoseTTaFold, ESMFold and AlphaFold-Multimer provide potential opportunities for large-scale sequence and structure interpretations of TCR epitope specificity63,64,65. This has been illustrated in a recent preprint in which a modified version of AlphaFold-Multimer has been used to identify the most likely binder to a given TCR, achieving a mean ROC-AUC of 82% on a small pool of eight seen epitopes66.

To train models, balanced sets of negative and positive samples are required. In the absence of experimental negatives, negative instances may be produced by shuffling or drawing randomly from healthy donor repertoires9. However, these approaches assume, on the one hand, that TCRs do not cross-react and, on the other hand, that the healthy donor repertoires do not include sequences reactive to the epitopes of interest. A recent study from Jiang et al.67 provides interesting strategies to address this challenge.

Finally, developers should use the increasing volume of functionally annotated orphan TCR data to boost performance through transfer learning: a technique in which models are trained on a large volume of unlabelled or partially labelled data, and the patterns learnt from those data sets are used to inform a second predictive task. This technique has been widely adopted in computational biology, including in predictive tasks for T and B cell receptors49,66,68. Indeed, the best-performing configuration of TITAN made used a TCR module that had been pretrained on a BindingDB database (see Related links) of 471,017 protein–ligand pairs12. Incorporating evolutionary and structural information through sequence and structure-aware representations of the TCR and of the antigen–MHC complex69,70 may yield further benefits.

Immunology

It is now evident that the underlying immunological correlates of T cell interaction with their cognate ligands are highly variable and only partially understood, with critical consequences for model design. Importantly, TCR–antigen specificity inference is just one part of the larger puzzle of antigen immunogenicity prediction16,18, which we condense into three phases: antigen processing and presentation by MHC, TCR recognition and T cell response.

Antigen processing and presentation pathways have been extensively studied, and computational models for predicting peptide binding affinity to some MHC alleles, especially class I HLAs, have achieved near perfect ROC-AUC15,71 for common alleles. However, this problem is far from solved, particularly for less-frequent MHC class I alleles and for MHC class II alleles7.

A key challenge to generalizable TCR specificity inference is that TCRs are at once specific for antigens bearing particular motifs and capable of considerable promiscuity72,73. This contradiction might be explained through specific interaction of conserved ‘hotspot’ residues in the TCR CDR loops with corresponding two to three residue clusters in the antigen, balanced by a greater tolerance of variations in amino acids at other positions60. TCRs may also bind different antigen–MHC complexes using alternative docking topologies58. Despite the known potential for promiscuity in the TCR, the pre-processing stages of many models assume that a given TCR has only one cognate epitope. Another under-explored yet highly relevant factor of T cell recognition is the impact of positive and negative thymic selection and more specifically the effect of self-peptide presentation in formation of the naive immune repertoire74.

Many groups have attempted to bypass this complexity by predicting antigen immunogenicity independent of the TCR14, as a direct mapping from peptide sequence to T cell activation. However, similar limitations have been encountered for those models as we have described for specificity inference. Many predictors are trained using epitopes from the Immune Epitope Database labelled with readouts from single time points7. However, Achar et al.75 illustrated that integrating cytokine responses over time improved prediction of quality. Antigen load and affinity can also play important roles74,76. Thus, models capable of predicting functional T cell responses will likely need to bridge from antigen presentation to TCR–antigen recognition, T cell activation and effector differentiation and to integrate complex tissue-specific cytokine, cell phenotype and spatiotemporal data sets. Our view is that, although T cell-independent predictors of immunogenicity have clear translational benefits, only after we can dissect the relative contribution of the three stages described earlier will we understand what determines antigen immunogenicity.

New experimental and computational techniques that permit the integration of sequence, phenotypic, spatial and functional information and the multimodal analyses described earlier provide promising opportunities in this direction75,77. Integrating TCR sequence and cell-specific covariates from single-cell data has been shown to improve performance in the inference of T cell antigen specificity48. By taking a graph theoretical approach, Schattgen et al.78 reported an association between clonotype clustering with the cellular phenotypes derived from gene expression and surface marker expression. We believe that such integrative approaches will be instrumental in unlocking the secrets of T cell antigen recognition.

Conclusions and call to action

Together, the limitations of data availability, methodology and immunological context leave a significant gap in the field of T cell immunology in the era of machine learning and digital biology. We believe that by harnessing the massive volume of unlabelled TCR sequences emerging from single-cell data, applying data augmentation techniques to counteract epitope and HLA imbalances in labelled data, incorporating sequence and structure-aware features and applying cutting-edge computational techniques based on rich functional and binding data, improvements in generalizable TCR–antigen specificity inference are within our collective grasp. To aid in this effort, we encourage the following efforts from the community.

First, a consolidated and validated library of labelled and unlabelled TCR data should be made available to facilitate model pretraining and systematic comparisons. Second, a coordinated effort should be made to improve the coverage of TCR–antigen pairs presented by less common HLA alleles and non-viral epitopes. We encourage the continued publication of negative and positive TCR–epitope binding data to produce balanced data sets. Third, an independent, unbiased and systematic evaluation of model performance across SPMs, UCMs and combinations of the two (Table 1) would be of great use to the community. Such a comparison should account for performance on common and infrequent HLA subtypes, seen and unseen TCRs and epitopes, using consistent evaluation metrics including but not limited to ROC-AUC and area under the precision–recall curve. We encourage validation strategies such as those used in the assessment of ImRex and TITAN9,12 to substantiate model performance comparisons. In the future, TCR specificity inference data should be extended to include multimodal contextual information as a means of bridging from TCR binding to immunogenicity prediction.

The scale and complexity of this task imply a need for an interdisciplinary consortium approach for systematic incorporation of the latest immunological understandings of cellular immunity at the tissue level and cutting-edge developments in the field of artificial intelligence and data science. This should include experimental and computational immunologists, machine-learning experts and translational and industrial partners. Considering the success of the critical assessment of protein structure prediction series79, we encourage a similar approach to address the grand challenge of TCR specificity inference in the short term and ultimately to the prediction of integrated T and B cell immunogenicity. Competing models should be made freely available for research use, following the commendable example set in protein structure prediction65,70.