Nested Sparsity for Scalable Pretraining and Continual Learning

Tianzhe Chu, Druv Pai, Yi Ma
10/22/2026
cs.LG
transformer-attentionmoe

Official code: Ma-Lab-Berkeley/Nestor (19 stars, Python, last commit 2026-10-26).

Abstract

Mixture-of-experts (MoE) transformers, the standard backbone for modern large-scale deep learning, employ conditional computation: only a sparse subset of model weights is used in each forward pass. In MoE transformers, this sparsity arises in the MoE operator, which generalizes the multi-layer perceptron in the classical transformer.

Show full abstract

In this work, we explore an alternative mechanism for conditional computation that analogously generalizes the attention operator. The sparsity induced by this mechanism naturally nests (i.e., hierarchically composes) with the sparsity induced by the MoE operator. We show that a transformer employing this nested sparsity mechanism, which we call Nestor, performs better than a conventional MoE transformer at equal compute and equal sparsity in language model pretraining. We also show that Nestor is well-suited for continual pretraining: it can be adapted to longer contexts more effectively than conventional MoEs, as well as adapt more efficiently to new domains while forgetting less on old domains. Furthermore, we demonstrate that these benefits persist as model size, dataset size, and context length grow. Our results demonstrate the potential of alternative conditional computation mechanisms for deep neural network architectures. Code and checkpoints are available on GitHub at https://github.com/Ma-Lab-Berkeley/Nestor .

View on arXivView PDF

Code Implementations(1)

Official repo of paper "Nested Sparsity for Scalable Pretraining and Continual Learning"

190Python, TypeScriptOct 12, 20261 months ago

Similar Papers

Cite this paper

@article{chu2026nested,
  title  = {Nested Sparsity for Scalable Pretraining and Continual Learning},
  author = {Tianzhe Chu and Druv Pai and Yi Ma},
  year   = {2026},
  eprint = {2610.31818},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.31818v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.31818.svg)](https://codeofpaper.com/paper/2610.31818)

Discussion