HackerPapers

arXiv:2512.24601cs.AI

Recursive Language Models

Alex L. Zhang, Tim Kraska, Omar Khattab

Abstract

We study allowing large language models (LLMs) to process arbitrarily long prompts through the lens of inference-time scaling. We propose Recursive Language Models (RLMs), a general inference paradigm that treats long prompts as part of an external environment and allows the LLM to programmatically examine, decompose, and recursively call itself over snippets of the prompt. We find that RLMs can successfully process inputs up to two orders of magnitude beyond model context windows and, even for shorter prompts, dramatically outperform the quality of vanilla frontier LLMs and common long-context and coding scaffolds (e.g., on GPT-5 by a median across the evaluated benchmarks of $26\%$ against compaction, $130\%$ against CodeAct with sub-calls, and $13\%$ against Claude Code) across four diverse long-context tasks while having comparable cost. At a small scale, we post-train the first model around the RLM. Our model, RLM-Qwen3-8B, outperforms the underlying Qwen3-8B model by $28.3\%$ on average and even approaches the quality of vanilla GPT-5 on three long-context tasks. Code is available at https://github.com/alexzhang13/rlm.

arXiv comments
9 pages, 43 with Appendix
Journal reference
DOI
Subjects
cs.AIArtificial Intelligence cs.CLComputation and Language

On Hacker News

Linked by 9 identifiable commenters in 13 comments across 13 threads, from Jan 2026 to Oct 2026. Found in 4 HN submissions from Jan 2026 to Feb 2026. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments13 threads

  1. Context Language Models 1 comment
    • I think this is an unsolved problem. The most interesting thing I saw here is the Recursive Language Models paper. https://arxiv.org/abs/2512.24601 There's also a great write up here by the author: https://alexzhang13.github.io/blog/2025/rlm/

      andaiView on HNParent context

    • Very interesting. Haven't heard of RLMs before. https://github.com/alexzhang13/rlm > We propose Recursive Language Models (RLMs), a general inference paradigm that treats long prompts as part of an external environment and allows the LLM to programmatically examine, decompose…

      andaiView on HNParent context

    • Extract of the study : We study allowing large language models (LLMs) to process arbitrarily long prompts through the lens of inference-time scaling. We propose Recursive Language Models (RLMs), a general inference paradigm that treats long prompts as part of an external…

      ihrimechView on HNParent context

    • It's almost certainly not quadratic at 1M. This would be wildly infeasible at scale. 10^6^2 = 10^12. That's a trillion things. They are probably doing something like putting the original user prompt into the model's environment and providing special tools to the model, along…

      bob1029View on HNParent context

    • > Certainly interesting for very low latency applications which need < 10k tokens context. I’m really curious if context will really matter if using methods like Recursive Language Models[0]. That method is suited to break down a huge amount of context into smaller subagents…

      jameslkView on HNParent context

    • > By 50,000 tokens, your conversation’s costs are probably being dominated by cache reads. Yeah, it's a well-known problem. Every AI company is working on ways to deal with it, one way or another, with clever data center design, and/or clever hardware and software engineering…

      cs702View on HNParent context

    • Hi HN, I built RLM Analyzer, an open-source tool for analyzing codebases using Recursive Language Models. Problem: LLMs have context limits. Large codebases don't fit. Solution: Based on MIT CSAIL's RLM paper (arXiv:2512.24601), the AI writes code to explore files and delegates…

      zendizmoView on HNParent context

    • ScholarlyArticle: "Recursive Language Models" (2025) https://arxiv.org/abs/2512.24601 /? recursive language models: https://hn.algolia.com/?q=Recursive+Language+Models : - https://news.ycombinator.com/item?id=45596059 - https://news.ycombinator.com/item?id=46475395

      westurnerView on HNParent context

    • Building some prototypes around the Recursive Language Model paper. I'm currently working on integrating it with Unity for scene and script automation. Thinking about standardized patterns for retrofitting this into other existing business systems. If I can make it drive Unity…

      bob1029View on HNParent context

    • > you have a massive pile of text, and you need to split it into smaller pieces that fit into embedding models or context windows. I think the recently posted Recursive Language Models paper approaches this in a far more compelling way. They put the long context into the…

      bob1029View on HNParent context

    • Alex Zhang just published the repo alongside already published paper here https://arxiv.org/abs/2512.24601v1

      larodiView on HNParent context

Submitted to Hacker News

  • Recursive Language Models
  • Show HN: CodeRLM – Tree-sitter-backed code indexing for LLM agents

    I've been building a tool that changes how LLM coding agents explore codebases, and I wanted to share it along with some early observations. Typically claude code globs directories, greps for patterns, and reads files with minimal guidance. It works in kind of the same way you'd learn to navigate a city by walking every street. You'll eventually build a mental map, but claude never does - at least not any that persists across different contexts. The Recursive Language Models paper from Zhang…

  • Show HN: Infinate –O(k)constant-time spatial attention for unlimited LLM context

    I built infinate, an open-source (Apache 2.0) attention mechanism that places tokens in a 3D semantic space and limits attention to ~50 nearest neighbors via exponential decay + hard cutoff. This gives true O(k) constant complexity: latency ~7–14 ms and memory fixed (1.50 MB in production) even at 10M+ tokens on CPU. Latest update (Jan 20, 2026): Milestone 1.11 – Strafe Jumping Navigation. As a longtime Quake player, I applied real game physics exploits (7/9 validated) — bunny hop, circle jump…

  • Show HN: RLM-MCP optimize context in Claude Code Using MIT's recursive LM paper

    RLM-MCP – Analyze massive files in Claude Code using MIT's Recursive Language Models. I built an MCP server that lets Claude Code analyze files that exceed its context window by implementing the Recursive Language Models approach from MIT (arXiv:2512.24601). The problem: Claude Code can't fit a 10GB log file in its context. Traditional grep/read returns thousands of tokens of raw matches. The solution: Instead of stuffing data into context, treat the file as an external environment. Claude…

Connected through shared HN threads, not inferred similarity or a recommendation.