LoongRL: 장문 맥락에 대한 고급 추론을 위한 강화 학습
LoongRL:Reinforcement Learning for Advanced Reasoning over Long Contexts
October 22, 2025
저자: Siyuan Wang, Gaokai Zhang, Li Lyna Zhang, Ning Shang, Fan Yang, Dongyao Chen, Mao Yang
cs.AI
초록
긴 문맥에 대한 추론은 대규모 언어 모델에 있어 필수적입니다. 강화 학습(RL)은 사고의 연쇄 속에서 "아하" 순간을 유도함으로써 짧은 문맥 추론을 향상시키지만, 긴 문맥 추론에 필요한 고급 사고 패턴은 여전히 크게 탐구되지 않았으며, 고난이도 RL 데이터는 부족한 실정입니다. 본 논문에서는 고급 긴 문맥 추론을 위한 데이터 기반 RL 방법인 LoongRL을 소개합니다. LoongRL의 핵심은 KeyChain으로, 짧은 다중 홉 질의응답(QA)을 고난이도 긴 문맥 작업으로 변환하는 합성 접근법입니다. 이는 UUID 체인을 삽입하여 방대한 분량의 방해 문서들 속에 실제 질문을 숨기는 방식으로 이루어집니다. 이러한 작업을 해결하기 위해서는 모델이 올바른 체인을 단계별로 추적하고, 실제 질문을 식별하며, 관련 사실을 검색하고 이를 추론하여 정확히 답변해야 합니다. KeyChain 데이터에 대한 RL 훈련은 훈련 길이를 훨씬 넘어서는 일반화된 계획-검색-추론-재확인(plan-retrieve-reason-recheck) 추론 패턴을 유도합니다. 16K 길이로 훈련된 모델은 128K 작업을 효과적으로 해결하며, 전체 길이 RL 롤아웃 비용을 크게 절감합니다. Qwen2.5-7B와 14B에서 LoongRL은 긴 문맥 다중 홉 QA 정확도를 각각 +23.5%와 +21.1%의 절대적 향상을 이끌어냅니다. 결과적으로 LoongRL-14B는 74.2점을 기록하며, o3-mini(74.5) 및 DeepSeek-R1(74.9)과 같은 훨씬 더 큰 프론티어 모델과 경쟁력을 보입니다. 또한 긴 문맥 검색을 개선하고, 모든 128K 바늘 찾기 스트레스 테스트를 통과하며, 짧은 문맥 추론 능력을 유지합니다.
English
Reasoning over long contexts is essential for large language models. While
reinforcement learning (RL) enhances short-context reasoning by inducing "Aha"
moments in chain-of-thought, the advanced thinking patterns required for
long-context reasoning remain largely unexplored, and high-difficulty RL data
are scarce. In this paper, we introduce LoongRL, a data-driven RL method for
advanced long-context reasoning. Central to LoongRL is KeyChain, a synthesis
approach that transforms short multi-hop QA into high-difficulty long-context
tasks by inserting UUID chains that hide the true question among large
collections of distracting documents. Solving these tasks requires the model to
trace the correct chain step-by-step, identify the true question, retrieve
relevant facts and reason over them to answer correctly. RL training on
KeyChain data induces an emergent plan-retrieve-reason-recheck reasoning
pattern that generalizes far beyond training length. Models trained at 16K
effectively solve 128K tasks without prohibitive full-length RL rollout costs.
On Qwen2.5-7B and 14B, LoongRL substantially improves long-context multi-hop QA
accuracy by +23.5% and +21.1% absolute gains. The resulting LoongRL-14B reaches
a score of 74.2, rivaling much larger frontier models such as o3-mini (74.5)
and DeepSeek-R1 (74.9). It also improves long-context retrieval, passes all
128K needle-in-a-haystack stress tests, and preserves short-context reasoning
capabilities.