面向可扩展预训练与持续学习的嵌套稀疏性
研究论文 · 2026/10/27
本文提出了一种新的条件计算机制,可类比地泛化注意力算子,其稀疏性与MoE算子诱导的稀疏性自然嵌套(分层组合)。采用该嵌套稀疏机制的Transformer(称为Nestor)在语言模型预训练中,在同等计算量和同等稀疏度下优于传统MoE Transformer。Nestor也更适合持续预训练:能更有效地适应更长上下文,更高效地适应新领域且对旧领域遗忘更少。这些优势随模型规模、数据集规模和上下文长度增长而持续。
该工作为深度神经网络架构提供了除MoE之外的条件计算新思路,实验证明其在预训练和持续学习场景下均具优势,且代码与检查点已开源,对大规模模型高效训练与持续学习有参考价值。
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. 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 .