Paper: 2608.27449 Authors: Dewu Zheng, Ruizhe Ye, Yanlin Wang, Yang Ye, Hongyu Zhang, Ensheng Shi, Xilin Liu, Yuchi Ma, Jianxing Yu, Zibin Zheng Categories: cs.AI, cs.CL, cs.SE

The Gap

The recipe for improving coding agents has been: collect large-scale agent trajectory datasets, keep the successful ones, and run supervised fine-tuning on them. Success is the label.

The paper’s objection is that success is a result label and it is being used as a process label. A trajectory can resolve the issue and still contain ineffective, redundant, or risky steps — dead ends that were abandoned, repeated exploration of the same file, a command that worked here but is not a pattern you would want imitated. Fine-tuning on it teaches the model to imitate those steps, because SFT has no way to know which parts of a trajectory were instrumental.

This is a specific and worsening problem. As trajectory datasets scale, the fraction of steps in any given trajectory that actually contributed to the resolution probably falls — long successful trajectories accumulate more wandering. So the standard recipe gets worse as the data grows, and it gets worse precisely in the direction the field has been scaling.

   THE STANDARD RECIPE

   collect large-scale agent trajectories
        |
        v
   keep the SUCCESSFUL ones  <-- success is the label
        |
        v
   supervised fine-tuning on them
        |
        v
   [THE OBJECTION] success is a RESULT label being used
                   as a PROCESS label
        |
        v
   a successful trajectory can still contain:
     ineffective steps  |  redundant exploration
     risky commands     |  abandoned dead ends
        |
        v
   SFT imitates ALL of it -- it cannot tell which steps
   were instrumental to the resolution
        |
        v
   [GAP] and it WORSENS with scale: longer successful
         trajectories accumulate more wandering

The Increment

One sentence: Before this paper, the success of a trajectory was the criterion for training on it; after it, two-stage filtering at trajectory and segment granularity means training on 10% of the resolved data outperforms training on all of it.

Core Mechanism

The method is a multi-granularity, two-stage selection procedure, and the granularities are the point — the two stages answer different questions.

Stage one: trajectory-level screening, on three criteria — process quality, result quality, and data representativeness. So a trajectory must not merely succeed; it must succeed well, and it must add something the dataset does not already have. The representativeness criterion is the subtle one: it prevents the filtered set from collapsing onto the easiest task types, which is what a pure quality filter would do.

Stage two: segment-level selection. Consecutive steps are grouped into semantic segments — units that correspond to an intent rather than to a fixed window of steps — and each segment is assessed on its contribution to the final solution, its learnability, and its potential risks. Contribution separates instrumental work from wandering; learnability separates segments that teach something transferable from those that are too task-specific; risk flags segments you would rather not have imitated at all.

The mechanism that makes segment-level selection work is a detail worth pausing on: during SFT, all segments remain in the sequence to preserve context, while only selected segments contribute to the loss. This is the right design and it is non-obvious. Dropping unselected segments would break the causal chain — the model would see a step without the context that produced it, and the remaining steps might not make sense. Keeping them in the input while masking them from the loss means the model is trained to predict only the good steps, while still conditioned on the full history that led to them.

The results are stated in the form that makes the argument: training on the 10% trajectory subset selected by SWE-Prime outperforms training on the full resolved dataset, with relative gains of up to 12.2% on SWE-Bench Pro and 24.2% on SWE-Bench Verified.

Read that comparison carefully, because it is stronger than a usual data-efficiency claim. The baseline is not “a smaller random subset” — it is the full resolved dataset. So the extra 90% of trajectories were not merely unhelpful; they were actively harmful on net. That is the quantitative form of the paper’s premise: the redundant and risky steps in successful trajectories are not neutral filler that washes out, they impose a cost.

   SWE-PRIME: TWO STAGES

   [ all successful trajectories ]
                |
                v
   STAGE 1: TRAJECTORY-LEVEL SCREENING
     process quality      (did it succeed WELL?)
     result quality
     data representativeness  (does it ADD anything?)
                |
                v
   STAGE 2: SEGMENT-LEVEL SELECTION
     group consecutive steps into SEMANTIC SEGMENTS
     score each on:
       contribution to the final solution
       learnability
       potential risks
                |
                v
   TRAINING DETAIL
     ALL segments stay IN THE SEQUENCE  (preserve context)
     ONLY selected segments contribute to the LOSS
        -> model predicts the good steps,
           conditioned on the full history
                |
                v
   RESULT: 10% trajectory subset  >  FULL resolved dataset
     SWE-Bench Pro        up to  12.2% relative
     SWE-Bench Verified   up to  24.2% relative
        -> the other 90% was NET HARMFUL, not merely unhelpful

Think of it as learning surgery by watching recordings of operations, where you can only tell afterwards which ones went well. Keeping every recording of every successful operation teaches the trainee a great deal that has nothing to do with competence: the time the surgeon explored the wrong area, the instrument passed twice because it was misidentified the first time, the improvisation that happened to work on that patient. A competent surgeon’s recording and a lucky one’s look identical if your only filter is “the patient survived”. What you want is to keep the recordings, so the trainee sees each step in context, but mark only the segments worth imitating — the incision done properly, not the fumbling that preceded finding it.

Key Concepts

  • Result label versus process label: success tells you the trajectory ended correctly, not that its steps were worth imitating. Treating them as interchangeable is the assumption the paper removes, and it is why a success-filtered dataset can be worse than a smaller filtered one.
  • Two granularities for two questions: trajectory level asks “is this a good and useful example at all?”; segment level asks “which parts of it should be learned?”. Collapsing them into one score loses the ability to keep a valuable trajectory while discarding its bad stretches.
  • Context preservation with loss masking: keeping all segments in the input while only selected segments contribute to the loss. It is what allows segment-level filtering without breaking the causal chain that makes the remaining steps interpretable.
  • Net harm, not just redundancy: the 10% subset beating the full dataset means the discarded trajectories cost more than they contributed. Distinguishing “unhelpful” from “harmful” changes what you do about data volume.

Framework Shift

Before (success as the label):
  collect trajectories -> keep successes -> SFT on all of them
  -> success correlates with quality but does not measure it
  -> more data monotonically assumed to help

After (quality as the label, at two granularities):
  trajectory level: process, result, representativeness
  segment level: contribution, learnability, risk
  train on selected segments with context preserved
  -> 10% subset BEATS the full resolved dataset
  -> the removed data was net harmful

From using task success as the training criterion, to selecting both which trajectories and which parts of them to learn from, the core shift is that a successful demonstration is not the same as good supervision, and the difference is measurable.

Expert Assessment

Problem choice: Excellent, and it names an assumption the field has been running on. “Keep the successes” sounds like a quality filter and is in fact a result filter, and the paper’s point that the gap widens with scale — longer successful trajectories accumulating more wandering — explains why the standard recipe gets worse as datasets grow, which is the opposite of the usual scaling assumption.

Method maturity: The two-stage design is well motivated, and the segment-level stage is the substantive contribution: grouping into semantic rather than fixed-size units respects the structure of a trajectory, and scoring on contribution, learnability and risk addresses three distinct ways a segment can be bad. The context-preservation-with-loss-masking detail is the kind of implementation choice that makes the difference between a method that works and one that does not, and it is stated plainly.

Experimental integrity: The baseline choice is what makes the result convincing. Comparing against the full resolved dataset rather than against a smaller random subset means the finding is about quality, not about sample efficiency, and reporting that the 10% subset wins demonstrates the discarded data was net harmful. Two benchmarks with different difficulty profiles — Pro and Verified — showing 12.2% and 24.2% means the effect is not a single-benchmark artefact. The main open question is how much of the gain comes from each stage and each criterion; the paper’s contribution would be easier to adopt if the ablation isolated the representativeness filter, which is the least obvious of the criteria.

Writing quality: The premise is stated as a crisp contrast — task success versus high-quality supervision — and the results are reported in the comparison that carries the argument. What would strengthen it is one worked example: a trajectory that passed the success filter and failed trajectory-level screening, with the offending steps identified, so a reader can calibrate their own data.

Verdict: strong accept — it identifies a labelling assumption that gets worse with scale, fixes it at two granularities, and demonstrates the fix with a comparison that shows the old data was harmful rather than merely unhelpful.

Takeaways

  • Treat task success as a result label, not a quality label. Filter on process, then filter again at the segment level before training.
  • Preserve context while masking the loss. Removing filtered steps from the input breaks the causal chain; keep them visible and exclude them from the gradient.
  • Compare against the full dataset, not a smaller random subset. Only that comparison reveals whether the extra data was neutral or harmful.
  • Expect the problem to get worse as you scale trajectories. Longer successful runs contain proportionally more wandering, so a success filter degrades exactly where you are investing.

论文: 2608.27449 作者: Dewu Zheng, Ruizhe Ye, Yanlin Wang, Yang Ye, Hongyu Zhang, Ensheng Shi, Xilin Liu, Yuchi Ma, Jianxing Yu, Zibin Zheng 分类: cs.AI, cs.CL, cs.SE

缺口

改进编程智能体的配方一直是:收集大规模智能体轨迹数据集,留下成功的那些,在其上做监督微调。“成功”就是那个标签。

论文的反对意见是:成功是一个结果标签,而它被当成了过程标签。 一条轨迹可以解决问题,同时包含无效、冗余或危险的步骤——被放弃的死胡同、对同一个文件的反复探索、一条在这里管用但并不值得被模仿的命令。在它上面做微调,就是在教模型模仿这些步骤,因为监督微调无从得知一条轨迹里哪些部分才是真正起作用的。

这是一个具体且会随规模恶化的问题。 随着轨迹数据集扩大,任何一条轨迹中”真正对解决问题有贡献的步骤”所占比例很可能在下降——长的成功轨迹会累积更多游荡。于是标准配方在数据变大时反而变差,而且恰恰在本领域一直在扩规模的那个方向上变差。

   标准配方

   收集大规模智能体轨迹
        |
        v
   留下「成功」的那些  <-- 成功就是标签
        |
        v
   在其上做监督微调
        |
        v
   [反对意见] 成功是「结果」标签,却被当成了「过程」标签
        |
        v
   一条成功的轨迹里仍可能包含:
     无效步骤  |  冗余探索
     危险命令  |  被放弃的死胡同
        |
        v
   监督微调会把它们「全部」模仿下来——
   它无法判断哪些步骤对解决问题起了作用
        |
        v
   [缺口] 而且会「随规模恶化」:成功的轨迹越长,
         累积的游荡越多

增量

一句话: 在这篇论文之前,“轨迹是否成功”就是是否在其上训练的标准;在这篇论文之后,在轨迹层与片段层做两阶段筛选,使得只用 10% 的已解决数据训练,效果优于用全部数据训练。

核心机制

方法是一套多粒度、两阶段的选择流程,而”粒度”才是关键——两个阶段回答的是不同的问题。

第一阶段:轨迹层筛选,依据三条标准——过程质量、结果质量、以及数据代表性。也就是说,一条轨迹不仅要成功,还要成功地好,并且要为数据集增添它还没有的东西。“代表性”这一条最微妙:它防止筛选后的集合塌缩到最容易的任务类型上——而那正是”纯质量筛选”会造成的后果。

第二阶段:片段层选择。 把连续的步骤聚成语义片段——对应一个意图的单位,而不是固定长度的步窗——再对每个片段评估它对最终解的贡献、它的可学习性、以及它的潜在风险。“贡献”把起作用的工序与游荡分开;“可学习性”把能教出可迁移之物的片段与过拟合到具体任务的片段分开;“风险”把那些你根本不愿被模仿的片段标记出来。

而让片段层选择真正可用的机制,是一个值得停下来看的细节:在监督微调过程中,所有片段都留在序列里以保留上下文,但只有被选中的片段参与损失计算。 这是正确的设计,而且并不显然。把未选中的片段直接删掉会打断因果链——模型会看到一个步骤,却看不到产生它的上下文,剩下的步骤可能就无法理解。把它们留在输入里、同时从损失中屏蔽掉,意味着模型被训练去预测的只有好步骤,但仍然以导致这些步骤的完整历史为条件。

结果以最能承载论证的形式给出:只在 SWE-Prime 筛选出的 10% 轨迹子集上训练,效果优于在完整的已解决数据集上训练,相对增益在 SWE-Bench Pro 上最高 12.2%、在 SWE-Bench Verified 上最高 24.2%

请仔细读这个对比,因为它比通常的”数据效率”主张更强。 基线不是”一个更小的随机子集”,而是完整的已解决数据集。所以另外那 90% 的轨迹不只是”没帮上忙”——它们整体上是有害的。这就是论文前提的定量形态:成功轨迹中的冗余与危险步骤不是会被冲淡的中性填充,它们带来了代价。

   SWE-PRIME:两个阶段

   [ 全部成功的轨迹 ]
                |
                v
   阶段一:轨迹层筛选
     过程质量       (它是「好好地」成功的吗?)
     结果质量
     数据代表性     (它「增添」了什么吗?)
                |
                v
   阶段二:片段层选择
     把连续步骤聚成「语义片段」
     对每个片段打分:
       对最终解的贡献
       可学习性
       潜在风险
                |
                v
   训练上的细节
     「所有」片段都留在序列中(保留上下文)
     「只有」被选中的片段参与损失
        -> 模型在完整历史的条件下,只预测好步骤
                |
                v
   结果:10% 的轨迹子集  >  完整的已解决数据集
     SWE-Bench Pro        相对提升最高  12.2%
     SWE-Bench Verified   相对提升最高  24.2%
        -> 另外 90% 是「净有害」,而不只是「没帮上忙」

可以用**“靠看手术录像学习,而你只能在事后判断哪几台做得漂亮”来理解这件事: 把每一台”成功”手术的录像都留着,会教给学员大量与”胜任”无关的东西:主刀探错区域的那段时间、器械被递了两次因为第一次认错了、以及那次恰好在这个病人身上奏效的临场发挥。 如果你唯一的筛选条件只是”病人活下来”,那么一台水平扎实的手术录像,与一台运气好的,看起来一模一样**。 你想要的是:保留录像,让学员在上下文中看到每一步;但只标记那些值得模仿的片段——切得漂亮的那一刀,而不是找到切口之前的摸索。

关键概念

  • 结果标签 vs 过程标签: 成功告诉你这条轨迹结束得对,而不是它的步骤值得模仿。把这两者当作可互换的,正是论文要移除的那个假设;也是”按成功筛选过的数据集”可能比”更小的筛选数据集”更差的原因。
  • 两个粒度回答两个问题: 轨迹层问”这到底是不是一个好而有用样本?“;片段层问”其中哪些部分该被学?“。把两者压成一个分数,就失去了”保留一条有价值的轨迹、同时丢掉其中糟糕段落”的能力。
  • 保留上下文 + 屏蔽损失: 让所有片段留在输入里,只让被选中的片段参与损失。正是它使片段层筛选得以在不打断因果链的前提下进行——而因果链正是让剩余步骤可被理解的前提。
  • 净有害,而不只是冗余: 10% 子集击败完整数据集,意味着被丢弃的那些轨迹代价大于贡献。把”没帮助”与”有害”区分开,会改变你对”数据量”该采取的动作。

框架转变

之前(把成功当作标签):
  收集轨迹 -> 留下成功的 -> 全部用于微调
  -> 成功与质量相关,但并不度量质量
  -> 默认「数据越多越好」

之后(把质量当作标签,且分两个粒度):
  轨迹层:过程、结果、代表性
  片段层:贡献、可学习性、风险
  在保留上下文的前提下,只用被选中的片段训练
  -> 10% 子集「击败」完整已解决数据集
  -> 被移除的数据是「净有害」的

从”把任务成功当作训练标准”,转变为”同时选择哪些轨迹以及其中的哪些部分值得学”,核心转变在于:一个成功的演示,并不等同于高质量的监督——而这个差别是可测量的。

专家评审

选题眼光: 极好,而且它指出了整个领域一直在跑的一个假设。 “保留成功的那些”听起来像一个质量筛选,实际上是结果筛选;而论文关于”这个落差会随规模扩大”的论点——更长的成功轨迹累积更多游荡——解释了为什么标准配方在数据集变大时反而变差。这与通常的扩展假设正好相反。

方法成熟度: 两阶段设计动机充分,而片段层那一阶段是实质贡献:按语义而非固定长度切分,尊重了轨迹本身的结构;按贡献、可学习性、风险打分,覆盖了”一个片段可以有三种不同的坏法”。至于”保留上下文 + 屏蔽损失”这个细节,正是那种决定”方法能用/不能用”的实现选择,而论文把它直白写了出来。

实验诚意: 基线的选择是让结果可信的关键。 对比完整的已解决数据集、而不是对比一个更小的随机子集,意味着这个发现是关于质量的,而不是关于样本效率的;而报告”10% 子集胜出”则说明被丢弃的数据是净有害的。两个难度画像不同的基准——Pro 与 Verified——分别给出 12.2% 与 24.2%,说明这个效应不是单基准的假象。 主要开放问题是增益中有多少来自哪个阶段、哪条标准;如果能通过消融把”代表性筛选”这一条单独隔离出来——它是所有标准里最不显然的一条——论文会更容易被采纳。

写作功力: 前提被陈述为一个鲜明的对照——任务成功 vs 高质量监督——而结果也以”承载论证的那个对比”来报告。 若能给出一个具体案例:一条通过了成功筛选、却在轨迹层筛选中被淘汰的轨迹,并指出具体是哪些步骤出了问题,会更有说服力——读者据此可以校准自己的数据。

判决: 强接收(Strong Accept) — 它指出一个会随规模恶化的标注假设,在两个粒度上修好它,并用一个”证明旧数据有害而非仅仅无用”的对比来展示修复效果。

要点总结

  • 把任务成功当作结果标签,而不是质量标签。先按过程筛,再在片段层筛,然后才训练。
  • 保留上下文、屏蔽损失。把被筛掉的步骤从输入里删掉会打断因果链;让它们保持可见,但排除在梯度之外。
  • 完整数据集对比,而不是与一个更小的随机子集对比。只有那个对比才能揭示多出来的数据究竟是中性的、还是有害的。
  • 预期这个问题会随轨迹规模扩大而恶化。越长的成功运行包含越多游荡,因此”按成功筛选”恰好在你在投入的方向上发生退化。