Naru News日本語

Home › Glossary › AI

What is a recursive language model (RLM) in AI?

Also called: Recursive Language Models, RLMs

Term explainer · Checked November 11, 2026 · 16 min read

In one minute

A recursive language model (RLM) is a way of using an AI (a large language model) in which a long text is not fed to it all at once but kept in a container inside a program (a variable); the AI writes code to peek at parts of it, calls an AI again to read each part, and gathers the answers.

An AI can only read so much at once (its context window, the AI’s “window”), and even within that limit, the longer the text, the more it misses. So the text is kept out of the window, in the place where the AI’s programs run (the computer’s memory). The AI finds the parts it needs, for example by searching for words, and has an AI read just those parts. Because an AI calls an AI, it is called “recursive.”

It is a way of using existing AIs, and it is different from “recursive self-improvement,” where an AI rebuilds itself. MIT researchers proposed it in 2025, and in their experiments GPT-5 used this way answered questions even about 1,000 documents (6 to 11 million tokens; tokens are the units AI counts text in), more than 20 times what it can read at once.

A common mix-up

“A recursive language model is an AI that rebuilds itself and keeps getting smarter.”

The “recursive” in the name (something calling itself) is right, but the reason for calling itself is different. In a recursive language model, the AI calls itself while answering one question, to have parts of a long text read. The numbers inside the AI (its parameters) don’t change, and once it has answered, it is the same AI as before. The idea of an AI building a better next AI, again and again, is a different thing called “recursive self-improvement.” Nor is a recursive language model a big, newly built AI. It is a way of using an existing AI such as GPT-5, a setup wrapped around it. The paper also tried training a small AI to get used to this way of working, but that was training the researchers carried out, for example by picking a larger AI’s worked runs as examples; it was not the AI rebuilding itself.

Explained in pictures

A figure comparing where a long text is kept in two ways of using an AI (example made up for this page). Title: “Keep the long text outside the window.” Left panel, “The usual way”: a long sheet of text lies sideways; its left part is inside a thick navy frame labeled “AI’s window,” and its right part sticks out of the window and is drawn with a dotted line. On lines inside the window are two orange “?” marks. Below the window: “missed”; below the part sticking out: “doesn’t fit.” Under the panel: “Won’t fit; long text gets missed.” Right panel, “Recursive language model”: on the left, a pale orange box labeled “Container (a variable)” holds a tall sheet of text, with one line boxed in orange. At the top right is a navy box, “AI.” An orange solid arrow labeled “code” goes from the AI to the container. A navy dotted arrow labeled “part” goes from the boxed line to a white frame below the AI labeled “AI’s window,” which lists “• length,” “• the start” and “• a peeked part.” Under the panel: “Only a short part enters the window.” Band at the bottom: Keep the text outside; read only what’s needed.
This figure compares, left and right, where a long text is kept. In the usual way on the left, the whole text is put into the window the AI can read at once (its context window). Whatever is longer than the window doesn’t fit, and even what fits gets missed more the longer it is. In a recursive language model on the right, the text stays in a container in a program (a variable). As the solid arrow shows, the AI writes a program (code), for example one that searches for words, to peek into the container, and as the dotted arrow shows, it gets back only a part it peeked at and things like the length. Because only short parts enter the window, the AI can handle texts far longer than the window.
A tree-shaped figure of a parent AI splitting a text and having child AIs read it (example made up for this page). Title: “A parent AI splits the text for child AIs.” Top row, from the left: a pale orange box “Long text (in the container),” an arrow, a navy box “Parent AI: splits, hands out, gathers,” an arrow and an orange-framed box “Final answer: built and returned.” Below the parent are three white boxes: “Child AI, reads part 1,” “Child AI, reads part 2” and “Child AI, reads part 3.” Dark brown solid arrows go from the parent to the children, labeled “part + question.” Orange dotted arrows go from the children back to the parent, labeled “answer.” Under the third child are two small dotted boxes, “Grandchild,” joined to it by solid arrows, with “A child can split again” below. Under the first two children: “Each child reads only its part.” Band at the bottom: An AI calls an AI to read: that is “recursive.”
This tree-shaped figure shows how a recursive language model shares out the reading of a long text. The parent AI at the top uses a program to split the text in the container into parts. Along the solid arrows, it hands a part and a question to each child AI, and each child reads only the part it was given and answers. The answers return to the parent along the dotted arrows, and the parent gathers them and builds the final answer. A child AI may be the same AI as the parent or a smaller, cheaper one (in the paper’s experiments, the parent was GPT-5 and the children GPT-5-mini). As at the bottom right, a child can also split its part again and call grandchild AIs. This nesting, an AI calling an AI, is what “recursive” means here.
A horizontal bar chart of how five ways of using GPT-5 did on two problems. Title: “Five ways compared on two problems.” Subtitle: “Compare the bar lengths within each problem (tested with GPT-5).” Top row: “Problem 1: Answer from 1,000 documents” (6–11 million tokens, over 20× the window). On the left, an example question, “Who won the beauty pageant one year at a festival named after a stew?” and “Follow clues across documents.” On the right, “Bars: share answered correctly (up to 100%)”: Reading it all 0% (didn’t fit; no bar), Searching 51.0%, Summarizing 70.5%, Outside only (no AI calls) 88.0%, Recursive LM (also calls AIs) 91.3% (orange striped bar). A dotted line drops from the end of the Outside only bar, and a tag “+3.3” sits next to 91.3%. Bottom row: “Problem 2: List every pair meeting a condition” (32,000 tokens, fits in the window). On the left, an example list: Person 1 “How far is the Moon?”, Person 2 “What is this flower called?”, Person 3 “Where is the station?”, Person 4 “How tall is Mt. Fuji?” Above it, “Type: read to decide,” with tags “number” on persons 1 and 4 and “place” on person 3. Below: “Rule: both asked about a number or place” and “Answer: 1 & 3, 1 & 4, 3 & 4 (3 pairs).” On the right, “Bars: score (F1, up to 100)”: Reading it all 0.1, Searching 24.7, Summarizing 0.1, Outside only 43.9, Recursive LM 58.0 (orange striped bar), which reaches well past the dotted line, with a tag “+14.1.” The other bars are navy. Band at the bottom: Outside alone helped; calling AIs added most on Problem 2.
This figure shows how five ways of using GPT-5 did on two problems. Compare the lengths of the five bars within each problem. Problem 1 is finding one answer among 1,000 documents (6 to 11 million tokens, more than 20 times the 272,000 tokens GPT-5 can read at once) by linking clues; the bars show the share answered correctly. Problem 2 starts from a list of questions (32,000 tokens, which fits in the window), each tagged with the number of the person who asked it, and asks for every pair of people that meets a condition, such as “both asked at least one question about a number or a place.” The list doesn’t say what type each question is, so each one has to be read and decided. The bars show an F1 score (the more of the right pairs listed, with none wrong and none left out, the higher, up to 100). “Outside only” keeps the text outside the window and reads it with programs but doesn’t call child AIs; the dotted line marks the end of its bar. On Problem 1, that alone got 88.0%, close to the 91.3% of the recursive language model, which also calls child AIs; on Problem 2, the gap opened: 43.9 against 58.0. Summarizing as it read got 70.5% on Problem 1 but 0.1 on Problem 2. The paper writes that summarizing assumes fine details can be forgotten, so it doesn’t suit problems that use fine details from all over the text. These are results from one study, with particular AIs.

You’re free to use these figures in lessons, slides and posts if you credit Naru News (naru.news). CC BY 4.0.

Think of it like this

A team searching newspapers in a warehouse

Imagine you are put in charge of finding out about a town’s festival from a warehouse full of old newspapers. Carrying them all to your desk and reading them is out of the question. So the team leader leaves the newspapers in the warehouse, first counts how many there are, and uses a search machine to find the issues where the word “festival” appears. When a promising bundle turns up, the leader asks a team member, “Find the festival’s winner in this bundle,” then gathers the notes that come back and writes the report.

The warehouse is the container (a variable), running the search machine is the program (code), and the team members handed bundles are the child AIs. All that lands on the leader’s desk (the context window) is counts, search results and notes, so however big the warehouse is, the desk never overflows. If a member’s bundle is still too big, that member can split it too and pass the pieces on to others. Because the member does the job the same way the leader does, this is recursion.

But the comparison has limits. The team members in a recursive language model are the same AI as the leader or a smaller relative of it, so they don’t each have different strengths or knowledge. A member also sees only the bundle and the question it was given, not the others’ notes or what the leader is thinking. And the AI leader can’t look around the warehouse with its own eyes; the only way it can learn what is inside is by writing a program and getting back a short part of the result.

Key points

Why is it called “recursive”?

“Recursion” is when a procedure calls itself partway through. For example, think of a procedure that counts the photos in a folder on a computer. If the folder has smaller folders inside, you use the same “count the photos” procedure on each of them and add up the results. Because the procedure calls itself, it can count photos however many folders deep they are. It is an idea often used in writing programs.

In a recursive language model, partway through the job “read this text and answer the question,” the AI again asks an AI to do the job “read and answer” for a part of the text. The AI that was asked can also pass part of its share to another AI. Because an AI is called inside an AI’s job, it is called “recursive.” The 2026 revised version of the paper tested a version where the child AIs only read (depth 1) and versions where children can call children of their own (depths 2 and 3).

The AI that gets called doesn’t have to be exactly the same one. In the paper’s experiments, the parent was GPT-5 and the children were GPT-5-mini, a smaller, cheaper relative. Both are “language models” of the same shape, taking text in and giving text back, and the job handed over is the same “read and answer.” That is why a recursive language model can also be used from outside just like a single language model.

Why not just feed in everything as is?

There is a limit to how much an AI can read at once (its context window). The GPT-5 used in the paper’s experiments had a limit of 272,000 tokens (tokens are the small pieces AI counts text in). Text longer than that simply doesn’t fit.

Even within the limit, the longer the text, the more the quality of the answers drops. The paper writes that how quickly it drops depends on the kind of question. Just finding one phrase in a lot of text works well even when the text is long. But for questions that count using nearly every line, or that check every pair of lines, quality dropped at much shorter lengths. In the paper’s experiments, as the length was varied from about 8,000 to about 1 million tokens, GPT-5’s scores fell the longer the text and the more involved the question, while the recursive language model declined more gently. Beyond about 16,000 tokens, the recursive language model was always ahead.

Another way is to summarize whenever things are about to overflow. But the paper writes that summarizing assumes some details from early in the text can safely be forgotten, so it doesn’t suit questions that need fine details from all over the text.

How does it split the text up and read it?

The text is put in a container in a program (a variable). The container sits where the AI’s programs run (in the computer’s memory), apart from the window the AI reads at once. At first, the parent AI is told only the text’s length and a little of its beginning.

So how does the parent find the parts to read? Instead of reading the text from the start, it writes programs to look into it and runs them. A program that finds where a word appears, for example, gives back a list of the places it was found. Of the results, too, the parent is shown only the first bit and the length, but that is enough to tell roughly where the hits are. It can also write programs that cut the text into chapters or lines. Because anything long is kept in the container, the parent’s window doesn’t fill up quickly.

When it finds a part that needs reading, the parent writes an instruction into its program that hands that part and a question to a child AI. The children’s answers are also stored in the container, and at the end the parent puts them together and returns its answer. Because the answer, too, is built up inside the container, the parent can return an answer longer than the window when the answer itself is long, such as a list of everything that meets a condition.

The paper describes an example of finding an answer among 1,000 documents (about 8.3 million tokens). The question asked for the name of the winner of a beauty pageant held one year at a festival named after a stew, to be pieced together from several clues. The parent, GPT-5, first wrote a program that searched for words such as “beauty pageant” and “festival,” and when it found a promising spot, it had a child AI read just that part. The child found the name, and the parent had children check it twice more before giving the correct name. This one question cost about 0.08 dollars.

How well did it work?

The paper (in its 2026 revised version) used GPT-5 and Qwen3-Coder, a large AI whose model is openly published, and compared the approach on four tasks with reading it all as is, summarizing as it reads, searching and then reading, and AI coding tools (such as Claude Code).

With GPT-5, on a task of answering from 1,000 documents (6 to 11 million tokens), reading it all as is didn’t fit and got 0%, searching and then reading got 51.0% and summarizing as it read got 70.5%, while the recursive language model got 91.3%. A question cost 0.99 dollars on average. On a task of listing every pair of people that meets a condition from a 32,000-token list that fits in the window, reading it all as is scored 0.1, but the recursive language model scored 58.0 (the score is F1: the more of the right pairs listed, with none wrong and none left out, the higher, up to 100). On a multiple-choice task about a large program, it went from 24.0% to 62.0%.

But it didn’t work equally well with every AI. With Qwen3-Coder, the 1,000-document task came out at 44.7%, and on some tasks going deeper even lowered the score. Qwen3-Coder often made mistakes in the programs it wrote, and at greater depths the children write programs just as the parent does, so the paper thinks the same mistakes happened in the children too. The paper also writes that when a small AI (Qwen3-8B) was trained on 1,000 examples of this way of working, it scored better than the original Qwen3-8B.

When did an AI calling an AI help?

The paper (in its 2026 revised version) also tried a way that keeps the text outside the window and reads it with programs but doesn’t call child AIs. With GPT-5, on the task of answering from 1,000 documents (6 to 11 million tokens) by linking clues, that alone got 88.0%, close to the 91.3% when child AIs were called. An AI coding tool (OpenCode) that was given the text in a file also got 94.0%. Even at lengths far too long for the window, keeping the text outside and reading while searching went a long way.

The gap opened on a task of listing every pair of people meeting a condition, from a list of questions (32,000 tokens), each tagged with the number of the person who asked it; for example, pairs where both people asked at least one question about a number or a place. The list doesn’t say what type each question is, so each one has to be read and its type decided from its meaning. Without calling child AIs it scored 43.9, and OpenCode 4.8, but calling child AIs gave 58.0, and depth 3, where children can call children, gave 76.0 (the score is F1: the more of the right pairs listed, with none wrong and none left out, the higher, up to 100). The paper thinks that without child AIs, the AI could only tell the types apart by word clues.

So in this paper’s experiments, what made long texts manageable was, first of all, keeping the text outside the window. An AI calling an AI helped on involved tasks, such as reading the meaning of every line one by one. It is the difference between a search that words alone can settle and one where each item must be read before you can decide. In the experiments with Qwen3-Coder, though, on the task about a large program, not calling child AIs scored better, so calling more is not always better.

What are its weak points?

First, it takes time. In the paper’s experiments, the child AIs were called one at a time, in turn, so it was slower than reading it all as is, and the time taken varied a lot from run to run, with some runs taking very long. The authors think it could be made faster by letting the children run at the same time.

Second, the cost varies a lot from run to run. Lining up the cost of each run from cheapest, the run in the middle was cheaper than reading it all as is, but the average over all runs was higher. That is because some runs struggle to find the answer and keep calling child AIs again and again. The paper names keeping the cost of calling children from ballooning, and how to add safety checks, as problems still to solve.

Third, how well it works depends on the AI. Small AIs without enough skill at writing programs didn’t do well. Qwen3-Coder tried to hand everything to child AIs: unless a sentence warning it not to call too many was added to its instructions, it called children thousands of times even on simple tasks. Even after that, it sometimes called a child for every line, making hundreds or thousands of calls on one question (GPT-5 made about ten). Other failures were seen too, such as handing in a sentence that was only a plan as the final answer, or ignoring the correct answer stored in the container and returning a wrong one.

How is it different from retrieval-augmented generation or AI agents?

Retrieval-augmented generation (RAG) uses a search tool to pick the parts likely to match the question, puts those parts into the window, and then has the AI answer. Where to read is decided first, by the search tool. In a recursive language model, the AI itself decides where and how to read, by writing programs. It can search by words, but it can also put a child AI on every line, one by one, and count. That is why it can also be used for questions that can’t be answered without looking at the whole text.

It is closely related to AI agents, which decide for themselves what to do next and use tools to get work done. A recursive language model, too, repeats writing code, running it, looking at the result and deciding what to do next. The paper writes that earlier ways of having an AI call itself as a helper write out each job to hand over in words, one at a time, so only a few can be handed out. In a recursive language model, child AIs are called inside a program’s loop, so they can be called hundreds of times, to match the length of the text. And not putting the text itself into the window also sets it apart from many agents.

All of these leave the AI itself (the numbers inside it, its parameters) unchanged and work on the setup around it. Another way to widen the window’s limit is to change the AI’s design and train it again, but the paper treats recursive language models as going in a different direction. Like reasoning models that think before answering, they are one of the ways to get better answers without rebuilding the AI, by spending more computation (more effort) when it answers. A reasoning model thinks longer before answering; a recursive language model calls AIs many times to read.

Check yourself

  1. Q1In a “recursive language model (RLM),” one way of having an AI answer about a very long text, where is the long text put first?

    Answer and explanation

    Answer: C All of it, as is, in a container inside a program

    In a recursive language model, the long text stays in a container (a variable) in the place where the AI’s programs run. If you try to put everything into the window, text over the limit won’t fit, and even what fits gets missed more the longer it is. The AI isn’t retrained either: the numbers inside it don’t change, and only the way it is used is worked out.

    More on this → Explained in pictures

  2. Q2In the AI technique “recursive language model (RLM),” when the parent AI gets a question about a long text, how does it find which parts of the text to read?

    Answer and explanation

    Answer: A It searches for words itself and looks at bits of the hits

    The parent AI doesn’t read the text in order from the start. It writes and runs its own programs, for example ones that search for words, looks at short bits of what they find, and narrows down where to read. In retrieval-augmented generation (RAG), a search tool picks the parts first; in a recursive language model, the AI itself decides where and how to read. The parts it finds are handed to child AIs to read.

    More on this → Key points: How does it split the text up and read it?

  3. Q3In the experiments of a paper that tried the AI technique “recursive language model (RLM)” for reading long texts, compared with not calling child AIs, on what kind of task did letting it call child AIs raise the score a lot?

    Answer and explanation

    Answer: B Tasks where the meaning of every line must be read and judged

    In this paper’s experiments (with GPT-5), the task of answering from 1,000 documents by linking clues was far too long for the window, yet without calling child AIs it scored 88.0%, and 91.3% with them: a small gap. Keeping the text outside and reading while searching solved much of it. On the task of listing every pair of people meeting a condition from a list of questions, the type of each question had to be decided from its meaning; it scored 43.9 without calling child AIs and 58.0 with them. The paper thinks that without them, the AI could only tell the types apart by word clues.

    More on this → Key points: When did an AI calling an AI help?

Sources and how we checked

AI wrote this page from the sources above, and a different AI checked it against the text of those sources (November 11, 2026). A person with a master’s degree in science and a Japanese high-school science teaching license also read and checked it before publishing. Numbers are as of that date. If anything was hard to follow, you spot a mistake, or there’s a term you’d like explained, please write to [email protected].

AI terms

All 58 AI terms →