ChatPaper.aiChatPaper

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)에 의존하여 실행의 검증, 예측, 분석이 어렵습니다. 본 논문에서는 자유 형식의 재귀 코드 생성 대신 λ-계산에 기반한 타입 기능형 런타임을 사용하는 장문맥 추론 프레임워크인 λ-RLM을 소개합니다. λ-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.
PDF235March 24, 2026