🚀NEW COURSEVibe Coding AI Apps with Claude Code 🤖✨Enroll now
Memory · Agents · Reasoning

Recursive Language Models

Free while signed in. Answers cite the passages they came from.

Figure 1
Recursive Language Models
The curator’s take

Recursive Language Models (RLMs) are a general inference strategy that allows LLMs to process arbitrarily long prompts by treating them as part of an external environment. Rather than feeding long contexts directly into the model, RLMs load the prompt as a variable in a Python REPL and let the LLM programmatically examine, decompose, and recursively call itself over snippets. - **Scaling beyond context windows:** RLMs successfully handle inputs up to two orders of magnitude beyond model context windows, scaling to the 10M+ token regime while maintaining strong performance. - **Outperforming base models:** On information-dense tasks like OOLONG-Pairs, GPT-5 achieves less than 0.1% F1 while RLM(GPT-5) reaches 58% F1. RLMs outperform base models and common long-context scaffolds by up to 2x on diverse benchmarks. - **Emergent decomposition patterns:** Without explicit training, RLMs exhibit sophisticated behaviors including filtering context using regex queries based on model priors, chunking and recursive sub-calling, and answer verification through small-context sub-LM calls. - **Cost-effective inference:** RLMs maintain comparable or lower costs than base model calls at median, with the ability to selectively view context rather than ingesting entire inputs like summarization approaches. - **Task complexity scaling:** While base LLM performance degrades rapidly with both input length and task complexity, RLMs degrade at a much slower rate, maintaining effectiveness even on quadratically-scaling tasks.

Key points
01

Scaling beyond context windows: RLMs successfully handle inputs up to two orders of magnitude beyond model context windows, scaling to the 10M+ token regime while maintaining strong performance.

02

Outperforming base models: On information-dense tasks like OOLONG-Pairs, GPT-5 achieves less than 0.1% F1 while RLM(GPT-5) reaches 58% F1. RLMs outperform base models and common long-context scaffolds by up to 2x on diverse benchmarks.

03

Emergent decomposition patterns: Without explicit training, RLMs exhibit sophisticated behaviors including filtering context using regex queries based on model priors, chunking and recursive sub-calling, and answer verification through small-context sub-LM calls.

04

Cost-effective inference: RLMs maintain comparable or lower costs than base model calls at median, with the ability to selectively view context rather than ingesting entire inputs like summarization approaches.

05

Task complexity scaling: While base LLM performance degrades rapidly with both input length and task complexity, RLMs degrade at a much slower rate, maintaining effectiveness even on quadratically-scaling tasks.

Abstract

We study allowing large language models (LLMs) to process arbitrarily long prompts through the lens of inference-time scaling. We propose 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. We find that RLMs can successfully process inputs up to two orders of magnitude beyond model context windows and, even for shorter prompts, dramatically outperform the quality of vanilla frontier LLMs and common long-context scaffolds across four diverse long-context tasks while having comparable cost. At a small scale, we post-train the first natively recursive language model. Our model, RLM-Qwen3-8B, 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 at this https URL.

Every Monday
Get next week’s papers.

The same picks and the same summaries, in your inbox. Free, and 176 issues deep.

Subscribe on Substack