The Y-Combinator for LLMs: Solving Long-Context Rot with λ-Calculus
Not on the map. Why?
Abstract (arXiv)
LLMs are increasingly used as general-purpose reasoners, but long inputs remain bottlenecked by a fixed context window. Recursive Language Models (RLMs) address this by externalising the prompt and recursively solving subproblems. Yet existing RLMs depend on an open-ended read-eval-print loop (REPL) in which the model generates arbitrary control code, making execution difficult to verify, predict, and analyse. We introduce λ-RLM, a framework for long-context reasoning that replaces free-form recursive code generation with a typed functional runtime grounded in λ-calculus. It executes a compact library of pre-verified combinators and uses neural inference only on bounded leaf subproblems, turning recursive reasoning into a structured functional program with explicit control flow. We show that λ-RLM admits formal guarantees absent from standard RLMs, including termination, closed-form cost bounds, controlled accuracy scaling with recursion depth, and an optimal partition rule under a simple cost model. Empirically, across four long-context reasoning tasks and nine base models, λ-RLM outperforms standard RLM in 29 of 36 model-task comparisons, improves average accuracy by up to +21.9 points across model tiers, and reduces latency by up to 4.1x. These results show that typed symbolic control yields a more reliable and efficient foundation for long-context reasoning than open-ended recursive code generation. The complete implementation of λ-RLM, is open-sourced for the community at: https://github.com/lambda-calculus-LLM/lambda-RLM.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 36 of its 43 references that are in the map. First posted on arXiv 20 Mar 2026.
Builds on
36 of 43 references.
References · 36
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,355
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,155
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2022Least-to-Most Prompting Enables Complex Reasoning in Large Language Modelscited by 1,397
- 2025Why Do Multi-Agent LLM Systems Fail?cited by 559
- 2025Which Agent Causes Task Failures and When? On Automated Failure Attribution of LLM Multi-Agent Systemscited by 170
- 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 162
- 2025Scaling Long-Horizon LLM Agent via Context-Foldingcited by 136
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 126
- 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAGcited by 122
- 2024Retrieval Augmented Generation or Long-Context LLMs? A Comprehensive Study and Hybrid Approachcited by 117
24 more
- 2024System-Level Defense against Indirect Prompt Injection Attacks: An Information Flow Control Perspectivecited by 91
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Modelscited by 71
- 2024Human-inspired Episodic Memory for Infinite Context LLMscited by 62
- 2024Training-Free Long-Context Scaling of Large Language Modelscited by 61
- 2024AgentOps: Enabling Observability of LLM Agentscited by 46
- 2026Scalable Power Sampling: Unlocking Efficient, Training-Free Reasoning for LLMs via Distribution Sharpeningcited by 27
- 2024Kolb-Based Experiential Learning for Generalist Agents with Human-Level Kaggle Data Science Performancecited by 22
- 2026Formal Analysis and Supply Chain Security for Agentic AI Skillscited by 21
- 2025Neuro-Symbolic Artificial Intelligence: Towards Improving the Reasoning Abilities of Large Language Modelscited by 19
- 2024Mixture of Attentions For Speculative Decodingcited by 17
- 2026From Storage to Steering: Memory Control Flow Attacks on LLM Agentscited by 17
- 2025RAPID: Long-Context Inference with Retrieval-Augmented Speculative Decodingcited by 14
- 2025A Survey on Agent Workflow -- Status and Futurecited by 14
- 2025Bourbaki: Self-Generated and Goal-Conditioned MDPs for Theorem Provingcited by 10
- 2025ReAcTree: Hierarchical LLM Agent Trees with Control Flow for Long-Horizon Task Planningcited by 10
- 2025When Does Divide and Conquer Work for Long Context LLM? A Noise Decomposition Frameworkcited by 8
- 2025SymRAG: Efficient Neuro-Symbolic Retrieval Through Adaptive Query Routingcited by 5
- 2026LycheeDecode: Accelerating Long-Context LLM Inference via Hybrid-Head Sparse Decodingcited by 5
- 2025Enhancing Large Language Models with Neurosymbolic Reasoning for Multilingual Taskscited by 4
- 2026DRAGON: LLM-Driven Decomposition and Reconstruction Agents for Large-Scale Combinatorial Optimizationcited by 3
- 2026The LLMbda Calculus: AI Agents, Conversations, and Information Flowcited by 3
- 2025Test-time Scaling of LLMs: A Survey from A Subproblem Structure Perspectivecited by 2
- 2026Decoding as Optimisation on the Probability Simplex: From Top-K to Top-P (Nucleus) to Best-of-K Samplerscited by 2
- 2026Recursive Language Models Meet Uncertainty: The Surprising Effectiveness of Self-Reflective Program Search for Long Contextcited by 1
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026Recursive Agent Harnessescited by 4
- 2026MedRLM: Recursive Multimodal Health Intelligence for Long-Context Clinical Reasoning, Sensor-Guided Screening, Evidence-Grounded Decision Support, and Community-to-Tertiary Referral Optimizationcited by 0
- 2026The Model Knows When to Stop: Training-Free Early Stopping for Long-Context Readingcited by 0
- 2026The Model Knows When to Stop: Training-Free Early Stopping for Long-Context Reading28 Sep 2026
- 2026MedRLM: Recursive Multimodal Health Intelligence for Long-Context Clinical Reasoning, Sensor-Guided Screening, Evidence-Grounded Decision Support, and Community-to-Tertiary Referral Optimization18 Jun 2026
- 2026Recursive Agent Harnesses11 Jun 2026