Teaching AI Agents to Go the Distance: 'KLong' Targets Extremely Long-Horizon Tasks
Ask a large language model to fix a typo and it rarely stumbles. Ask it to reproduce an entire machine learning paper from scratch — read the manuscript, write the code, train the models, debug the failures, and reconcile the results across hundreds of tool calls and several hours of runtime — and something breaks. Errors pile on errors, the context window fills and forgets, and the agent loses the plot. That failure mode, not raw intelligence, is the wall standing between today's chatbots and genuinely autonomous agents. A new paper wants to knock it down.
In "KLong: Training LLM Agent for Extremely Long-horizon Tasks" (arXiv:2602.17547), a team led by Yue Liu, with co-authors Zhiyuan Hu, Flood Sung, Jiaheng Zhang, and Bryan Hooi, introduces an open-source agent trained specifically to survive tasks that unfold over hundreds of steps. The distinction they draw is stark. "We observe that the running time and assistant turns of the extremely long-horizon task are approximately 10 times that of the long-horizon task," the authors write. Where prior work capped out at models with limited context windows or "tasks that only require a few assistant turns (e.g., ranging from 20 to 200)," KLong is built for jobs an order of magnitude larger.
The method: split the trajectory, stretch the clock
The core problem is almost mechanical. Extremely long-horizon tasks "inevitably exceed the context window," which breaks the standard machinery of both supervised fine-tuning and reinforcement learning. You cannot fine-tune on a trajectory that does not fit in memory.
KLong's answer is a two-stage recipe. First, the team cold-starts a 106-billion-parameter base model with a broad SFT pass covering "common knowledge, coding, mathematics, and search" to switch on basic agentic behavior. Then comes the headline technique: trajectory-splitting SFT. Rather than truncate a multi-hour trajectory and lose its structure, the method pins the paper-reading segment at the beginning of the context, progressively truncates the later history as the context window fills, and overlaps consecutive sub-trajectories so the agent retains continuity across the seams. In effect, the model learns "extremely long-horizon behaviors" from data that no single window could hold.
Feeding that pipeline is Research-Factory, an automated data engine. A search agent harvests accepted papers from top venues — ICML, NeurIPS, and ICLR over the past five years — along with metadata, then builds evaluation rubrics and prompts. The resulting set is distilled into roughly a thousand extremely long-horizon trajectories, generated by Claude 4.5 Sonnet (Thinking) acting as the teacher.
The final stage is progressive reinforcement learning. The authors are candid that RL on these tasks "remains challenging due to sparse rewards, high variance, and unstable credit assignment" — the exact pathologies that make long-horizon learning hard. Their fix is to schedule training in stages with progressively extended timeouts, letting the agent learn from short episodes before graduating to the multi-hour runs. That scheduling alone yielded a 6.67% performance bump. Along the way, the trained agent's stamina grew dramatically: average assistant turns per task climbed from 114.90 to 732.70.
The results
KLong's benchmark centerpiece is PaperBench, a test of an agent's ability to replicate AI research. There, the 106B model posts an average score of 62.59 — the best open-source result reported — and, the authors note, "surpasses Kimi K2 Thinking (1T) by 11.28% on PaperBench" despite being roughly a tenth the size of that trillion-parameter rival. Against closed models cited in the paper, KLong clears reported figures for GPT-4.1 and Claude 4 Sonnet on the same benchmark, and it leads across sub-categories including mechanistic understanding and test-time model adaptation.
Crucially, the gains generalize. The authors report that the improvement "generalizes to other coding benchmarks like SWE-bench Verified and MLE-bench" — the latter being machine learning engineering, another domain where an agent must plan and execute long sequences of tool calls under time and resource limits. Training was tailored to PaperBench, yet the long-horizon ability transferred to four other agentic benchmarks, suggesting the recipe teaches a general skill rather than memorizing one task.
Why long-horizon reliability is the frontier
The reason this line of work matters more than another leaderboard climb is that autonomy is fundamentally a compounding problem. If an agent is 99% reliable per step, a 700-step task succeeds only about half the time — and real research replication involves far more than 700 decisions. Three failure modes converge at length. Compounding errors: a small mistake early poisons everything downstream. Memory: the context window is finite, so an agent literally cannot see its own early reasoning by the end of a long run. Credit assignment: when a reward arrives only after hours of work, RL struggles to know which of the thousands of intermediate actions deserved credit or blame.
KLong is interesting precisely because it attacks all three at the level of training procedure rather than model scale. Trajectory-splitting is a memory strategy; overlapping sub-trajectories fight forgetting; progressive timeouts are a direct assault on sparse-reward credit assignment. The implicit argument is that long-horizon competence is a learnable behavior, not an emergent byproduct of bigger models — and the fact that a 106B agent beats a 1T one on PaperBench is the strongest evidence for that claim.
What to watch
Several questions remain open. The teacher was a frontier proprietary model, so KLong's ceiling is partly borrowed; whether the method can bootstrap beyond its distillation source is unproven. Research replication is also a domain with unusually clean rubrics — it is not obvious how Research-Factory-style data generation transfers to messier, less-verifiable real-world work. And a 700-turn agent surfaces hard infrastructure and safety problems: rollouts that end synchronously congest the judge, and an autonomous system running for hours is one that needs oversight for hours.
Still, the direction is clear. The industry has spent two years making agents smarter per step. KLong is a bet that the next unlock is teaching them to stay coherent across many steps — the difference between a model that can help with a task and one that can finish it.
"We observe that the running time and assistant turns of the extremely long-horizon task are approximately 10 times that of the long-horizon task."- The authors, KLong (arXiv:2602.17547)