SWE-Trail Guides Coding Agent Training

HuggingFaceWednesday, November 4, 2026
SWE-Trail Guides Coding Agent Training
  • •SWE-Trail uses earlier coding-agent trajectories to guide collection while keeping history out of the agent’s context
  • •A 124B student improved mean resolution by 2.33 points on SWE-bench Multilingual and 1.60 on SWE-bench Pro
  • •Without history, the same pipeline improved Multilingual results by only 0.11 points over independent sampling

SWE-Trail, a method for collecting training trajectories for coding agents, uses earlier attempts to guide where more exploration is spent while keeping those attempts out of the agent’s context. The approach was introduced in an arXiv paper published on Nov 1 and submitted to Hugging Face on Nov 3 by Ziming Li, Lu Yu, Jiatan Huang, Qing Cui, Jun Zhou and Chuxu Zhang of Ant Group. Coding agents solve repository issues through sequences of exploration, code edits and validation; those trajectories are increasingly used as post-training data, so their collection affects what student models learn.

Researchers say independent sampling of multiple trajectories for each issue can make later attempts increasingly redundant. Giving the agent earlier attempts as advice could help direct exploration, but may create a train-test mismatch (a difference between training and test conditions) because that advice is unavailable at test time. SWE-Trail instead keeps history outside the agent’s context and uses it to choose where to spend collection effort, while the agent decides what to generate.

During a new rollout, SWE-Trail uses previous trajectories to identify a state worth exploring further. From that same checkpoint (a saved state of the process), the coding agent proposes candidate next actions using its ordinary context. SWE-Trail briefly executes the candidates and selects which route continues. The researchers evaluated collection methods by training student models on the trajectories they produced.

For a 124B student initialized from Ling-3.0-flash-base, SWE-Trail improved mean resolution over independent sampling by 2.33 percentage points on SWE-bench Multilingual and 1.60 percentage points on SWE-bench Pro. Without history, the same pipeline produced more resolved trajectories than independent sampling but improved results by only 0.11 points on Multilingual. The authors attribute the gains to using history to guide collection, rather than to the pipeline alone.