Lune

ICML2022Top-tier venue

The Dual Form of Neural Networks Revisited: Connecting Test Time Predictions to Training Patterns via Spotlights of Attention

Kazuki Irie, Róbert Csordás, Jürgen Schmidhuber

Abstract

Linear layers in neural networks (NNs) trained by gradient descent can be expressed as a keyvalue memory system which stores all training datapoints and the initial weights, and produces outputs using unnormalised dot attention over the entire training experience. While this has been technically known since the 1960s, no prior work has effectively studied the operations of NNs in such a form, presumably due to prohibitive time and space complexities and impractical model sizes, all of them growing linearly with the number of training patterns which may get very large. However, this dual formulation offers a possibility of directly visualising how an NN makes use of training patterns at test time, by examining the corresponding attention weights. We conduct experiments on small scale supervised image classification tasks in single-task, multi-task, and continual learning settings, as well as language modelling, and discuss potentials and limits of this view for better understanding and interpreting how NNs exploit training patterns. Our code is public † .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

22 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Titans: Learning to Memorize at Test Time cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • Titans: Learning to Memorize at Test Time cites Linear Transformers Are Secretly Fast Weight Programmers
  • Random Feature Attention cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Random Feature Attention cites Language Models are Few-Shot Learners
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Random Feature Attention
  • Parallelizing Linear Transformers with the Delta Rule over Sequence Length cites Linear Transformers Are Secretly Fast Weight Programmers
  • A Survey on In-context Learning cites Language Models are Few-Shot Learners
  • Nested Learning: The Illusion of Deep Learning Architectures cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Nested Learning: The Illusion of Deep Learning Architectures cites Titans: Learning to Memorize at Test Time
  • Nested Learning: The Illusion of Deep Learning Architectures cites Parallelizing Linear Transformers with the Delta Rule over Sequence Length
  • Nested Learning: The Illusion of Deep Learning Architectures cites Language Models are Few-Shot Learners
  • Nested Learning: The Illusion of Deep Learning Architectures cites Linear Transformers Are Secretly Fast Weight Programmers
  • Feature learning in deep classifiers through Intermediate Neural Collapse cites Language Models are Few-Shot Learners
  • Linear Transformers Are Secretly Fast Weight Programmers cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
  • Linear Transformers Are Secretly Fast Weight Programmers cites Random Feature Attention
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers22

  1. A Survey on In-context LearningQingxiu Dong, Lei Li, Damai Dai, Ce Zheng et al.EMNLP 2024 · 479 citations
  2. Parallelizing Linear Transformers with the Delta Rule over Sequence LengthSonglin Yang, Bailin Wang, Yu Zhang, Yikang Shen et al.NeurIPS 2024 · 412 citations
  3. Titans: Learning to Memorize at Test TimeAli Behrouz, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 368 citations
  4. Nested Learning: The Illusion of Deep Learning ArchitecturesAli Behrouz, Meisam Razaviyayn, Peilin Zhong, Vahab MirrokniNeurIPS 2025 · 96 citations
  5. Feature learning in deep classifiers through Intermediate Neural CollapseAkshay Rangamani, Marius Lindegaard, Tomer Galanti, Tomaso A. PoggioICML 2023 · 64 citations

Builds on7

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations
  3. Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
  4. Random Feature AttentionHao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz et al.ICLR 2021 · 425 citations
  5. Linear Transformers Are Secretly Fast Weight ProgrammersImanol Schlag, Kazuki Irie, Jürgen SchmidhuberICML 2021 · 394 citations

Related papers

  1. Test-Time Training with KV Binding Is Secretly Linear AttentionJunchen Liu, Sven Elflein, Or Litany, Zan Gojcic et al.ICML 2026 · 6 citations
  2. Training Dynamics of In-Context Learning in Linear AttentionYedi Zhang, Aaditya K. Singh, Peter E. Latham, Andrew M. SaxeICML 2025
  3. Towards flexible perception with visual memoryRobert Geirhos, Priyank Jaini, Austin Stone, Sourabh Medapati et al.ICML 2025
  4. Generalisation First, Memorisation Second? Memorisation Localisation for Natural Language Classification TasksVerna Dankers, Ivan TitovACL Findings 2024
  5. Continual learning with the neural tangent ensembleAri S. Benjamin, Christian-Gernot Pehle, Kyle DaruwallaNeurIPS 2024 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines