What are Recursive Language Models (RLMs)?
Recursive Language Models process long texts outside the model's context window, using code and recursive model sub-calls to put together a final answer.
Recursive Language Models (RLMs) are a way to make a language model work on long texts using code and recursive calls to itself or to other models. The text stays in an external environment while the main model examines portions, transforms them, or hands them off to sub-calls, then combines the results. In the authors' implementation, that environment is a REPL, a workspace that runs code and keeps results between steps. The context window, the amount of text a single model call can receive, still caps each call; only the system as a whole can take on a larger input. An RLM is a way to organize work at inference time and does not guarantee correct answers. It can help when a question requires examining many parts of a document, but it adds time, cost, and risks that must be assessed alongside answer quality.
See also: Context engineeringContext engineering designs the information supplied to an AI model, selecting the instructions, documents, and history that each specific request needs.
Origin and key difference
The MIT CSAIL authors describe their proposal in the Recursive Language Models paper and their initial research overview. The main model writes code to explore the text and can launch sub-calls on selected portions. Intermediate results can also stay in the external environment. The model decides how to divide the work, so it need not receive the entire document in one request.
RAG, or retrieval-augmented generation, finds relevant documents or passages and feeds them to the model, which answers from them. RAG is worth comparing with an RLM, and the two can coexist: retrieval can help when only a few sources contain the answer, while a broader scan may be useful when important details are scattered throughout the documents. Neither approach alone guarantees that relevant passages are found or interpreted correctly.
Maturity
The updated paper runs the OOLONG benchmark at about 131,000 tokens (the units of text a model processes), which fits within GPT-5's window. There, GPT-5 as the main model with GPT-5-mini sub-calls scores 56, versus 44 for GPT-5 alone. The result covers one task and one configuration and does not predict performance on business documents. The authors also note that costs vary and that safeguards need further study. The authors' repository distinguishes isolated from non-isolated environments: its default local environment runs code in the same process and is not intended for production.
An enterprise example
A procurement team needs to find notice obligations across contracts and attachments. An RLM prototype could split the documents, use sub-calls to identify the clauses, and assemble the results with document references. Staff would then check the original passages, including exceptions and amendments: a missed or misread clause could change the team's decision. This scenario is illustrative and does not come from the authors' results.
Why it matters for decision makers
Before buying or adopting an RLM, compare it with document retrieval and with sending the full text to the model when the text fits in the window, using representative questions with verified answers. Count missed clauses and correct references, and measure time and cost per case, sub-calls included. Ask where code and models run, what data they receive, and how access is protected. Set spending and execution limits, and require human review for contract decisions.
Frequently asked questions
Related terms
- Context engineeringContext engineering designs the information supplied to an AI model, selecting the instructions, documents, and history that each specific request needs.
- Context windowThe context window is the limit, measured in tokens, on how much information an AI model can use for a request, including the response that the model generates.
- RAGRAG combines search and generation: it retrieves external sources relevant to a question and passes them to a language model, which draws on them to answer.
- Reasoning modelsReasoning models are language models designed to work through intermediate steps before answering; their costs and results must be measured on the actual task.
- Looped transformerA model that runs the same layers several times to think longer, without writing out any intermediate step.