How T-cell repertoires encode,
store and recall information

Johannes Textor
Department of Tumor Immunology
Nijmegen, The Netherlands

  1. What is memory?
  2. How does the immune system implement memory?
  3. How does sleep affect memory?

Memory, in biological systems, refers to a process in which the organism extracts and maintains relevant environmental information to enable sustainable adaptive responses.

Jan Born

Two major biological systems form memory

the brain the immune system
C. elegans:
✓ central nervous system
✓ sleep
X adaptive immune system
Gingliomostoma cirratum:
✓ central nervous system
✓ sleep
✓ adaptive immune system

Although referring to different domains of environmental events, both the CNS and immune system appear to share basic functions of memory. If so, then could there even be common rules and mechanisms of memory that apply to the two systems?

Westermann, Lange, Textor & Born, Trends Neurosci, 2015

Systems consolidation

  1. Encoding: uptake of the information to be stored.
  2. Consolidation: transformation of a fragile initial memory trace into a stable, long-lasting representation.
  3. Recall: reactivation of the stored memory to enable the execution of the adaptive response.

The plasticity-stability-dilemma

  • Plasticity:
    Mcoming information needs to be rapidly encoded.
  • Stability:
    Memory should not immediately be overwritten by new information.

In the CNS, two distinct systems cooperate to solve the dilemma.

Saletin and Walker, Front. Neurol., 2012

Biological memory uses two stores

Two stores in the immune system

In the immune system, long-term retention of
antigenic peptides in the body seems difficult.

Westermann, Lange, Textor & Born, Trends Neurosci, 2015

A brief historical exursion: Jerne's network theory

Both [the immune system and the CNS] build up a memory that is [...] deposited in persistent network modifications.

Niels Jerne, 1974

How the network theory works

The idiotypic network does not exist

B cells require T cell help, and T cell receptors cannot be secreted.

We have both seen the grand idolatry of intuition run his course. If anything, this is of the Devil.

Max Delbrück to Niels Jerne

It is safe to say [...] that we never learnt anything from it.

(Cohn, Annu Rev Immunol 1994)

Repertoires are not networks

Key properties of repertoires:

  • Diversity
  • Motility
  • Plasticity

Forrest et al, Comm ACM 1997

Lymphocyte receptor repertoires are large




Can we build such large models?


"[Repertoire modelling] was thoroughly explored and has no potential for becoming a [...] useful [...] technique. [...] Future work [...] is not meaningful."

(from a dissertation, TU Darmstadt)

[Repertoire modelling] [...] turns out to be equivalent to an NP-complete problem.

(Stibor et al, Theor Comp Sci, 2008)


Problem: the number of required detectors grows
exponentially in the data dimensionality

Enter finite state machines

Brzozowski's finite state machine minimization algorithm

Textor & Liskiewicz, GECCO 2010; Elberfeld & Textor, Theor Comp Sci 2011; Textor, ICARIS 2012; Textor, PPSN 2012; Textor et al, GECCO 2014

Self-nonself discrimination

  • nmitla hiligaynon
  • ciditi latin
  • nyukil xhosa
  • llowed english
  • ynystr middle english
  • agnana tagalog

Wortel et al., submitted, biorXiv

A simple model of TCR-pMHC recognition

Three ingredients needed:

1 Epitope peptide that binds MHC-I (9-mer)
2 (CD8+) TCR
3 Matching rule

A simple model of TCR-pMHC recognition

Three ingredients needed:

1 Epitope peptide that binds MHC-I (9-mer)
2 (CD8+) TCR "implicit" motif & matching length k
3 Matching rule

A simple model of TCR-pMHC recognition

Three ingredients needed:

1 Epitope peptide that binds MHC-I (9-mer)
2 (CD8+) TCR "implicit" motif motif & matching length k
3 Matching rule at least k matches in a row

Tuning cross-reactivity

Which peptides can bind to a given TCR?

k # binders frequency
6 1 1 in 64,000,000
5 39 1 in 650,000
4 1,160 1 in 55,000
3 30,800 1 in 2,000
2 766,879 1 in 80
1 16,954,119 1 in 4
lower k less specific
more cross-reactive

Simulating negative selection

Negative selection removes highly cross-reactive T cells

Fewer T cells survive if:

  • More self epitopes are "seen" in the thymus
  • T cells are more cross-reactive (low k)

Cross-reactivity & generalization: tolerance

Higher tolerance if: - More self "seen"
- Cross-reactivity (lower k)

Cross-reactivity & generalization: foreign recognition


Foreign epitopes that "look like self" are deleted
faster with higher cross-reactivity.

Measuring learning success

To measure how well we learn, we can sort peptides by their precursor frequencies.

Can T cells learn languages?

To see whether negative selection can perform cognitive tasks in principle, let's feed our artificial repertoire with a problem that we know is feasible.

Seen self Unseen self Nonself
ewer_g vors_i ions_p ffin_l lossus ne_tri ne_mig _manki ... sent_h d_thom rs_sha groom_ ceived ple_th ll_go_ ce_and ... ela_em ngengu ni_san mna_we lizwi_ de_wen _sezul u_abe_ ...

Artificial T cells can learn languages

Trained on 1000 English strings
Evaluated on 1000 English and 1000 Xhosa strings

Why can T cells learn languages?

In this graph, nodes are strings and they are linked if they are recognized by many "T cells" simultaneously.

English vs Xhosa: linked nodes tend to be same class (color)

Why can T cells learn languages?

In this graph, nodes are strings and they are linked if they are recognized by many "T cells" simultaneously.

English vs English: linked nodes independent in class (color)

Predicting learning success

Self-nonself discrimination works if strings matched by
the same T cell tend to be of the same class.

Towards real negative selection

Seen self
Unseen self
Positions 3-8 of 9mers predicted to bind HLA-A02:01 using NetMHCPan

Self-nonself discrimination looks difficult

Self peptides are no more similar to each other than to viral peptides.

Self-nonself discrimination is difficult

Generalization hardly occurs on human self vs. HIV.

Choice of "training" epitopes in thymus

With our model, we can compute the choice that optimizes generalization.

Optimizing peptide choice for tolerance


Summary on our repertoire model

  • T cell repertoires can (in principle) solve arbitrary classification tasks.
  • This works well if "self elements" are more similar to each other than to "non-self elements".
  • Human self and pathogen nonself may lack this property.
  • Learning is still possible if peptides presented in thymus are well chosen.

Sleep: an off-line state for the organism

Pace-Schott & Hobson, Nat Rev Neurosci 2002

The impact of sleep on memory

Diekelmann & Born, Nat Rev Neurosci 2010

The impact of sleep on immune memory

Everyone knows that sleep supports immunological memory.

Does it? Let's look at some evidence.

Sleep deprivation hampers vaccination success

Lange et al, JI 2011; Dimitrov et al, 2019

Westermann, Lange, Textor & Born, Trends Neurosci, 2015

Circadian and sleep effects on lymphocyte circulation

Besedovsky et al, 2016

normal T cell ebb-and-flow no T cell ebb-and-flow


  • Both the CNS and the immune system form memory.
  • The CNS uses cellular networks to store information.
  • But the immune system uses repertoires.
  • Despite their differences, both cell networks and repertoires can encode, consolidate, and retrieve information.
  • Sleep appears to foster memory in both systems, and we would like to understand how this works.


Tumor Immunology, Nijmegen

  • Inge Wortel
  • Jolanda de Vries
  • Carl Figdor

TR-SFB 272 (Tübingen/Lübeck, Germany)

  • Jan Born
  • Tanja Lange
  • Jürgen Westermann

Theoretical Biology, Utrecht

  • Rob de Boer
  • Can Kesmir

Physiology, McGill University Montreal

  • Judith Mandl


  • KWF
  • Radboudumc PhD grant