Recursive Language Models
(RLMs)
Scaling Large Language Models Beyond Context Limits
Paper by Alex L. Zhang, Tim Kraska, Omar Khattab | MIT CSAIL, 2026
Presented by -
Bhavya Ladumor
Tanay Puranik
The Problem with Current
LLMs
Limited Context Context Rot
Windows Performance degrades
Most LLMs can only process a significantly when input
few thousand to tens of becomes very long or complex
thousands of tokens at once
Real-World Needs
Many practical tasks require processing millions of tokens
simultaneously
Existing Approaches to Long Context
The Limitations
Increasing Context Window
These approaches either lose critical information, remain
Expanding model capacity to handle more tokens directly inefficient for extremely long inputs, or require extensive
retraining of models.
Summarization & Compression
Reducing input size by extracting key information
Retrieval Systems
Fetching relevant context on-demand during processing
Key Idea: Recursive Language
Models
01 03
Prompt as Environment Recursive Processing
Large prompts are stored externally, not fed directly to the model Model calls itself on smaller, manageable chunks of the input
02 04
Programmatic Exploration Result Combination
Model writes code to inspect and retrieve specific parts of prompt Intermediate results are stored and combined to form final answer
Key Idea: Recursive Language
Models
How RLMs Work
REPL-Based Framework
Prompt Storage
Large prompt stored as variable in external environment
Code Generation
Model writes inspection code to access specific prompt sections
Recursive Calls
Model invokes itself on smaller, focused chunks of input
Result Aggregation
Intermediate outputs stored and combined into final response
Example Workflow
Large Prompt Received
Millions of tokens to process
Split into Chunks
Divided into manageable pieces
Recursive Processing
RLM calls itself repeatedly
Combine Results
Aggregate intermediate outputs
Final Answer
Complete response generated
Results from the Research
10M+ 28% 3.2x
Tokens Processed Performance Gain Speed Increase
Successfully handled inputs exceeding 10 Average improvement over standard LLM Faster processing compared to naive
million tokens calls on long-context tasks context window expansion
RLMs demonstrated consistent improvements across multiple benchmark datasets when tested with models like GPT-5 and Qwen.
*RLM to GPT-5
Conclusion & Future Impact
Extremely Long Contexts Scalable AI Systems
Handles inputs of arbitrary length without fixed context window limitations New direction for building AI systems for research, coding, and document analysis
Key Takeaway: RLMs represent a paradigm shift in how we think about scaling
language models, treating prompts as programmatically accessible environments rather
than fixed inputs.
Improved Reasoning
Better performance on complex tasks requiring analysis of large datasets