Modern Hopfield Networks and Attention for Immune Repertoire Classification

A central mechanism in machine learning is to identify, store, and recognize\npatterns. How to learn, access, and retrieve such patterns is crucial in\nHopfield networks and the more recent transformer architectures. We show that\nthe attention mechanism of transformer architectures is actually the update\nrule of modern Hopfield networks that can store exponentially many patterns. We\nexploit this high storage capacity of modern Hopfield networks to solve a\nchallenging multiple instance learning (MIL) problem in computational biology:\nimmune repertoire classification. Accurate and interpretable machine learning\nmethods solving this problem could pave the way towards new vaccines and\ntherapies, which is currently a very relevant research topic intensified by the\nCOVID-19 crisis. Immune repertoire classification based on the vast number of\nimmunosequences of an individual is a MIL problem with an unprecedentedly\nmassive number of instances, two orders of magnitude larger than currently\nconsidered problems, and with an extremely low witness rate. In this work, we\npresent our novel method DeepRC that integrates transformer-like attention, or\nequivalently modern Hopfield networks, into deep learning architectures for\nmassive MIL such as immune repertoire classification. We demonstrate that\nDeepRC outperforms all other methods with respect to predictive performance on\nlarge-scale experiments, including simulated and real-world virus infection\ndata, and enables the extraction of sequence motifs that are connected to a\ngiven disease class. Source code and datasets: https://github.com/ml-jku/DeepRC\n

Paper

Similar papers

© 2026 NYSGPT2525 LLC