Skip to content

Source paper

Recursive Language Models

Alex L. Zhang, Tim Kraska, Omar Khattab
arXiv 2512.24601 · 202517 upvotes on Hugging Face

Research ideas from this paper (4)

Generated by AI. The paper’s authors did not write these.

AI summary

This paper introduces Recursive Language Models (RLMs), an inference-time scaling strategy that allows Large Language Models to process arbitrarily long inputs by treating the context as an external environment within a Python REPL. Instead of ingesting the full context at once, the model writes code to programmatically access, decompose, and recursively sub-query specific chunks of the data, enabling effective processing of inputs up to 10M+ tokens with competitive costs compared to base models.

How it works (AI summary)

The core methodology involves wrapping an LLM in a Read-Eval-Print Loop (REPL) environment where the long context is stored as a variable. The model is prompted to interact with this variable via Python code and a special `llm_query` function, allowing it to perform recursive decomposition (chunking) and sub-calls (processing chunks) to synthesize an answer without ever fitting the whole context into its immediate attention window.