Skip to main content
GW
HomeWorkAI appsPapersAboutNotesStackLabPilotPlan↗ (opens in a new tab)INVST↗ (opens in a new tab)
Govind Waghmare

Finance systems and AI. Building in public from NYC.

Resume (PDF)Book 20 minEmail
HomeNotesWorkAboutStackPapersLabFor founders
XLinkedInGitHubllms.txt
© 2026 · New York City

Keyboard shortcuts

?
Open this list
g then h
Go to Home
g then w
Go to Work
g then n
Go to Notes
g then a
Go to About
c
Ask the AI guide
Esc
Close this list
Original paperAbstract
Open in new tab (opens in a new tab)
All papers
AI agents and tools

Use past attempts to steer data collection, not to coach the agent

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

Ziming Li, Lu Yu, Jiatan Huang, Qing Cui, Jun Zhou, Chuxu Zhang · arXiv preprint (University of Connecticut, Ant Group) · Posted 1 Nov 2026 · 14 min read · arXiv 2611.02074

Share this paper

LinkedIn (opens in a new tab)X (opens in a new tab)WhatsApp (opens in a new tab)EmailDownload PDFExplainer + original paper (PDF), 1.7 MB

  • Coding agents learn from recorded attempts, called trajectories.
  • Teams often sample many attempts independently.
  • Later attempts become redundant.
  • Showing past attempts to the agent as advice creates a mismatch.
  • At test time the advice is gone.
+2.33

points of SWE-bench Multilingual resolution over independent sampling.

  • The collector reads earlier attempts. The agent never sees them.
  • It spots a key moment and runs two next actions briefly.
  • A 124B student trained on the result, with 3 training runs.

  • Gains of 2.33 on Multilingual and 1.60 on SWE-Pro.
  • Without history, gains were only 0.11 on Multilingual.
  • Advice shown to the agent hurt: 1.33 and 2.78 points lower.
  • Ten past attempts added only a little over five.

History-guided collection gives the best student on both testsFrom Table 1
SWE-bench MultilingualSWE-bench Pro
020406080Mean resolution (%) of the 124B studentSeedBank (independent)63.33%41.22%SWE-TRACE64.44%40.77%SWE-Lego64.56%41.63%SWE-Trail H0 (no history)63.44%41.95%SWE-Trail H565.67%42.82%

Hover, tap or focus a bar to read its exact value.

Collection methodSWE-bench Multilingual (%)SWE-bench Pro (%)
SeedBank (independent)63.3341.22
SWE-TRACE64.4440.77
SWE-Lego64.5641.63
SWE-Trail H0 (no history)63.4441.95
SWE-Trail H565.6742.82

  • One collection model and one agent scaffold were used.
  • The H5 over H0 gap has intervals that include zero.
  • Only 3 training runs per setup. The test gives p = 0.05.

Jump to

  1. A The abstract
  2. 1 Introduction
  3. 2 Motivation: why history helps
  4. 3 SWE-Trail: the method
  5. 4 Experiments
  6. 5 Related work
  7. 6 Discussion and limitations
  8. 7 Conclusion
  9. A Appendix A: evidence behind the motivation
  10. B Appendix B: collector algorithm, schemas, prompts
  11. C Appendix C: data and experimental conditions
  12. D Appendix D: training, evaluation, metrics
  13. E Appendix E: complete downstream results
  14. F Appendix F: collection mechanism in detail
  15. G Appendix G: controls, cost, best-of-N
  16. H Appendix H: case study and advice diagnostics
  17. I Appendix I: detailed related work
  18. W Words to know

Every detail from the paper

Cards follow the paper's own order. Dotted words link to Words to know. Numbers match the paper.

The setting

  • Coding agents fix repository issues through long runs of exploring, editing and checking.
  • These trajectories now serve as post-training data.
  • So how they are collected shapes what the model learns.
  • A common method samples several trajectories per issue independently, then selects or curates them.

The problem and the principle

  • As more trajectories are sampled, later ones grow redundant.
  • Earlier ones can guide where later effort should go.
  • One way is to show history to the agent as advice.
  • But training on such runs can make the model lean on advice.
  • It will not have that advice at test time.
  • This train-test mismatch can lower downstream results.
  • The authors argue history should guide where effort goes.
  • The agent should decide what to generate by itself.

The method and the results

  • SWE-Trail uses earlier trajectories to guide collection and keeps that history outside the agent's context.
  • During a rollout it finds a state where more effort may help.
  • The agent proposes next actions from its ordinary context.
  • SWE-Trail runs candidates briefly from the same checkpoint and picks the route to continue.
  • A 124B student from Ling-3.0-flash-base gains 2.33 and 1.60 points over independent sampling.
  • The tests are SWE-bench Multilingual and SWE-bench Pro.
  • Without history, the same pipeline gains only 0.11 points on Multilingual.
  • It still resolves more trajectories than independent sampling.

Trajectories as training data

  • Fixing a repository-level issue means exploring the repository, changing code and validating the change.
  • A trajectory records the reasoning and actions of the whole repair.
  • It is more than the final patch.
  • Trajectories are widely used as post-training data.
  • So collection directly sets their training value.

How data is collected today

  • A common way is to sample several trajectories per issue.
  • Teams keep those that pass tests or a judge.
  • Some also edit kept trajectories. They mask flawed tool calls or drop redundant steps.
  • These methods work after collection.
  • Trajectories for one issue are still made independently.
  • Later samples become redundant and revisit the same repair targets.

Allocation signals

  • Earlier trajectories can guide where later effort goes.
  • Example: where successful and failed runs disagree, the choice there is worth comparing.
  • The authors call such evidence allocation signals.
  • They call the earlier trajectories for an issue its history.
  • Section 2 tests how redundant independent sampling is and if history gives such signals.

The advice trap

  • A natural idea is to put history in the agent's context as advice.
  • That can help the current run.
  • But the recorded reasoning was made with access to the advice.
  • At test time the trained model has none.
  • So these trajectories may be weaker training data.
  • Central question: how can history guide where effort goes?
  • The agent should still decide what to generate.

The SWE-Trail answer

  • SWE-Trail keeps history outside the agent's context.
  • Before collection, it uses history to pick which states get more effort.
  • It also picks what evidence to weigh there.
  • In a rollout, the agent proposes candidate next actions from its ordinary context.
  • SWE-Trail runs them briefly from the same checkpoint and picks the better-supported route.
  • The agent then continues from that route.

A concrete example

  • On a Rust issue, all prior failed runs made an edit.
  • Then they kept reading without running tests.
  • SWE-Trail marks that state for extra effort.
  • In a new rollout the agent proposes more reading and running tests.
  • SWE-Trail runs both briefly from one checkpoint.
  • It picks the test-running route based on the evidence.
  • The agent finishes from there.

The controlled test

  • All settings use the same 300 SWE-rebench V2 issues.
  • Each collects five trajectories per issue with GLM-5.1.
  • SeedBank is the independent-sampling baseline.
  • H5 uses the five SeedBank runs per issue as history to collect five new ones.
  • H0 runs the same pipeline with no history.
  • A 124B Ling-3.0-flash-base student trains on each, three runs each.
  • H5 beats SeedBank by 2.33 on Multilingual and 1.60 on SWE-bench Pro.
  • H0 resolves more trajectories than SeedBank but gains only 0.11 on Multilingual.
  • So collection success alone does not explain the gain.
  • A Qwen3-14B-Base student gains 3.11 and 2.42 points.

  • The authors study the independent SeedBank trajectories.
  • An attempt is one independent try at an issue.
  • They ask how coverage grows with more attempts and if earlier attempts give allocation signals.
2.1 Diminishing coverage gains from independent rollouts
Each extra independent attempt solves fewer new issuesFrom Figure 1A
0255075100Expected solved issues with k attempts per issue1 attempt58.4 issues2 attempts71.5 issues3 attempts79.5 issues4 attempts84.6 issues5 attempts88.0 issues

Hover, tap or focus a bar to read its exact value.

Attempts per issueSolved issues
1 attempt58.4
2 attempts71.5
3 attempts79.5
4 attempts84.6
5 attempts88.0

Outcome coverage

  • The count averages over all subsets of k of the five recorded attempts.
  • An issue counts as solved if any attempt succeeds.
  • With one attempt, 58.4 issues are solved on average.
  • Going from 1 to 2 attempts adds 13.1 solved issues.
  • Going to 3, 4 and 5 adds only 8.0, 5.1 and 3.4.
  • Each attempt still adds coverage, but less each time.

Patch-target coverage

  • Patch targets are the files an attempt modified.
  • Three history types come from SeedBank outcomes.
  • Stable-solved: all attempts succeed. Mixed: both successes and failures. Never-solved: all fail.
  • One attempt already covers 90.0% of the files on stable-solved issues.
  • It covers 73.2% on mixed issues and 80.1% on never-solved issues.
  • Later attempts cover fewer new files.
  • Even when all attempts fail, they modify many of the same files.
  • So independent sampling does not redirect effort after repeated failures.
2.2 History provides allocation signals

Mixed histories

  • Mixed issues are useful.
  • Successes and failures may pick different next actions from similar states.
  • For each mixed issue, an auditor compares the most similar successful and failed attempts.
  • It finds their first meaningful decision difference.
  • It checks if the states are similar enough and if both actions are reasonable.
  • Two auditors run the test independently: GPT-5.6-Sol and GLM-5.1.
  • The main analysis covers 43 of the 51 mixed issues.
  • Eight are out because the failed attempt hit a timeout or collector error.
  • GPT-5.6-Sol finds such cases in 26 issues and GLM-5.1 in 31.
  • Both models find 20.

Never-solved histories

  • History must still help when no attempt succeeded.
  • The mean pairwise Jaccard overlap of modified files across failed attempts is 0.841.
  • Among 198 issues with a defined score, 93 score 1.0.
  • Failed attempts often focus on the same repair targets.
  • This does not say why they fail.
  • It does show where effort is spent again and again.
  • So history can guide effort even with no success to compare.

How SWE-Trail collects one trajectoryFrom Figure 2
  1. OfflineModelCompile history into detector
  2. OnlineAgent rolls out normally
  3. CodeDetector rule matches a state
  4. Agent proposes next actions
  5. Run two routes briefly
  6. Selector keeps better route

History never enters the agent's context.

Setup

  • For issue i, the issue statement and repository snapshot are given.
  • The history holds the attempts already collected on that issue.
  • SWE-Trail can read history. The coding agent cannot.
  • Reference patches are not available during collection.
  • Offline, SWE-Trail uses history and read-only repository checks to pick states for extra effort.
  • Online, the agent proposes candidates at such a state.
  • SWE-Trail picks candidates and runs them briefly in parallel.
  • They start from one checkpoint. It keeps the better route.
3.1 Compiling history into detectors
  • A new rollout can reach a similar situation by a different path.
  • So the compiler builds a detector whose rules spot such states from actions and observations.
  • Rules do not use fixed step numbers.
  • Example: repeated reading after an edit with no validation.
  • The runtime checks the rules after each new repository observation.
  • It samples candidate actions when a state matches.

How the compiler works

  • It first reads the issue and history for allocation signals.
  • Signals include decisions that successes support, differences across repair routes and repeated failures.
  • It then runs bounded read-only repository checks to answer open questions.
  • These checks never edit source code or touch the reference patch.
  • Evidence, check results and open questions go in a private acquisition record.
  • From it the compiler writes detector rules and a local comparison objective for each state.
  • The objective says what evidence to weigh when comparing routes.

How history type shapes the plan

  • Stable-solved: success shows which choices are well supported.
  • Extra effort goes only where real doubt remains.
  • Mixed: focus on states where successful and failed routes differ.
  • Never-solved: focus on repeated failures, such as edits followed by more reading with no validation.
  • The compiler also sets a temperature schedule for candidate generation.
  • Mixed and never-solved histories use higher temperatures for more varied actions.

Admission checks

  • Before collection, each proposed detector state is checked against its evidence.
  • Rules are replayed on the recorded attempts.
  • States without enough support are dropped.
  • Admitted states, objectives and temperature schedule are fixed for the whole collection round.
3.2 Sampling comparable alternatives
  • The detector decides where effort goes. The agent decides which actions to consider.
  • At a detected state, SWE-Trail samples several next actions from the agent's ordinary context.
  • History, the acquisition record and the objective are not added to that context.
  • The first sample uses the ordinary temperature and is the default.
  • The others use the schedule temperature.
  • Equivalent proposals are grouped.
  • SWE-Trail keeps the default and shortlists executable alternatives.
  • It picks at most one alternative, using the record and the objective.
  • With no suitable alternative, the rollout continues with the default.
  • Otherwise two isolated workspaces restore from the same checkpoint.
  • Both run for the same short horizon.
  • Each trajectory makes at most one such comparison.
3.3 Selecting a route by executed evidence
  • SWE-Trail compares the two executed suffixes using the local objective.
  • They appear in shuffled order, so the selector cannot tell which is the default.
  • The private record is only background.
  • A route wins only with clear evidence of better progress.
  • Otherwise the default stays.
  • The agent then continues only from the chosen workspace.
  • Training keeps only the chosen route.
  • The agent's original reasoning and actions stay unchanged.
  • The unchosen suffix and private collector events are removed.
  • So the record is one continuous agent-made trajectory with no private information.

4.1 Setting

Shared setting

  • All comparisons use the same collection issues and the same number of trajectories.
  • Each dataset has five trajectories for each of 300 SWE-rebench V2 issues.
  • That gives 1,500 trajectories.
  • No collection repository appears in either evaluation benchmark.
  • All rollouts use GLM-5.1 with the OpenHands scaffold.
  • Collection runs in an offline sandbox with commit histories removed.
  • Reference patches and published fixes are not available.

Methods and variants

  • SeedBank is the independent-sampling baseline.
  • Controlled adaptations of SWE-Gym, SWE-TRACE and SWE-Lego edit the same SeedBank trajectories.
  • SWE-Exp is adapted to test a different use of history.
  • There the agent reads an experience message built from the SeedBank attempts.
  • The message stays in the training record.
  • For SWE-Trail, history stays outside the agent's context.
  • H5 uses the five SeedBank attempts as history.
  • H0 has no history but runs the same checks and compiler.
  • H0 against SeedBank tests the pipeline without history.
  • H5 against H0 isolates what history adds.

Controls and extras

  • Random detection compares at a random eligible state instead of a history-guided one.
  • Random retention keeps H5's detector but picks the route to continue at random.
  • Both use H5's model-call limits and horizon.
  • H10 adds five more independent attempts to H5's history.
  • Top-5-of-10 picks five of ten independent trajectories per issue.
  • Top-5-hybrid applies the same verifier to five SeedBank and five H5 trajectories.

Students and evaluation

  • Every trajectory in the final training set is used, resolved or not.
  • The main student is the 124B Ling-3.0-flash-base.
  • It trains with full-parameter supervised fine-tuning on 128 H800 GPUs.
  • Each dataset trains three independent runs.
  • Evaluation uses SWE-bench Multilingual (300 tasks) and SWE-bench Pro (731 tasks).
  • Resolution is the share of tasks whose patches pass the benchmark tests.
  • The score is the mean over the three runs.
  • A second student, Qwen3-14B-Base, tests if gains carry over.
4.2 Downstream training utility
ConditionMultilingualSWE-Pro
SeedBank independent rollouts63.3341.22
SWE-Gym, outcome-conditioned64.00 (+0.67)40.86 (-0.36)
SWE-TRACE, critical-path reduction64.44 (+1.11)40.77 (-0.46)
SWE-Lego, tool-error masking64.56 (+1.22)41.63 (+0.41)
SWE-Exp, agent-visible experience62.00 (-1.33)38.44 (-2.78)
SWE-Trail H063.44 (+0.11)41.95 (+0.73)
SWE-Trail H5, random detection64.22 (+0.89)41.54 (+0.32)
SWE-Trail H5, random retention64.78 (+1.44)41.63 (+0.41)
SWE-Trail H565.67 (+2.33)42.82 (+1.60)

Table 1: mean resolution (%) over three training runs

Changes are relative to SeedBank. Run ranges: SeedBank 63.00 to 63.67 and 41.18 to 41.31. H5 64.00 to 67.67 and 41.72 to 43.37.

SWE-Trail improves resolution

  • H5 beats all other rows on both benchmarks.
  • It gains 2.33 on Multilingual and 1.60 on SWE-Pro.
  • Data size and training are fixed, so the gain comes from the collected trajectories.
  • Every H5 run beats every SeedBank run on both benchmarks.
  • An exact one-sided permutation test over runs gives p = 0.05 on each.
  • SWE-Exp falls below SeedBank by 1.33 and 2.78 points.
  • This may reflect reliance on advice seen in training and absent at test time.
  • Removing advice after collection does not remove its effect on how the run was made.
  • The agent wrote its reasoning after reading the advice.

H5 against H0

  • Without history, H0 gains 0.11 on Multilingual and 0.73 on SWE-Pro.
  • History in H5 adds a further 2.22 and 0.87 points over H0.
  • The estimates are positive on both benchmarks.
  • But 95% task-paired bootstrap intervals are [-0.2, 4.6] and [-0.8, 2.5].
  • Both intervals include zero.

Both choices matter

  • Random detection lowers resolution by 1.44 on Multilingual and 1.28 on SWE-Pro.
  • Random retention lowers it by 0.89 and 1.19.
  • So history should pick where to spend effort.
  • And executed evidence should pick which route continues.
  • Both variants stay above SeedBank, but their run ranges overlap H5's.

A second student

  • Qwen3-14B-Base uses the same SeedBank, H0 and H5 trajectory sets.
  • H5 beats SeedBank by 3.11 on Multilingual and 2.42 on SWE-Pro.
  • It beats H0 by 1.67 and 1.60.
  • So the gain shows up with another student model.
4.3 History scale and cost
ConditionResolved / solved issuesTotal tokensMulti / Pro
H0 (no history)329 / 92at least 1.845B63.44 / 41.95
H5 (main, 5 prior attempts)345 / 981.914B65.67 / 42.82
H10 (10 prior attempts)341 / 942.160B65.89 / 42.95

Table 2: history scale, collection cost and student results

Acquisition-only tokens: H0 164M, H5 307M, H10 510M. H0 leaves out offline compiler calls, so its compute is a lower bound.

More history, small gains

  • Five prior attempts beat H0 by 2.22 on Multilingual and 0.87 on SWE-Pro.
  • Going from five to ten adds only 0.22 and 0.14.
  • H10 does not improve collection outcomes over H5.
  • It raises tokens beyond the ordinary rollout from 307M to 510M, up 66.0%.
  • Total collection tokens rise by 12.9%.
  • H5 stays near H0 in cost.
  • Excluding the cost of prior attempts, H5 uses at most 3.7% more tokens than H0.
  • Its ordinary rollouts use 4.4% fewer tokens.
  • The Qwen3-14B-Base student shows the same pattern.
  • H10 adds 1.00 and 0.36 over H5 there.
Selection helps, but collection with history helps moreFrom Table 3
SWE-bench MultilingualSWE-bench Pro
020406080Mean resolution (%) of the 124B studentSeedBank63.33%41.22%Top-5-of-1064.11%41.86%SWE-Trail H565.67%42.82%Top-5-hybrid66.22%43.14%

Hover, tap or focus a bar to read its exact value.

Training dataSWE-bench Multilingual (%)SWE-bench Pro (%)
SeedBank63.3341.22
Top-5-of-1064.1141.86
SWE-Trail H565.6742.82
Top-5-hybrid66.2243.14

Selection alone and selection plus SWE-Trail

  • Top-5-of-10 beats SeedBank but trails H5 by 1.56 on Multilingual and 0.96 on SWE-Pro.
  • So picking from more independent runs does not match SWE-Trail.
  • The collection process matters beyond picking later.
  • Top-5-hybrid keeps 1,500 trajectories too.
  • Its student reaches 66.22 and 43.14.
  • That is above H5 by 0.56 and 0.32.
  • So selection and SWE-Trail work together.
4.4 What history adds to collection
MethodResolvedSolved issuesVerified positive
SeedBank29288263
SWE-Trail H032992272
SWE-Trail H5345 (+16)98 (+6)285 (+13)

Table 4: collection outcomes over 1,500 trajectories per method

Changes in the H5 row are relative to H0.

Success does not explain the gain

  • H0 gives 37 more resolved trajectories than SeedBank.
  • Yet it lifts the student by only 0.11 on Multilingual.
  • H5 gives 16 more resolved trajectories and six more solved issues than H0.
  • It lifts the student by a further 2.22.
  • The gain is not proportional to the rise in resolved trajectories.

History changes the repair process

  • H5 cuts mean actions from 40.89 to 39.51.
  • It cuts repeated file reads from 7.59 to 7.01.
  • Edited trajectories with a check after the final edit rise from 88.91% to 89.53%.
  • The clearest shift is shorter repairs with fewer repeated reads.
  • H5-trained students also take fewer actions and repeat fewer reads.

Gains come from mixed histories

  • Stable-solved issues show no difference in resolved trajectories between H0 and H5.
  • Mixed histories are only 51 of the 300 collection issues.
  • They give 13 of H5's 16 extra resolved trajectories.
  • They give five of its six extra solved issues.
  • Never-solved histories give the other three trajectories and one issue.
  • This fits Section 2.2: mixed histories reveal decision points.
4.5 How the collection mechanism changes
  • With history, candidate sampling happens in 1,147 of 1,500 rollouts.
  • Under H0 it happens in 664.
  • Both suffixes run in 968 rollouts under H5 and 560 under H0.
  • Candidate sampling rises by 29.8 points on mixed histories and 35.4 on never-solved histories.
  • It rises by 17.3 on stable-solved histories.
  • Candidate diversity is similar: at least two distinct actions in about 90% of cases.
  • So more comparisons come mainly from sampling happening more often.
  • One route shows better local progress in 40.7% of H5 rollouts.
  • For H0 it is 28.7%.
  • Alternative-selection rates are similar: 37.4% and 39.0%.
  • H5 reaches comparisons with clear progress more often.
  • How often it picks the alternative stays the same.

Test-time search and selection

  • Search methods spend extra compute on the current issue.
  • Some sample independent rollouts and choose with tests or model judgments.
  • Others reuse earlier prefixes or summaries of prior attempts.
  • Tree search explores alternatives inside a growing execution tree.
  • SWE-Trail uses prior attempts to guide where effort goes during data generation.
  • The chosen route becomes the training trajectory.

Trajectory generation and curation

  • Some methods make more tasks and trajectories or add diversity through adaptive synthesis.
  • Others select resolved trajectories or edit finished ones.
  • Recent work evolves curation rules from downstream failures.
  • SWE-Trail collects new execution evidence instead of only selecting or editing.
  • Post-hoc selection can still follow, as Section 4.3 shows.

Experience-guided agents

  • Agents use reflections, insights, workflows and skills to guide later actions.
  • For coding, this experience can come from earlier repairs.
  • It can also come from human debugging records or the current attempt.
  • These methods guide the agent's reasoning or actions.
  • SWE-Trail guides where collection effort goes.
  • The agent never receives the history.

What the results show

  • The tests separate collection success from training value.
  • H0 resolves more trajectories than independent sampling but gives little gain on Multilingual.
  • Adding history in H5 gives larger student gains.
  • Randomizing where effort goes, or which route continues, lowers mean resolution.
  • The gains also appear with Qwen3-14B-Base.
  • History works as a collector-side signal, not as advice shown to the agent.

Limitations and future work

  • The tests use two students but one collection model and one agent scaffold.
  • History is fixed during each collection round.
  • Every issue gets the same budget.
  • Future work can update history across rounds and spread effort by issue.
  • A replay audit suggests testing more diverse candidate proposals.
  • Going beyond coding needs environments that restore state and give feedback.
  • Web navigation is one possible direction.

  • Prior attempts are useful for what they hold and for where new effort should go.
  • SWE-Trail turns prior attempts into rules that flag when extra effort may help.
  • The agent proposes actions without seeing the history.
  • The collector briefly runs candidates from one checkpoint and picks the route to continue.
  • With training fixed, the 124B student gains 2.33 and 1.60 points over independent sampling.
  • The gains appear with Qwen3-14B-Base too.
  • H0 shows that collection success alone does not explain the gain.
  • Randomizing either choice lowers mean resolution relative to H5.

A.1 and A.2 Redundancy and the mixed-history audit

  • Behavior-level tables show attempts often return to the same repair targets.
  • They do not repeat the same action sequence.
  • The audit uses the 51 mixed issues.
  • Each holds at least one resolved and one unresolved trajectory.
  • Actions become timelines with category, target, command, reasoning and result.
  • Statements are capped in length.
  • The audit scores every resolved and unresolved pair and picks the best-scoring pair per issue.
  • That gives 43 primary pairs and eight explicitly censored ones.
  • Stage 1 finds the first meaningful route difference using outcomes.
  • Stage 2 hides outcomes and asks if both next actions are reasonable.
  • Stage 1 gives valid results for 47 of 51 pairs.
  • That is 44 localized divergences and three with no meaningful divergence.
  • In the primary set, 21 strict and ten possible cases give 31 decision points.

A.3 Independent cross-model replication

  • A second auditor, gpt-5.6-sol, replays the same 51 pairs without seeing the first auditor's results.
  • It completes all 43 primary pairs.
  • It finds 26 decision points: 16 strict and ten possible.
  • The first auditor finds 31: 21 strict and ten possible.
  • They agree on found versus no divergence in 40 of 43 primary cases.
  • Binary agreement on whether both actions are defensible is 60.5% end to end.
  • It is 64.3% at fixed boundaries.
  • Agreement is stronger on finding differences than on judging if both actions are reasonable.
  • The audits show candidate places to compare. They do not say which action to take.

  • Algorithm 1 gives the collection steps for one issue.
  • Policy calls get only the ordinary issue, conversation and repository observations.
  • The temperature schedule changes sampling without adding history to the prompt.
  • Shortlisting and selection choose among actions the agent already proposed.
  • Cost accounting separates the training corpus size from the compute used to collect it.
  • H5 and H10 token counts are complete.
  • H0 omits offline compilation.
  • SeedBank has no source-provider usage record.

Compiler and detector admission

  • The compiler reads history, extracts evidence, runs read-only checks, writes rules and admits them.
  • Checks record the command, observation and provenance.
  • Each rule has observable conditions, a local objective and abstention conditions.
  • Rules are parsed, linted, deduplicated and replayed on source trajectories.
  • Predicates may use only features available in the current rollout.
  • They may not hold a reference patch, hidden tests, past solution actions or future outcomes.
  • H5 compiles 687 candidate rules.
  • Of these, 569 match at least one source trajectory and 397 pass admission.

Runtime, boundaries and prompts

  • A checkpoint snapshots the conversation, workspace and metadata.
  • The agent samples eight one-step continuations.
  • Candidate zero uses temperature 0.7. H0 uses 0.7 for every slot.
  • Mixed histories alternate 0.7 and 0.85. Stable-solved histories stay at 0.7.
  • The two routes run for two observations in isolated workspaces.
  • If restoration or execution fails, the default stays.
  • Export keeps the agent's original reasoning.
  • It pairs each tool call with one result and drops private events.
  • A record is rejected if a selected event cannot be traced to the raw stream.
  • Prompts for the compiler, shortlister and selector are listed in the appendix.
  • The selector picks a branch only on clear evidence of better progress.
  • Otherwise it returns a tie.

  • SWE-bench Multilingual has 300 issues across nine languages.
  • They are C, C++, Go, Java, JavaScript, TypeScript, PHP, Ruby and Rust.
  • SWE-bench Pro has longer issues. Its public split has 731 tasks.
  • The 300 Multilingual tasks span 41 repositories. The 731 SWE-Pro tasks span 437.
  • Neither shares an issue or repository with the collection set.
  • The SWE-Gym adaptation marks each record with its outcome.
  • The SWE-Lego adaptation masks assistant turns with strict tool misuse in successful records.
  • The SWE-TRACE adaptation removes noncritical messages from successful records.
  • All three modify the same SeedBank trajectories and collect no new interactions.

  • The 124B student has 5.1B activated non-embedding parameters.
  • Each corpus has 1,500 trajectories, all used whether resolved or not.
  • Each condition trains independently three times from the same start.
  • No condition gets separate tuning, and evaluation never picks a model.
  • Qwen3-14B-Base trains the same way on SeedBank, H0, H5 and H10.
  • Every task stays in the denominator, including errors and timeouts.
  • Paired comparisons average each task's outcome over the three trained students.
  • They resample tasks with 20,000 bootstrap replicates.
  • Metrics cover resolution, collection yield, process counts, mechanism rates, tokens and time.
  • A solved issue has at least one resolved trajectory among five.

  • Every H5 run beats every SeedBank run on both benchmarks.
  • On Multilingual, the lowest H5 result, 64.00, beats the highest H0 result.
  • The permutation test has 20 ways to assign three runs to each condition.
  • The three H5 scores are the three highest, so p = 1/20 = 0.05.
  • That is the smallest value this test can give with three runs.
  • H5 over H0 is positive at 2.22 and 0.87, but both task-bootstrap intervals include zero.
  • H10 adds only 0.22 and 0.14 over H5.
  • H5 is no lower than H0 on seven of nine languages.
  • The two drops are on JavaScript and PHP.
  • Each is about one third of a task per run.
  • The biggest gain over H0 is on C.
  • The collection set has only three C issues out of 300 and no Ruby issues.

  • F.1 gives full distributions of actions, repeated reads and validation.
  • F.2 compares student behavior on held-out issues.
  • F.3 breaks yield down by history type.
  • F.4 lists runtime comparison stages.
  • F.5 shows compiler classes and example records.

G.1 Randomized controls and selector replay

  • Random detection picks a random eligible repository-observation boundary.
  • Eligible states have a finished observation, a restorable workspace and enough budget.
  • A stricter selector turns ties from 5 of 18 comparisons to 12 of 18.
  • Candidate coverage is the most common limit, in 13 of 18 replayed comparisons.
  • A selector cannot recover a useful action that was never proposed.

G.2 History scale and cost

  • H5 records 1.914B total tokens, including 307.3M acquisition-only tokens.
  • H0 records at least 1.845B, including 164.3M.
  • Ordinary rollout tokens are 1.607B for H5 and 1.681B for H0.
  • H10 uses 2.160B total, including 510.0M acquisition-only.
  • In H5, candidate proposals use 238.4M tokens and executed suffixes 43.1M.
  • Selection uses 16.8M and offline compilation 9.1M.
  • Never-solved histories use 75.8% of H5's acquisition-only tokens.
  • Mixed histories use 16.9% and stable-solved histories use 7.3%.

G.3 Verifier-based selection

  • The verifier ranks ten candidates and keeps five.
  • It ranks format-admissible first, then the resolved label, then a fixed hash tie-break.
  • It does not use reference patches, length or process metrics.
  • Top-5-of-10 uses twice as many independent rollouts as SeedBank.
  • Its cost is not matched exactly to H5.
  • The hybrid set has a 1.27 point higher trajectory-resolution rate.
  • Ten issues are solved only by the hybrid set.
  • Five are solved only by the independent set.

H.1 A repair case after five failed attempts

  • On schemars-304, all five SeedBank attempts fail after a one-line SERDE_KEYWORDS edit with no validation.
  • Under H5, four of five new trajectories resolve it.
  • A read-only check finds the SERDE_KEYWORDS list that gates attribute forwarding.
  • The detector rule matches after an edit with no validation.
  • It also needs three of ten recent actions to be reads.
  • The agent proposes eight next actions.
  • Candidate 0 keeps reading. Candidate 6 runs the two relevant Rust test suites.
  • The selector picks candidate 6 from the executed evidence.
  • The final one-file patch resolves the issue.

H.2 Retaining or removing advice

  • Two exports are made from the same 1,500 advice-conditioned trajectories.
  • One keeps the advice messages. The other removes them and the reasoning that cites them.
  • Actions and tool results stay the same in both.
  • Removing advice improves SWE-Pro but lowers Multilingual.
  • Removing it does not change the context in which the actions were made.

  • I.1 covers executable coding agents and trajectory corpora.
  • I.2 covers inference-time search and selection.
  • I.3 covers trajectory construction and post-hoc curation.
  • I.4 covers training-time diversity and adaptive curation.
  • I.5 covers experience-guided agents.
  • I.6 covers adaptive acquisition and harness optimization.

Coverage note

  • This page covers the main body in full.
  • The 41-page paper has long appendices. They are summarized, not copied.

Words to know

  • Detector: A set of rules that spot a state where extra effort may help.
  • Trajectory: The full record of an agent's reasoning, actions and tool results.

Share this paper

LinkedIn (opens in a new tab)X (opens in a new tab)WhatsApp (opens in a new tab)EmailDownload PDFExplainer + original paper (PDF), 1.7 MB

Ask AI about this paper

Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.

Read the original paper on arXiv: SWE-Trail: History-Guided Trajectory Collection for Coding Agent Training (opens in a new tab)

Jump to

One paper a week, in plain English

Every Monday: the new AI papers worth your time. Short lines, the key number, and what to do with it.

One email a week. Unsubscribe with one click. No spam.