Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation

Sangmin Bae, Yujin Kim, Reza Bayat, Sungnyun Kim, Jiyoun Ha +6 more
7/14/2025
cs.CLcs.LG

No official code found. Best implementation: raymin0223/mixture_of_recursions (581 stars, Apache-2.0, last commit 2025-09-26). 2 more below.

Abstract

Scaling language models unlocks impressive capabilities, but the accompanying computational and memory demands make both training and deployment expensive. Existing efficiency efforts typically target either parameter sharing or adaptive computation, leaving open the question of how to attain both simultaneously. We introduce Mixture-of-Recursions (MoR), a unified framework that combines the two axes of efficiency inside a single Recursive Transformer. MoR reuses a shared stack of layers across recursion steps to achieve parameter efficiency, while lightweight routers enable adaptive token-level thinking by dynamically assigning different recursion depths to individual tokens. This allows MoR to focus quadratic attention computation only among tokens still active at a given recursion depth, further improving memory access efficiency by selectively caching only their key-value pairs. Beyond these core mechanisms, we also propose a KV sharing variant that reuses KV pairs from the first recursion, specifically designed to further decrease memory footprint. Across model scales ranging from 135M to 1.7B parameters, MoR forms a new Pareto frontier: at equal training FLOPs and smaller model sizes, it significantly lowers validation perplexity and improves few-shot accuracy, while delivering higher throughput compared with vanilla and existing recursive baselines. These gains demonstrate that MoR is an effective path towards large-model quality without incurring large-model cost.

View on arXivView PDF

Code Implementations(3)

ahmedtaha100/MoRCommunity74%

PyTorch implementation of "Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation" (NeurIPS 2025, Google DeepMind)

10PythonFeb 5, 20268 months ago
recursive-transformers
Apache-2.0

Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation (NeurIPS 2025)

58184Shell, PythonJun 16, 20251 years agoApache-2.0
adaptive-computationearly-exitingkv-cachellmrecursive-transformers+1 more

Dataset generation script for simulating "recursive thinking depth" in language models, inspired by Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation.

00Jupyter NotebookAug 8, 20251 years ago

Similar Papers

Cite this paper

@article{bae2025mixtureofrecursions,
  title  = {Mixture-of-Recursions: Learning Dynamic Recursive Depths for Adaptive Token-Level Computation},
  author = {Sangmin Bae and Yujin Kim and Reza Bayat and Sungnyun Kim and Jiyoun Ha and Tal Schuster and Adam Fisch and Hrayr Harutyunyan and Ziwei Ji and Aaron Courville and Se-Young Yun},
  year   = {2025},
  eprint = {2507.10524},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.10524v3}
}

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/2507.10524.svg)](https://codeofpaper.com/paper/2507.10524)

Discussion