Source-linked AI summary

MOSCOPT: Mixture-of-Skills Collective Optimization for LLM Agents

Zhenyu Zhang, Jiudong Yang

arXiv:2609.14399v2cs.AIcs.CL

TL;DR

A single monolithic skill cannot serve multiple complementary task roles, and agents lack a mechanism to invoke the right strategy at the right time. MOSCOPT jointly optimizes a pool of skills and a textual gating skill; it achieves the best average performance on all five benchmarks, outperforming no-skill and strongest single-skill baselines.

  • Problem

    A single monolithic skill cannot serve multiple complementary task roles, and agents lack a mechanism to invoke the right strategy at the right time.

    Source: §1 · p. 1
  • Method

    MOSCOPT jointly optimizes a pool of complementary natural-language skills and a textual gating skill that dynamically selects skills, using parameter-free, three-phase interleaved updates.

    Source: §1 · p. 2, §3 · p. 3
  • Results

    MOSCOPT achieves the best average performance on all five benchmarks, consistently improving over the no-skill and strongest single-skill baseline, SkillOpt.

    Source: §4.2 · p. 7
  • Takeaways & Limitations

    Ablations identify three-phase interleaving, gating optimization, and selective skill activation as important to MOSCOPT’s reported performance.

    Source: §5.1 · pp. 8–9

Abstract

from arXiv · show

Natural language prompts and skills serve as the strategic backbone of LLM-based agents. Recent advances in prompt and skill optimization have achieved notable gains, yet all existing methods optimize a \emph{single} text template---missing the synergy among multiple complementary strategies. We propose MOSCOPT, a text-native, parameter-free algorithm that jointly optimizes a pool of $N$ skills and a gating skill $G$ that dynamically selects $K$ skills per step. To effectively optimize the skills, we build the EditAdam with internally maintained dual states. Through the three-phase interleaved updates with EditAdam, the system monotonically improves without gradient or parameter tuning. Extensive experiments and detailed ablations across 5 benchmarks and 3 target LLMs demonstrate that MOSCOPT consistently outperforms all baselines, and confirm that both the mixture-of-skills architecture with selective activation and the collective evolution with three-phase interleaving are essential to its superior performance. Code is released https://github.com/zhangzhenyu13/SummerClaw/tree/master/summerclaw/agent_trainer/algorithms/moscopt.

1 Introduction

MOSCOPT addresses the limits of single-skill agents by jointly optimizing a text-native skill pool and gating scheduler. Its interleaved updates support collective evolution without modifying model weights.

1 Introduction

  • Real-world tasks require complementary strategies within one trajectory, but a monolithic skill cannot handle diverse roles or dynamically invoke the right strategy.The passage gives calculation, search, and verification as examples of distinct sub-tasks.Source: §1 · p. 1
  • Manual or one-shot skills are labor-intensive and feedback-insensitive; self-improvement refines outputs but does not produce persistent reusable skills.Single-skill optimization such as SkillOpt [20] cannot model strategy interactions or dynamic combinations.Source: §1 · pp. 1–2
  • Population-level methods and evolutionary coordination target independent instances, while MoE routing uses neural routers that are neither interpretable nor text-editable.MOSCOPT instead optimizes the text document that schedules skills.Source: §1 · p. 2
  • MOSCOPT maintains N complementary skills and a text-based gating skill G that activates exactly K skills per step while keeping inactive skills out of context.It supports full-mixture gating, distilled single-skill, and static-routing-table deployment.Source: §1 · p. 2
  • EditAdam optimizes the pool through three interleaved phases: skill editing, gating editing, and collective evolution.The gating skill uses the same bounded-edit pipeline as the skills it schedules.Source: §1 · p. 2

2 Related Work

Prior work optimizes single prompts or skills, evolves components without modeling interactions within one agent’s skill pool, or routes among neural experts. MOSCOPT combines collective skill optimization with a textual gate.

Agent Skill Optimization

  • OPRO, Reflexion, and SkillOpt [20] optimize a single prompt or skill, which the authors identify as limiting tasks needing complementary strategies.Related work also covers reusable procedural skills [8] and persistent agent memory.Source: §2 · p. 2

Collective Evolution

  • EvoSkill [1], PromptBreeder [5], and evolutionary orchestration evolve skills, prompts, or coordination but do not model interactions among strategies within one agent’s skill pool.The gap concerns co-existing strategies within a single agent, rather than coordination across agents.Source: §2 · pp. 2–3

Routing and Mixture Paradigms

  • Neural mixture-of-experts [7] routes among specialized expert networks, but its parameterized routing lacks the interpretability and editability of text-based strategies.Source: §2 · p. 3

Positioning

  • MOSCOPT maintains and optimizes a population of skills with synergistic credit assignment in one agent, while its textual gate uses bounded edits and progressive disclosure.The gate is parameter-free and interpretable, unlike neural MoE routing.Source: §2 · p. 3

3 Method: MOSCOPT

MOSCOPT jointly optimizes a pool of natural-language skills and a natural-language gating skill that selects skills using trajectory feedback, without gradients or parameter tuning. Its method combines interleaved skill editing, gating editing, and collective pool evolution with EditAdam’s two levels of textual state.

3.1 Mixture-of-Skills Architecture

  • A natural-language gating skill selects exactly K skills from a pool of N strategies, while the pool and gate are jointly optimized for task success.The gate receives a skill summary and task context, and can select once per task or reselect at each step; parse failures fall back to top-K Q-score selection.Source: §3.1 · pp. 3–4

3.2 Collective Skill Evolution

  • MOSCOPT alternates skill editing, gating editing, and periodic collective evolution, accepting edits only when held-out validation performance improves.Successful-trajectory rewards are shared equally among co-activated skills; high-synergy pairs are protected, while evolution eliminates low-Q skills, reproduces top performers, and co-breeds synergistic pairs.Source: §3.2 · pp. 4–5

3.3 EditAdam: Dual-State Text Optimizer

  • EditAdam uses rejected-edit feedback and long-term memory to guide bounded text edits, yielding a unified optimizer for skills and gating without learning-rate tuning.The step buffer records rejected edits to avoid repeating failed directions; long-term memory reflects changes across epoch buffers to capture durable optimization patterns.Source: §3.3 · pp. 5–6

3.4 Implementation Designs

  • MOSCOPT supports dynamic full-mixture deployment, fixed routing from gating Q-scores, and a distilled single-skill prompt.To preserve pool diversity, it protects high-synergy pairs, mutates offspring, and injects diversity when pairwise similarity exceeds 0.85.Source: §3.4 · p. 7

4 Experimental Results

MOSCOPT achieves the best average performance across five benchmarks with Qwen3.6-Plus and improves average results across three evaluated models. The experiments compare nine baselines under a shared agent harness.

4.1 Setup

  • Evaluation covers five benchmarks, compares nine baselines, and equips each agent with Shell, Python, and Browser Search.Benchmarks are SearchQA, GPQA-Diamond, HLE, AIME, and LiveMathematician; the baselines include No Skill, 5-shot LLM Skill, Reflexion, DSPy [9], SE-Agent, OPRO, Trace2Skill [13], EvoSkill [1], and SkillOpt [20]. AIME problems from 2024–2026 are split 50/10/30 for train/validation/test with seed 42; the other benchmarks use 100/20/50 samples, adaptive stopping from 3 to 50 runs, temperature 0.8, and top-p 0.6.Source: §4.1 · p. 7

4.2 Overall Performance

  • Qwen3.6-Plus gains +12.1 points on average, StepFun 3.5 Flash +15.8 on average, and DeepSeek-V3.2 +11.8 on average across five benchmarks.Relative gains are inversely correlated with baseline strength, with the comparatively weakest model benefiting proportionally most as diverse skills compensate for capability limitations.Source: §4.2 · pp. 7–8
  • MOSCOPT achieves the best average performance on all five benchmarks with Qwen3.6-Plus, consistently improving over the no-skill and SkillOpt baselines.Gains are most pronounced on search and mathematical reasoning tasks; the results support joint skill optimization rather than routing orchestration as the source of skill-optimization effectiveness.Source: §4.2 · p. 7, Table 1 · p. 8

5 Discussion

The discussion attributes MOSCOPT’s performance to interleaved updates, adaptive selective routing, and EditAdam, and examines how skill diversity and complementarity shape deployment and training. All experiments use Qwen3.6-Plus as the backend.

5.1 Ablation Study

  • Three-phase interleaving is the most critical ablation choice; gating refinement and step-wise selection also matter, while progressive disclosure and collective co-breeding add gains.Simultaneous updates cause confounded attribution and optimization oscillation; step-wise gating uses feedback and status to select skills at each step.Source: §5.1 · p. 8, Table 2 · p. 9
  • Replacing EditAdam with simple reflect-edit reduces performance; its step buffer blocks failed directions within an epoch, while long-term memory guides historically effective edits across epochs.Strict-improvement validation ensures monotonic progress.Source: §5.1 · pp. 8–9

5.2 Deployment Mode Comparison

  • The full {S, G, K} mixture achieves the best average score; static top-Q routing degrades, and a distilled single skill is only marginally above static routing.The gating skill dynamically selects K skills per query using trajectory feedback, while consolidation dilutes specialized strengths and loses subtask-specific routing.Source: Table 3 · p. 9, §5.2 · pp. 9–10

5.1 Ablation Study

  • K=1 and K=N both reduce performance, and random gating performs substantially worse, supporting selective activation and intelligent routing.Source: §5.1 · p. 9

5.3 Synergy Analysis of MOSCOPT

  • Gating learns role assignments, activating planning skills early, computation skills mid-trajectory, and verification skills for final checks without explicit supervision.Source: §5.3 · p. 10
  • Over 78% of successful trajectories co-activate high-synergy skill pairs (C(i, j) > 3), and collective co-breeding adds 0.4 points in ablation.Source: §5.3 · p. 10
  • On average, 2–3 skills are replaced during training; eliminated skills typically have under 5% activation and over 0.9 similarity to existing skills measured via BGE.This selective pressure maintains pool diversity while removing skills that lack a complementary niche.Source: §5.3 · p. 10

6 Conclusion · A Technical Details · A.1 Structured Patch Editing

MOSCOPT jointly optimizes a skill pool with a gating scheduler, and experiments across five benchmarks and three LLMs show consistent gains over all baselines. The appendix supplements the main paper with technical specifications, including structured patch editing.

6 Conclusion

  • MOSCOPT extends skill optimization from one skill to a jointly optimized skill pool with a gating scheduler.Its three core contributions are the Mixture-of-Skills Architecture, EditAdam-based Collective Optimization, and Text-Native Routing.Source: §6 · p. 10
  • Experiments across five benchmarks and three LLMs demonstrate consistent gains over all baselines.Source: §6 · p. 10

A Technical Details

A.1 Structured Patch Editing

  • Each edit operation is structured as a patch containing one or more atomic operations.Source: §A.1 · p. 12
  • Patch operations include adding text after a designated anchor or deleting a target text segment identified after an anchor.Source: §A.1 · p. 12
  • The LLM generates edits in a structured JSON format with a reasoning field and an edits array containing operation, content, and anchor values.The example shows add and delete operations.Source: §A.1 · p. 12
  • Operations are applied sequentially, with each status tracked independently, while runtime anchor matching infers precise text offsets.Statuses can be applied, skipped, or error.Source: §A.1 · p. 12

A.2 Reflect Context Injection … Initial Gating Prompt Template.

The optimizer injects prior Reflect-call summaries and rejected-edit records into prompts, maintains epoch-local buffers, schedules edit budgets, and initializes a gating skill to select exactly K skills. These mechanisms provide context for reflection, vary edit budgets, and guide skill activation.

A.2 Reflect Context Injection

  • Reflect prompts receive prior-call summaries to avoid repeating failure analysis and rejected-edit records with score changes to discourage similar edits.A rejection record can include the step, score change, edit summary, and associated failure patterns.Source: §A.2 · p. 12

Step Buffer.

  • Each skill and the gate maintain independent step buffers that accumulate summarized failure modes and edit suggestions within an epoch, then clear at its start.This avoids cross-epoch contamination while accumulating knowledge about discovered failure patterns within the epoch.Source: Step Buffer · p. 13
  • Each skill and the gate also use an epoch-local circular FIFO rejection buffer, defaulting to capacity 10 and evicting the oldest entry when full.Records include the rejection step, before-and-after scores, an edit summary capped at 200 characters, and associated failure patterns.Source: Step Buffer · p. 13

LR Scheduler.

  • The LR scheduler offers constant, linear-decay, cosine, and autonomous modes to set the maximum edits per optimization step.The modes respectively target fixed budgets, decay from Lmax to Lmin, smooth annealing, and LLM-determined budgets.Source: LR Scheduler · p. 13
  • In autonomous mode, the LLM uses the current rollout’s hard and soft scores to choose the number of edits.Source: LR Scheduler · p. 13

Initial Gating Prompt Template.

  • The initial gating prompt directs G to select exactly K skills, favor planning early and activating at least one math-specialized skill for computation tasks.It requires the output format ACTIVATE: id1, id2.Source: Initial Gating Prompt Template · p. 13

Summary Table: Phase 1 vs. Phase 2.

Before enrichment (erich=2), the gate receives a minimal five-skill table; afterward, the table adds recent scores and activation counts.

Summary Table: Phase 1 vs. Phase 2.

  • Before enrichment (erich=2), the gate receives a minimal table listing Cautious Planner, Efficient Executor, Math Expert, Creative Thinker, and Detail Verifier.The table describes these skills as step-by-step verification, fast action, rigorous reasoning, unconventional solutions, and edge-case scrutiny.Source: Summary Table: Phase 1 vs. Phase 2 · p. 14
  • 0.91 (act=18) is Math Expert’s Recent Score; the enriched table also reports a score and activation count for each of the other four skills.Cautious Planner: 0.72 (act=15); Efficient Executor: 0.85 (act=20); Creative Thinker: 0.45 (act=10); Detail Verifier: 0.68 (act=12).Source: Summary Table: Phase 1 vs. Phase 2 · p. 14

Gate I/O Example (End-to-End). … Gating Parse Failures.

The appendix illustrates how the gate selects skills, how feedback edits its text, and how rollout outcomes update skill and pair scores. It also lists hyperparameter settings and specifies fallback behavior for parse failures.

Gate I/O Example (End-to-End).

  • With N=5 skills and K=2, the gate prompt requests exactly two IDs; the example selects Skills 2 and 3 and adds their full skill documents to the agent prompt.The displayed skill table gives Skill 2 a recent score of 0.85 and Skill 3 a score of 0.91.Source: Gate I/O Example (End-to-End) · pp. 14–15

Gating Edit Examples.

  • Gating edits discourage Skill 4 for math and suggest Skill 5 for a failing verification pairing, while reinforcing the successful Skill 2 + Skill 3 math pairing.The example reports a 92% success rate for the Skill 2 + Skill 3 pairing on computation tasks.Source: Gating Edit Examples · p. 15

A.5 Credit Assignment Example

  • Rollout rewards update per-skill means and successful-pair counts: C(2, 3) gains 2 and C(1, 3) gains 1, while the failed rollout is excluded from pair updates.The example’s next-call Q-scores are 0.65 for Skills 1 and 3 and 0.35 for Skill 5; a persistently low score with activations above cmin makes Skill 5 a possible elimination candidate.Source: §A.5 · pp. 15–16

A.6 Hyperparameter Summary

  • The hyperparameter summary sets N=10 skills, K=3 activations, M=1 replacement per cycle, and E=1 epoch between evolution cycles.It also lists task-level gating, edit budgets of Lmax=8 and Lmin=2, and R=10 capacity per skill or gate.Source: §A.6 · p. 16, Rejection buffer · p. 16

Rejection buffer

  • The rejection buffer settings include capacity R=10, a 200-character reject summary, minibatch size Mb=4, merge batch size Mg=8, and minimum activations cmin=5.The same settings list validation fraction pval=1.0 and EMA coefficient β=0.3.Source: Rejection buffer · p. 16

Gating Parse Failures.

  • If the gate output cannot be parsed into exactly K valid skill IDs, the system selects the top K by Q-score, records negative feedback, and rebuilds the gate if failures exceed 30% over consecutive optimization steps.The end-to-end example illustrates fallback selection of Skills 3 and 2 based on Q-scores 0.91 and 0.85.Source: Gate I/O Example (End-to-End) · p. 15, Gating Parse Failures · p. 17

Skill Diversity Collapse. · Credit Assignment Noise. · K = N Degeneration.

The paper addresses skill convergence, noisy credit assignment, and loss of gating meaning when K approaches N with diversity-restoration methods, safeguards against erroneous elimination, and configuration checks.

Skill Diversity Collapse.

  • When skill texts converge after repeated elimination and reproduction cycles, the method tracks pairwise similarity and triggers forced mutation above an average similarity of 0.85.The diversity metric can use edit distance or embedding cosine similarity, and forced mutation modifies 50% of the text.Source: Skill Diversity Collapse · p. 17
  • Fresh gene injection replaces the lowest-scoring skills with 1–2 entirely new skills sampled from seed prompts.Source: Skill Diversity Collapse · p. 17

Credit Assignment Noise.

  • Random activation combinations or validation noise can cause erroneous skill elimination.Source: Credit Assignment Noise · p. 17
  • To reduce noisy elimination rankings, the method smooths Q-scores with an exponential moving average and ranks only skills meeting a minimum activation threshold cmin.Source: Credit Assignment Noise · p. 17
  • Skill pairs with high co-occurrence scores C(i, j) are protected from elimination even when their individual Q-scores are low.Source: Credit Assignment Noise · p. 17

K = N Degeneration.

A.8 Comparison with SkillOpt

MOSCOPT strictly subsumes SkillOpt, with SkillOpt recovered when K=1 and N=1. The comparison contrasts their optimization, exploration, safety, costs, context requirements, and deployment characteristics.

A.8 Comparison with SkillOpt

  • At K=1 and N=1, MOSCOPT degenerates to SkillOpt: its single-skill pool has trivial ACTIVATE: 1 gating and no collective evolution.This makes MOSCOPT a strict superset and preserves backward compatibility.Source: §A.8 · pp. 17–18
  • Compared with SkillOpt’s single-skill, single-path, fixed-strategy approach, MOSCOPT uses a skill pool plus gating, multi-skill parallel exploration, phase-aware switching, and explicit synergy modeling.The comparison characterizes SkillOpt as having no synergy exploitation and MOSCOPT as explicitly modeling it.Source: §A.8 · p. 18
  • Safe editing is “Bounded + gate” for SkillOpt versus “Inherited + 3-phase” for MOSCOPT; deployment complexity is low versus medium, while local-optima resistance is low versus high.These are the comparison table’s paired characterizations.Source: §A.8 · p. 18
  • LLM calls per optimization step are O(B + R) for SkillOpt versus O(BT + N|V | + |V |) for MOSCOPT; context length is 1× skill len versus K× skill + summary.The listed call and context costs distinguish the two methods’ resource requirements.Source: §A.8 · p. 18
Loading 2609.14399v2…