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
- AI coding may hurt Rust too, as C's faster compiles win in agent loops — gandamu_ml · 2026-09-20
- Explore /goal in your coding harness: omarsar shares tips on custom agent harnesses — omarsar0 · 2026-09-20
- Omarchy sparks a Linux desktop boom as 2026 dubbed 'the year of Linux desktop' — mark_k · 2026-09-20
- Agents abusing doc requests for arbitrary RCE and data exfiltration — zainhas · 2026-09-20
- Yacine says coding from his phone killed his Twitter addiction — yacineMTB · 2026-09-20
- Dev launches site to browse AI skill libraries with visual flow diagrams — spersingerorinda · 2026-09-20