Language / 语言

合成实例与 Agent 训练:规模之后,是环境、验证和迁移

Jul 2026 · Synthetic Instances / Agentic RL / Foundation-Model Post-Training

“生成 2K 个合成实例”不是一个训练结论,只是一个规模假设。对会使用工具、网页、终端或 GUI 的 agent,真正有训练价值的实例不是一行 prompt-answer,而是一个可执行、可验证、可追溯的小环境:它说明 agent 从什么初态出发,能做什么,哪些轨迹发生过,什么终态算成功,以及这条数据为什么没有泄漏最终评测的答案。

中心命题:合成数据的规模、效果和安全性必须分开报告。先证明实例能够被执行和独立验证;再报告它的覆盖与多样性;最后才在环境、workflow、规则和 verifier 都隔离的未见任务上检验迁移。没有第三步,“训练变强”通常只是对生成器附近分布的描述。

1. 一条合成实例至少包含什么

对 agent 而言,训练记录的最小单位不是文本对,而是下面这个版本化对象:

字段 应保存什么 没有它会发生什么
Intent 用户目标、约束和允许的成功范围 模型只学到过度指定的操作序列
Initial state 环境 image、数据库 / 文件 / browser profile、账号模板和随机种子 无法重新执行或判断是否从同一问题开始
Action surface 工具 schema、权限、网络与副作用策略 训练轨迹可能使用测试时不存在或越权的工具
Outcome and evidence 独立 verifier、最终工件、服务端 postcondition、trace 与 artifact hash 用语言自评或截图替代真正完成
Provenance generator / model / prompt / source、许可与敏感数据审查、去重和 split 标签 无法审计泄漏、版权、隐私或模板记忆

这也解释了为什么“更多对话”不等于“更多 agent data”。只要没有初态、动作语义和独立终态,轨迹就很难变成可靠的 SFT 示范或 outcome-RL rollout。

2. 三类合成路线,三种不同风险

AgentTrek 以网页教程为引导,将文本步骤转成 GUI 目标,并在真实数字环境中尝试执行和评估。它说明 guided replay 可以扩展 GUI 轨迹;它不让教程文本天然变成可训练、可许可、且与评测隔离的数据。

EnvFactory 的路线不同:先从真实资源探索、验证有状态的可执行工具环境,再以 topology-aware 的方式生成自然多轮轨迹。它的贡献是把 environment construction 和 trajectory synthesis 连在一起;其特定 benchmark 增益不自动迁移到网页、GUI 或任意工具协议。

Agentick 代表第三类:用程序化任务、共同的 Gym 接口和参考策略来统一不同 agent 范式。Reinforcement Learning Foundation Models Should Already Be A Thing 进一步提出从合成 MDP prior 预训练 RL foundation model 的议程,并在 held-out tabular MDP 上给出概念验证。这两条路线有利于控制生成分布,但并不凭此证明真实工作流的语义、权限或用户意图被保留。

选择规则:教程或网页来源可提供自然 intent;可执行环境提供状态转移与 verifier;程序化生成提供覆盖控制。一个成熟数据管线可组合它们,但必须记录每一层如何改变了数据分布,不能把三种证据混称为“真实数据”。

3. 规模不是唯一刻度:多样性与可执行性先于行数

Beyond Quantity: Trajectory Diversity Scaling 报告,在其固定预算的 code-agent 设置中,增加轨迹多样性比单纯增加数量更有价值。这个结果支持把覆盖、长尾和行动复杂度纳入数据选择;它不是任意领域中“多样性必然优于数量”的定律。

因此一个 “2K” 计划应在数量之前公布实例仪表板:

  1. 执行率: 从冻结初态能否复跑,verifier 是否通过,失败是环境不稳定还是 agent 行为。
  2. 结构多样性: 网站 / 工具图、目标类型、初态、权限、失败恢复和 action topology 的覆盖,而非只比较 embedding。
  3. 语义多样性: intent 是否只是模板改写,是否包含隐含子目标、约束冲突和需要停止 / 拒绝的任务。
  4. 完整性: 是否出现答案、hidden rule、successful trace、评测器代码或评测数据的可搜索近邻。
  5. 成本与风险: 生成、重放、judge、人工复核、许可证/隐私审查和被拦截的危险动作。

只有当 accepted / rejected instance 与上述指标都可查询时,2K 才是可审计的数据目标,而不是宣传数字。

4. SFT、RL 与 SFT+RL:比较的是学习信号,不是算法口号

SFT 可以让 policy 模仿通过验证的 action sequence;outcome-RL 则通过环境终态鼓励能完成但未必与演示完全相同的轨迹。两者都可能失败:SFT 会继承老师的冗余和模板,RL 会放大 verifier 缺口、稀疏 reward 或无效探索。

SFT Memorizes, RL Generalizes 在其受控文本规则与视觉环境中发现,outcome-based RL 对未见变体的泛化优于单独 SFT,而 SFT 仍有助于稳定 RL 的输出格式。它是一个重要的实验设计提醒,不是“RL 在所有 agent 环境都胜过 SFT”的结论。

条件 训练数据与信号 最小公平对照 必须额外检查
SFT-only 通过 verifier 的轨迹与 action / observation 序列 与其他条件同一 base model、相同训练 token 和相同训练环境 模仿成功轨迹是否只复现模板
RL-only 在线 / 离线 rollout 与独立 outcome reward 同一 action surface、rollout budget、stop rule 与安全 policy reward 是否稀疏、可刷或只在训练初态有效
SFT+RL 先以可验证轨迹建立格式和工具先验,再以 outcome 优化 报告两个阶段各自的数据、budget、checkpoint 和选择规则 SFT 贡献、RL 增益和二者交互能否被消融

任何比较若改变了 harness、可用工具、browser profile、verifier、并发或 token 预算,就不再是仅比较训练方法。它比较的是不同 agent system。

5. 四重隔离:防止生成器、搜索和 evaluator 共享答案

训练 / 评测分割不能只按随机行切分。对 agent task,至少需要四重隔离:

隔离面 训练侧可见 最终评测必须保持不同
Environment 网站、VM image、服务或数据库快照 新站点、独立 image 或不重合的 backend state
Workflow / rule 已见的工具图、业务规则和 verifier pattern 新的工具组合、约束、failures 和 postconditions
Evidence 合成所需的 source 与执行日志 hidden tests、成功轨迹、答案 / metadata 与 evaluator implementation
Search 为训练采集允许的检索语料 评测期间禁止检索到 benchmark、问题上下文或标签

Search-Time Contamination in Deep Research Agents 说明,即使模型权重没有见过 benchmark,测试时 web retrieval 也可能拿到题目上下文或答案而抬高分数。对合成 agent data,生成阶段和评测阶段都需要记录检索源、禁止域与相似度审计;否则“未见”只是文件名不同。

完整性 task 还应包含可检测的 reward-hacking 机会。 Hack-Verifiable Environments 的价值正是在于将这类利用变成可自动判定的 outcome。成功率上升但完整性违规上升,不应被报告为训练改善。

6. 一个可被推翻的 2K 实例协议

以下是为合成实例基础模型训练提出的研究设计,不是当前已完成的数据集或训练结果:

  1. 先做小型 pilot。 每条 candidate instance 从冻结初态执行,保留生成、执行、verifier 和失败记录。只有通过 provenance、可重放和完整性筛查的实例进入 accepted pool。
  2. 冻结分布。 在训练前声明 environment / workflow / rule / evidence / search split;generator 不能看到 final task 或 evaluator 的答案通道。
  3. 按覆盖取样。 在固定 token 与环境预算下,优先补齐 action topology、恢复模式、拒绝/停止、权限和初态的长尾,而不是复制高分模板。
  4. 完成三条件训练。 SFT-only、RL-only、SFT+RL 使用相同 base model、环境、工具和总资源,保存所有 checkpoint 与失败 rollout。
  5. 只在隔离的终态上接纳。 由不在 agent 写权限内的 verifier 计算 outcome、integrity violation、cost per verified success、recovery 和跨环境迁移;不以语言 judge 的单一偏好作最终 ground truth。

ACuRL 将环境探索、能力相关 curriculum synthesis 与持续适应连在一起,显示“目标环境中的经验”可以成为 data source。它同样提醒我们:这类 adaptive curriculum 必须与 final evaluation 隔离,否则 agent 只是持续追踪同一个测试分布。

7. 它如何接回五条核心线

核心线 合成训练必须提供 合成训练绝不能替代
RSI / OpenRSI 版本化 skill / harness edit 的训练与 regression evidence 独立 acceptance gate 与跨代 held-out 曲线
Auto Research / ART 可复跑实例、对照、失败和资源账本 研究新颖性、因果解释和同行评审
Long horizon checkpoint、恢复、状态变更与成本相关的轨迹 真实数小时运行的独立验证
ClawBench V2 / WebsiteBench self-hosted 初态、动作、后端 postcondition 和安全回归 真实外部服务的开放权限或 secret
Foundation-model training 可审计的 SFT / RL experience 和 OOD transfer test “规模更大一定更强”的叙述

这也把五条线收回一个简单原则:环境定义什么可被学习,verifier 定义什么算完成,隔离定义什么结果值得相信。更完整的环境设计见Agent Research Environments;真实 harness 中的 reward 和轨迹见Agentic RL;stateful instance、memory operation、schema/provenance split 与 memory trust boundary 见Agent Memory;skill-aware data、受控 revision 与 skill/RL 的隔离见Agent Skills;相邻的 memory、MCP 与安全方向见Agent 热门方向地图

Synthetic Instances for Agent Training: Beyond Scale to Environments, Verification, and Transfer

Jul 2026 · Synthetic Instances / Agentic RL / Foundation-Model Post-Training

“Generate 2K synthetic instances” is not a training result; it is only a scale hypothesis. For agents that use tools, web pages, terminals, or GUIs, a useful instance is not a prompt-answer row. It is an executable, verifiable, traceable micro-environment: it specifies the initial state, available actions, observed trajectory, successful terminal state, and why the data did not leak the answer to final evaluation.

Central claim: report synthetic-data scale, effectiveness, and safety separately. First show that instances execute and verify independently. Then report their coverage and diversity. Only then test transfer on unseen tasks with environment, workflow, rule, and verifier separation. Without the third step, “training got better” usually describes a distribution close to the generator.

1. What a Synthetic Instance Must Contain

For an agent, the minimum training record is not a text pair but the following versioned object:

Field What to retain Failure without it
Intent User goal, constraints, and permitted completion range The model learns an over-specified operation sequence
Initial state Environment image, database/files/browser profile, account template, and random seed The run cannot be replayed or shown to start from the same problem
Action surface Tool schema, authority, network, and side-effect policy A training trace may use unavailable or unauthorized test-time tools
Outcome and evidence Independent verifier, final artifact, backend postcondition, trace, and artifact hash Language self-assessment or a screenshot substitutes for completion
Provenance Generator/model/prompt/source, license and sensitive-data review, deduplication, and split label Leakage, copyright, privacy, or template memorization cannot be audited

This is why “more dialogue” does not mean “more agent data.” Without initial state, action semantics, and an independent terminal state, a trajectory is hard to use as a reliable SFT demonstration or outcome-RL rollout.

2. Three Synthesis Routes, Three Different Risks

AgentTrek uses web tutorials as guidance, turns textual steps into GUI goals, and attempts execution and evaluation in real digital environments. It shows that guided replay can scale GUI trajectories; it does not make tutorial text automatically trainable, licensed, or separated from evaluation.

EnvFactory takes a different route: it explores and verifies stateful executable tool environments from authentic resources, then synthesizes natural multi-turn trajectories with topology-aware sampling. Its contribution is joining environment construction and trajectory synthesis; its benchmark-specific gains do not automatically transfer to web, GUI, or arbitrary tool protocols.

Agentick represents a third route: procedural tasks, a shared Gym interface, and reference policies make different agent paradigms comparable. Reinforcement Learning Foundation Models Should Already Be A Thing further proposes pretraining an RL foundation model from a synthetic MDP prior and gives a proof of concept on held-out tabular MDPs. These routes help control the generation distribution, but do not by themselves preserve the semantics, authority, or user intent of real workflows.

Selection rule: tutorials or web sources can supply natural intent; executable environments supply transitions and verifiers; procedural generation supplies coverage control. A mature pipeline can combine them, but must record how each layer changes the data distribution rather than call all three “real data.”

3. Scale Is Not the Only Axis: Diversity and Executability Come Before Row Count

Beyond Quantity: Trajectory Diversity Scaling reports that, in its fixed-budget code-agent setting, raising trajectory diversity was more valuable than merely increasing count. That supports measuring coverage, long tails, and action complexity during selection; it is not a law that diversity always beats quantity in every domain.

A “2K” plan should therefore publish an instance dashboard before its count:

  1. Executability: Can it replay from a frozen initial state; does its verifier pass; are failures environmental flakiness or agent behavior?
  2. Structural diversity: Coverage of sites/tool graphs, goal types, initial states, authority, failure recovery, and action topology, not only embedding distance.
  3. Semantic diversity: Whether intents are template rewrites, and whether they include implicit subgoals, conflicting constraints, and tasks requiring stop or refusal.
  4. Integrity: Whether answer text, hidden rules, successful traces, evaluator code, or searchable near-duplicates of evaluation data appear.
  5. Cost and risk: Generation, replay, judging, human review, license/privacy review, and blocked dangerous actions.

Only when accepted and rejected instances remain queryable with these measures does 2K become an auditable data target rather than a promotional number.

4. SFT, RL, and SFT+RL: Compare Learning Signals, Not Algorithm Slogans

SFT can teach a policy to imitate verifier-passing action sequences. Outcome RL instead favors trajectories that complete an environment even when they differ from a demonstration. Both can fail: SFT inherits teacher redundancy and templates; RL can amplify verifier gaps, sparse reward, or useless exploration.

SFT Memorizes, RL Generalizes finds, in its controlled textual-rule and visual environments, that outcome-based RL generalizes better to unseen variants than SFT alone, while SFT still helps stabilize RL output format. It is an important experimental-design signal, not evidence that RL beats SFT in every agent environment.

Condition Training data and signal Minimum fair control Additional check required
SFT-only Verifier-passing traces with action/observation sequences Same base model, training tokens, and training environment as other conditions Does imitation merely reproduce a success template?
RL-only Online or offline rollouts with an independent outcome reward Same action surface, rollout budget, stop rule, and safety policy Is reward sparse, gameable, or valid only at training initial states?
SFT+RL Verifiable trajectories establish format/tool priors, then outcome optimization Report data, budget, checkpoints, and selection rule for each phase Can the SFT contribution, RL gain, and interaction be ablated?

If a comparison changes harness, available tools, browser profile, verifier, concurrency, or token budget, it no longer compares only training methods. It compares different agent systems.

5. Four Separations: Do Not Let Generator, Search, and Evaluator Share Answers

Training/evaluation splitting cannot be a random row split. Agent tasks need at least four separations:

Separation surface Visible on training side Final evaluation must keep different
Environment Sites, VM images, services, or database snapshots New sites, independent images, or non-overlapping backend state
Workflow / rule Seen tool graphs, business rules, and verifier patterns New tool combinations, constraints, failures, and postconditions
Evidence Sources and execution logs required for synthesis Hidden tests, successful traces, answer/metadata, and evaluator implementation
Search Retrieval corpus permitted for collection Benchmark, question context, or labels cannot be retrieved at evaluation time

Search-Time Contamination in Deep Research Agents shows that even when model weights did not contain a benchmark, test-time web retrieval can surface question context or answers and inflate a score. Synthetic agent-data generation and evaluation both need logged retrieval sources, blocked domains, and similarity audits; otherwise “unseen” can mean only a different filename.

Integrity tasks should also contain detectable reward-hacking opportunities. Hack-Verifiable Environments makes such exploitation an automatically scored outcome. Higher task success accompanied by higher integrity violations is not a training improvement.

6. A 2K-Instance Protocol That Can Fail

This is a research design for synthetic-instance foundation-model training, not a completed dataset or reported training result:

  1. Start with a small pilot. Execute each candidate instance from a frozen state, retaining generation, execution, verifier, and failure records. Only candidates passing provenance, replay, and integrity checks enter the accepted pool.
  2. Freeze distributions. Declare the environment, workflow, rule, evidence, and search split before training; the generator cannot see final tasks or an evaluator’s answer channel.
  3. Sample by coverage. At fixed token and environment budget, fill long tails in action topology, recovery patterns, stopping/refusal, authority, and initial state rather than duplicate high-scoring templates.
  4. Train three conditions. SFT-only, RL-only, and SFT+RL use the same base model, environment, tools, and total resource budget, retaining every checkpoint and failed rollout.
  5. Accept only on isolated final states. A verifier outside the agent’s write authority measures outcome, integrity violation, cost per verified success, recovery, and cross-environment transfer; a language judge’s single preference is not final ground truth.

ACuRL connects environment exploration, ability-related curriculum synthesis, and continual adaptation, showing how target-environment experience can become a data source. It also reinforces why adaptive curricula must remain separate from final evaluation: otherwise the agent keeps tracking the same test distribution.

7. How It Returns to the Core Five

Core thread What synthetic training must provide What synthetic training cannot replace
RSI / OpenRSI Training and regression evidence for versioned skill/harness edits Independent acceptance gates and cross-generation held-out curves
Auto Research / ART Replayable instances, controls, failures, and resource ledgers Research novelty, causal explanation, and peer review
Long horizon Trajectories carrying checkpoints, recovery, state changes, and cost Independent validation of real hours-long runs
ClawBench V2 / WebsiteBench Self-hosted initial states, actions, backend postconditions, and safety regressions Open authority or secrets from real external services
Foundation-model training Auditable SFT/RL experience and OOD transfer tests A narrative that larger scale is necessarily better

This returns the five lines to one simple principle: the environment defines what can be learned, the verifier defines completion, and separation defines which results deserve belief. See the fuller agent research environments design, world models and verifiable environments for executable state transitions and synthetic-world lineage, agentic RL for real-harness reward and trajectories, Agent Memory for stateful instances, memory operations, schema/provenance splits, and a memory trust boundary, Agent Skills for skill-aware data and controlled revision, and the hot agent directions map for adjacent choices in memory, MCP, and safety.