SkillOpt 工作流 Mermaid 图解

论文: SkillOpt: Executive Strategy for Self-Evolving Agent Skills arXiv: 2605.23904, 2026年5月 作者: Yifan Yang et al. (Microsoft, SJTU, Tongji, Fudan)


图解一:完整 Pipeline 流程图

SkillOpt 的核心流程:冻结目标 Agent 执行 rollout → 独立 Optimizer Model 进行 minibatch 反思并生成编辑提案 → 合并排序并按预算裁剪 → Held-out 验证门禁把关 → 接受或拒绝,形成闭环。

flowchart TB
    subgraph Epoch["🔄 单次 Epoch 迭代"]
        direction LR

        subgraph FrozenAgent["🧊 Frozen Target Agent (左)"]
            A1["📦 当前技能 S<br/><i>300-2000 token Markdown</i>"]
            A2["🎯 执行 Rollout Batch<br/>K 条轨迹 · 多任务"]
            A3["📊 轨迹评分<br/>成功 ✅ / 失败 ❌"]
            A1 --> A2 --> A3
        end

        subgraph Optimizer["🧠 Optimizer Model (中)"]
            B1["🔍 Minibatch Reflection<br/>分析成功/失败模式"]
            B2["✏️ 生成 Bounded Edits<br/>Add · Delete · Replace"]
            B3["🔄 K 个 Mini-batch 并行<br/>每组独立产出提案"]
            B1 --> B2 --> B3
        end

        subgraph MergeRank["🔀 Merge & Rank (右上)"]
            C1["🗂️ 合并 K 组提案<br/>去重 · 冲突消解"]
            C2["📏 Clip by 编辑预算 L<br/><i>L ↓ decay per epoch</i>"]
            C3["📋 排序后的候选编辑列表"]
            C1 --> C2 --> C3
        end

        subgraph Gate["🚦 Validation Gate (右下)"]
            D1["✅ Held-out 验证集评估"]
            D2{"⚖️ 验证分数<br/>是否严格提升?"}
            D1 --> D2
        end

        subgraph Accept["✅ Accept 路径"]
            E1["💾 更新 best_skill.md"]
            E2["🚀 部署 artifact<br/><i>零推理开销</i>"]
            E1 --> E2
        end

        subgraph Reject["❌ Reject 路径"]
            F1["🗑️ 存入 Rejected-Edit Buffer"]
            F2["📝 记录失败原因<br/><i>作为负反馈信号</i>"]
            F1 --> F2
        end

        subgraph Feedback["🔄 反馈闭环"]
            G1["📈 Epoch-wise Slow Update<br/><i>跨 epoch 反思:有效/无效模式</i>"]
            G2["🔁 下一 Epoch<br/>更新后技能 S → Frozen Agent"]
            G1 --> G2
        end

        A3 -->|"轨迹 + 评分"| B1
        B3 -->|"编辑提案"| C1
        C3 -->|"候选技能"| D1
        D2 -->|"Accept ✅"| E1
        D2 -->|"Reject ❌"| F1
        F2 -.->|"负反馈"| B1
        G1 -.->|"Momentum (动量)"| B1
        G2 -.->|"循环"| A1
    end

    style FrozenAgent fill:#0f172a,stroke:#10b981,stroke-width:2px,color:#e2e8f0
    style Optimizer fill:#0f172a,stroke:#06b6d4,stroke-width:2px,color:#e2e8f0
    style MergeRank fill:#0f172a,stroke:#f59e0b,stroke-width:2px,color:#e2e8f0
    style Gate fill:#0f172a,stroke:#8b5cf6,stroke-width:2px,color:#e2e8f0
    style Accept fill:#0f172a,stroke:#10b981,stroke-width:2px,stroke-dasharray:5 5,color:#e2e8f0
    style Reject fill:#0f172a,stroke:#ef4444,stroke-width:2px,stroke-dasharray:5 5,color:#e2e8f0
    style Feedback fill:#0f172a,stroke:#64748b,stroke-width:2px,stroke-dasharray:5 5,color:#e2e8f0

流程说明

  1. Frozen Target Agent 使用当前技能文档 S 在一组任务上执行,收集 K 条轨迹及成功/失败评分
  2. Optimizer Model(独立的 Frontier LLM)对轨迹进行 minibatch 反思,提出有限制的 Add/Delete/Replace 编辑提案
  3. Merge & Rank 将 K 组并行 minibatch 的提案合并、去重、冲突消解,并按编辑预算 L 裁剪(模拟学习率)
  4. Validation Gate 用 Held-out 验证集严格评估候选技能——只有验证分数严格提升时才接受
  5. 接受的编辑更新 best_skill.md;拒绝的编辑存入 Rejected-Edit Buffer 作为负反馈
  6. 每个 Epoch 结束执行 Slow/Meta Update,反思有效/无效编辑模式,提供动量效应

图解二:深度学习类比映射

SkillOpt 将 Agent 技能优化映射为深度学习训练过程——技能文档是「参数」,编辑提案是「梯度」,预算 L 是「学习率」,验证门禁是「validation check」,慢更新是「动量」。

flowchart LR
    subgraph DL["🧮 深度学习概念"]
        P["Parameter θ<br/><i>模型权重</i>"]
        G["Gradient ∇L<br/><i>参数更新方向</i>"]
        LR["Learning Rate η<br/><i>步长控制</i>"]
        VAL["Validation Loss<br/><i>早停与选模</i>"]
        MOM["Momentum<br/><i>稳定更新方向</i>"]
        NEG["Negative Gradient<br/><i>失败的方向信号</i>"]
    end

    subgraph SO["📝 SkillOpt 等价概念"]
        S["Skill Document<br/><i>Markdown 技能文档</i>"]
        E["Add/Delete/Replace<br/><i>Bounded 编辑提案</i>"]
        L["Edit Budget L<br/><i>每 epoch 最大编辑数</i>"]
        GATE["Held-out Validation Gate<br/><i>严格接受/拒绝</i>"]
        SLOW["Epoch-wise Slow Update<br/><i>跨 epoch 元反思</i>"]
        BUF["Rejected-Edit Buffer<br/><i>负反馈存储</i>"]
    end

    P -->|"≡ 映射"| S
    G -->|"≡ 映射"| E
    LR -->|"≡ 映射"| L
    VAL -->|"≡ 映射"| GATE
    MOM -->|"≡ 映射"| SLOW
    NEG -->|"≡ 映射"| BUF

    style DL fill:#0f172a,stroke:#38bdf8,stroke-width:2px,color:#e2e8f0
    style SO fill:#0f172a,stroke:#34d399,stroke-width:2px,color:#e2e8f0
    style P fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style G fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style LR fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style VAL fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style MOM fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style NEG fill:#0f172a,stroke:#38bdf8,color:#e2e8f0
    style S fill:#0f172a,stroke:#34d399,color:#e2e8f0
    style E fill:#0f172a,stroke:#34d399,color:#e2e8f0
    style L fill:#0f172a,stroke:#34d399,color:#e2e8f0
    style GATE fill:#0f172a,stroke:#34d399,color:#e2e8f0
    style SLOW fill:#0f172a,stroke:#34d399,color:#e2e8f0
    style BUF fill:#0f172a,stroke:#34d399,color:#e2e8f0

类比详解

深度学习SkillOpt设计动机
Parameter θSkill Document (Markdown)技能文档是 Agent 的「外部状态」,通过修改文本来改变 Agent 行为
Gradient ∇LAdd/Delete/Replace Edits编辑提案指向「改进方向」,如同梯度指向损失下降方向
Learning Rate ηEdit Budget LL 控制每 epoch 最大编辑数 → 文本空间的「步长」;L 随 epoch 衰减
LR ScheduleDecay L over epochs早期大 L 允许大步探索,后期小 L 精细微调
Validation CheckHeld-out Gate防止过拟合——只有验证分数严格提升的编辑才被接受
MomentumEpoch-wise Slow Update跨 epoch 反思稳定编辑方向,防止震荡
Negative GradientRejected-Edit Buffer失败编辑转化为负反馈信号,指导未来优化方向

图解三:关键设计决策树

mindmap
  root((SkillOpt<br/>核心设计))
    Bounded Edits
      Add 添加
      Delete 删除
      Replace 替换
      词级粒度
      防止语义跳跃
    Textual LR
      编辑预算 L
      Decay over epochs
      文本空间步长
    Validation Gate
      Held-out 数据
      严格提升判定
      防止有害累积
    Rejected Buffer
      负反馈存储
      非浪费计算
      指导未来优化
    Slow Update
      Epoch 级反思
      稳定编辑方向
      动量效应
    Zero Overhead
      部署仅需 Markdown
      300-2000 tokens
      无额外模型调用

文件导航