
A new paper from researchers at MIT CSAIL and Stanford introduces Recursive Language Models (RLMs), a general inference paradigm that treats long prompts as part of an external environment and allows the LLM to programmatically examine, decompose, and recursively call itself over snippets of the prompt.
The approach enables LLMs to process inputs up to two orders of magnitude beyond their native context windows. Even for shorter prompts, RLMs dramatically outperform vanilla frontier LLMs and common long-context and coding scaffolds — on GPT-5 by a median of 26% against compaction, 130% against CodeAct with sub-calls, and 13% against Claude Code across four diverse long-context tasks, while maintaining comparable cost.
The researchers also post-trained the first model around the RLM paradigm: RLM-Qwen3-8B, which outperforms the underlying Qwen3-8B model by 28.3% on average and even approaches the quality of vanilla GPT-5 on three long-context tasks.
Code is available on GitHub.
RLMs address a fundamental limitation of current LLMs: their fixed context windows. By allowing models to recursively process long inputs, the paradigm could unlock new applications in document analysis, codebase understanding, and any domain requiring reasoning over very long texts — without requiring larger context windows or more expensive hardware.
Sources: Source 1