Research map / Large language models / Reasoning and chain of thought
Recursive Language Models
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Recursive Language Models (RLMs), an inference scaffold that stores long prompts as a REPL variable so the LLM can programmatically inspect and recursively call itself over snippets, and post-trains an 8B RLM from 1,000 distilled trajectories.
Problem
Frontier LLMs have bounded context windows and suffer context rot, and existing compaction, retrieval, and coding-agent scaffolds lose fine-grained information or cannot make programmatic sub-calls over long prompts.
Approach
Treat the user prompt as an external variable in a Python REPL, let the root LM write code that peeks into, decomposes, and invokes the same LM (sub-RLM) programmatically over slices of the prompt, with only constant-size metadata appended to the root context.
Key results
- GPT-5 RLM (depth=1) reaches 58.0 F1 on OOLONG-Pairs versus 0.1 for base GPT-5, and 76.0 at depth=3.
- On BrowseComp-Plus (1K, 6-11M tokens), RLM(GPT-5, depth=1) scores 91.3 versus 70.5 for the compaction agent at comparable cost.
- RLM-Qwen3-8B improves over base Qwen3-8B by a median of 28.3% across four evaluation tasks using 1,000 training trajectories.
Surprising findings
- Depth-0 RLM without sub-calls outperforms all sub-calling RLM variants on CodeQA with Qwen3-Coder.
- Higher recursion depth performs worse for Qwen3-Coder because its syntax errors propagate to sub-calls.
Limitations
- Sub-LM calls are blocking and sequential, making RLM runs slow.
- Exploding sub-call costs and guardrail issues for recursive calls.
- Smaller models such as Qwen3-8B struggle without strong coding ability; training experiments are small-scale.
Experimental setup
Datasets: LongBenchPro MRCRv2 RULER S-NIAH OOLONG BrowseComp-Plus LongBench-v2 CodeQA LongCoT-mini
Benchmarks: S-NIAH BrowseComp-Plus (1K) OOLONG OOLONG-Pairs LongBench-v2 CodeQA LongCoT-mini MRCRv2
Metrics: accuracy F1 API cost runtime
Baselines: GPT-5 base CodeAct (+ BM25) CodeAct (+ sub-calls) Compaction agent OpenCode Claude Code Qwen3-Coder-480B-A35B base Qwen3-8B base
Builds on: ReAct CodeAct BM25 ReSum ViperGPT
Closest papers by meaning
- ReCAP: Recursive Context-Aware Reasoning and Planning for Large Language Model Agents (NeurIPS 2025 · similarity 0.89)
- Investigating the Effectiveness of Task-Agnostic Prefix Prompt for Instruction Following (AAAI 2024 · similarity 0.89)
- Scaling Prompt Synthesis for Large Language Model Reasoning (ICML 2026 · similarity 0.89)
- Recursive Inference Scaling: A Winning Path to Scalable Inference in Language and Multimodal Systems (NeurIPS 2025 · similarity 0.89)
- Supervised Knowledge Makes Large Language Models Better In-context Learners (ICLR 2024 · similarity 0.88)
- Prompt Sketching for Large Language Models (ICML 2024 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
