microsoft/SkillOpt

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

SkillOpt – Training Agent Skills Like Neural Networks

What it is – SkillOpt is an open‑source framework that treats the skill prompt used by a frozen LLM‑based agent as a trainable parameter. It runs a classic deep‑learning‑style optimisation loop (rollout → reflect → aggregate → select → update) that edits a markdown skill file until a held‑out validation score improves. The result is a compact best_skill.md (a few hundred‑to‑few‑thousand tokens) that can be dropped back into the original agent without any extra inference cost.

Why it matters – Most current agent‑skill pipelines rely on hand‑crafted prompts, one‑shot generation from a strong LLM, or ad‑hoc self‑revision. Those approaches are not reproducible and often fail to consistently improve performance. SkillOpt brings the rigor of gradient‑based optimisation to the textual skill itself, giving measurable gains across many benchmarks and model families while keeping deployment lightweight.

Key features (as described in the README)

  • Training loop with epochs, batch size, learning‑rate‑like budget, and validation gates – all operating on the skill document, not model weights.
  • Optimizer model that proposes bounded add/delete/replace edits; edits are accepted only if they raise a held‑out score.
  • Zero‑runtime overhead – the final skill file is a plain markdown prompt; the target model stays unchanged.
  • Multi‑backend support – works with OpenAI, Azure, Claude, Qwen, MiniMax, Codex, Copilot, etc., via a plug‑in backend system.
  • Benchmarks & results – six built‑in benchmarks, seven target models, three execution harnesses; reported improvements of ~+20‑25 points over a no‑skill baseline, and best‑or‑tied‑best on all 52 evaluated cells.
  • SkillOpt‑Sleep – an offline “self‑evolution” CLI (skillopt‑sleep) that harvests past agent sessions, replays them, and consolidates validated edits behind a held‑out gate.
  • WebUI dashboard – optional Gradio interface for monitoring training runs (port, host, share options).
  • Extensible – add new backends or benchmarks by following the documented contracts; example backends and env packages are provided.

Typical workflow

  1. Install via pip install skillopt (or editable install for the web UI).
  2. Configure a backend (e.g., openai_chat) and a benchmark environment (e.g., searchqa).
  3. Run the training CLI which iterates over rollouts, collects scores, and lets the optimizer edit the skill markdown.
  4. Validate against a held‑out set; when the validation score improves, the edit is committed.
  5. Deploy the resulting best_skill.md with the original frozen agent – no extra API calls needed.

Who should use it – Researchers experimenting with prompt‑engineering, developers building LLM‑powered coding assistants, or anyone who wants a systematic way to improve agent prompts without retraining the underlying model.

Where to learn more – Full docs, reproduction guide, and technical blog are linked in the README; the paper (arXiv:2605.23904) provides the detailed methodology and ablations.

Related

  • Project
  • Project
  • Project
  • Project
  • Project