Recursive Language Models: Treat the Prompt as Code, Not a Window
Watch on TikTok
A 47-second breakdown of an MIT paper on Recursive Language Models (RLMs). The core move is small but counterintuitive: stop cramming the whole prompt into the context window. Load it as a variable in a code environment instead, and let the model write code to inspect only the parts that matter. The video frames this as a fix for "context rot," the failure mode where models get worse the longer the prompt gets.
The Problem: Context Rot
The video opens on a film-strip graphic labeled "THE WINDOW" holding a running token count (576,477 climbing toward 1,000,000+). The point: past a certain length, even frontier models degrade as the prompt grows. More context, lower quality.
The "CONTEXT ROT" frames make this literal. A quality gauge sits next to the model. With a short prompt the reading is "sharp" and the meter is green. As the caption "the prompt keeps growing" fills the screen with rows of gray tokens, the gauge flips to "wrong" and drops into the red. The model is the same. Only the prompt length changed.
The Flip: Load the Prompt, Don't Read It
Recursive Language Models invert the usual setup. Instead of forcing the entire prompt through the context window, they load it as a variable inside a code environment. The video shows an env block with the prompt represented as a row of tokens and a single line of code:
p = load(prompt)
The model itself is labeled "NEVER READS IT RAW." It does not ingest the full text directly. It treats the prompt as data it can query, the same way you would open a large file in a script rather than paste the whole thing into your editor.
Recursion: Split, Skip, Recurse
Once the prompt is a variable, the main model writes code to peek at pieces and break them up. The "RECURSION" frames diagram this as:
split(p) -> recurse
The root model splits the prompt into chunks and spawns smaller copies of itself on the chunks that actually matter. The diagram shows three child chunks: two highlighted in orange (kept and passed to child models), and a middle chunk grayed out and labeled "SKIPPED." One of the child models spawns its own child, showing the recursion can go deeper. The model only spends compute on the parts relevant to the task, recursively, rather than attending to every token at once.
What It Buys You
The "WHAT IT BUYS YOU" frames make three claims:
- It handles inputs more than
10x past the window. - It is "stronger on short prompts too," so the gain is not only at extreme lengths.
- It works as
rlm( your model )with "NO RETRAINING." The on-screen text calls it "a wrapper, not a new model."
That last point is the practical hook. RLM wraps a model you already use. There is no fine-tuning step and no new base model to train. You keep your existing model and change how the prompt is handled around it.
The One-Line Summary
The closing frame states the thesis directly: "treat the prompt as an environment," not a window. A window is a fixed-size box you stuff text into until quality breaks down. An environment is a place the model can run code, load data, and pull only what it needs. The video notes the paper is linked in the creator's bio.
Key Takeaways
- Context rot is the target problem: model output quality degrades as the prompt grows longer, even on frontier models.
- RLMs load the prompt as a variable in a code environment (
p = load(prompt)) so the main model never reads the full text directly. - The model writes code to split the prompt, skip irrelevant chunks, and recursively call smaller copies of itself on the parts that matter (
split(p) -> recurse). - The approach handles inputs more than 10x past the context window and reportedly performs better even on short prompts.
- It requires no retraining. RLM is a wrapper around a model you already use (
rlm( your model )), not a new base model. - Mental model shift: treat the prompt as an environment to run code against, not a window to fill with text.
Published June 20, 2026. Writeup generated from a favorited TikTok.