← 返回 2026-06-24

OpenThoughts-Agent:代理模型的数据配方 OpenThoughts-Agent: Data Recipes for Agentic Models

Negin Raoof, Richard Zhuang, Marianna Nezhurina, Etash Guha, Atula Tejaswi, Ryan Marten, Charlie F. Ruan, Tyler Griggs, Alexander Glenn Shaw, Hritik Bansal, E. Kelly Buchanan, Artem Gazizov, Reinhard Heckel, Chinmay Hegde, Sankalp Jajee, Daanish Khazi, Emmanouil Koukoumidis, Xiangyi Li, Hange Liu, Shlok Natarajan, Harsh Raj, Nicholas Roberts, Ethan Shen, Nishad Singhi, Michael Siu, Ashima Suvarna, Hanwen Xing, Patrick Yubeaton, Robert Zhang, Leon Liangyu Chen, Xiaokun Chen, Steven Dillmann, Saadia Gabriel, Xunyi Jiang, Anurag Kashyap, Boxuan Li, Yein Park, Minh Pham, Sujay Sanghavi, Lin Shi, Ke Sun, Yixin Wang, Zhiwei Xu, Erica Zhang, Siyan Zhao, Wanjia Zhao, Jenia Jitsev, Alex Dimakis, Benjamin Feuer, Ludwig Schmidt 📅 2026-06-23 👍 47 2026-07-13 08:37
Agent训练 开源基准测试 强化学习 数据构建 监督微调

首个公开agent训练pipeline,100+实验,32B模型超越基线3.9pp

前置知识

Agent模型

Agent模型是能够使用工具、与环境交互、执行复杂任务的语言模型,不同于传统的问答模型,它们可以操作计算机、编辑代码、运行命令等。这类模型通常需要通过监督微调(SFT)学习任务-轨迹对,再通过强化学习(RL)优化策略。关键技术包括长序列训练、沙箱环境执行、工具调用等。

本文核心就是研究如何训练这类模型,理解其能力边界和训练方式是读懂论文的基础

监督微调(SFT)

SFT是语言模型后训练的关键阶段,通过在(任务, 轨迹)对上训练,让模型学会执行特定任务。轨迹是指模型解决问题的完整过程,包括思考、工具调用、观察等。SFT通常使用较小的学习率(如$4e^{-5}$)和较长的上下文(如32,768 tokens),学习率采用余弦调度。与预训练相比,SFT数据量小但质量要求极高。

本文的主要贡献就是构建agent SFT数据pipeline,理解SFT的原理和目标有助于理解实验设计

消融实验

消融实验是通过移除或替换模型的某个组件来评估其贡献的方法。本文使用z-score标准化来平衡不同基准测试的分数差异:$z = (x - μ)/σ$,然后对多个基准的z-score取平均。这样可以确保每个基准在决策中权重相等,不受分数范围差异影响。作者对pipeline的6个阶段独立进行消融,每个候选策略训练10,000条数据。

本文核心方法就是系统的消融实验,理解其设计和评估方式是理解结论的关键

基准测试

基准测试是评估模型性能的标准任务集。本文使用SWE-Bench Verified(GitHub issue修复)、Terminal-Bench 2.0(终端操作任务)、OT-TBLite(100个Terminal-Bench风格任务)作为核心基准,以及Aider Polyglot、BFCL-Parity、MedAgentBench、GAIA-127、FinanceAgent-Terminal作为分布外(OOD)基准。评估在Daytona沙箱中使用Terminus-2 harness,每任务运行3次取平均值。

本文的贡献主要体现在这些基准上的提升,理解基准的含义和评估方式有助于判断结果的重要性

研究动机

Agent模型虽然应用前景广阔,但公开文献中关于如何训练它们的详细信息极其有限。以DeepSeekV4为例,虽然开源了模型权重并发布了50多页的技术报告,但对训练数据的描述仅有两段概括性文字。现有的开源数据集如SWE-Smith、SERA、Nemotron-Terminal等通常只针对单个基准测试优化,缺乏能够泛化到多样化agent任务的训练数据研究。这导致开放AI研究难以理解广泛能力的agent模型是如何训练的,也无法有效贡献改进。

本文的目标是本文旨在填补这一空白,通过OpenThoughts-Agent(OT-Agent)项目提供一个完全开放的agent模型训练数据构建pipeline。具体目标包括:系统研究pipeline的每个阶段,通过100+控制消融实验揭示任务来源和多样性的重要性;构建最优的agent SFT训练集;验证训练数据的扩展性;并研究强化学习数据的选择策略。最终在多个agent基准上验证方法的有效性。

与已有工作不同的是,本文的独特切入角度是专注于泛化能力而非单一基准优化。与现有工作只关注SWE-Bench或Terminal-Bench不同,本文在7个agent基准上评估模型,包括分布外任务,确保训练出的模型具有广泛能力。同时,本文系统研究了SFT和RL两个训练阶段的交互,这是以往工作很少涉及的。另一个创新点是大规模消融实验,每个pipeline阶段独立测试多种策略,提供数据驱动的insights而非经验之谈。

核心方法

本文提出了一个六阶段的SFT数据构建pipeline,从任务生成到轨迹过滤,每个阶段都经过系统消融。直觉上,好的训练数据应该来自多样化的任务源,由合适的教师模型生成高质量的执行轨迹,并经过严格过滤。技术路线是:首先从95种策略中测试任务生成方法,然后混合Top 4-8策略获得平衡性能,接着测试任务增强和过滤策略,选择最佳教师模型,最后过滤轨迹保留多轮交互。通过z-score标准化的平均性能来决策最优策略。

核心创新点是强模型未必是好教师。实验发现GPT-5.3-Codex虽然是最强的agent模型,但作为教师模型时效果反而不如GLM-4.7-AWQ,在Terminal-Bench 2.0上性能下降约5%。这表明教学能力和任务执行能力是不同的,好的教师应该能生成可学习的轨迹而非仅仅解决困难问题。另一个关键发现是保留多轮轨迹(≥5 turns)能显著提升下游性能,验证了agent学习中过程监督的重要性。

方法步骤详情

第一步是任务来源选择,测试95种策略包括GitHub issue合成(SWE-Smith)、Stack Exchange问答、自然语言到Bash任务等,在SWE-Bench Verified-100、OT-TBLite、Terminal-Bench 2.0三个基准上评估,发现Top 4策略混合最佳。第二步是任务增强,测试LLM重写、约束添加、任务合并等方法,发现都不如原始任务描述。第三步是任务过滤,使用GPT-5响应长度作为难度信号,选择需要更多token的任务能提升约3pp。第四步是教师模型选择,在GLM-4.7-AWQ、GLM-5、Kimi K2.5、GPT-5.3-Codex等中消融,GLM-4.7-AWQ最佳。第五步是轨迹生成,在Daytona沙箱中使用Terminus-2 harness生成执行轨迹。第六步是轨迹过滤,保留≥5 turns的轨迹效果最好。最终pipeline生成100K训练数据。

技术新颖性

技术新颖性体现在:1)首次系统研究agent数据pipeline的每个阶段,提供全面消融而非零散优化;2)揭示强模型≠好教师这一反直觉发现,挑战了简单使用最强模型生成数据的做法;3)证明多轮轨迹的重要性,验证了过程监督对agent学习的价值;4)训练数据展现良好的扩展性,在每个规模上都优于替代数据集,这是数据质量而非数量的优势;5)同时研究SFT和RL两个阶段,探索它们的协同效应,这是以往工作很少涉及的。

Six-stage SFT data pipeline for OpenThoughts-Agent. Each stage is ablated independently in Sections 3.1–3.6.
Figure 2: Six-stage SFT data pipeline for OpenThoughts-Agent. Each stage is ablated independently in Sections 3.1–3.6.
OpenThoughts-Agent Full Data Pipeline. Our final SFT dataset is 100k agentic traces.
Figure 4: OpenThoughts-Agent Full Data Pipeline. Our final SFT dataset is 100k agentic traces.

实验结果

核心发现可以总结为五点。第一,任务来源是pipeline中影响最大的阶段,Top 1和Bottom 1策略在SWE-Bench上的差异高达30pp。Top 4策略混合(SWE-Smith、StackExchange SuperUser、StackExchange Tezos、IssueTasks)在三个核心基准上取得平衡性能。第二,任务增强策略没有带来改进,所有LLM驱动的重写、约束添加等方法都在噪声范围内。第三,任务过滤中GPT-5响应长度信号最有效,选择长响应任务能提升约3pp平均性能。第四,教师模型选择上GLM-4.7-AWQ(量化版)最佳,GPT-5.3-Codex反而最差,说明基准性能和教学能力不同。第五,轨迹过滤保留≥5 turns能提升约6pp性能,在匹配token预算后仍然成立,证明是多轮监督的价值而非额外算力。扩展性方面,合成任务增强(用LLM重写Tezos问题)克服了上采样瓶颈,从31.6K到100K持续改进,SWE-Bench提升+7.7pp,Terminal-Bench提升+5.0pp。RL方面,pymethods2test数据源最佳(21.72%平均),8B模型SFT+RL达到27.9%,超越纯SFT和纯RL策略。

OpenThinkerAgent-32B is the best open-data model (Qwen-3 model family or earlier, up to 32B scale) on an average of seven agentic benchmarks.
Table 1: OpenThinkerAgent-32B is the best open-data model (Qwen-3 model family or earlier, up to 32B scale) on an average of seven agentic benchmarks.
Task source choice has the largest spread of any pipeline stage. Issue-resolution tasks and human-written infrastructure questions dominate the top, but improvements are spiky across benchmarks.
Table 2: Task source choice has the largest spread of any pipeline stage. Issue-resolution tasks and human-written infrastructure questions dominate the top, but improvements are spiky across benchmarks.
Mixing top-ranked task generation strategies, random shuffle within task. Mixing the top-4 to top-8 strategies yields the strongest balanced performance, outperforming the unmixed top-1 baseline by avoiding over-specialization.
Table 3: Mixing top-ranked task generation strategies, random shuffle within task. Mixing the top-4 to top-8 strategies yields the strongest balanced performance, outperforming the unmixed top-1 baseline by avoiding over-specialization.
Task description augmentation strategies are within noise. No LLM-driven augmentation strategy reliably outperforms the un-augmented baseline.
Table 4: Task description augmentation strategies are within noise. No LLM-driven augmentation strategy reliably outperforms the un-augmented baseline.
Filtering task descriptions with LLM-based difficulty signals improves performance. Selecting tasks for which GPT-5 produces longer responses improves over random selection by ~3pp on average.
Table 5: Filtering task descriptions with LLM-based difficulty signals improves performance. Selecting tasks for which GPT-5 produces longer responses improves over random selection by ~3pp on average.
Teacher model ablation: stronger model ≠ better teacher. Despite GPT-5.3-Codex being the strongest model on these benchmarks, it is the weakest teacher, underperforming GLM 4.7 AWQ by ~5pp on Terminal-Bench 2.0.
Table 6: Teacher model ablation: stronger model ≠ better teacher. Despite GPT-5.3-Codex being the strongest model on these benchmarks, it is the weakest teacher, underperforming GLM 4.7 AWQ by ~5pp on Terminal-Bench 2.0.
Filtering agent rollouts: keeping longer trajectories helps. The minimum-turns filter outperforms timeout and subagent filters across all three benchmarks.
Table 7: Filtering agent rollouts: keeping longer trajectories helps. The minimum-turns filter outperforms timeout and subagent filters across all three benchmarks.
Task-Source diversity has a negligible effect at larger data scales. Adding sources beyond Top-4 does not reliably lift performance.
Table 8: Task-Source diversity has a negligible effect at larger data scales. Adding sources beyond Top-4 does not reliably lift performance.
Data source strongly influences agentic RL performance. Across eight 8B RL runs that hold the training pipeline fixed and vary only the source, performance varies well beyond noise.
Table 9: Data source strongly influences agentic RL performance. Across eight 8B RL runs that hold the training pipeline fixed and vary only the source, performance varies well beyond noise.
RL main results (8B scale). Each cell reports the highest accuracy (%) attained by the model across all evaluated agent harnesses for that benchmark.
Table 10: RL main results (8B scale). Each cell reports the highest accuracy (%) attained by the model across all evaluated agent harnesses for that benchmark.
RL on top of moderately strong SFT outperforms other strategies. Our SFT + RL model (1), which starts from a medium-strength SFT base model (3), outperforms both RL from a weaker SFT base model (4) and SFT alone (3).
Table 11: RL on top of moderately strong SFT outperforms other strategies. Our SFT + RL model (1), which starts from a medium-strength SFT base model (3), outperforms both RL from a weaker SFT base model (4) and SFT alone (3).
The OpenThoughts-Agent-SFT dataset leads to SotA performance on Terminal-Bench 2.0 and an 100-subset of SWE-Bench Verified at large dataset scales. The all-benchmark average is over the seven benchmarks reported in Table 1.
Figure 1: The OpenThoughts-Agent-SFT dataset leads to SotA performance on Terminal-Bench 2.0 and an 100-subset of SWE-Bench Verified at large dataset scales. The all-benchmark average is over the seven benchmarks reported in Table 1.
Synthetic augmentation scales past the upsampling plateau. Both methods build on the same 10K base and diverge only when scaling beyond it.
Figure 3: Synthetic augmentation scales past the upsampling plateau. Both methods build on the same 10K base and diverge only when scaling beyond it.
查看结构化数据
任务指标本文基线提升
SWE-Bench Verified 准确率(%) 54.0 Nemotron-Terminal-32B: 41.9 +12.1pp
Terminal-Bench 2.0 准确率(%) 26.2 Nemotron-Terminal-32B: 25.1 +1.1pp
OT-TBLite 准确率(%) 41.3 Nemotron-Terminal-32B: 16.1 +25.2pp
七基准平均 平均准确率(%) 44.8 Nemotron-Terminal-32B: 40.9 +3.9pp
Aider Polyglot 准确率(%) 32.4 Nemotron-Terminal-32B: 24.9 +7.5pp
BFCL-Parity 准确率(%) 85.9 Nemotron-Terminal-32B: 69.1 +16.8pp
GAIA-127 准确率(%) 23.6 Nemotron-Terminal-32B: 22.3 +1.3pp

局限与改进

作者承认的局限性包括:RL研究仅在8B规模进行,计算约束下未测试32B规模的RL效果;所有SFT实验都从Qwen3家族开始,未消融base model的选择,无法分离预训练贡献;最大训练集仅100K轨迹,未测试百万级轨迹规模的趋势。作者还指出Agent模型是双用途技术,可能被用于未授权操作,需要适当沙箱和人工监督。另外的观察是:Top-4之外的额外任务源没有带来可靠提升,说明高质量任务比数量更重要;Tezos问题集仅997个唯一任务,限制了天然任务多样性,不得不依赖合成增强;基准测试存在运行到运行方差(约2.0pp),需要多次取平均来降低噪声。

独立分析的弱点

本文的弱点主要集中在几个方面。第一,任务增强策略全部失败,这可能是LLM重写引入了噪声或偏离了原始意图,未来可以尝试更精细的增强方法如保持语义不变的同义改写。第二,Top-4之外的任务源没有帮助,Tezos任务集太小成为瓶颈,虽然用合成增强缓解了这个问题,但更好的方法是寻找更多高质量的自然任务源而非依赖合成。第三,RL研究不够深入,只测试了8B规模且没有深入研究策略变化,未来可以扩展到32B并分析RL对agent行为的具体影响。第四,没有消融base model选择,所有实验都用Qwen3,无法知道其他base model是否能从相同数据中获得更大提升。第五,训练成本高昂,单次10K微调需要160 GPU小时,限制了普通研究者的参与。

未来方向

作者提出的未来工作包括:将RL研究扩展到32B规模,验证8B的发现是否适用于更大模型;消融base model选择,理解预训练和后训练的交互;测试百万级轨迹规模,验证当前趋势是否继续;将数据改进移植到Qwen3.5并研究base model与SFT/RL数据的交互。基于成果可以延伸的方向包括:研究更精细的任务增强方法,探索不同增强策略对不同任务类型的差异影响;分析RL中的策略变化,理解为什么pymethods2test能推动模型采用更激进的探索策略;研究agent行为的可解释性,从轨迹中提取通用的agent技能;开发自动化数据质量评估指标,减少对昂贵消融实验的依赖;探索多模态agent数据,扩展到视觉agent和跨模态任务。

复现评估

本文复现性评估良好。作者完全开源了训练集、数据pipeline、实验数据和模型,可以在openthoughts.ai获取。训练使用Llama-Factory fork支持ALST长序列训练,RL使用扩展的SkyRL框架,评估在Daytona沙箱中用Terminus-2 harness。单次10K微调需要160 GPU小时(GH200),这对普通研究者来说是高门槛,但小规模实验可以在较少GPU上运行。论文详细报告了所有超参数:学习率$4e^{-5}$、余弦调度、全局batch size 96、7 epochs、32,768上下文长度。RL使用RLOO算法,24xA100 80GB运行约46小时。代码和数据的开源程度很高,pipeline完全可复现,但计算需求较大。基准测试的运行到运行方差约2.0pp,需要多次运行来获得稳定结果。