Modern Hopfield Networks and Attention for Immune Repertoire Classification
Michael Widrich, Bernhard Schäfl, Milena Pavlovic, Hubert Ramsauer, Lukas Gruber, Markus Holzleitner, Johannes Brandstetter, Geir Kjetil Sandve, Victor Greiff, Sepp Hochreiter, Günter Klambauer
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 Hopfield 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 Preprint. Under review.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 6a7e2e0e-d765-426a-be6c-fb63c6ad4429Cited by top-tier papers28
- Hopfield Networks is All You NeedHubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl et al.ICLR 2021 · 620 citations
- Large Associative Memory Problem in Neurobiology and Machine LearningDmitry Krotov, John J. HopfieldICLR 2021 · 202 citations
- CLOOB: Modern Hopfield Networks with InfoLOOB Outperform CLIPAndreas Fürst, Elisabeth Rumetshofer, Johannes Lehner, Viet T. Tran et al.NeurIPS 2022 · 131 citations
- Associative Memories via Predictive CodingTommaso Salvatori, Yuhang Song, Yujian Hong, Lei Sha et al.NeurIPS 2021 · 84 citations
- Conformal Prediction for Time Series with Modern Hopfield NetworksAndreas Auer, Martin Gauch, Daniel Klotz, Sepp HochreiterNeurIPS 2023 · 70 citations
Related papers
- A Label Disambiguation-Based Multimodal Massive Multiple Instance Learning Approach for Immune Repertoire ClassificationFan Xu, Yu Zhao, Bingzhe Wu, Yueshan Huang et al.AAAI 2024 · 2 citations
- GRIP: Graph Representation of Immune Repertoire Using Graph Neural Network and TransformerYongju Lee, Hyunho Lee, Kyoungseob Shin, Sunghoon KwonAAAI 2023 · 5 citations
- On the Role of Hidden States of Modern Hopfield Network in TransformerTsubasa Masumura, Masato TakiNeurIPS 2025 · 2 citations
- Immunogenicity Prediction with Dual Attention Enables Vaccine Target SelectionSong Li, Yang Tan, Song Ke, Liang Hong et al.ICLR 2025
- Nonparametric Modern Hopfield ModelsJerry Yao-Chieh Hu, Bo-Yu Chen, Dennis Wu, Feng Ruan et al.ICML 2025
