# Recursive Language Models

- **ID:** 589
- **Kind:** code
- **URL:** https://github.com/alexzhang13/rlm
- **Authors:** Alex L. Zhang, Tim Kraska, Omar Khattab
- **Venue:** MIT OASYS (GitHub)
- **Published:** 2025
- **Source:** github
- **Access:** free
- **License:** MIT
- **License family:** Permissive (auto-classified)
- **Tags:** rlm, recursive-language-models, long-context, codeact, mit, oasys, repl
- **Topics:** long-context inference, recursive LM calls, agent harnesses
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/589

## Summary

Replaces llm.completion with rlm.completion: the prompt lives in a CodeAct-style REPL that the model can inspect, decompose, and recurse into via sub-(R)LM calls. Paper arXiv 2512.24601: process inputs up to two orders of magnitude beyond the base context window. pip install rlms. Sandboxes: local, ipython, docker, modal, prime, daytona, e2b. Training via verifiers + prime-rl (OOLONG example). Maintained by the paper authors at MIT OASYS. MIT license.

## Attributes

- **Purpose:** Inference engine (and training env) that treats long prompts as a REPL variable and recursively calls sub-LMs
- **Scale:** 5,467 stars; 885 forks at check. Python ≥3.11. Paper: arbitrarily long prompts vs standard context windows.
- **Time period:** GitHub created 2025-12-20; updated 2026-08-14. Discord posted 2026-05-27. Paper arXiv 2512.24601 v1 2025-12-31 / v3 2026-05-11.

## From the source (fetched 2026-10-03)

- **Repository:** alexzhang13/rlm (GitHub)
- **Created:** Dec 20, 2025 (GitHub)
- **Last push:** Sep 24, 2026 (GitHub)
- **Stars:** 5,657 (GitHub)
- **Forks:** 909 (GitHub)
- **Main language:** Python (GitHub)

## Research notes

- Primary: GitHub README + API (MIT, Python, 5467 stars / 885 forks at check). Paper arXiv 2512.24601 (Zhang/Kraska/Khattab). Docs https://alexzhang13.github.io/rlm/. Discord posted the repo. Inference/training library, not a new hosted corpus, so no datasets_local row.

## Related entries

- Discussed in: [Long context: three bets and a weak spot in evaluation (overview)](https://papers.projxon.ai/entries/1208) (note, #1208)

## Similar entries

- [Harness as a Language: A Minimalist Agent Framework With Maximal Expressivity](https://papers.projxon.ai/entries/1072) (paper, #1072)
- [Reinforcing Recursive Language Models](https://papers.projxon.ai/entries/1100) (post, #1100)
- [Naive-N0.5-Flash: Building Frontier AI with AI](https://papers.projxon.ai/entries/1077) (model, #1077)
- [LongHarness Bench: Stress-Testing Language Model Harnesses for Long-Context Reasoning](https://papers.projxon.ai/entries/821) (paper, #821)
- [Context Language Models](https://papers.projxon.ai/entries/793) (paper, #793)
- [Pokee-Isaac 28B: A 10M-Token Context Efficient Agentic Model Technical Report](https://papers.projxon.ai/entries/1090) (paper, #1090)
