Modern Hopfield Networks and Attention for Immune Repertoire Classification
Michael WidrichiD, Bernhard SchäfliD, Milena PavlovićiD, Hubert Ramsauer, Lukas Gruber, Markus HolzleitneriD, J. BrandstetteriD, Geir Kjetil SandveiD, Victor GreiffiD, Sepp HochreiteriD, Günter KlambaueriD
Abstract
A central mechanism in machine learning is to identify, store, and recognize patterns. How to learn, access, and retrieve such patterns is crucial in Hopfield networks and the more recent transformer architectures. We show that the attention mechanism of transformer architectures is actually the update rule of modern Hop-field networks that can store exponentially many patterns. We exploit this high storage capacity of modern Hopfield networks to solve a challenging multiple instance learning (MIL) problem in computational biology: immune repertoire classification. Accurate and interpretable machine learning methods solving this problem could pave the way towards new vaccines and therapies, which is currently a very relevant research topic intensified by the COVID-19 crisis. Immune repertoire classification based on the vast number of immunosequences of an individual is a MIL problem with an unprecedentedly massive number of instances, two orders of magnitude larger than currently considered problems, and with an extremely low witness rate. In this work, we present our novel method DeepRC that integrates transformer-like attention, or equivalently modern Hopfield networks, into deep learning architectures for massive MIL such as immune repertoire classification. We demonstrate that DeepRC outperforms all other methods with respect to predictive performance on large-scale experiments, including simulated and real-world virus infection data, and enables the extraction of sequence motifs that are connected to a given disease class. Source code and datasets: https://github.com/ml-jku/DeepRC
02 /Specification & Classification
Click any tag to browse matching papers- Citations
- 104
- Research Focus
- Approach
Abstract summary
Claude Opus 5.5 · xhigh effort · 18 Oct 2026 · from the abstract
Transformer attention is recast as the update rule of modern Hopfield networks, and the resulting DeepRC classifier handles immune repertoires with enormous instance counts and few informative sequences.
Predicting an individual's disease status from their immunosequences is a multiple instance learning (MIL) task with, as the authors describe it, two orders of magnitude more instances than problems usually tackled and an extremely low witness rate. Tying attention to the storage capacity of modern Hopfield networks is their route to making that scale tractable while still recovering disease-associated sequence motifs.
Key results
ClaimedThe attention mechanism of transformer architectures is identified with the update rule of modern Hopfield networks, which the authors say can store exponentially many patterns.
Asserted in the abstract as the theoretical basis for the method; no derivation, proof sketch or capacity measurement is present in the available text. · Abstract
ClaimedDeepRC is reported to beat every competing method on predictive performance for immune repertoire classification.
Stated for large-scale experiments on simulated data and real-world virus infection data; no metric, score, baseline name or dataset size appears in the abstract. · Abstract
ClaimedThe trained model is said to allow extraction of sequence motifs connected to a given disease class, alongside the classification.
Claimed in the abstract without example motifs, counts or any check against known disease-associated sequences. · Abstract
Methods, data and reproducibility
DeepRC inserts transformer-like attention, presented as equivalent to a modern Hopfield network update, into deep learning architectures for multiple instance learning at massive scale, with a repertoire treated as a bag of immunosequences. Evaluation uses large-scale simulated data and real-world virus infection data, and the method is reported to enable extraction of motifs connected to a disease class.
- simulated immune repertoire data for large-scale experiments
- real-world virus infection immune repertoire data
- Methods & tools
- DeepRC, modern Hopfield networks, transformer attention
- Data & accessions
- https://github.com/ml-jku/DeepRC
Limitations (2)
- The headline superiority claim comes with no metric, no named baselines and no dataset sizes, so neither the margin nor the comparison conditions can be checked from the text. · noted in this summary
- The only real-world data the abstract names is virus infection repertoires, and the extracted motifs are not validated against independently known disease-associated sequences. · noted in this summary
Who should read:Read this if you classify immune repertoires, or run multiple instance learning with extreme bag sizes and low witness rates, and want attention framed as a Hopfield retrieval step.
Reproducibility ledger
Nobody has reported trying to reproduce this paper yet. Did you replicate an experiment or run the code? Your report saves the next lab a week.
Sign in to file a reproducibility report.
Related papers
- MotifBoost: k-mer based data-efficient immune repertoire classification method
Yotaro Katayama, Tetsuya Kobayashi·Frontiers in ImmunologyPeer-reviewed·Jul 20, 2022
- GRIP: Graph representation of immune repertoire using graph neural network and transformer
Yong‐Ju Lee, Hyunho Lee, … Sunghoon Kwon·Proceedings of the AAAI Conference on Artificial IntelligencePeer-reviewed·Jun 26, 2023
- Counting Is Almost All You Need
O. Akerman, Y. Louzoun, … R. Levi·bioRxiv·Aug 9, 2022
- Computational Convergence of Adaptive Immunity and Artificial Intelligence
Sai T. Reddy·bioRxiv·Feb 5, 2026
- HLA class I binding prediction via convolutional neural networks
Yeeleng S. Vang, Xiaohui S. Xie·BioinformaticsPeer-reviewed·Apr 20, 2017
- DeepTCR: a deep learning framework for understanding T-cell receptor sequence signatures within complex T-cell repertoires
John-William Sidhom, H. Benjamin Larman, … Alexander S. Baras·bioRxiv·Dec 23, 2019