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):

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)→

Original post →

More from coding & agent

coding & agent channel →