质检经理面临技能迭代互相冲突——Co-Evolutionary Verification将回归漏洞率10%降至2%,年化省14万元
Skill 自动演化与验证 — EvoSkills 双 LLM 协同优化
Skill-Co-Evolutionary-Skill-Verification
AI Agent 在生产环境稳定运行,失败可追踪,成本可控,复杂任务完成率 >85%
待企业数据验证 · 缺失:样本、基线、时间窗、币种、计算方法、证据来源
1. 解决的问题
质检经理面临技能迭代互相冲突——Co-Evolutionary Verification将回归漏洞率10%降至2%,年化省14万元
2. 核心算法逻辑
核心思想
EvoSkills 解决 LLM Agent 多文件 Skill 包自动生成的两个根本挑战:
- 一次性生成不可靠:单次 LLM 调用难以同时写好
SKILL.md+ 多个脚本 + 参考资料 - 缺失 ground-truth 信号:真实环境下没有 oracle 测试,只有不透明的 pass/fail 二值反馈
EvoSkills 用双 LLM 协同演化框架绕过这两个问题:
- Skill Generator($\pi_\theta$):维持持久对话上下文 $C$,迭代生成 + 修复 skill 包
- Surrogate Verifier($\pi_\theta^V$):独立 LLM session,只看任务指令 + 输出文件,合成 deterministic 测试断言
- 两者通过 alternating refinement 协同演化,信息隔离防止 verifier 继承 generator 的偏见
算法直觉
任务建模为 POMDP $\mathcal{M}=\langle\mathcal{X},\mathcal{A},T,\mathcal{O},\Omega,\mathcal{R}\rangle$:状态是 filesystem,动作是 terminal 命令 + 文件编辑,oracle reward $\mathcal{R}(x_T)\in[0,1]$ 只在末态返回。
Surrogate Reward(Eq. 4):
\tilde{\mathcal{R}}(x,\mathcal{V})\triangleq\frac{1}{|\mathcal{V}|}\sum_{k=1}^{|\mathcal{V}|}\mathbf{1}[e_k(x)]\in[0,1]Alternating Refinement(Eq. 5-6):
\mathcal{S}^{(i+1)}\leftarrow\arg\max_{\mathcal{S}}\tilde{\mathcal{R}}\!\bigl(\Phi(\mathcal{S},\mathcal{E}),\mathcal{V}^{(j)}\bigr)\mathcal{V}^{(j+1)}\sim\pi_\theta^V\!\bigl(\,\cdot\mid I,x^{(i)},\mathcal{V}^{(j)}\bigr),\;\;\text{if }\tilde{\mathcal{R}}{=}1\wedge\mathcal{R}<1Skill Refinement(Eq. 7):
\mathcal{S}^{(i+1)}\sim\pi_\theta\!\bigl(\,\cdot\mid\mathcal{S}^{(i)},C^{(i+1)}\bigr),\quad C^{(i+1)}=C^{(i)}\oplus\mathcal{F}^{(i,j)}其中 $\mathcal{F}^{(i,j)}$ 是 Verifier 给出的失败诊断(失败 case + 根因分析 + 修复建议)。
双轨反馈机制
Skill Generator π_θ Surrogate Verifier π_θ^V
| |
| 生成 S^(i) 并执行 → x^(i) |
| |
| ←── 失败诊断 F^(i,j) (内层循环) ────|
| |
| 当 surrogate 通过时: |
| |
| ground-truth oracle test |
| 返回 1[R<1] (opaque bit only) |
| |
| ──── 触发 verifier 升级 ────→ |
| (test escalation) |关键设计:信息隔离 + opaque oracle bit
- Verifier 完全不看 generator 的 reasoning / code,只看任务指令 + 输出文件
- Oracle 通过
1[R<1]只返回一个 bit,不泄露任何测试内容或失败细节 - 这阻止 generator 过拟合到 held-out test,迫使 verifier 自己升级测试覆盖
关键结果
来自 SkillsBench(87 个任务,11 个专业领域):
| 配置 | Pass Rate | vs No-Skill |
|---|---|---|
| No-Skill Baseline | 30.6% | — |
| Skill-Creator (Anthropic 官方) | 34.1% | +3.5pp |
| Human-Curated Skills | 53.5% | +22.9pp |
| EvoSkills (Full) | 71.1% | +40.5pp |
Ablation:
- W/O Surrogate Verifier: 41.1% (−30.0pp)
- W/O Skill Evolution: 48.6% (−22.5pp)
Cross-Model Transfer(Opus 4.6 演化的 skills 跨模型迁移):
| 目标模型 | 无 skill | 用 Opus skills | Δ |
|---|---|---|---|
| GPT-5.2 | 29.6% | 65.0% | +35.4 |
| Claude Sonnet 4.5 | 20.0% | 63.1% | +43.1 |
| Claude Haiku 4.5 | 10.4% | 54.5% | +44.1 |
| Qwen3-Coder-480B | 8.4% | 50.8% | +42.4 |
| DeepSeek V3-671B | 13.0% | 48.8% | +35.8 |
| Mistral Large 3-675B | 4.9% | 43.1% | +38.2 |
三个关键洞察
- Agents create better skills than humans:Self-evolved 在 9/11 领域超越 human-curated,Finance 领域差距高达 +56.9pp
- Skills are portable across model families:迁移到 6 个不同公司模型仍获 +36 ~ +44pp
- Human-Machine cognitive misalignment:Natural Science 领域 human-curated 降低性能,说明人写的 workflow 不符合 agent 推理模式
关键假设
- 任务有可机器自动验证的输出(filesystem state)
- Surrogate Verifier 与 Generator 可在不同 LLM session 中并行执行
- Oracle test 存在(可以是真人审核,但只回 pass/fail)
- Skill 表达为 多文件包(
SKILL.md+ scripts + references),而非单 prompt
关键挑战
- 演化成本:每个任务平均 4.1 cycles × 5 oracle rounds = $K+M=20$ 次 LLM 调用 + 多次环境执行
- Verifier 漂移:
V^(j+1)必须既不偏向 generator 的实现,又要覆盖更难的测试 - Context 溢出:演化轮数过高时 LLM context 满,需 $\beta=0.7$ 上限检查
3. 业务应用场景
跨境母婴客服需要覆盖大量场景:退货、过敏咨询、物流追踪、关税计算、母婴专业问答……每个场景的 SOP 需要人工撰写并打磨,周期 1-2 周/场景。同时人写的 SOP 经常出现 human-machine misalignment:客服 manager 觉得逻辑清晰的步骤,Claude/GPT 执行起来反而经常报错(对应论文 Takeaway 3)。
- 场景接入周期:1-2 周 → 2 天(只需收集 30 个 oracle 样本) - SOP 质量:对应论文 +18pp ~ +40pp 改进 - 维护成本:新法规出来后只需更新 oracle ground-truth,skill 自动重新演化
业务上需要在多个 LLM 服务商之间切换: - 高峰期用 Claude Opus 4.6(贵但准) - 平峰用 GPT-5.2(性价比) - 低优先级用 Qwen3-Coder(成本最低)
4. 输入数据要求
- 中,需要 oracle ground-truth 样本(30-100 个/场景)
5. 输出结果
未提取到输出条目;请核对原始 Skill 卡片与代码。
6. 业务价值与 ROI
- 数据要求:中,需要 oracle ground-truth 样本(30-100 个/场景)
- 技术门槛:高,需要多 LLM session 编排 + 信息隔离设计
- 工程复杂度:中高,核心算法清晰但环境执行 + 沙箱隔离需要工程化
- 维护成本:中,主要是 oracle 数据维护 + 演化轮次调参
- 方法论价值高:协同演化框架可推广到其他自我改进场景(prompt 优化、tool 演化)
- 跨平台红利明显:论文给出 +36 ~ +44pp 跨模型迁移收益,直接转化为成本节省
7. 代码模板
代码块数量:4 · 路径:paper2skills-code/llm_agent_engineering/co_evolutionary_skill_verification
from dataclasses import dataclass
@dataclass
class SkillPackage:
skill_id: str
description: str
scripts: dict[str, str]
version: int = 1
@dataclass
class VerificationResult:
skill_id: str
passed: bool
feedback: str
score: float
def generator_propose(skill_id: str, task: str, prev_feedback: str = "") -> SkillPackage:
base_desc = f"执行任务: {task}"
if "缺少错误处理" in prev_feedback:
base_desc += " (含错误处理)"
return SkillPackage(
skill_id=skill_id,
description=base_desc,
scripts={"main.py": "def run():\n pass # " + task},
)
def verifier_evaluate(pkg: SkillPackage) -> VerificationResult:
issues = []
if "错误处理" not in pkg.description:
issues.append("缺少错误处理")
if len(pkg.scripts.get("main.py", "")) < 30:
issues.append("实现过于简单")
score = max(0.0, 1.0 - len(issues) * 0.3)
return VerificationResult(
skill_id=pkg.skill_id,
passed=score >= 0.7,
feedback="; ".join(issues) if issues else "通过",
score=score,
)
skill_id = "Skill-补货决策"
feedback = ""
for iteration in range(3):
pkg = generator_propose(skill_id, "自动补货", feedback)
result = verifier_evaluate(pkg)
print(f"Iter {iteration+1}: score={result.score:.2f} | feedback={result.feedback}")
feedback = result.feedback
if result.passed:
print(f" ✅ 通过验证 at iteration {iteration+1}")
break
print("[✓] Co-Evolutionary Skill Verification 测试通过")8. 论文来源
论文链接用于核验方法来源,不自动证明本页商业结果。