Retrieval-Centric Deep Learning in Growing Nonparametric Neural Networks

Maximilian Schlegel, Rajai Nasser, Seijin Kobayashi, Yanick Schimpf, Oliver Sieberling, Robert Obryk, Kazuki Irie, João Sacramento, Johannes von Oswald

TL;DR

Researchers have introduced Retrieval-Centric Deep Learning (RCDL), a paradigm where neural networks "grow" by storing every training example as a key-value pair instead of compressing them into fixed weight matrices. By deriving principled functional gradient learning rules for non-linear kernels like RBF and a novel "weighted softmax," they achieve superior sample efficiency and a new theoretical bridge between attention mechanisms and second-order optimizers.

What Problem Does This Paper Address?

Standard deep learning is a process of compression: we take massive datasets and squeeze their information into fixed-size weight matrices. However, a classic (though often overlooked) mathematical duality shows that any linear layer trained by gradient descent is actually equivalent to a "key-value memory system" performing linear attention over its entire training history.

The problem is that linear attention is known to be suboptimal compared to the non-linear softmax attention used in Transformers. While it seems intuitive to simply swap linear layers for softmax-based retrieval, doing so is mathematically "non-trivial." Naively adding new data points to a softmax denominator causes discontinuous jumps, breaking standard optimization. This paper fills that gap, providing the theoretical framework to build and train "growing" networks that use powerful, non-linear retrieval.

Methods

The authors establish the RCDL framework, where the network's state is a growing database $\mathcal{D} = \{K, V\}$.

  1. Functional Gradient Descent: Instead of updating weights, the authors perform gradient descent in the space of functions. They derive specific update rules for two types of non-linear attention:
  2. Positive Definite Kernels (e.g., RBF): Where adding a data point is equivalent to an update in a Reproducing Kernel Hilbert Space (RKHS).
  3. Weighted Softmax: The authors introduce a scalar weight $w$ for each memory entry. This allows for "smooth" additions to the database; a new point can be added with an infinitesimal weight that grows as the model learns from it.
  4. Gauge Invariance: To handle "negative weights" (which can cause numerical instability in softmax), they developed a geometrically principled method that uses translational symmetry in the value space to ensure all weights remain positive.
  5. Hybrid Learning: To prevent memory from exploding, they propose a hybrid approach. The model only adds a new key-value pair if the input is sufficiently "novel" (distinct from existing keys). Otherwise, it uses standard parametric updates (like Adam) to refine existing entries.
  6. Optimizer Duality: They show that using advanced linear attention variants (like MesaNet) in the dual form leads directly to approximate second-order optimizers like FOOF, providing a new lens to understand why modern optimizers work.

Datasets

The authors evaluated their approach on:

  • Synthetic Teacher-Student Tasks: A regression problem where a student network tries to mimic a hidden teacher network.
  • CIFAR-10 & CIFAR-100: Standard image classification benchmarks, used to test both the growing networks and the derived optimizers.
  • Vision Transformers (ViT): Used as a testbed for mixing RCDL layers with standard parametric layers.

Key Insights and Ideas

  • Memory as Weights: The "Illustration" in the paper (see below) beautifully contrasts the two worlds. In parametric NNs, $x$ hits a fixed $W$. In RCDL, $x$ acts as a query to retrieve from a growing library of past experiences.
Comparison of parametric vs. retrieval-centric paradigms
  • The "Aha" Moment on Optimization: The realization that the MesaNet update rule—which minimizes squared error over all past keys and values—is mathematically identical to the FOOF optimizer. This suggests that the best way to update a weight matrix is to treat it as the best possible linear associative memory of the training data.
  • Non-linear Advantage: RCDL models fit training data drastically faster than parametric models. Because they store data rather than just compressing it, they exhibit a "strong memorization" property that actually aids generalization in low-data regimes.

Key Results

  • Superior Efficiency: On CIFAR-10, RCDL models (RBF and Weighted Softmax) significantly outperformed standard SGD-trained MLPs and were competitive with advanced optimizers like Muon.
  • Single-Pass Learning: In the "online" regime (only one pass through the data), RCDL was the clear winner, outperforming all parametric baselines.
  • Hybrid Scaling: The hybrid algorithm matched the performance of a fully growing model while using only a small fraction of the memory capacity (see Figure 5).
  • ViT Integration: Replacing the Feed-Forward Network (FFN) blocks in a Vision Transformer with RCDL layers boosted single-epoch CIFAR-10 accuracy from 48.4% to 54.4%.
Figure 2: (Left Plots) Test set accuracy on CIFAR-10/100: Growing Weighted Softmax & RBF, while based on plain SGD, significantly outperform the SGD-trained MLP and Adam/RMSProp and are competitive with MLPs trained with Muon. The Mesa/FOOF optimizer achieves high accuracy on CIFAR-10 and performs best on CIFAR-100. (Middle Right) Training loss for Growing Weighted Softmax & RBF decreases much faster than that of the other models. (Right) Test set accuracy on CIFAR-10 after a single pass on the training data. Growing Weighted Softmax & RBF are the most efficient learning algorithms. To place our results, we include the test accuracy of two classical (not single pass) methods: k-nearest-neighbor (kNN) and SVM (starred; details in Appendix F.10).

Limitations and Future Work

  • Memory Footprint: The most obvious drawback is that $O(T)$ memory growth (linear with training steps) is eventually prohibitive. While the hybrid approach and pruning strategies (like decaying old values) help, scaling this to "internet-scale" data remains a challenge.
  • Optimizer Support: The current theory primarily supports vanilla gradient descent for the growing part. Deriving how to apply Adam-like adaptive learning rates to the functional updates is a key next step.
  • Language Modeling: The authors suggest that integrating these growing layers into Large Language Models (LLMs) could be a path toward models that truly "remember" their training data rather than just approximating it.

Summary updated

BibTeX
@inproceedings{schlegel2026retrieval,
  author = {Maximilian Schlegel and Rajai Nasser and Seijin Kobayashi and Yanick Schimpf and Oliver Sieberling and Robert Obryk and Kazuki Irie and João Sacramento and Johannes von Oswald},
  title = {{Retrieval-Centric Deep Learning in Growing Nonparametric Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=lYGqisD7No},
}
Figure