SkillGrad:优化特工技能如梯度下降
概览
SkillGrad 将代理技能包视为结构化参数,并通过文本类比的梯度下降进行优化:执行者生成轨迹,诊断器将其转换为每个任务的更新信号,动量代理在迭代中积累重复的模式,补丁程序对技能进行层级感知编辑。 该仓库包含完整的 SpreadsheetBench Verified 集成作为参考流水线。运行时,按照 data/benchmarks/README.md 中的布局,将数据集置于 data/benchmarks/spreadsheetbench/。要使用 SkillGrad 进行新基准测试,需实现相应的加载器和评分界面。 三个命令从仓库根节点运行端到端优化周期。 通过MODEL环境变量切换骨干网络模型: 默认运行ID是skillgrad_。最终遗物落在结果/运行次数/skillgrad_ /: 训练循环会优化你指向的初始技能——技能-dir。
概述(AI 翻译)
优化特工技能,比如梯度下降。
SkillGrad 将客服技能包视为结构化参数, 通过文本上的梯度下降对应物进行优化:执行者 生成轨迹,诊断器将其转化为每个任务的更新 动量因素在信号中积累了反复出现的模式 迭代后,补丁程序会对技能进行层感知编辑。
| 论文 | arXiv:2605.27760 |
| 代码 |
优化类比:
| 梯度下降 | SkillGrad |
|---|---|
| 参数 θ | 结构化技能包 S = (H, B, Q) |
| 损失证据 | 任务结果 + 轨迹痕迹 |
| 每例梯度 | 每任务文本诊断 |
| 动量 | 持久模式记忆 + 每次迭代叠加 |
| 参数更新 | 层级感知技能补丁 |
仓库布局
安装
该仓库包含完整的 SpreadsheetBench 验证集成作为参考流水线。运行时,按照 data/benchmarks/README.md 中的布局将数据集置于 data/benchmarks/spreadsheetbench/ 下。要使用 SkillGrad 和新的基准测试,需实现相应的加载器和评分界面。
快速开始
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
SkillGrad
Optimizing agent skills like gradient descent.
SkillGrad treats an agent skill package as a structured parameter and optimizes it through a textual analogue of gradient descent: an executor produces trajectories, a diagnoser turns them into per-task update signals, a momentum agent accumulates recurring patterns across iterations, and a patcher applies a layer-aware edit to the skill.
| Paper | arXiv:2605.27760 |
| Code |
The optimization analogy:
| Gradient descent | SkillGrad |
|---|---|
| parameter θ | structured skill package S = (H, B, Q) |
| loss evidence | task outcomes + trajectory traces |
| per-example gradient | per-task textual diagnosis |
| momentum | persistent pattern memory + per-iteration overlay |
| parameter update | layer-aware skill patch |
Repository layout
pipeline/ executor, diagnoser, momentum, patcher, training loop
prompts/ the five agent prompts
runners/ model dispatch, cost ledger, trajectory logger, …
evaluators/ xlsx grader used as the terminal loss signal
data/ dataset loader, split, layout
scripts/ base_traj.sh, train.sh, eval.sh
seeds/xlsx/ bundled initial skill (SKILL.md)
assets/ figures referenced from the README
Installation
pip install -r requirements.txt
cp .env.example .env
# fill in exactly one of the two provider blocks
This repo includes a complete SpreadsheetBench Verified integration as a reference pipeline. To run it, place the dataset under data/benchmarks/spreadsheetbench/ following the layout in data/benchmarks/README.md. To use SkillGrad with a new benchmark, implement the corresponding loader and grader interfaces.
Quickstart
Three commands run an end-to-end optimization cycle from the repo root.
bash scripts/base_traj.sh # 1. collect failure pool
bash scripts/train.sh # 2. train SkillGrad
bash scripts/eval.sh # 3. evaluate on held-out test split
Switch the backbone model via the MODEL environment variable:
MODEL=gpt-4.1 bash scripts/train.sh
The default run id is skillgrad_. Final artifacts land under
results/runs/skillgrad_/:
results/runs/skillgrad_gpt-5.4/
├── config.json
├── train/
│ ├── training_results.json
│ ├── iter_1/, iter_2/, …
│ └── final_skill/xlsx/
└── eval/
├── summary.json
└── /trajectory.json
Initial skill
The training loop optimizes whatever initial skill you point
--skills-dir at. The repository ships with one bundled seed at
seeds/xlsx/SKILL.md and the scripts default to it. To use a different
initialization, lay it out as /xlsx/SKILL.md and pass
SKILLS_DIR= to the scripts.
Configuration
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add wwwhy725/skillgrad