Nested Learning: The Illusion of Deep Learning Architectures

Ali Behrouz, Meisam Razaviyayn, Peilin Zhong, Vahab Mirrokni

TL;DR

This paper introduces Nested Learning (NL), a new paradigm that reframes deep learning architectures and optimizers as an interconnected system of nested, multi-level optimization problems. By viewing both layers and optimizers as associative memory modules operating at different update frequencies, the authors design Hope, a self-modifying architecture with a continuum memory system that significantly improves long-context reasoning and continual learning.

What Problem Does This Paper Address?

Modern Large Language Models (LLMs) excel at processing immediate context, but they are largely static after pre-training. The authors compare this to anterograde amnesia: models cannot easily form new long-term memories, meaning their persistent knowledge is frozen at the "end of pre-training."

Simply stacking more layers doesn't solve this fundamental limitation. It fails to grant models the ability to continually learn from new data streams without experiencing catastrophic forgetting or requiring computationally expensive retraining. The paper aims to bridge this gap by taking inspiration from the human brain's uniform structure and multi-timescale processing system (neural oscillations).

Figure 1: The uniform and reusable structure as well as multi time scale update in the brain are the key components to unlock the continual learning in humans. Nested Learning (NL) allows for multi time-scale update for each component of the brain, while showing that well-known architectures such as Transformers are in fact linear layers with different frequency updates.

Methods

The authors introduce the Nested Learning (NL) framework, which decomposes machine learning models into multi-level optimization loops, each managing its own "context flow."

Figure 2: Nested Learning Paradigm that represent a machine learning model and its training procedure as a set of nested optimization problems. (Left) An example of Hybrid architecture. While deep learning perspective, as the flattened image of NL, does not provide insight about the depth of computation in the blocks, NL transparently represent all the inner gradient flows. (Right) A Neural Learning Module: A computational model that learns how to compress its own context flow. For example, the first level corresponds to the model’s most outer-loop training, often refer to as “pre-training” step.

Key methodological innovations include:

  1. Optimizers as Associative Memory: The paper proves that standard gradient-based optimizers (like SGD with Momentum or Adam) act as associative memories that compress gradient information. Leveraging this, they introduce Delta Gradient Descent (DGD) and the Multi-scale Momentum Muon (M3) optimizer to better capture data dependencies.
  2. Self-Modifying Learning Modules: They propose a sequence model (Self-Referential Titans) that learns how to modify its own internal update rules dynamically in-context.
  3. Continuum Memory System (CMS): Instead of a rigid binary split between short-term and long-term memory, CMS organizes memory as a continuous spectrum of MLP blocks updating at different frequencies.
  4. The HOPE Architecture: A unified neural learning module combining the self-modifying sequence model with CMS to enable robust, parallelizable continual learning.

Datasets

The framework was evaluated across a diverse suite of benchmarks:

  • Class-Incremental Learning: CLINC (intent classification), Banking (customer service queries), and DBpedia (Wikipedia topic classification).
  • Long-Context Understanding: LongHealth (clinical QA), QASPER (scientific paper QA), MK-NIAH from the RULER benchmark (multi-key needle-in-a-haystack), and BABILong (extrapolating up to millions of tokens).
  • Language Modeling & Reasoning: Wikitext, LMB, PIQA, HellaSwag, WinoGrande, ARC-easy, ARC-challenge, SIQA, and BoolQ.
  • In-Context Recall & Synthetic Tasks: SWDE, NQ, DROP, FDA, SQUAD, TQA, and the MAD synthetic benchmark.
  • Vision Tasks (Optimizer Evaluation): ImageNet-21K (used to benchmark the M3 optimizer on Vision Transformers).

Key Insights and Ideas

  • The "Illusion" of Architecture: From the NL perspective, the apparent heterogeneity of deep learning (combining attention, MLPs, RNNs) is an illusion. All components are fundamentally uniform feedforward networks; they simply differ in their optimization objectives and update frequencies.
  • Pre-Training is In-Context Learning: Pre-training can be viewed as an extreme form of in-context learning where the "context" is the entire pre-training dataset, compressed directly into the model's weights.
  • Self-Referential Backpropagation: Backpropagation is not a simple linear recurrence; it is a self-referential process where a layer's target values are generated by the state of the memory itself.
  • Looping Memory Prevents Forgetting: In the CMS design, when knowledge is forgotten in a high-frequency block, backpropagation allows it to "circle back" from lower-frequency, more persistent blocks, creating a protective memory loop.

Key Results

  • Continual Learning Superiority: The Hope architecture achieved the highest accuracy in class-incremental text classification tasks, outperforming standard In-Context Learning (ICL) and established baselines like Elastic Weight Consolidation (EWC) and InCA.
  • Massive Context Scaling: On the challenging BABILong benchmark, while traditional large models failed around 128K–256K context lengths, Hope maintained stable performance up to a 10-million token context length.
  • Better Optimization: When training Vision Transformers (ViTs) from scratch on ImageNet-21K, the proposed M3 optimizer achieved superior training and test loss compared to both AdamW and Muon.

Limitations and Future Work

  • Computational Overhead: The M3 optimizer introduces multiple momentum terms, making it relatively slower than standard Muon and potentially challenging to scale to massive networks without further engineering optimization.
  • Catastrophic Forgetting is Not Fully "Solved": The authors note that catastrophic forgetting is a natural consequence of data compression. Because network capacity is finite, compression forces a trade-off between retaining old information and learning new patterns. Future work will focus on better exploiting the "axis of levels" rather than simply building deeper static networks.

Summary updated

Abstract

Despite the recent progresses, particularly in developing Language Models, there are fundamental challenges and unanswered questions about how such models can continually learn/memorize, self-improve, and find effective solutions. In this paper, we present a new learning paradigm, called Nested Learning (NL), that coherently represents a machine learning model with a set of nested, multi-level, and/or parallel optimization problems, each of which with its own context flow. Through the lenses of NL, existing deep learning methods learns from data through compressing their own context flow, and in-context learning naturally emerges in large models. NL suggests a philosophy to design more expressive learning algorithms with more levels, resulting in higher-order in-context learning and potentially unlocking effective continual learning capabilities. We advocate for NL by presenting three core contributions: (1) Expressive Optimizers: We show that known gradient-based optimizers, such as Adam, SGD with Momentum, etc., are in fact associative memory modules that aim to compress the gradients' information (by gradient descent). Building on this insight, we present other more expressive optimizers with deep memory and/or more powerful learning rules; (2) Self-Modifying Learning Module: Taking advantage of NL's insights on learning algorithms, we present a sequence model that learns how to modify itself by learning its own update algorithm; and (3) Continuum Memory System: We present a new formulation for memory system that generalizes the traditional viewpoint of long/short-term memory. Combining our self-modifying sequence model with the continuum memory system, we present a continual learning module, called Hope, showing promising results in language modeling, knowledge incorporation, and few-shot generalization tasks, continual learning, and long-context reasoning tasks.
BibTeX
@inproceedings{behrouz2025nested,
  author = {Ali Behrouz and Meisam Razaviyayn and Peilin Zhong and Vahab Mirrokni},
  title = {{Nested Learning: The Illusion of Deep Learning Architectures}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=nbMeRvNb7A},
}
Figure