Papers
arxiv:2611.02074

SWE-Trail: History-Guided Trajectory Collection for Coding Agent Training

Published on Nov 1
· Submitted by
ziming li
on Nov 3
Authors:
,
,
,
,
,

Abstract

SWE-Trail improves trajectory collection for coding agents by using past rollouts to guide exploration without exposing history to the agent, yielding better-trained student models.

Coding agents solve repository issues through long sequences of exploration, editing, and validation. These trajectories are increasingly used as post-training data, so how they are collected shapes what the trained model learns. A common approach is to sample multiple trajectories independently for each issue and then select or curate them. However, as more trajectories are sampled independently, later trajectories become increasingly redundant, even though earlier trajectories could guide where subsequent collection effort should be spent. A natural way to use this history is to expose it to the coding agent as advice. But training on such trajectories can make the model rely on advice that is unavailable at test time, creating a train-test mismatch. Instead, we argue that history should guide where collection effort is spent, while the coding agent decides what to generate. We introduce SWE-Trail, a trajectory collector that uses earlier trajectories to guide subsequent collection while keeping that history outside the coding agent's context. During a new rollout, SWE-Trail uses history to identify a state where additional collection effort may be useful. There, the coding agent proposes candidate next actions from its ordinary context, and SWE-Trail briefly executes them from the same checkpoint to decide which route continues. We evaluate collection approaches by training student models on the trajectories they produce. For a 124B student initialized from Ling-3.0-flash-base, SWE-Trail improves mean resolution over independent sampling by 2.33 and 1.60 percentage points on SWE-bench Multilingual and SWE-bench Pro, respectively. Without history, the same pipeline produces more resolved trajectories than independent sampling, but improves by only 0.11 points on Multilingual. These results show the value of using history to guide collection without exposing it to the coding agent.

Community

Paper submitter

TL;DR: SWE-Trail is a trajectory collector for coding-agent post-training. It uses earlier trajectories to decide where additional collection effort should go, while keeping that history out of the agent's context, so there is no train-test mismatch from training on advice that isn't available at test time.

How it works: During a new rollout, history is used to pick a state worth exploring further. The agent proposes candidate next actions from its ordinary context; SWE-Trail briefly executes them from the same checkpoint and decides which route continues.

Results: Training a 124B student (initialized from Ling-3.0-flash-base) on SWE-Trail trajectories improves mean resolution by +2.33 pp on SWE-bench Multilingual and +1.60 pp on SWE-bench Pro over independent sampling. Without history, the same pipeline yields more resolved trajectories but only +0.11 pp on Multilingual. The gain comes from using history to guide collection, not from the pipeline alone.

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2611.02074
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2611.02074 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2611.02074 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.02074 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.