Beyond Reward Engineering: A Data Recipe for Long-Context Reinforcement Learning
cs.CL, cs.AI
Submitted: 2026-06-17
Updated: 2026-10-13
Comments: 15 pages, 6 figures, 12 tables
Code: https://github.com/gkamradt/LLMTest_NeedleInAHaystack
License: http://creativecommons.org/licenses/by/4.0/
The gist: Long-context reasoning is an essential capability for large language models, particularly when they are deployed as autonomous agents that must reason over lengthy trajectories.
Terminology
Abstract
Long-context reasoning is an essential capability for large language models, particularly when they are deployed as autonomous agents that must reason over lengthy trajectories. Reinforcement learning (RL) has recently emerged as a dominant paradigm for improving this ability, yet existing work largely focuses on reward engineering while diverse training data remains scarce. We revisit this problem from a data-centric perspective and show that a simple yet effective data recipe alone, paired with a minimal outcome-based GRPO setup, suffices to substantially improve long-context reasoning. Our recipe targets three complementary task families -- retrieval, multi-evidence synthesis, and reasoning -- for which we construct and curate eight datasets totaling 14K examples. Experiments on three models (Qwen3-4B/8B/30B-A3B) yield average gains of +7.2/+3.2/+6.4 points across seven long-context benchmarks, surpassing prior RL training sets. We further demonstrate that these gains transfer to agentic tasks, where continuing RL training on an agent-tuned model with our data recipe improves GAIA by +4.8 and BrowseComp by +7.0 points. We will release our datasets to facilitate future research.
Sources
- LongRLVR: Long-Context Reinforcement Learning Requires Verifiable Context Rewards
- AgentCPM-Explore: Realizing Long-Horizon Deep Exploration for Edge-Scale Agents
- Evidence-Augmented Policy Optimization with Reward Co-Evolution for Long-Context Reasoning
- ALR$^2$: A Retrieve-then-Reason Framework for Long-context Question Answering
- Large Language Models Can Self-Improve in Long-context Reasoning
- Evaluating Test-Time Scaling of General LLM Agents
- LongReason: A Synthetic Long-Context Reasoning Benchmark via Context Expansion
- WebExplorer: Explore and Evolve for Training Long-Horizon Web Agents
- DeepDive: Advancing Deep Search Agents with Knowledge Graphs and Multi-Turn RL
- OpenAI o1 System Card
- Incentivizing In-depth Reasoning over Long Contexts with Process Advantage Shaping
- LongAct: Harnessing Intrinsic Activation Patterns for Long-Context Reinforcement Learning
- LongR: Unleashing Long-Context Reasoning via Reinforcement Learning with Dense Utility Rewards
- UI-TARS: Pioneering Automated GUI Interaction with Native Agents
- Qwen3 Technical Report
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- QwenLong-L1.5: Post-Training Recipe for Long-Context Reasoning and Memory Management
- Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism
- ACC: Compiling Agent Trajectories for Long-Context Training
- Michelangelo: Long Context Evaluations Beyond Haystacks via Latent Structure Queries
Related papers
- Exploring Solution Divergence and Its Effect on Large Language Model Problem Solving
- Ishigaki-IDS-Bench: A Benchmark for Generating Information Delivery Specification from BIM Information Requirements
- Subliminal Steering: Stronger Encoding of Hidden Signals
- MedStruct-S: A Benchmark for Key Discovery, Key-Conditioned QA and Semi-Structured Extraction from OCR Clinical Reports
- The End of Transformers? On Challenging Attention and the Rise of Sub-Quadratic Architectures
- Untangling the Mechanisms of Misleading Context in Medical Question Answering