TL;DR
This paper introduces GoLongRL, a novel framework for training large language models (LLMs) to excel at long-context reasoning tasks. It addresses limitations in existing methods by proposing a capability-oriented dataset and a new reinforcement learning algorithm (TMN-Reweight) that better handles diverse reward signals, leading to improved performance on a range of challenging long-context benchmarks.
What Problem Does This Paper Address?
As LLMs are increasingly deployed in complex applications like multi-document analysis and deep research, their ability to coherently understand and reason over extended contexts (tens or hundreds of thousands of tokens) becomes crucial. While pre-training and mid-training have expanded context windows, effectively utilizing these long contexts during post-training, particularly with reinforcement learning (RL), remains a bottleneck. Existing RL approaches often rely on data constructed around narrow retrieval paths, leading to homogeneous task coverage and reward formulations that don't fully capture the diverse capabilities needed for long-context understanding. Furthermore, standard RL algorithms struggle with the heterogeneous reward scales and variance profiles inherent in multitask learning, leading to optimization challenges.
Methods
GoLongRL tackles these issues with two main contributions:
- Capability-Oriented Data Construction: Instead of focusing on retrieval paths, the authors define 9 core long-context capabilities (e.g., precise retrieval, evidence-grounded comprehension, structured extraction) and build a dataset of 23K RLVR (Reinforcement Learning with Verifiable Rewards) samples aligned with these capabilities. Each task is paired with its natural evaluation metric as a reward function, preserving richer semantic information. The dataset comprises both curated open-source samples and synthetic samples generated from real documents.
- TMN-Reweight Algorithm: To address optimization challenges from heterogeneous rewards, they propose TMN-Reweight. This algorithm has two key components:
- Task-level Mean Normalization: This normalizes advantages by a task-level aggregated standard deviation, aligning cross-task reward scales without distorting within-task difficulty.
- Difficulty-Adaptive Reweighting: This step uses a smoothed pass rate to adaptively weight advantages, amplifying signals from hard prompts and attenuating those from easy prompts, leading to more stable and informative learning.
Datasets
- GoLongRL Dataset: A newly introduced dataset of 23,965 RLVR samples spanning 9 task types, designed to cover diverse long-context capabilities. It includes both curated open-source samples and synthetic samples generated from real documents (books, academic papers, dialogues).
- Evaluation Benchmarks: The paper evaluates performance on a suite of long-context benchmarks, including LongBench-V2, MRCR, Frames, LongBench (with five subsets), DocMath, and CorpusQA. They also evaluate on general reasoning (MMLU-Pro, AIME24/25, GPQA), agentic memory, and dialogue memory benchmarks to ensure general capability retention.
Key Insights and Ideas
- Capability-Centric Data is Key: The authors demonstrate that focusing on a diverse set of capabilities rather than just retrieval paths leads to more effective long-context RL. This broader coverage significantly benefits model improvement.
- Natural Rewards Matter: Using task-specific, natural evaluation metrics as reward functions (e.g., NDCG for ranking, EM for exact match) preserves more information and provides better feedback than collapsing them into a single metric.
- Multitask RL Needs Specialized Algorithms: Standard RL algorithms struggle with the inherent scale and variance differences of rewards from diverse tasks. TMN-Reweight's combination of task-level normalization and difficulty-adaptive reweighting is crucial for stable and effective multitask optimization.
- Balancing Act: TMN-Reweight achieves a sweet spot by normalizing across tasks to align scales but preserving within-task difficulty signals, avoiding the pitfalls of methods that either remove normalization entirely or apply it too granularly.
Key Results
- GoLongRL's capability-oriented dataset, when trained with vanilla GRPO, outperforms the closed-source QwenLong-L1.5 dataset.
- The GoLongRL-30B-A3B model trained on their data achieves performance comparable to state-of-the-art models like DeepSeek-R1-0528 and Qwen3-235B-A22B-Thinking-2507.
- TMN-Reweight further improves average performance over vanilla GRPO. For instance, on Qwen3-4B-Thinking, it raises the average score from 62.2 to 63.0, surpassing QwenLong-L1.5.
- The method shows strong gains on aggregation- and reasoning-intensive tasks like CorpusQA (+4.5 points) and LBV2 (+1.6 points).
- General reasoning and memory capabilities are preserved or improved, indicating that long-context training doesn't degrade these skills.
- The model demonstrates effective length extrapolation, performing well on sequences longer than those seen during training.
Limitations and Future Work
- Scale Dependency: The effectiveness of difficulty reweighting might vary across model scales, with clearer gains observed at 4B and less settled evidence at larger scales. Further study on scale-dependent optimization dynamics is needed.
- CorpusQA Gap: A remaining gap on the CorpusQA benchmark suggests that targeted data supplementation for multi-document reasoning could be beneficial.
- Token-Level Weighting: Combining context-aware token weighting methods with RLVR for more fine-grained training is proposed as a promising future research direction.
Summary updated