LLMのためのYコンビネータ:λ計算による長文脈劣化問題の解決
The Y-Combinator for LLMs: Solving Long-Context Rot with λ-Calculus
March 20, 2026
著者: Amartya Roy, Rasul Tutunov, Xiaotong Ji, Matthieu Zimmer, Haitham Bou-Ammar
cs.AI
要旨
大規模言語モデル(LLM)は汎用推論エンジンとしてますます利用されているが、長い入力は固定長のコンテキストウィンドウによってボトルネックとなっている。再帰的言語モデル(RLM)はプロンプトを外部化し部分問題を再帰的に解決することでこの課題に取り組む。しかし既存のRLMは、モデルが任意の制御コードを生成するオープンエンドのREPL(Read-Eval-Print Loop)に依存しており、実行の検証・予測・分析が困難である。
我々はλ-RLMを提案する。これは長文脈推論のためのフレームワークであり、自由形式の再帰的コード生成を、λ計算に基づく型付き関数型ランタイムで置き換える。事前検証済みのコンビネータのコンパクトなライブラリを実行し、ニューラル推論を有界の末端部分問題にのみ適用することで、再帰的推論を明示的な制御フローを持つ構造化された関数型プログラムに変換する。λ-RLMが標準RLMにはない形式的保証を提供することを示す。これには終了性、閉形式のコスト上限、再帰深度に応じた精度制御、単純なコストモデル下での最適分割規則が含まれる。
実証実験では、4つの長文脈推論タスクと9つの基盤モデルにおいて、λ-RLMは36のモデル・タスク比較のうち29で標準RLMを上回り、モデル階層全体で平均精度を最大21.9ポイント向上させ、レイテンシを最大4.1倍削減した。これらの結果は、型付き記号的制御がオープンエンドの再帰的コード生成よりも、長文脈推論においてより信頼性と効率性の高い基盤を提供することを示している。λ-RLMの完全な実装は、https://github.com/lambda-calculus-LLM/lambda-RLM でコミュニティに向けて公開されている。
English
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.