SWE-Prime: Fewer Trajectories, Better Performance
作者: Dewu Zheng, Ruizhe Ye, Yanlin Wang, Yang Ye, Hongyu Zhang, Ensheng Shi, Xilin Liu, Yuchi Ma, Jianxing Yu, Zibin Zheng
分类: cs.SE, cs.AI, cs.CL
发布日期: 2026-08-27
备注: 9 pages, 5 figures
💡 一句话要点
提出SWE-Prime以优化大语言模型的软件问题解决能力
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大语言模型 监督微调 数据选择 软件问题解决 性能提升
📋 核心要点
- 现有方法在使用成功轨迹进行监督微调时,可能引入噪声监督,导致模型学习不良行为。
- 提出SWE-Prime,通过两阶段的轨迹和段落筛选,优化训练数据的质量,提升模型性能。
- 实验结果显示,使用SWE-Prime选择的10%轨迹子集训练,性能提升显著,优于使用完整数据集。
📝 摘要(中文)
为提升大语言模型解决现实软件问题的能力,现有研究主要集中在构建大规模代理轨迹数据集并对成功轨迹进行监督微调(SFT)。然而,成功轨迹并不一定提供高质量的监督,可能包含无效、冗余或风险步骤。直接使用这些轨迹进行SFT可能引入噪声监督,导致模型模仿不良的解决行为。因此,本文提出了SWE-Prime,一种多粒度、两阶段的SFT数据选择方法,逐步过滤训练数据。第一阶段基于过程质量、结果质量和数据代表性进行轨迹级筛选,选择高质量的成功轨迹子集。第二阶段通过将连续步骤分组为语义段落,评估每个段落对最终解决方案的贡献、可学习性和潜在风险。实验结果表明,使用SWE-Prime选择的10%轨迹子集进行训练,相较于完整数据集,性能提升可达12.2%和24.2%。
🔬 方法详解
问题定义:本文旨在解决现有大语言模型在软件问题解决中,因使用成功轨迹而引入的噪声监督问题。现有方法未能有效过滤无效或冗余的步骤,导致模型学习不良行为。
核心思路:SWE-Prime通过多粒度的两阶段数据选择,逐步筛选出高质量的训练数据。第一阶段关注轨迹的整体质量,第二阶段则细化到每个步骤的贡献,确保模型学习到有效的解决策略。
技术框架:SWE-Prime的整体架构包括两个主要阶段:轨迹级筛选和段落级筛选。轨迹级筛选根据质量和代表性选择成功轨迹,段落级筛选则将连续步骤分组,评估每个段落的有效性。
关键创新:SWE-Prime的创新在于其多粒度筛选机制,能够在保留上下文的同时,确保只有高质量的段落参与损失计算。这一设计显著提高了模型的学习效率和解决问题的能力。
关键设计:在段落级筛选中,评估标准包括段落对最终解决方案的贡献、可学习性和潜在风险。通过这种方式,模型能够更好地理解和学习有效的解决策略。实验中,选择的10%轨迹子集在多个基准上表现优异。
🖼️ 关键图片
📊 实验亮点
实验结果表明,使用SWE-Prime选择的10%轨迹子集进行训练,相较于完整数据集,性能提升显著,分别达到了12.2%和24.2%的相对提升。这一结果验证了SWE-Prime在优化训练数据选择方面的有效性。
🎯 应用场景
该研究的潜在应用领域包括软件开发、自动化测试和智能助手等。通过优化大语言模型在软件问题解决中的表现,SWE-Prime能够提升软件开发的效率和准确性,减少开发过程中的错误和风险。未来,该方法可能在更广泛的AI应用中发挥重要作用,推动智能系统的进步。
📄 摘要(原文)
To improve large language models' ability to resolve real-world software issues, prior work has focused on constructing large-scale agent trajectory datasets and performing supervised fine-tuning (SFT) on successful trajectories. However, task success does not guarantee high-quality supervision: successful trajectories may still contain ineffective, redundant, or risky steps. Directly using such trajectories for SFT can introduce noisy supervision and encourage models to imitate undesirable problem-solving behaviors. Therefore, we propose SWE-Prime, a multi-granularity, two-stage SFT data selection method that progressively filters training data at the trajectory and segment levels. Specifically, the first stage performs trajectory-level screening based on process quality, result quality, and data representativeness, selecting a high-quality and representative subset of successful trajectories. The second stage performs segment-level selection by grouping consecutive steps into semantic segments and assessing each segment based on its contribution to the final solution, learnability, and potential risks. During SFT, all segments remain in the sequence to preserve context, while only selected segments contribute to the loss computation. Experiments on SWE-Bench Pro and SWE-Bench Verified show that training on the 10% trajectory subset selected by SWE-Prime outperforms training on the full resolved dataset, yielding relative performance gains of up to 12.2% and 24.2%, respectively.