Recursive Language Models
Content Summary
Programming & TechnicalRecursive Language Models • Alex L. Zhang; Tim Kraska; Omar Khattab
TL;DR
This paper introduces Recursive Language Models (RLMs), a general inference paradigm that treats arbitrarily long prompts as external environment variables rather than feeding them directly into the neural network, enabling LLMs to programmatically examine, decompose, and recursively call themselves over snippets of the prompt. RLMs process inputs up to two orders of magnitude beyond model context windows and dramatically outperform vanilla frontier LLMs and common long-context scaffolds across four diverse tasks while maintaining comparable cost. A small-scale post-trained model (RLM-Qwen3-8B) improves over its base by 28.3% on average, demonstrating that training natively recursive language models is a promising new axis of scale.
ELI5
Imagine you have a really, really long story book — so long you can't hold it all in your hands at once. Instead of trying to read it all at the same time, you put the book on a table, look at the table of contents, then flip to just the pages you need, read those parts, write notes, and sometimes ask a friend to read other pages for you. That's what RLMs do — they put the big text on a 'table' (a computer environment) and look at just the pieces they need, asking helper copies of themselves to read other pieces!
Top Concepts
Keywords
Quick Actions
- !Implement the RLM pattern: offload user prompts as variables in a persistent REPL environment rather than feeding them directly into the LLM context window
- !Enable symbolic recursion by allowing REPL code to programmatically invoke the LLM on slices of the prompt inside loops
- !Build final outputs through REPL variables (FINAL_VAR) rather than pure autoregressive generation to overcome output length limits
Want to analyze your own content?
Extract insights from YouTube videos, PDFs, and web articles. Free to start.
Try Knowmler Free