Automatic Optimization of Agent Skill Documentation: A Technical Breakdown

    This article breaks down an automatic optimization method for agent skill documentation, where a frontier model acts as a coach that repeatedly edits an external skill document while a frozen model stays unchanged, keeping each edit only if it improves validation scores. It explains the method as a constrained hill-climbing search over discrete text, the role of the text learning rate, validation-set gating and data isolation, cost and applicability boundaries, and a practical deployment checklist, along with a grounded view on interpreting sweeping benchmark wins.

    1. The Trigger: A “Scorecard” That Started a Debate

    A research team recently published an automatic optimization method for agent skill documentation. The idea can be summarized in one sentence: let a frontier model act as a coach that repeatedly revises the external skill document a frozen model relies on, running the evaluation set after each revision, keeping the change if the score goes up and rolling it back if the score drops.

    The reported results show first or tied-first place across dozens of evaluation combinations spanning multiple benchmarks, multiple base models, and multiple execution environments, with an average absolute score improvement of over 20 points. On table processing and office-document QA tasks, scores rose from 41.8 to 80.7 and from 33.1 to 72.1, respectively, averaging about 5.4 points higher than several mainstream automatic prompt optimization baselines.

    Results like these tend to trigger two extreme reactions: one treats them as evidence of a “general capability surge,” the other dismisses them as leaderboard gaming. A more pragmatic stance is to treat it as an engineering problem: what is being optimized, where the feedback signal comes from, when a write is allowed, and how failures are recovered. The rest of this article unpacks it in that order.

    The core setup of this paradigm has four parts, none of which can be missing:

    • The optimized subject is fully frozen, with parameters and inference configuration unchanged;
    • Domain knowledge is externalized into a structured skill document, typically 300 to 2000 tokens long;
    • Another strong model serves as the optimizer, reads execution traces with scores, and proposes additions, deletions, and edits to the document;
    • Each edit is accepted only if it improves the held-out validation set; otherwise it is rolled back.

    In engineering terms, this is a hill-climbing search over a discrete text space with an acceptance gate. Gradients do not exist; the substitute for a gradient is natural-language feedback in the form of “trace + score.” The learning rate is no longer a float but the scale of change allowed per round.

    A sketch of the main loop:

    1. skill = load_skill("skills.md")
    2. best = evaluate(skill, valid_set)
    3. for step in range(max_steps):
    4. traj = collect_rollouts(skill, train_set) # execution traces + failure cases
    5. proposal = optimizer.diff(skill, traj, lr=lr) # text-level "gradient" and "step size"
    6. if evaluate(proposal, valid_set) > best:
    7. skill, best = proposal, evaluate(proposal, valid_set)
    8. log_accept(step, best)
    9. else:
    10. log_reject(step) # roll back and record the lesson in memory

    3. Text Learning Rate: The Overlooked Key Knob

    The “text learning rate” controls the magnitude of change in a single round: how many lines may be added or rewritten, whether existing entries may be deleted, and which sections the changes concentrate in. Its role is highly similar to the step size in numerical optimization.

    • Too large: the optimizer tends to rewrite the whole document, validation scores oscillate wildly, and historically effective experience gets overwritten;
    • Too small: each round only allows wording-level tweaks, convergence is extremely slow, and it consumes a large evaluation budget;
    • Practical advice: use a larger step early to quickly build the skeleton, then decay it gradually once you hit a plateau, keeping only local patches.

    The accompanying “lesson memory” is equally important: rejected edits are retained together with the reason for failure, and the next round prompts the optimizer to avoid repeating the same kind of change, which amounts to adding a negative-sample constraint to the search.

    4. Validation-Set Gating: The Load-Bearing Wall

    What keeps this method from being “let the model do whatever it wants” is the acceptance mechanism. Three engineering details matter:

    1. Data isolation. The set used to generate traces and the set used for acceptance must be strictly separated; otherwise the optimizer memorizes specific examples and the document degrades into an answer list.
    2. Consistent comparison conditions. Temperature, maximum output length, tool permissions, and retry strategy must be identical before and after a change; otherwise score differences cannot be attributed.
    3. Multi-sample noise reduction. Single results on a small validation set have high variance; it is advisable to fix the random seed, repeat several times, and take the mean before deciding whether to accept an edit.

    At the same time, a structural risk must be acknowledged: when the validation set is limited in size, repeatedly selecting on it introduces selection bias, so the validation score keeps rising while real generalization does not improve in step. The mitigation is to keep a test set that has never participated in any decision and use it only at the end of a stage.

    5. Cost, Benefit, and Applicability Boundaries

    What this kind of method truly saves is labeling and training cost: no gradients, no compute clusters, and the output is a readable, auditable, versionable text. The benefit is most obvious in scenarios with clear task shapes and automatable scoring, such as structured table operations, document information extraction, and format-constrained report generation.

    Cases where the benefit is not obvious or even negative are also common:

    • The scoring criteria are vague or rely on subjective judgment, and feedback noise drowns out the real signal;
    • The task itself is limited by the model’s intrinsic capability, and no amount of documentation can fill the gap;
    • Each evaluation round is slow and expensive, and the optimization overhead exceeds writing the document manually;
    • In domains requiring strict compliance audits, automatically generated rule entries still need human review.

    6. Deployment Checklist

    • Document layering: store task flows, field definitions, exception handling, and a few examples in separate sections to enable local edits by section.
    • Version management: generate a version for each accepted edit, retaining one-click rollback and change notes.
    • Budget control: set caps on maximum iterations, evaluations per round, and total duration to avoid infinite loops.
    • Observability: record acceptance rate, validation curve, lines changed, and failure-case clusters to judge whether it is a step-size problem or a capability ceiling.
    • Human in the loop: before rollout, have domain experts spot-check document entries and remove statements that “look reasonable but mislead the model.”
    • Engineering support: traces and documents can land in object storage and a config center respectively, evaluation jobs can be elastically launched on a container platform, and the whole process can be wired into logging and monitoring with alerts for reproducibility and alerting.

    7. How to Read “Winning Everything” Rationally

    When the number of evaluation combinations is limited and the task distribution is concentrated, a high win rate says more about the method being effective within that distribution than about a universal leap in capability. A more reliable judgment looks at whether cross-task transfer is stable, whether the variance is acceptable, whether gains hold on a test set that never participated in optimization, and the cost-effectiveness relative to hand-written documentation.

    The conclusion is not mysterious: externalizing domain knowledge into iterable text and then searching for a better version with a closed loop gated by acceptance is a cost-controlled, auditable means of capability enhancement. It will not replace model capability, but on tasks with clear scoring, it is often a high-return step. If you are building agent applications, you can pilot on a single high-frequency task first, using the general-purpose container, storage, and monitoring capabilities of platforms such as Baidu AI Cloud to run the evaluation pipeline, then decide whether to extend to more scenarios.