Key points
This zhichai.net forum post is an extended analysis of the paper Recursive Language Models by Alex L. Zhang, Tim Kraska, and Omar Khattab (MIT CSAIL), arXiv:2512.24601v1, released December 31, 2025.
The problem
- Even the strongest LLMs (e.g., GPT-5, ~272k context) choke on very long inputs. Truncation causes forgetting; context compression is lossy — fine-grained details ("what color was the dress in chapter 18?") get discarded.
- Inspired by virtual memory in operating systems: don't feed the whole prompt into the network. Instead, store it in an external REPL environment as a variable (
context) and let the model inspect and slice it with Python code. - When a task is too large, the model recursively delegates: split the document (e.g., 10M tokens into 100 chunks of 100k), summon sub-LMs to process each chunk, and recurse further if needed, then aggregate results.
- This trades time (more inference calls) for space (effectively unbounded context). The limit becomes budget-driven rather than GPU-memory-driven.
- Benchmarks: S-NIAH (needle in a haystack, low entropy), BrowseComp (deep research, medium entropy), OOLONG (full aggregation, high entropy).
- At ~10M tokens, RLM keeps functioning and outperforms all baselines, while standard models exceed their context limits.
- Even on short texts within a model's window, RLM beats direct inference on OOLONG — "divide and conquer" beats swallowing whole.
- Intuitive filtering: the model spontaneously skims document heads/middles and searches keywords (e.g., "festival") before deciding what to read carefully.
- Self-organization: with Qwen3-Coder, the model adopted line-by-line semantic transformation on its own as the only feasible strategy under limited windows.
- Context rot: errors can compound and amplify across deep recursion layers.
- Overhead and latency: RLM is "System 2" slow thinking — code writing, sub-call scheduling, aggregation all cost compute; it can over-think on simple tasks.
- The authors' framing: RLM offers tunable trade-offs between accuracy/speed, global/detail, cost/quality.
- The post frames RLM as a step from "probabilistic predictor" toward a cognitive operating system: virtual-memory-like context offloading, process-scheduling-like task decomposition, and REPL-as-I/O. Future directions include multi-modal recursion, human-in-the-loop recursion, and self-optimization from execution trajectories.