Manuscript Offprint

arXiv:2610.18868

Tev: Scaling Long-Horizon Agentic Environments with Dense Progress Rewards

Wenbo Hu, Shraman Pramanick, Krishna Kumar Singh, Nanyun Peng, Kai-Wei Chang, Yong Jae Lee

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Long-horizon agents have drawn growing attention for their ability to work autonomously—from hours to days—on economically valuable tasks, a capability essential to automated discovery and recursive self-improvement (RSI). Yet open-source models still struggle on long-horizon tasks, largely for lack of both training data and a working recipe, and scaling both is hard: long, complex tasks are difficult to curate and verify, and their rewards are sparse. We address both. First, we introduce TEV-GYM, the first long-horizon agent training dataset with verifiable, dense, progressive rewards—1,170 verified task environments across 7 domains. It is built on a latent-world-first approach that first constructs a latent world: a complete and correct hidden specification of the task domain, workflow, and expected state after each step. Each task is then progressively rendered from this specification into an agent-facing environment, enabling controllable complexity and a natural progress metric. Second, we turn this metric into a training recipe: via progress-potential reward shaping (PPRS), we convert progress into a dense per-step reward that improves training efficiency and makes otherwise-intractable tasks trainable. Training with this recipe yields TEV-27B, which achieves substantial gains on the Agents' Last Exam computing and math sciences domains (ALE-CM), matching GPT-6 Astra and Claude Opus 5 at Pass@5. Despite training only on ALE-related data, it generalizes to the Terminal-Bench (TB) 3.0 and 4.0 subsets, surpassing GLM 5.2 and Gemini 3.7 Flash, and reaches Claude Opus 4.8-level performance on middle-horizon tasks such as TB 2.1.

Tev (ours) vs. Qwen base

Tev (ours; RL on Tev-Gym data) Qwen base

Figure

All models on ALE-CM

Models ranked by Pass@5.

Pass@5

Score@5

Figure

Latent-world-first data synthesis

Latent World

hidden from the agent

Oracle the correct end state, built first

Corruption plan invertible defects to repair

Render task environment

Task Environment

prompt.md

input/ (corrupted)

bash tool

Progress reward

RL rollout

Agent rollout

Strict verifier

Progress potential Φ\Phi

Hidden truth grades every state

Figure 1: We demonstrate TEV’s results on ALE-CM, and generalization to Terminal-Bench (TB) 3.0-CM, 4.0-CM, and 2.1 on the left and a summary of our latent-world-first data synthesis approach on the right. TEV showcases significant performance gains across two model scales and TEV-27B matches GPT-6 Astra and Claude Opus 5 at Pass@5 on ALE-CM.

Figure

Figure 2: All models on the Terminal-Bench 4.0 “CM” subset (TB 4.0-CM), ranked by Pass@1. TEV-320B and TEV-27B are trained with our recipe from GLM-5.3-Flash and Qwen3.8-27B, respectively; each arrow gives the relative gain over its base.

1 INTRODUCTION

Recent progress in large language models (LLMs) has shifted attention toward long-horizon agents (OpenAI, 2026; Anthropic, 2026; Moonshot AI, 2026), which can work autonomously for hours to days on complex, economically valuable tasks (Sun et al., 2026; Styles et al., 2024; Zhu et al., 2026a). Long-horizon tasks, such as solving open problems in mathematics and science, conducting automated machine learning research, and advancing coding and security systems, are fundamental to automated discovery and recursive self-improvement (RSI).

Despite these promising breakthroughs, coding-agent progress in the open-source community has focused on shorter- and mid-horizon tasks, scaled via large agentic training corpora such as SWE-Smith (Yang et al., 2025a), TMAX (Ivison et al., 2026), Endless Terminals (Gandhi et al., 2026), CLI-Gym (Lin et al., 2026), SETA (Shen et al., 2026), and Terminal-Universe (Wu et al., 2026). These datasets contain thousands to tens of thousands of environments, but each involves only a pull-request-sized fix or a short terminal session, and their unit-test-based evaluation provides only a terminal pass/fail signal or the fraction of tests passed. By contrast, genuinely long-horizon tasks are available only in human-authored benchmarks (Merrill et al., 2026; Li et al., 2026b). These benchmarks contain only tens to a few hundred instances, each requiring weeks of expert effort. They provide partial credit only through hand-written checkpoints and exist only as evaluation sets. Thus, no training corpus of long-horizon tasks exists: agentic training corpora are large but short-horizon, while long-horizon tasks exist only as small, human-authored evaluation sets.

Curating long-horizon tasks requires balancing two competing goals: tasks must be sufficiently long and structurally complex to provide meaningful training while remaining exactly verifiable (Zeng et al., 2026a). Scaling long-horizon environments for training is even more difficult because rewards are sparse and available only upon task completion, depriving long-tail tasks of useful training signals. To address both limitations, we introduce a latent-world-first synthesis approach that begins by constructing a latent world, a complete and correct hidden specification of the task domain. We first represent the underlying workflow as a directed acyclic graph (DAG) within a latent world and then progressively render the input files from that world. This procedure allows us to control task complexity while retaining every correct intermediate state, which provides a natural metric for measuring progress and therefore a verifiable dense reward for our training. Unlike pipelines that ask a language model to generate the task, inputs, and checker without a true answer, our latent world serves as an exact answer key for reliable verification.

Long-horizon tasks come with sparse rewards, arriving only at task completion and submission, which notoriously starves training on long-tail samples (Yu et al., 2025; Shen et al., 2026; Zeng et al., 2026a). Group-relative policy optimization (GRPO; Shao et al., 2024) normalizes rewards within a group of G rollouts of the same task, so under terminal-only reward, a group in which all G rollouts fail has zero advantage everywhere and contributes nothing to the gradient. Mid-horizon pipelines can afford to discard such groups (Ivison et al., 2026; Yu et al., 2025) because they are rare there; on long-horizon tasks they are most common at the start of training, when the policy is weakest and signal is needed most. We therefore introduce progress-potential reward shaping (PPRS) into reinforcement learning (RL), which makes training efficient and makes otherwise-intractable

Table 1: TEV-GYM versus prior agentic task corpora. “Agent time” is the median and mean wall-clock minutes per rollout of Gemini 3.6 Flash, from first action to last step (details in Appendix A.8). Difficulty is Pass@k measured by Gemini 3.6 Flash across all datasets.

DatasetSize# DomainsAgent time (min)OracleGrading MetricProgressive RewardP@1P@8
MedianMean
SWE-Smith (Yang et al., 2025a)50.1k12.02.4unit testspass/fail✕47%52%
Terminal-Universe (Wu et al., 2026)32.0k3NANApytestpass/fail✕NANA
TMAX-15K (Ivison et al., 2026)14.6k31.32.1unit testspass/fail✕74%80%
SETA (Shen et al., 2026)4.5k41.22.1unit teststest fraction✕80%88%
Endless Terminals (Gandhi et al., 2026)3.3k20.50.7unit testspass/fail✕83%89%
CLI-Gym (Lin et al., 2026)1.7k41.92.3unit testspass/fail✕69%74%
TEV-GYM (ours)1,170712.414.8latent worldstaged Φ + pass/fail✓29%40%

tasks trainable. PPRS scores the agent's workspace after every turn tt against the known-correct intermediate states from our latent world, giving a progress potential Φ(st)∈[0,1]\Phi(s_t) \in [0,1] that rises as the workflow is completed and falls on regressions. Reward shaped by Φ\Phi gives within-group variance from the first turn, even when no rollout finishes.

Figure 1 summarizes our approach and TEV's results, and Figure 2 ranks all models on the Terminal-Bench (TB) 4.0 “CM” subset by Pass@1. Using our latent-world-first synthesis approach, we introduce TEV-GYM, composed of 1,170 verified long-horizon task environments across 7 domains (software engineering, data engineering, AI/CS research, mathematics and operations research, security and forensics, infrastructure administration, and quantum computing). As illustrated in Table 1, TEV-GYM's tasks take a frontier agent a median of 12.4 minutes per rollout, about 6 times longer than the most time-intensive prior corpus (Yang et al., 2025a), and have the lowest pass rate, demonstrating our training data's complexity and quality. Moreover, TEV-GYM can be scaled beyond a fixed collection by coding agents writing generators that produce new verified environments across seeds and scale tiers without further model calls.

We introduce TEV-9B and TEV-27B, trained with PPRS on the unit tier and the full corpus of TEV-GYM, respectively. On ALE-CM, the computing-and-math split of Agents' Last Exam (Sun et al., 2026), TEV-9B improves Pass@5 by 83%83\% over Qwen3.5-9B, while TEV-27B improves it by 65%65\% over Qwen3.8-27B to 0.28, matching GPT-6 Astra and Claude Opus 5. Despite training only on ALE-related data, TEV-27B generalizes to the TB 3.0 and 4.0 subsets (Merrill et al., 2026; Marten et al., 2026; Marten, 2026), improving Pass@1 by 56%56\% and 150%150\%, respectively, and outperforming GLM 5.2 and Gemini 3.7 Flash. On the mid-horizon TB 2.1, TEV-9B improves zero-shot Pass@1 by 28%28\%, while TEV-27B reaches 0.794 Pass@1, matching Claude Opus 4.8-level performance. The recipe also transfers to a larger base: applying it to GLM-5.3-Flash yields TEV-320B, which raises Pass@1 on the TB 3.0 and 4.0 subsets by 35%35\% and 28%28\% and, on TB 4.0, trails only Claude Opus 5, Claude Fable 5, and GPT-5.6 (sol).

Our main contributions are summarized as follows:

  • We propose latent-world-first synthesis, a pipeline that constructs long-horizon agentic tasks backward from a known-correct world, giving exact verification, a controllable difficulty ladder, and a progressive reward in the middle.

  • We introduce TEV-GYM, the first long-horizon agent training dataset with progressive rewards, composed of 1,170 verified long-horizon task environments across 7 domains.

  • We present TEV-27B, trained on TEV-GYM using PPRS, and demonstrate its superior performance on ALE-CM, the TB 3.0 and TB 4.0 subsets, and TB 2.1; the same recipe applied to GLM-5.3-Flash gives TEV-320B, which improves further.

References (80)