Get Started
Home
Topics
Search
Library
6 min read · Agents · Evaluation · Added Oct 18 · Paper published Oct 13, 2026

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

Source: research paper via Hugging Face Daily Papers
Agentic RL on long-horizon tasks dies because ~92% of rollout groups score zero and yield no gradient. Tev-Gym flips the recipe: generate a correct world first, then corrupt it, so partial progress grades exactly each turn. A 27B model trained this way matches Claude Opus 5 on one coding split.

TL;DR

Tev-Gym builds long-horizon agent tasks backward from a hidden ground-truth world, so partial progress can be graded exactly after every turn, giving reinforcement learning a dense signal where terminal pass/fail would otherwise leave most training groups with zero gradient.

Why It Matters

Suppose you want to train an open-source coding agent to do things that take hours: migrate a Kubernetes service, consolidate ML checkpoints, rebuild a messy data warehouse. The standard approach is Group Relative Policy Optimization (GRPO): sample G attempts per task, reward each with 1 if the final submission passes a test suite and 0 otherwise, and update the policy using how each attempt compares to the group average.
This breaks on long tasks. If the untrained model succeeds roughly 1 in 100 times, then with 8 attempts per task about 92% of groups have zero successes. Every attempt in those groups gets the same zero reward, every advantage is zero, and the gradient is zero. The hardest and most interesting tasks contribute nothing to learning, exactly when the model needs the signal most.
Prior agent training corpora like SWE-Smith sidestep this by staying short: pull-request-sized bugs with unit tests, where even a weak policy sometimes passes. Genuinely long tasks only exist as small hand-authored evaluation sets like Terminal-Bench, with no training data at all.

How It Works

The core move: never write a task top-down. Instead, generate a complete correct world first, then corrupt it to create the problem.
For a retail warehouse task, a seeded Python program first builds the latent world W: all the customers, products, transactions, and the clean star-schema database they should produce. Then it compiles the workflow into a dependency graph of stages (profile sources, reconcile facts, normalize dimensions, load facts, aggregate, package). Then it renders W into the file formats an agent sees (CSVs, JSON, SQLite). Finally, it applies a declared defect plan: inject specific duplicates, schema drift, scrambled shards. The corrupted tree is what the agent receives. The untouched W is the answer key.
Because W exists before the task, every correct intermediate state is also known. This gives a progress potential \Phi(s), a number between 0 and 1 that scores the agent’s current workspace against the known-correct stages, with later stages gated on earlier ones (a correct aggregate over a wrong fact table scores zero on the aggregate).
Progress-Potential Reward Shaping then shapes the reward: the per-step reward is the change in \Phi, so completing a stage adds credit and destroying prior work subtracts it. The total rollout reward is the terminal pass/fail plus \lambda=0.25 times the final \Phi. Crucially, this keeps the terminal potential (unlike classical Potential-Based Reward Shaping), so a group where every rollout fails still has reward variance based on how far each one got.
for turn t in rollout: workspace = agent_act(workspace) phi_t = score_against_latent_world(workspace, W) reward_t = lambda_ * (phi_t - phi_prev) # dense per-turn signal phi_prev = phi_t if submitted: reward_T += strict_verifier(workspace, W) # 1.0 or 0.0
The scorer that computes \Phi, the strict verifier, and the reference solver all live in separate code with no shared imports, and 14 “gaming probes” (empty output, copied input, hard-coded answers) must all score zero before a generated environment is admitted.

What They Found

The authors release Tev-Gym: 1,170 verified environments across 7 domains (software, data, ML research, math and OR, security, infra, quantum). A frontier agent takes a median of 12.4 minutes per rollout, roughly 6x longer than the most time-intensive prior corpus, and solves only 29% at pass@1.
Training Qwen3.8-27B with PPRS on Tev-Gym gives Tev-27B. On ALE-CM, Tev-27B lifts pass@5 from 0.17 to 0.28, matching GPT-6 Astra and Claude Opus 5 on this split. On the Terminal-Bench 3.0 and 4.0 “CM” subsets (longer-horizon tasks, no training overlap measured), pass@1 rises from 0.09 to 0.14 and 0.04 to 0.10. On mid-horizon TB 2.1, pass@1 reaches 0.794, comparable to Claude Opus 4.8. Applying the same recipe to GLM-5.3-Flash yields Tev-320B, the strongest open-source model on both TB subsets they tested.
The ablations isolate two things. First, replacing the latent-world construction with a standard “prompt-first” model-generated pipeline (same terminal reward) matches the untrained baseline. Second, holding Tev-Gym fixed and switching PPRS for terminal-only reward: at 27B scale, terminal-only training produces “almost entirely zero-advantage groups and fails to complete a single optimizer step.” The dense reward isn’t a nice-to-have at this horizon; it’s what makes training possible.
The authors are careful about one claim: the shaped reward is not policy-invariant in the formal sense of classical shaping. They keep the terminal \Phi term deliberately, and show that preference reversal between policies is bounded (any passing rollout scores 1+\lambda, strictly more than any failing one).

What’s Useful

•
If you’re doing agentic RL and running into dead groups on hard tasks, the diagnostic from §3.1 is worth internalizing: with G=8 rollouts and 5% success rate, 66% of groups give zero gradient. Any dense signal that varies within a failing group recovers training.
•
The latent-world-first recipe is a concrete pattern for building verifiable training data in domains where you can procedurally generate the ground truth (data pipelines, infra configs, numerical simulations). The pattern doesn’t apply when the “correct” answer isn’t computable, like open-ended research or UX work.
•
Worth testing: whether a simpler progress proxy (fraction of named output files that parse and match a schema) captures enough signal in your domain without the full workflow-DAG machinery. The paper’s ablation suggests the gating structure matters, but not how much simpler versions degrade.
•
The gap to frontier models on TB 3.0/4.0 remains large (0.14 vs 0.53 pass@1). Training on this corpus narrows the gap substantially but doesn’t close it, and the 320B result suggests the open base model is still the bottleneck. Code and generators are promised at tev-agent.github.io.

Caveats

All environments are synthetic terminal tasks, mostly in computing and math. The paper demonstrates three worked examples in other domains (cloud ops, building control, finance) but does not train or evaluate on them. The 27B gains on ALE-CM’s Coding & System split are small (pass@1 unchanged at 0.20); the clear wins are on Math & Science and on longer-horizon transfer. The Terminal-Bench “CM” subsets were selected by asking Claude to classify tasks, and the authors show the subsets track full-benchmark rankings with Pearson r≈0.96, but this is still a filtered evaluation. Finally, authoring a new generator requires human review and takes real effort; the “1,170 environments” number reflects seeded instantiations of a smaller set of generators, not 1,170 independently designed tasks.
Topics
Agents
Evaluation
Reinforcement Learning
NLP
Agents
Evaluation
Reinforcement Learning
NLP
Up next in Agents
Self-Evolving Coding Agents via Harness-Policy Optimization
Interlock: From Local Correctness to Task Completion in Long-Horizon Agents
Don't miss new content
Log in to follow topics and personalize your feed.
Related topics you might like
Agents310 episodes
Reinforcement Learning157 episodes
Evaluation209 episodes