RLM explained: LMs recursively self-invoke in a REPL to tame long-context rot
gordic_aleksa · x · 2026-09-20
RLM (Recursive Language Model) is an inference strategy where an LM programmatically manipulates its input as external data and recursively invokes itself or other LMs on selected portions.
Key difference from conventional coding agents: the entire input and intermediate results live in an external Python REPL, while the root LM decides what computations to run — mitigating context rot.
Example workflow (counting 'entity' questions among 5k entries):
- Data sits in a REPL variable context, not in the prompt
- Root LM inspects format via print(context[:2000])
- Python filtering shrinks 5k entries to 347 relevant lines without polluting context
- Lines are chunked (50 each) and classified via 7 recursive sub-LLM calls, then aggregated
Most importantly, the root LM can be RL post-trained inside this harness, showing much better generalization since many problems look alike at this abstraction level. Work by Alex L. Zhang and lateinteraction.
Related event: Recursive Language Models Let LMs Call Themselves on Long Contexts(2 posts)→
More from coding & agent
- Mnemos MCP nears launch after shared memory layer fix — RileyRalmuto · 2026-11-04
- Moving mobile dev to remote machines makes it multiplayer across product, design, engineering — rudrank · 2026-11-04
- Kuaishou's EvoRec: self-evolving agentic recommender lifts ad revenue 4.6% — _reachsumit · 2026-11-04
- TRIO: three specialized agents with aligned objectives refine retrieval-augmented generation — _reachsumit · 2026-11-04
- How Multica uses Multica to build itself: full human-agent dev workflow — jiayuan_jy · 2026-11-04
- Claude Code fixes game copyright refusal rule in 2.1.317: naming a game now works — apples_jimmy · 2026-11-04