Agent training data: more tasks, or more attempts per task?
Before adding agent training data, compare new tasks, new environments, and fresh attempts at existing tasks separately; use gains on unseen tasks under comparable training and evaluation conditions to decide what to expand next.
On this page
A coding agent is improving slowly despite further training. The team can run more attempts in familiar repositories to collect successful trajectories, or spend time setting up new repositories and gathering unfamiliar problems. The first route is easier to scale; the second may address missing capabilities. Neither a larger sample count nor the slogan “diversity matters more” settles the decision.
The two papers control different variables
SWE-smith and SWE-Gym both study software engineering agents, but they do not jointly constitute one standardized contest between quantity and diversity. The useful starting point is what each experiment actually changes.[1][2]
| Study and setting | Actual comparison | What it establishes |
|---|---|---|
| SWE-smith v2: a 7B student, successful expert trajectories, and SWE-agent | 700 trajectories from pools of 4, 25, 50, or 100 repositories, using Procedural Modification tasks | Broader repository coverage accompanies better SWE-bench Verified performance in this setting. Equal counts need not provide equal training value |
| SWE-Gym v2: the Qwen2.5-Coder-Instruct family with frameworks including OpenHands | 491 successful trajectories, 294 after deduplication by task, and several subsets | The authors do not yet find diversity to be a bottleneck at this scale. The 491-versus-294 comparison also changes quantity, so it cannot establish that repetition beats coverage |
SWE-smith's fixed-count comparison addresses repository coverage more directly, but it does not thereby hold every training token, difficulty factor, or generation characteristic constant. SWE-Gym provides a reminder that when data is scarce, additional usable demonstrations may still help. Its finding is not a refutation of SWE-smith, and these papers do not establish a universal sample threshold beyond which a team should switch from quantity to coverage.[1][2]
Define what the model is missing before defining “more”
A trajectory records one attempt at a task: what the agent observed, which actions it took, and what feedback followed. One task can produce many trajectories, and one repository can supply many tasks. Those counts are not interchangeable. Repeated runs may reveal alternative solutions, or merely reword the same sequence of actions.
If the model reliably locates the relevant file but rarely checks its patch, investigate whether demonstrations of effective testing are missing. If it works in familiar repositories but fails under a different dependency structure, investigate environment coverage. If the test harness itself is wrong, either form of expansion may amplify misleading signals. These are diagnostic hypotheses; execution records must substantiate them.
Our conditional judgment is that repeated sampling remains worth testing when existing tasks can expose useful behaviors the model has not learned. When additional attempts are highly repetitive and failures cluster in unfamiliar task types or environments, test broader coverage first. Record the learning opportunity contributed by the new data instead of treating either repetition or diversity as inherently good or bad.
Are the trajectories teaching behavior or judging outcomes?
The sampling discussion needs a learning target. Supervised fine-tuning, or SFT, trains a model to imitate demonstrations. A verifier learns to assess or rank candidate outcomes. Online reinforcement learning updates a policy through further interaction and feedback. These processes may share tasks while requiring different examples.
| Learning target | What repeated attempts may contribute | Evidence to retain |
|---|---|---|
| Policy SFT | Alternative useful action sequences, or merely repeated demonstrations | Actions, observations, outcome checks, the demonstration model, and tool versions |
| Verification or candidate ranking | Comparable successes and failures for the same problem | Task groups, candidate outcomes, labels, and their checking records |
| Online reinforcement learning | Exploration and comparable feedback under the current policy | An executable environment, states, policy versions, grouped attempts, and reward versions |
SWE-Gym's main policy experiments fine-tune on filtered successful trajectories, while its verifier uses successes and failures. Repeated sampling does not make the policy training policy-gradient RL.[2] RAGEN studies state coverage, grouped attempts, and trajectory freshness in online training. RAGEN-2 further describes how reasoning can become less dependent on the input even while outputs remain superficially diverse.[3][4] These findings establish useful boundaries; they do not prescribe a universal number of attempts or a universal data-quality score.
Compare three additions under the same training budget
The following is our proposed SFT experiment, not a reported result. Each arm uses the same base dataset D0 plus its own addition, ΔA, ΔB, or ΔC. Keep exposure to D0 and its mixing proportion constant. Fix the base model, tool interface, demonstration model and version, decoding parameters, and success-filtering rules. Record data-sampling seeds before varying the source of the addition.
| Arm | Where the addition comes from | Main question |
|---|---|---|
| A: new attempts at existing tasks | Resample familiar tasks and filter with the same outcome checks | Do additional usable paths improve behavior within covered tasks? |
| B: new tasks in existing repositories | Keep the environments and add different problems | Is the main limitation coverage of problem types? |
| C: new tasks in new repositories | Add unfamiliar code structures, dependencies, and problems | Does jointly broadening environments and problems improve transfer to unseen repositories? |
Match the number of training tokens in each addition that actually contribute to the loss, and check optimizer updates, batch sizes, and learning rates. An equal context-length cap is not an equal training budget. Account separately for padding, masked tool responses, and repeated exposure across epochs. Also report full input lengths and GPU time: equal supervision does not mean equal computation. If an arm lacks enough examples, lower the common budget or disclose the difference instead of silently duplicating data to fill the gap.
Also include a D0-only control with the same exposure to D0 and no addition. Gains over that control include the effect of extra training. To ask whether new data is more valuable than further practice on old data, add a separate control that repeats D0 to match the total training-token budget. These controls answer different questions; state every arm's budget explicitly.
Stratify by length, error type, and solvability under a fixed initial model, then inspect the resulting distributions. Solvability is a noisy proxy for difficulty, and matching may remain imperfect. If C changes both environments and problems, call it a joint coverage strategy. Isolating a repository effect requires matching problem families as closely as possible. Disclose residual differences, including changes in context length associated with new repositories.
Reserve the final holdout, then test whether gains transfer
All attempts at a task should stay in the same data partition, with related patches and derived tasks checked as well. Evaluating transfer to new repositories requires separation by repository and relevant lineage: repositories added to C's training data cannot enter the unseen-repository test set. Keep training, tuning-validation, and final holdout sets distinct. Select the recipe and checkpoint on validation data, freeze that choice, and only then inspect the holdout. Do not keep changing the data after seeing final scores.
Start with pass@1, the proportion of tasks solved in a single attempt. Fix the agent framework, tools, maximum steps, token or time budget, and decoding temperature across arms. The same metric name does not guarantee the same inference resources. Report unseen-task and unseen-repository performance separately, then examine behaviors such as reproducing the failure, modifying files, and running tests. The phrase “tests passed” in a log does not establish that a test ran.
At least three training seeds can be a practical starting point, but they do not guarantee reliability. Data sampling is another source of randomness: record its seeds and repeat sampling and training where feasible. Estimate uncertainty by resampling task or repository groups, rather than treating every trajectory as independent. Such resampling cannot replace drawing new training data or rerunning training. With few repositories, show individual repository results, and disclose conclusions that vary substantially across seeds or repositories.
What result would change the collection plan?
| Observation | Provisional interpretation | What still needs ruling out |
|---|---|---|
| A wins consistently on the holdout | Existing tasks still contain useful behavioral variation | Longer demonstrations, more effective tokens, or looser filtering |
| B beats A; C adds no further benefit | New problems may be the current bottleneck, without needing more environments | Poor environment preparation or a difficulty mismatch in C |
| C consistently improves unseen-repository performance | Joint coverage expansion deserves further testing | A gain confined to a few repositories or a particular problem type |
| None shows a reliable gain | Revisit the data, objective, and training recipe | An undersized evaluation, model saturation, faulty environments, or incorrect labels |
This table guides the next experiment; it does not permanently rank kinds of data. Even if C is more effective, account separately for environment setup, failed generation attempts, verification, and maintenance. Equal training budgets do not imply equal collection costs. Expand the part of the data that produces a verifiable gain at an acceptable cost under the current conditions, and change direction when the comparison no longer supports it.
