Verified Experience and Shared Skillsfor Safe, Speedy, Self-Evolving Coding Agents经过验证的经验与共享技能面向安全、快速、自我进化的编程智能体
Coding agents meet the same failures in session after session, and every session starts with an empty context. We add a self-evolution layer to S-Code, an open-source coding harness. It turns an agent’s own verified repairs into short lessons, called Experiences, that later sessions reuse, and lets a team share the lessons that hold up under independent evaluation as Skills.编程智能体在一次又一次的会话中遇到同样的失败,而每次会话都从空白的上下文开始。我们为开源编程框架 S-Code 加入了一层自我进化机制:它把智能体自己经过验证的修复转化为简短的经验(Experience),供之后的会话复用,并让团队以技能(Skill)的形式共享那些经得起独立评估的经验。
1Mila - Québec AI Institute 2McGill University 3Independent Researcher
4Carnegie Mellon University 5The Ohio State University 6Columbia University 7Princeton University
Lesson When adding callable evaluation behavior, verify both direct and nested compositions, including symbolic arguments…
Applies when symbolic systems, lazy evaluators…
Every session starts from zero每次会话都从零开始
A coding agent that fixes a tricky bug today keeps none of what it learned. Tomorrow’s session meets the same kind of failure with an empty context and pays for the same exploration again.今天修好一个棘手 bug 的编程智能体,学到的东西一点也留不下来。明天的会话带着空白的上下文遇到同类失败,又要为同样的探索再付一次代价。
Learning from past trajectories sounds easy and is hard in practice. Most runs carry no lesson: the agent solved the task directly, or never recovered. Advice copied from a transcript can leak file paths and secrets, can teach the agent to weaken a test, and can mislead on tasks that only look similar. S-Code therefore learns from one narrow, checkable event: a check fails, the agent edits code, and the identical check passes.从过往轨迹中学习听起来容易,做起来难。大多数运行并不包含可学的经验:智能体要么直接解决了任务,要么始终没能恢复。从对话记录里照搬的建议可能泄露文件路径和密钥,可能教智能体削弱测试,也可能在只是看起来相似的任务上产生误导。因此,S-Code 只从一种范围很窄、可以核验的事件中学习:检查失败,智能体修改代码,完全相同的检查随后通过。
Only a corrective trajectory can produce a lesson. 113 of 288 runs did; the owner then screened out 45 and approved 68. The rest were solved directly (93) or ended without a repair (82).只有包含纠错的轨迹才能产生经验。288 次运行中有 113 次做到了;所有者随后筛除 45 条,批准 68 条。其余运行要么直接解决(93 次),要么以未修复告终(82 次)。
Learn only from repairs the agent can prove, and trust each lesson one gate at a time.只从智能体能够证明的修复中学习,让每条经验一道关卡一道关卡地赢得信任。§3 · Method§3 · 方法
A lesson earns every step of trust每一步信任,都要经验自己挣来
S-Code adapts a store of short natural-language lessons while the model weights, the agent code and the retrieval policy stay fixed. Each lesson moves through six stages, and every move has a gate. Click a stage, or let it play.S-Code 只调整一个由简短自然语言经验组成的经验库,模型权重、智能体代码和检索策略都保持不变。每条经验要经过六个阶段,每向前一步都有一道关卡。点击某个阶段,或让它自动播放。
Example records are abridged from an earlier development run on a SymPy issue and from a sanitized sharing demo; identifiers are shortened.示例记录节选自早期开发阶段在一个 SymPy 问题上的运行,以及一次脱敏后的共享演示;标识符已缩短。记录本身保留英文原文。
The rules behind each step每一步背后的规则
Each Experience is a record e=(\ell,\alpha,\epsilon,s): a lesson \ell of at most 400 characters, an applicability statement \alpha of at most 200, bounded evidence \epsilon and a status s\in\{\textit{candidate},\textit{approved},\textit{rejected}\}. The Experiences of actor a in workspace w form a private store M_{a,w}, and after turn t the store changes only through acquisition and authorized decisions,每条经验是一个记录 e=(\ell,\alpha,\epsilon,s):最多 400 个字符的要点 \ell、最多 200 个字符的适用条件 \alpha、有上限的证据 \epsilon,以及状态 s\in\{\textit{candidate},\textit{approved},\textit{rejected}\}。用户 a 在工作区 w 中的经验构成私有库 M_{a,w};第 t 个回合之后,该库只会通过获取和授权决定发生变化:
where \tau_t is the turn’s trace, d_t the decisions recorded by authorized principals, and U may add a candidate distilled from \tau_t and applies d_t (paper Eq. 1). Model weights, agent code and the retrieval policy stay fixed. The boxes state when a turn yields a candidate, when an evaluation lets its owner approve it and which records a later turn receives; the algorithms below apply these rules.其中 \tau_t 是该回合的轨迹,d_t 是授权主体记录的决定;U 可以加入一条从 \tau_t 提炼出的候选,并执行 d_t(论文式 1)。模型权重、智能体代码和检索策略都保持不变。下面三个框分别说明一个回合何时产生候选、评估何时允许所有者批准候选,以及后续回合会收到哪些记录;再下面的算法执行这些规则。
Number the observations of a trace T in execution order. \mathcal{V} indexes the check runs, each with an identity \iota_j (same command, same arguments) and an outcome \pi_j\in\{0,1\}, which is 1 when the command exits with status zero; \mathcal{E} indexes successful edits. For an identity \iota, p_\iota=\max\{j\in\mathcal{V}:\iota_j=\iota\} is its final run and f_\iota=\max\{j\in\mathcal{V}:j<p_\iota,\ \iota_j=\iota,\ \pi_j=0\} its most recent failure before that run. The identity qualifies when把轨迹 T 中的观测按执行顺序编号。\mathcal{V} 索引各次检查运行,每次运行有一个标识 \iota_j(同一命令、同一参数)和一个结果 \pi_j\in\{0,1\},命令以状态码 0 退出时为 1;\mathcal{E} 索引成功的修改。对标识 \iota,p_\iota=\max\{j\in\mathcal{V}:\iota_j=\iota\} 是它的最后一次运行,f_\iota=\max\{j\in\mathcal{V}:j<p_\iota,\ \iota_j=\iota,\ \pi_j=0\} 是此前最近的一次失败。当下式成立时,该标识符合条件:
that is, the final run passed, an edit lies between the latest failure and that run, and nothing was edited afterwards. The turn yields即最后一次运行通过、最近一次失败与该运行之间有修改,并且之后没有再修改。该回合产生
where \iota^\ast=\arg\max_{\iota:\,\operatorname{Qual}(\iota)}p_\iota is the qualifying identity whose final run came last. The evidence keeps the excerpt of the most recent failure, the paths edited between f_{\iota^\ast} and p_{\iota^\ast} (at most ten) and the number of failures of \iota^\ast since its previous success.其中 \iota^\ast=\arg\max_{\iota:\,\operatorname{Qual}(\iota)}p_\iota 是最后一次运行最晚的符合条件的标识。证据保留最近一次失败的摘录、在 f_{\iota^\ast} 与 p_{\iota^\ast} 之间被修改的路径(最多十个),以及 \iota^\ast 自上次成功以来的失败次数。
An evaluation v reports raw pass counts on 1 to 16 held-out tasks that exclude the source task, with 5 repeats per task and arm. It is eligible when一次评估 v 报告在 1 到 16 个不含源任务的留出任务上的原始通过计数,每个任务每组重复 5 次。当下式成立时,评估合格:
where \operatorname{CountOK} is the count rule其中 \operatorname{CountOK} 是计数规则
P_{\mathrm{cand}} and P_{\mathrm{base}} are the total passes with and without the Experience, and p_{\cdot,k} the passes on task k. The rule tolerates one lost pass overall and excludes a candidate that collapses a task the baseline usually solves. It is a count screen and runs no statistical test.P_{\mathrm{cand}} 与 P_{\mathrm{base}} 是使用和不使用经验时的总通过数,p_{\cdot,k} 是任务 k 上的通过数。该规则容许总共少通过一次,并排除让基线通常能解决的任务崩溃的候选。它只是计数筛查,不做统计检验。
Each Experience e has a creation time t_e and expires at t^{\mathrm{exp}}_e=t_e+90 days, and \rho_a is the time of actor a’s last privacy reset. The available records and the retrieved set are每条经验 e 有创建时间 t_e,并在 t^{\mathrm{exp}}_e=t_e+90 天时过期;\rho_a 是用户 a 最近一次隐私重置的时间。可用记录和检索结果为
where \operatorname{Newest}_8 keeps the eight records with the latest creation times and m is the memory mode. Retrieval is recency-based within an actor and workspace, with no relevance ranking; the experiments replace it with the lexical router described in Result 1.其中 \operatorname{Newest}_8 保留创建时间最晚的八条记录,m 是记忆模式。检索在同一用户和工作区内按时间先后进行,不做相关性排序;实验中改用结果一所述的词汇路由器。
- procedure Acquire(trace, a, w)过程 Acquire(trace, a, w)
- if collection is off, the turn did not complete, or the actor reset its privacy settings after the turn began then return若 收集已关闭、回合未完成,或用户在回合开始后重置了隐私设置,则返回
- Eq. 9式 9repair \gets the check whose final run passed most recently, after an edit that followed its latest failure, with no edit after that passrepair \gets 最终一次运行最晚通过的检查:在它最近一次失败之后有过修改,且通过之后没有再修改
- if no check qualifies, or the last check run in the turn failed, then return若 没有符合条件的检查,或回合中最后一次检查运行失败,则返回
- evidence \gets the check, its failure excerpt, the edited paths and its failure count, each boundedevidence \gets 该检查、失败摘录、被修改的路径和失败次数,各自有上限
- if evidence matches a secret pattern then return若 evidence 匹配密钥模式,则返回
- lesson \gets Distill(evidence), or a fallback built from evidence; screen it for secretslesson \gets Distill(evidence),或由 evidence 构造的后备经验;再筛查一次密钥
- under the actor’s privacy lock: if no reset has occurred since evidence was stamped, store lesson in M_{a,w} as an encrypted candidate持有该用户的隐私锁:若 evidence 盖戳之后没有发生重置,就把 lesson 作为加密的候选存入 M_{a,w}
- after the store commits, record a creation event存储提交之后,记录一条创建事件
- end procedure结束过程
- procedure Decide(e, q, decision)过程 Decide(e, q, decision)
- if q\neq a or e is no longer a candidate then return refused若 q\neq a 或 e 已不再是候选,则返回 拒绝
- each change commits with its audit record每次变更都与审计记录一同提交if decision is reject then mark e rejected若 decision 为 reject,则 将 e 标记为已拒绝
- else if the policy is
manualthen mark e approved否则若 策略为manual,则 将 e 标记为已批准 - else approve e only if its newest evaluation is eligible (Eq. 2), and bind that evaluation否则 仅当 e 最新的评估合格(式 2)时才批准,并绑定该评估
- end procedure结束过程
- procedure RecordEvaluation(e, v)过程 RecordEvaluation(e, v)
- if e is a candidate, store v; under
automaticpolicy, an eligible v also approves e and is bound to it若 e 是候选,则存储 v;在automatic策略下,合格的 v 还会批准 e 并与之绑定 - end procedure结束过程
- procedure Retrieve(a, w, t)过程 Retrieve(a, w, t)
- available \gets approved records of M_{a,w}, unexpired at t and created after a’s last privacy resetavailable \gets M_{a,w} 中已批准、在 t 时未过期且创建于 a 最近一次隐私重置之后的记录
- Eq. 5式 5return the eight newest of available, as untrusted advisory context placed oldest first返回 available 中最新的八条,作为不受信任的建议性上下文,按从旧到新排列
- end procedure结束过程
- procedure Publish(e)过程 Publish(e)
- Eq. 6式 6if publication was not requested explicitly, or not Publishable(e), then return refused若 未明确请求发布,或 非 Publishable(e),则返回 拒绝
- if the sanitizer finds a prohibited pattern in the lesson or applicability then return refused若 脱敏器在经验或适用条件中发现禁止的模式,则返回 拒绝
- send the sanitized text and its digest; S re-validates it and stores candidate Skill k发送脱敏后的文本及其摘要哈希;S 重新校验并存储候选技能 k
- end procedure结束过程
- procedure RecordReceipt(k, receipt)过程 RecordReceipt(k, receipt)
- transaction事务
- store receipt under the evaluator identity of its authenticated principal以已认证主体的评估者身份存储 receipt
- if an authoritative direct receipt reports a safety failure then deprecate k permanently若 某份权威的直接回执报告安全检查失败,则 永久弃用 k
- Eq. 7式 7else if k is a candidate and VerifyGate(k) then mark k verified否则若 k 是候选 且 VerifyGate(k),则 将 k 标记为已验证
- end transaction结束事务
- end procedure结束过程
- procedure Use(list)过程 Use(list)
- return nothing if the Skill Shop is off; otherwise the first eight Skills on list that are verified (candidates only in evaluation mode), visible to the consumer and unaltered, as untrusted context返回:若技能商店关闭则为空;否则为 list 中前八个已验证(仅在评估模式下包括候选)、对使用方可见且未被改动的技能,作为不受信任的上下文
- end procedure结束过程
Appendix A.1 of the paper gives the exact forms, with every guard and state transition, and maps each procedure to the functions that implement it.论文附录 A.1 给出包含所有检查条件和状态转换的完整形式,并把每个过程对应到实现它的函数。
What sets this layer apart与已有系统有何不同
Prior systems already keep lessons from past trajectories and return them by similarity, and several test a skill before admitting it. In each, the pipeline that builds a lesson also admits it, and the papers do not report who may read a stored lesson or what evidence another user needs before adopting it. Three decisions set this layer apart.已有系统已经能从过去的轨迹中保留经验、按相似度取回,其中几个还会在准入前测试技能。但在这些系统里,构建经验的流程同时负责准入,论文也没有说明谁可以读取存储的经验,以及其他用户在采用之前需要什么证据。本文在三个决定上与它们不同。
Learn from the agent’s own check从智能体自己的检查中学习
A candidate Experience comes from the agent’s own check, which failed and then passed after an edit. Any repository with a runnable check can supply lessons, with no model judge, ground-truth label or gold patch.候选经验来自智能体自己的检查:先失败,修改代码后再通过。任何有可运行检查的代码库都能提供经验,不需要模型评判、真实标签或标准补丁。
Private until approved批准之前保持私有
An Experience belongs to the actor and workspace that produced it, is stored encrypted and stays out of every prompt until its owner or an eligible evaluation approves it. Approved lessons return as untrusted context, so a stored instruction cannot change the agent’s permissions.经验属于产生它的用户和工作区,加密存储,在所有者或合格评测批准之前不会进入任何提示。获批的经验以不受信任的上下文返回,因此存储的指令无法改变智能体的权限。
Two independent receipts两份独立回执
A Skill reaches other agents only after two evaluators other than its publisher report qualifying results, which the registry recomputes from raw counts.技能只有在发布者以外的两名评估者报告合格结果之后才会到达其他智能体,注册中心会根据原始计数重新核算这些结果。
| System系统 | What adapts调整什么 | Acquisition signal获取信号 | Admission准入 | Sharing scope共享范围 |
|---|---|---|---|---|
| Reflexion | verbal reflections (episodic, within a task)语言反思(情景式,限于单个任务内) | task feedback; self-generated unit tests for code任务反馈;为代码自生成的单元测试 | stored automatically, bounded buffer自动存入,有界缓冲区 | one agent, one task单个智能体、单个任务 |
| ExpeL | insights and stored trajectories洞见与存储的轨迹 | environment success or failure on training tasks训练任务上环境给出的成功或失败 | LLM edit and vote operationsLLM 编辑与投票操作 | one agent单个智能体 |
| Voyager | executable skill library可执行技能库 | critic model confirms task success评审模型确认任务成功 | critic verification评审模型验证 | reused by another agent in one experiment在一项实验中被另一个智能体复用 |
| ACE | itemized context playbook条目化的上下文手册 | execution feedback, no labels执行反馈,无标签 | curator with delta updates and counters带增量更新和计数器的整理器 | not reported未报告 |
| ReasoningBank | memory items记忆条目 | LLM-as-judge success labels, no ground truth由 LLM 评判的成功标签,无真实标签 | added without a gate不经关卡直接加入 | not reported未报告 |
| SWE-Exp | experience bank经验库 | trajectories validated against ground truth; gold patch given to extraction依据真实答案验证的轨迹;提取时提供标准补丁 | not reported (manual audit of 75 instances)未报告(人工审查 75 个实例) | not reported未报告 |
| EvolveR, SkillRL | principles or skills plus policy weights (RL)原则或技能,外加策略权重(强化学习) | distilled trajectories蒸馏后的轨迹 | utility scores (EvolveR); not reported (SkillRL)效用评分(EvolveR);未报告(SkillRL) | not reported未报告 |
| DGM | agent code智能体代码 | benchmark evaluation基准评测 | archive of evaluated agents已评测智能体的存档 | not reported未报告 |
| SkillGen | one fixed skill per benchmark and model每个基准和模型一个固定技能 | success and failure trajectories成功与失败轨迹 | net repairs over regressions in paired runs on construction tasks在构建任务的配对运行中,修复多于退化 | across models; sharing between users not reported跨模型;用户之间的共享未报告 |
| SkillClaw, Agent KB | skills or a knowledge base技能或知识库 | trajectories across users or frameworks跨用户或跨框架的轨迹 | evolver (SkillClaw); use-time gate (Agent KB)演化器(SkillClaw);使用时关卡(Agent KB) | shared across users or frameworks跨用户或跨框架共享 |
| This work (S-Code)本文(S-Code) | lessons in context; weights and code fixed上下文中的经验;权重和代码不变 | the agent’s own check fails, an edit, the same check passes智能体自己的检查失败,修改代码,同一检查通过 | approval: manual, evaluated or automatic (Experience); two independent receipts (Skill)批准:人工、评测或自动(经验);两份独立回执(技能) | private per actor and workspace; Skills opt-in by team or public按用户和工作区私有;技能由团队或公众自行选择接收 |
“Not reported” means that the source does not describe the property. ExpeL, ReasoningBank, SWE-Exp and SkillGen follow arXiv versions v3, v2, v2 and v1.“未报告”指原始文献没有描述该属性。ExpeL、ReasoningBank、SWE-Exp 和 SkillGen 分别依据 arXiv 第 3、2、2、1 版。
Approved lessons raise success on recurring tasks获批经验提高了重复任务的成功率
Each suite has 36 target tasks and three disjoint source histories. Every target is attempted three times with the same router and budget: with no store, with a summary memory written from the same source runs, and with S-Code’s Experiences. The comparison with the summary separates the value of the lesson from the value of simply remembering the run.每个任务集有 36 个目标任务和三段互不重叠的源历史。每个目标在相同的路由和预算下尝试三次:无记忆、使用由同一批源运行写成的摘要记忆,以及使用 S-Code 的经验(Experience)。与摘要记忆的对比,把经验本身的价值和单纯“记住这次运行”的价值区分开来。
Both memory arms deliver at most one item per target through the same lexical router, which makes no model call. With \operatorname{tok}(\cdot) the set of tokens in a text, it scores each item e of the arm’s own store against the target request q,两个记忆组都通过同一个词汇路由器为每个目标最多提供一个条目,路由过程不调用模型。记 \operatorname{tok}(\cdot) 为文本中的词元集合,路由器把本组经验库中的每个条目 e 与目标请求 q 进行打分:
and delivers e^\ast when J(q,e^\ast) clears the threshold 0.28; otherwise the request carries no item. In every memory arm the router takes the place of the product’s recency retrieval (paper Eq. 5).当 J(q,e^\ast) 通过阈值 0.28 时提供 e^\ast,否则该请求不携带任何条目。在所有记忆组中,这个路由器都替代了产品的按时间检索(论文式 5)。
Paired comparisons count rescues b (solved only with Experiences) and losses c (solved only without); the effect on n matched pairs is \Delta=(b-c)/n. Intervals are 95% task-cluster bootstrap intervals; p-values are task-cluster permutation tests on the recurring suites and exact McNemar tests elsewhere.配对比较统计挽回 b(只有使用经验时才解决)和丢失 c(只有不使用经验时才解决);在 n 个匹配配对上的效应为 \Delta=(b-c)/n。区间为按任务聚类的 95% bootstrap 区间;重复任务套件上的 p 值来自按任务聚类的置换检验,其余研究的 p 值来自精确 McNemar 检验。
Experiences raised success over no memory by 10.6 and 12.0 points at caps of 24 and 48 model calls (p = 0.011 and 0.006, both significant after Holm correction for multiple comparisons), and over the same-source summary by 4.6 and 6.9 points. The summary comparison is within noise at each cap (p = 0.20 and 0.095); pooled over both caps, a post hoc test gives +5.8 points (p = 0.030).在 24 和 48 次模型调用上限下,经验相对无记忆的成功率分别提高 10.6 和 12.0 个百分点(p = 0.011 和 0.006,经 Holm 多重比较校正后仍然显著),相对同源摘要记忆分别提高 4.6 和 6.9 个百分点。与摘要记忆的差异在每个上限下都处在噪声范围内(p = 0.20 和 0.095);合并两个上限的事后检验给出 +5.8 个百分点(p = 0.030)。
The middle of the difficulty range gains most中等难度的任务获益最多
Before the runs, every target was labeled by how many corrective actions it needs. Easy tasks rarely need help, and the hardest ones often exceed what one short lesson can carry. Toggle the cap to see where the gains land.运行之前,每个目标都按所需纠错动作的数量做了标注。简单任务很少需要帮助,最难的任务又常常超出一条简短经验所能承载的内容。切换调用上限,看看收益落在哪里。
At 24 calls, mid-difficulty targets went from 34 solved with the summary to 47 with Experiences (+18.1 points, p = 0.015).在 24 次调用上限下,中等难度目标的解决数从摘要记忆的 34 个升至经验的 47 个(+18.1 个百分点,p = 0.015)。
Per-store results: one store can mislead按经验库拆分:单个经验库也可能误导
Experiences minus summary memory, in points, for each of the 12 suite × cap × store cells. Experiences led no memory in 11 of 12 cells and led the summary in 8. Coding store A trailed the summary at both caps.12 个“任务集 × 上限 × 经验库”单元中,经验减去摘要记忆的差值(百分点)。经验在 12 个单元中有 11 个优于无记忆,有 8 个优于摘要记忆。编程经验库 A 在两个上限下都落后于摘要记忆。
Paper Figures 3 and 4论文图 3 和图 4
The procedure gets used; the condition keeps it on target做法被用上了,适用条件让它用在该用的地方
An Experience has two parts: a lesson (what to do, up to 400 characters) and an applicability condition (when it applies, up to 200). To see which part does the work, we built three task families with 16 applicable targets and 10 near misses each, and removed one part at a time.一条经验包含两部分:要点(做什么,最多 400 个字符)和适用条件(何时适用,最多 200 个字符)。为了弄清是哪一部分在起作用,我们构建了三个任务族,每族含 16 个适用目标和 10 个近似干扰任务,并每次移除其中一部分。
Each dot is one target. Two authors labeled the agent’s actions independently and disagreed on fewer than 4% of traces.每个点代表一个目标。两位作者独立标注智能体的行为,存在分歧的轨迹不到 4%。
The procedure more than doubled how often agents completed the relevant check (paired 23 vs 3, p < 0.001), and the applicability condition kept it off most near misses. Success on applicable targets rose from 26 to 32 of 48 (p = 0.21); in 8 of the 11 rescues, only the Experience arm completed the check.经验中的做法让智能体完成相关检查的次数增加了一倍多(配对 23 vs 3,p < 0.001),适用条件则让它避开了大多数近似干扰任务。适用目标上的成功数从 26 升至 32(共 48,p = 0.21);在 11 次挽回中,有 8 次只有经验组完成了检查。
Paper Figure 5论文图 5
The lesson tells the agent what to check. The condition tells it where that advice applies.要点告诉智能体该检查什么,适用条件告诉它这条建议用在哪里。§4.3 · Content ablation§4.3 · 内容消融
One reminder nearly doubles what the agent learns一句提醒,让智能体学到的经验几乎翻倍
A lesson needs evidence: the failing check must be rerun after the edit. Agents often skip that rerun. Asking the source agent to rerun its check, with the same 144 sources and the same admission criteria, changes how many repairs become lessons.经验需要证据:修改之后必须重跑之前失败的检查,而智能体常常跳过这一步。在相同的 144 个源任务和相同的准入标准下,只要提醒源智能体重跑检查,能变成经验的修复数量就会明显不同。
Paired over sources, the reminder gained 34 approvals and lost 5 (+20.1 points, p < 0.001). Candidates rose from 60 to 81, and hidden-test passes on the source tasks from 94 to 106. Whether the larger store also helps reuse is untested.按源任务配对,提醒带来 34 条新增批准,丢失 5 条(+20.1 个百分点,p < 0.001)。候选从 60 条增至 81 条,源任务上的隐藏测试通过数从 94 增至 106。更大的经验库是否也能改善复用,尚未测试。
Lessons travel as far as their procedure does经验能迁移多远,取决于做法能适用多远
On nine public benchmarks, run under adapted protocols with 8 to 36 sampled tasks each and three source histories per benchmark, Experiences solved 338 of 600 target attempts, the summary memory 324, and no memory 308.在九个公开基准上(采用调整后的协议,每个基准抽样 8 到 36 个任务,各有三段源历史),600 次目标尝试中,经验解决了 338 次,摘要记忆 324 次,无记忆 308 次。
Experiences led no memory on all nine benchmarks (pooled +5.0 points, p = 0.020) and led the summary on five (pooled +2.3 points, p = 0.26). No single benchmark’s difference is distinguishable from zero, and every benchmark has losses as well as rescues.经验在全部九个基准上都优于无记忆(合并 +5.0 个百分点,p = 0.020),在其中五个上优于摘要记忆(合并 +2.3 个百分点,p = 0.26)。单个基准上的差异都无法与零区分,而且每个基准都既有挽回也有丢失。
Distance decides迁移距离是关键
We also moved targets away from the source tasks: near targets keep the source procedure, adjacent targets change the task family in the same environment, and broad targets change the environment.我们还让目标逐步远离源任务:近迁移目标保留源任务的做法,邻近迁移目标在同一环境中更换任务族,远迁移目标则更换环境。
Near targets gained 14.6 points over no memory (p = 0.0011). Broad targets showed no gain (0.0 over no memory, −0.7 over the summary).近迁移目标相对无记忆提升 14.6 个百分点(p = 0.0011)。远迁移目标没有提升(相对无记忆 0.0,相对摘要记忆 −0.7)。
Paper Figures 6 and 9论文图 6 和图 9
Fewer model calls per solved task每解决一个任务,模型调用更少
An Experience is small: a median of 81 tokens when delivered, about the size of a summary item. Building a store took 6 to 13 distillation calls, against 348 to 622 calls spent collecting its source runs. The saving shows up in the target runs, which solve more tasks while making fewer calls.一条经验很小:投放时中位数为 81 个 token,和一条摘要差不多大。构建一个经验库只需 6 到 13 次提炼调用,而收集它的源运行花费了 348 到 622 次调用。节省体现在目标运行中:解决的任务更多,调用反而更少。
Over the n=216 target attempts of an arm at one cap, with c_i model calls and outcome y_i\in\{0,1\} on attempt i,对某一组在一个调用上限下的 n=216 次目标尝试,记第 i 次尝试的模型调用数为 c_i、结果为 y_i\in\{0,1\}:
where u_i is the cost in accounting units, from the input tokens I_i, of which I^{\mathrm{c}}_i were cached, and the output tokens O_i. At a cap of 24, Experiences needed 29.2 calls per pass against 37.8 with no memory, so 1-29.2/37.8=22.8\% fewer.其中 u_i 是以核算单位计的成本,由输入词元 I_i(其中 I^{\mathrm{c}}_i 个命中缓存)和输出词元 O_i 计算。在 24 次调用的上限下,经验组每次通过需要 29.2 次调用,无记忆组为 37.8 次,即少 1-29.2/37.8=22.8\%。
How strong is each claim?每个结论有多可靠?
The three stores of a suite share each target, so results on one target are correlated. Where the records identify tasks, we resample and permute whole targets: intervals come from a task-cluster bootstrap and p-values from a task-cluster permutation test. Elsewhere p is an exact McNemar test, which treats units as independent and so overstates precision. The four recurring-suite comparisons of Experiences with no memory and with the summary memory at each cap form the primary family, adjusted with the Holm method; every other comparison is secondary or descriptive.同一任务集的三个经验库共享每个目标,因此同一目标上的结果彼此相关。凡是记录能识别任务的地方,我们都以整个目标为单位重抽样和置换:区间来自按任务聚类的 bootstrap,p 值来自按任务聚类的置换检验。其余研究使用精确 McNemar 检验,它把各单元视为相互独立,因而会高估精度。重复任务集上经验与无记忆、与摘要记忆在两个调用上限下的四项比较构成主要比较族,并用 Holm 方法校正;其余比较均为次要或描述性分析。
For arm T against arm C on n matched units with outcomes y_i^{T}, y_i^{C}\in\{0,1\}, let b count rescues (y^{C}=0,\ y^{T}=1) and c count losses (y^{C}=1,\ y^{T}=0). The effect, in percentage points, is在 n 个匹配单元上比较处理组 T 与对照组 C,结果为 y_i^{T}, y_i^{C}\in\{0,1\}。记 b 为挽回数(y^{C}=0,\ y^{T}=1),c 为丢失数(y^{C}=1,\ y^{T}=0)。以百分点表示的效应为
Where the records identify tasks, let D_j be the sum of y^{T}-y^{C} over the stores of target j. The permutation test flips the sign of whole targets, drawing s^{(r)}_j\in\{-1,+1\} uniformly in each of B=10{,}000 permutations:凡是记录能识别任务的地方,记 D_j 为目标 j 在其各经验库上 y^{T}-y^{C} 之和。置换检验按整个目标翻转符号,在 B=10{,}000 次置换中每次均匀抽取 s^{(r)}_j\in\{-1,+1\}:
For the primary family of m=4 comparisons, sort the raw p-values as p_{(1)}\le\dots\le p_{(m)}. The Holm-adjusted values are对于包含 m=4 项比较的主要比较族,把原始 p 值排序为 p_{(1)}\le\dots\le p_{(m)}。Holm 校正后的值为
so the smallest p-value, 0.0062, becomes 4\times 0.0062 = 0.025, and the next, 0.0109, becomes 3\times 0.0109 = 0.033.因此最小的 p 值 0.0062 变为 4\times 0.0062 = 0.025,次小的 0.0109 变为 3\times 0.0109 = 0.033。
| Claim and comparison结论与比较 | Effect效应 | p | Role类别 |
|---|---|---|---|
| Experiences raise success over no memory on recurring tasks经验提高了重复任务上的成功率(相对无记忆)Experiences vs no memory · 216 task–store pairs per cap经验 vs 无记忆 · 每个上限 216 个“任务–经验库”配对 | +10.6 and +12.0 pp at 24 and 48 calls24 和 48 次调用下分别 +10.6 和 +12.0 个百分点 | 0.011 and 0.0060.011 和 0.006Holm 0.033 and 0.025 ✓Holm 校正后 0.033 和 0.025 ✓ | primary主要 |
| Experiences lead a summary memory of the same source runs经验领先于由同一批源运行构建的摘要记忆Experiences vs summary · 216 task–store pairs per cap经验 vs 摘要 · 每个上限 216 个“任务–经验库”配对 | +4.6 and +6.9 pp; positive in all 4 suite–cap cells; +5.8 pp over both caps (post hoc)+4.6 和 +6.9 个百分点;4 个“任务集 × 上限”单元全部为正;合并两个上限 +5.8 个百分点(事后分析) | 0.20 and 0.0950.20 和 0.095Holm 0.20 and 0.19; 0.030 over both capsHolm 校正后 0.20 和 0.19;合并两个上限 0.030 | primary主要 |
| The stored procedure makes the agent complete the relevant check经验中的做法让智能体完成相关检查Experiences vs summary · 48 applicable targets经验 vs 摘要 · 48 个适用目标 | check completed in 34 vs 14 attempts完成检查 34 次 vs 14 次 | <0.001<0.001 | secondary次要 |
| The applicability condition keeps the procedure off near misses适用条件让做法避开近似干扰任务Experiences vs summary · 30 near-miss targets经验 vs 摘要 · 30 个近似干扰目标 | procedure started in 6 vs 16 attempts启动做法 6 次 vs 16 次 | 0.0210.021 | secondary次要 |
| A rerun reminder raises acquisition重跑提醒提高了经验获取量reminder vs standard source prompt · 144 sources提醒 vs 标准源提示 · 144 个源任务 | 66 vs 37 approved Experiences获批经验 66 条 vs 37 条 | <0.001<0.001 | secondary次要 |
| Gains are largest on targets near the source越接近源任务,收益越大Experiences vs summary and no memory · 144 near-transfer units经验 vs 摘要与无记忆 · 144 个近迁移单元 | +8.3 and +14.6 pp+8.3 和 +14.6 个百分点 | 0.096 and 0.0010.096 和 0.001 | secondary次要 |
| Experiences lead no memory on public benchmarks经验在公开基准上领先于无记忆Experiences vs no memory and summary · 600 triplets经验 vs 无记忆与摘要 · 600 个三元组 | +5.0 and +2.3 pp; ahead of no memory on 9 of 9 benchmarks+5.0 和 +2.3 个百分点;9 个基准全部领先于无记忆 | 0.020 and 0.260.020 和 0.26 | secondary次要 |
| Verified Skills lead both controls for consumers on new tasks已验证技能在使用方的新任务上领先于两个对照Skill vs summary and no memory · 72 tasks技能 vs 摘要与无记忆 · 72 个任务 | 47 vs 43 and 41 passes通过 47 次 vs 43 次和 41 次 | 0.52 and 0.290.52 和 0.29 | secondary次要 |
| Experiences cut model calls per solved task经验减少了每解决一个任务所需的模型调用Experiences vs no memory · recurring targets at each cap经验 vs 无记忆 · 两个上限下的重复任务目标 | 23% and 22% fewer calls per pass每次通过的调用数减少 23% 和 22% | –– | descriptive描述性 |
Within the primary family, only the two gains over no memory remain significant after the Holm adjustment (✓). The gain over the summary memory keeps its direction in every suite and cap, and the per-cap tests cannot separate it from zero.在主要比较族中,只有相对无记忆的两项提升在 Holm 校正后仍然显著(✓)。相对摘要记忆的提升在每个任务集和上限下方向都一致,但单个上限的检验无法把它与零区分开。
Each row is one paired comparison on matched units. Bars are 95% task-cluster bootstrap intervals, drawn only where the records identify tasks. ★ marks the primary family. Hover a row for the counts.每一行是匹配单元上的一项配对比较。横线为按任务聚类的 95% bootstrap 区间,只在记录能识别任务时绘出。★ 表示主要比较族。将鼠标悬停在某一行上可查看计数。
Paper Figure 8: every comparison against its reference rate论文图 8:每项比较与其参照通过率
What this means for agent builders对智能体开发者意味着什么
Learn from evidence the harness can check从框架能够核验的证据中学习
A failing check, an edit and a passing rerun of the identical check give a lesson its provenance. A reminder to rerun the check raised approved lessons from 37 to 66 of 144.一次失败的检查、一次修改,加上同一检查重跑通过,构成了经验的来源凭据。一句重跑检查的提醒,让 144 个源任务中的获批经验从 37 条增至 66 条。
Compare against a memory of the same runs与同源运行的记忆做对比
A summary built from the same trajectories is the fair baseline. Against it, the gain shrinks to 4.6 and 6.9 points, and the content ablation shows where the remaining gain comes from.由同一批轨迹构建的摘要才是公平的基线。与它相比,提升缩小到 4.6 和 6.9 个百分点,而内容消融揭示了剩余提升从何而来。
Write when a lesson applies写明经验何时适用
Removing the applicability condition sent the procedure into 23 of 30 near misses and cost five near-miss solves.移除适用条件后,做法在 30 个近似干扰任务中的 23 个上被启动,并因此少解决了 5 个。
Gate sharing on independent receipts用独立回执为共享把关
Aggregate pass counts hid a task collapse in one Skill. Two qualifying receipts from evaluators other than the publisher caught it.总通过数掩盖了某个技能在单个任务上的崩溃;要求发布者以外的评估者提供两份合格回执,才把它拦了下来。
Scope and limitations, as stated in the paper论文中说明的适用范围与局限
- All results use one model (Claude Sonnet 4.5) through one provider route, with one attempt per target, arm and store. Cross-model transfer is untested.所有结果都使用同一个模型(Claude Sonnet 4.5),经同一条服务商通道调用,每个目标、组别和经验库只尝试一次。跨模型迁移尚未测试。
- The gain over the summary memory is within noise at each cap; only a post hoc pooled test reaches p = 0.030. Difficulty strata and delivery rates are post hoc and descriptive.相对摘要记忆的提升在每个上限下都处在噪声范围内;只有事后合并检验达到 p = 0.030。难度分层和投放率都是事后的描述性分析。
- The authors built the recurring suites and ablation families, so their tasks recur by design. Benchmarks ran under adapted protocols on 8 to 36 sampled tasks each.重复任务集和消融任务族由作者构建,其中的任务按设计就会重复出现。公开基准采用调整后的协议,每个只抽样 8 到 36 个任务。
- Reuse has losses as well as rescues: on the benchmarks, Experiences corrected 73 of the summary arm’s failures and lost 59 of its passes. Broad transfer to a new environment showed no gain.复用既有挽回也有丢失:在公开基准上,经验纠正了摘要组的 73 次失败,同时丢失了它的 59 次通过。向新环境的远迁移没有带来提升。
- Retrieval gating (+6.2 points over a random item, p = 0.46) and a growing store (+5.6 points over a frozen one, p = 0.31) gave small, inconclusive differences.检索门控(相对随机条目 +6.2 个百分点,p = 0.46)和持续增长的经验库(相对冻结的经验库 +5.6 个百分点,p = 0.31)带来的差异较小,尚无定论。
- Sharing was tested on 3 Skill families, 2 evaluators and 2 consumers. The sanitizer is pattern-based, the poisoning probe tests one injected rule, and evaluators attest counts that the registry recomputes without rerunning tasks.共享只在 3 个技能族、2 名评估者和 2 个使用方上测试过。脱敏器基于模式匹配,投毒探测只测试一条注入规则,评估者提交的计数由注册中心重新计算,但不会重跑任务。
- Experiment stores held 2 to 10 Experiences admitted by the authors acting as owners, and experiments used a lexical router; the product retrieves the newest approved records. Revoking an individual approved Experience is not yet implemented.实验中的经验库含 2 到 10 条经验,由作者以所有者身份准入,实验使用词法路由器;产品中则检索最新的获批记录。撤销单条已批准经验的功能尚未实现。
BibTeX
@misc{wang2026scode,
title = {Verified Experience and Shared Skills for Safe, Speedy,
Self-Evolving Coding Agents},
author = {Wang, Guangyuan and Deng, Wei and Wan, Langlin and
Zhang, Yinling and Liu, Shilong},
year = {2026},
note = {Manuscript in preparation}
}