SkillOpt: Executive Strategy for Self-Evolving Agent Skills
From the publisher’s feed, collected in the ZeroLabs newsroom.
SkillOpt is a novel framework that optimizes an AI agent’s skill — a compact natural-language policy document — rather than its weights. It treats the skill text as a trainable parameter: a frozen “target” model repeatedly executes tasks using the current skill, and a separate optimizer model analyzes the resulting trajectories to propose bounded edits (add, delete, replace) to the skill. Each candidate edit is accepted only if it improves performance on a held-out validation set. This process mirrors deep learning training (rollout = forward pass; reflection = backward pass; edit budget = learning rate; validation gate = early stopping). In extensive experiments (6 benchmarks, 7 models, 3 execution modes), SkillOpt yielded best or tied best results on every task, often boosting accuracy by 20–40 points over no-skill baselines. Key features — validation gating, learning-rate budgeting, rejected-edit memory, and epoch-wise slow updates — ensure stable, monotonic improvement while adding zero inference cost at deployment. The trained artifact is a small best_skill.md file (typically a few hundred tokens) that can be inspected, audited, and reused across models or environments.The Problem: Procedural Adaptation of Frozen AgentsModern LLM-based agents often use skills — human-readable instruction files that encode tool policies, verification rules, output formats, etc.. Adapting agents to new domains thus requires updating these procedures. Traditional methods (manual prompts, one-shot LLM-generated skills, or unstructured revisions) do not reliably improve performance. Moreover, many powerful models are closed or expensive to fine-tune, so weight updates are impractical. SkillOpt addresses this by training the skill document itself as the external state of a fixed agent. Formally, given a frozen target model π, a task harness H, and a skill text s, each execution yields a trajectory and score r = f(π,H,s). SkillOpt aims to find a skill s^* that maximizes expected reward on held-out tasks, using iterative trial-and-error (see Problem Setup in pseudocode). In essence, it converts the adaptation problem into a controlled text optimization problem, with the skill as the “parameter” to learn.Algorithmic PipelineSkillOpt’s core loop is shown in Figure 1. At each step, the frozen target model executes a batch of tasks with the current skill (rollout). The optimizer model then analyzes the batch of trajectories, separating successes from failures, and suggests structured edits (additions, deletions, replacements) to the skill document. These candidate edits are merged (prioritizing fixes for failures), ranked by expected utility, and clipped to respect a textual learning-rate budget (an “edit budget”). The resulting candidate skill (original skill plus edits) is then evaluated on a held-out validation split: if it strictly improves performance, it replaces the current skill; otherwise it is rejected and its edits go into a rejected-edit buffer. Periodically (once per epoch), an epoch-wise slow/meta update can inject longer-term guidance into the skill.SkillOpt training loop. The frozen target model executes tasks with the current skill, then an optimizer model proposes bounded edits (patches) based on successes/failures. A held-out validation gate accepts only those edits that improve performance. Rejected edits are stored for future reflectionKey components include:Rollout (Forward Pass): The target executes tasks with skill s, collecting dialogues, tool calls, answers, etc. Small batch sizes allow quick but noisy updates, while large batches expose stable patterns. SkillOpt supports accumulating multiple batches before an update.Reflection (Backward Pass): The optimizer model groups failed and successful trajectories into minibatches and reasons over them to propose edits. Failure batches suggest missing or corrective instructions; success batches suggest preserving good rules. This “trajectory-driven reflection” produces structured patch edits or, in rewrite mode, suggested full rewrites.Bounded Updates: A cap (edit budget) limits how many edits are applied per step. After merging duplicate/conflicting proposals, edits are ranked (by novelty or heuristic utility) and only the top-k are applied. This prevents destructive rewrites and enforces a controlled “learning rate” for text. SkillOpt supports cosine, linear, constant or adaptive budget schedules.Validation Gate: Every candidate skill is tested on a held-out validation split. Only if its score exceeds the current best does SkillOpt accept the update. This gate prevents spurious or overfitting edits — making learning propose-and-test rather than blind revision.Rejected-Edit Buffer: Rejected edits aren’t discarded. Instead, their patterns and score deltas are stored in an epoch-local buffer. Future reflection calls are informed to avoid repeating these mistakes, providing negative feedback without extra runtime cost.Slow/Meta Update: Once per epoch, the optimizer can incorporate longer-horizon feedback. For example, comparing skills at epoch boundaries on the same tasks provides momentum, and a “meta skill” memory can guide the optimizer model. This ensures stability over many steps, akin to momentum in SGD.Overall, SkillOpt’s loop closely mirrors a gradient-based optimizer:rollouts ≈ forward pass, reflection ≈ gradient computation, edit budget ≈ learning rate, and validation gate ≈ early stopping. This disciplined approach ensures each update is justified by measurable improvement.Detailed MethodSkillOpt is a harness-agnostic algorithm. It formalizes as follows:Let:π = the frozen target modelH = an execution harness (chat, code execution, etc.)s = a skill document (text)For a task set T, each tuple(π, H, s, t)yields a trajectory and score rₜSplit T into:• Training set• Validation set• Test setAt each step:Sample a batch:T_trainObtain trajectories under the current skill document s.Form:S = successesF = failures(by threshold or top/bottom fraction).Pass S and F separately to the optimizer LLM, which outputs:Δ_S = set of edits suggested from successesΔ_F = set of edits suggested from failuresMerge these patches (giving priority to failure-fixes), then select the top:η editsunder a schedule.Apply the edits to obtain:s_cand = candidate skill documentEvaluate s_cand on validation tasks:If R_val(s_cand) > R_val(s), accept s_cand and update:s ← s_candotherwise reject it and add:(Δ, Δ!R)to the buffer.After each epoch, optionally perform a slow/meta update (e.g. asking the optimizer to refine a protected section of s based on cumulative evidence).The final output is:best_skill.md— the highest-validated skill found.This procedure is fully data-driven and does not require RL or gradient signals. Instead it uses hard feedback (rewards, verifiers) typical in agent benchmarks. The approach assumes such feedback is available (e.g. exact-match oracles, code execution checks); for open-ended tasks, one could substitute proxy metrics or human evaluation in the gate.Computational and Data RequirementsModels: Two LLM interfaces are required: the target model π (e.g. GPT-5.5, Claude, Qwen) whose behavior we want to adapt, and an optimizer model (called the “frontier model” in the paper). In practice the optimizer is also an LLM (often larger or equivalent scale). For example, Yang et al. used GPT-5.5 as the optimizer when training skills for GPT-5.5, as well as mixing between Codex and Claude for different harnesses.Data: For each benchmark, standard training/validation/test splits are needed. Benchmarks in the paper include SearchQA (closed-book QA), SpreadsheetBench (code generation), OfficeQA/DocVQA (document question answering), LiveMathematician (multiple-choice math), ALFWorld (embodied game). Each sample must have a known correct answer or verifier. The dataset must be pre-split; SkillOpt itself does not create data.Hyperparameters: Typical defaults (e.g. 4 epochs, rollout batch size 40, reflection minibatch 8, edit budget=4 edits/step, cosine schedule) come from the authors’ evaluation protocol. These were found robust: for instance, cosine decay outperformed constant schedules, and very large batches/epochs gave diminishing returns. (Table below summarizes key defaults.)Compute: Training involves many LLM calls. Each rollout batch requires queries to pi and each reflection requires several queries to the optimizer model (one per minibatch plus aggregate queries). Thus compute ~ (num_epochs × num_rollouts × (1 + overhead)) model calls. Yang et al. typically used hundreds of GPU-accelerated queries (e.g. via Azure OpenAI). However, after training, inference is cheap: the final skill is just fed into the agent’s context, with no extra model calls.Logging/Observability: SkillOpt supports verbose logging. Users can track the score trajectory, accepted edits, and rejected proposals. A Gradio-based dashboard is available for monitoring (optional, via skillopt[webui]). All checkpoints and skill versions can be saved for audit.Multi-Agent Note: The paper focuses on single-agent skills. In a multi-agent setup, one could apply SkillOpt separately to each agent’s skill, or even optimize a joint multi-agent instruction set. For example, in a system where agents communicate, SkillOpt could train each agent’s prompt, or a shared “coordination document”. The loop is inherently parallelizable: each agent’s trajectories could be fed to a corresponding optimizer. (This is an open area; no direct experiments were reported on multi-agent coordination in the paper.)Implementation Example (Python)Below is a simplified Python example illustrating how to train a SkillOpt skill. It uses the skillopt library (install via pip install skillopt) and assumes prepared data splits for a use case (e.g. SearchQA with GPT-5.5). This code is illustrative and omits many details (credentials, actual dataset loading) for brevity.import osfrom skillopt.config import load_configfrom skillopt.engine.trainer import ReflACTTrainerdef train_skillopt_skill(config_path: str, split_dir: str, endpoint: str) -> str: """ Train a SkillOpt skill for a given benchmark. Args: config_path: Path to the YAML config (e.g. 'configs/searchqa/default.yaml'). split_dir: Directory containing 'train.jsonl', 'valid.jsonl', 'test.jsonl'. endpoint: Azure/OpenAI endpoint URL or OpenAI API URL. Returns: Path to the trained best_skill.md file. """ # Ensure environment variables or explicit settings for Azure/OpenAI are provided # (e.g. AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY for Azure mode). try: # Load SkillOpt configuration (inherits from base configs) config = load_config(config_path) # Initialize trainer: specify model backends via env or arguments trainer = ReflACTTrainer( config=config, split_dir=split_dir, azure_openai_endpoint=endpoint # Additional args (e.g. anthopic_api_key, qwen settings) can be passed here ) # Run training loop best_skill_path = trainer.train() print(f"Training complete. Best skill saved to: {best_skill_path}") return best_skill_path except Exception as e: # Catch and report errors (e.g. missing credentials, config issues) print(f"[Error] SkillOpt training failed: {e}") raiseif __name__ == "__main__": # Example usage: SearchQA with GPT-5.5 (via Azure OpenAI) # (This assumes you have set AZURE_OPENAI_ENDPOINT and API key in .env or environment.) skill_md = train_skillopt_skill( config_path="configs/searchqa/default.yaml", split_dir="data/searchqa_split", endpoint="https://my-openai-resource.openai.azure.com/" )The skillopt package (v0.1.0+) provides all core logic. It requires Python 3.10+, an LLM backend (OpenAI/Azure, Anthropic Claude, or local Qwen), and benchmark data (not bundled). The trainer automatically handles checkpointing and resume. External dependencies include OpenAI/Azure CLI for auth or Anthropic keys as needed.Architecture DiagramA frozen agent (LLM + tools) consumes the evolving skill text. An optimizer LLM observes rollouts and edits the skill. The skill document, optimizer, and gating logic form a self-contained pipeline:System architecture. The frozen agent uses the current skill in its context. An optimizer LLM performs reflective analysis on the trajectories and proposes textual edits. A bounded update applies only the top edits, and a gate ensures only improvements are kept. Rejected edits inform future roundsSkillOpt vs. Baselines: Accuracy GainsSkillOpt’s disciplined optimization yields large empirical gains. For example, on GPT-5.5 (direct chat mode), SearchQA accuracy jumps from 77.7% (no skill) to 87.3% with the SkillOpt skill. Similarly, SpreadsheetBench climbs from 41.8% to 80.7%, OfficeQA from 33.1% to 72.1%, DocVQA from 78.8% to 91.2%, LiveMath from 37.6% to 66.9%, and ALFWorld from 83.6% to 95.5%. These improvements dominate all baselines. In aggregate, SkillOpt achieved the best reported accuracy in all 52 model-benchmark-harness combinations tested. Other methods (human-written skills, one-shot LLM prompts, prompt-optimization like TextGrad/GEPA, or evolution methods like Trace2Skill/EvoSkill) consistently underperform SkillOpt.Sample accuracies on GPT-5.5 direct-chat. Baselines include no-skill (zero-shot), a human-crafted skill, a one-shot LLM prompt, and prior algorithms (Trace2Skill, TextGrad, GEPA). SkillOpt achieves the highest accuracy on every task.These gains also translate to sample efficiency. SkillOpt typically converges in just a few epochs. The authors note that “skills converge in ~2–4 epochs” and that larger batch sizes or more epochs yield little extra benefit. In other words, a modest amount of execution data suffices to train an effective skill, thanks to the structured reflection. Theoretical intuition suggests this efficiency arises from using each trajectory to propose informed edits, akin to using gradient information rather than random search. The held-out gate ensures improvements accumulate monotonically.Ablations and MetricsSkillOpt is validated with rigorous ablations. Key components and their impacts:Textual Learning Rate (Edit Budget): Disabling the edit budget (i.e. allowing unlimited edits) severely degrades stability. In ablation, removing the budget dropped accuracy (e.g. from 87.1% to 84.6% on SearchQA). A moderate budget (4–16 edits) was found optimal.Validation Gate: Essential for safety. Without gating, even plausible edits often hurt performance. The paper shows that every accepted skill was validated against a held-out split.Rejected-Edit Buffer: Turning off the buffer also reduces accuracy (e.g. SearchQA falls from 87.1% to 85.5% without it). The buffer prevents revisiting known-bad edits, acting like replay memory.Slow/Meta Update: Including the slow update phase yields small but consistent gains, especially on longer-horizon tasks. This adds “momentum” to keep useful instructions from being forgotten.Metrics: Benchmarks are evaluated by task-specific exact-match or accuracy scores. All reported improvements are on held-out test sets. Ablation experiments (e.g. varying train-set size, removing components) consistently show SkillOpt’s design choices improve the final skill quality.Limitations and Failure ModesThe authors identify several practical limitations. Crucially, SkillOpt requires reliable feedback signals. It works best on tasks with clear verifiers (e.g. correct answers, tool outputs). In open-ended domains (story generation, subjective tasks), designing a validation criterion or reward is non-trivial. One could incorporate human or model evaluators into the gate, but this adds cost.Training is also computationally intensive: thousands of rollouts and LLM queries may be needed. While deployment is lightweight (just the static skill text), the upfront training cost can be high — a downside if only one-off adaptation is needed.SkillOpt intentionally produces a single skill document. This simplicity helps deployment, but can be a drawback in heterogeneous domains: one short text may not cover all scenarios. Some tasks might require multiple specialized skills or stateful policies, which SkillOpt does not natively provide (it does not grow a library of skills). In practice, one could apply SkillOpt separately to different sub-domains or use code logic as part of the skill, but this is beyond the scope of the basic method.Finally, because skills are trained on specific data, they encode domain heuristics. The paper warns that “optimized skills can encode domain-specific heuristics, so careful held-out evaluation remains necessary before transferring them to substantially different models, harnesses, or tasks”. Indeed, transfer experiments showed positive cross-model and cross-harness results, but only for related settings.Mitigations: Many limitations are architectural (e.g. need for verifiable reward). The solution is to combine SkillOpt with other techniques: use human-in-the-loop for gating on fuzzy tasks, extend the text with code execution to handle complexity, or integrate with weight fine-tuning for parts of the task that skills cannot express. Slow and meta updates already mitigate overfitting by consolidating stable instructions. In deployment, users should review the learned skill text — its transparency is a key advantage — to catch any unwanted biases or errors.Deployment and Practical ConsiderationsOnce trained, the deployment of a SkillOpt skill is straightforward. The final artifact is a Markdown file (e.g. best_skill.md) containing the procedural instructions. To use it, prepend or attach this text to the target model’s context or system prompt – no code changes or extra model calls are needed. This means inference latency is unchanged, and the only “cost” is a few hundred tokens of context. Because the skill is human-readable, it can be reviewed or edited by engineers before rollout (an advantage for safety auditing).In a production multi-agent system, one could ship each agent’s best_skill.md along with the agent. The pipeline does not assume a single thread: it can optimize each agent’s skill independently. For load balancing, the rollout and reflection steps can be parallelized across GPUs or servers. Logging and telemetry are built in: the skillopt library can emit logs of scores, accepted edits, and gate decisions. These logs aid observability and debugging.For scaling, note that adding more compute (larger batch sizes, more powerful models) generally improves the skill but with diminishing returns. The authors found moderate hyperparameters work well. An example baseline config is:Representative default hyperparameters for SkillOpt (SearchQA benchmark). These can be tuned per task; ablations showed cosine schedules and moderate LR improve stability.Environment and Commands: To reproduce results, install skillopt (v0.1.0) and prepare data. Example command-line (for SearchQA) is:python scripts/train.py \ --config configs/searchqa/default.yaml \ --split_dir /path/to/searchqa_split \ --azure_openai_endpoint https:// \ --seed 42This will automatically resume from checkpoints if interrupted. The environment requires proper credentials (AZURE_OPENAI_* or Anthropic API key) and Python ≥3.10. All random seeds should be fixed for experiment logs; e.g. pass --seed as above and ensure library randomness is controlled. The code snippet above shows the equivalent Python API usage.Comparisons and Related WorkSkillOpt advances over prior skill/prompt optimization methods by adding deep-learning rigor. Table 3 qualitatively compares SkillOpt to related approaches:SkillOpt differs by focusing on a single, reusable skill document that is trained with explicit validation and stability controls. Unlike GEPA/TextGrad, SkillOpt handles multi-step agent interactions and produces a persistent artifact. Compared to EvoSkill/Trace2Skill, SkillOpt adds bounded updates and rejected-edit buffers to avoid regression. Empirically, this pays off: SkillOpt “wins or matches the best” result on all evaluated tasks, whereas each prior method can outperform baselines on only a subset of tasks.ReproducibilityAll experiments in Yang et al. (2026) are fully reproducible with the released code and data splits. The authors provide exact commands and seeds in Appendix C. For example, the default optimization protocol uses --seed 0, four epochs, and reports final test accuracy on held-out splits. Since each run is deterministic given the seed, others can replicate the results. The ckpt/ directory includes example trained best_skill.md files (e.g. gpt5.5_searchqa_skill.md) for reference.Randomness and Seeds: The trainer uses Python’s RNG and the optimizer LLM’s sampling (if any) in a deterministic way (seeded LLM calls if the backend supports it). To ensure reproducibility, one should fix: the trainer --seed, the backend model version (e.g. GPT-5.5), and the splits directory. Evaluation metrics are accuracy, so runs are stable once data is fixed.ConclusionSkillOpt introduces a production-ready paradigm for tuning agent skills via text-space optimization. By treating a skill document like trainable weights, and using LLMs to perform “gradient-like” edits, it achieves dramatic accuracy gains on diverse tasks without touching the agent’s model internals. The approach is validated by extensive experiments and ablations. While best suited to tasks with clear feedback, its artifact-centric design (compact skill files) makes it appealing for real-world systems: skill updates are fast at runtime, transparent, and portable. Future work might extend SkillOpt to skill libraries or integrate it with on-line learning, but as is it provides a robust recipe for self-improving LLM agents.SkillOpt: Executive Strategy for Self-Evolving Agent Skills was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.