Agent Skill Acquisition for Large Language Models via CycleQD

So Kuroki, Taishi Nakamura, Takuya Akiba, Yujin Tang

Training a single Large Language Model (LLM) to master multiple distinct, complex skills—such as coding, managing an operating system (OS), and querying databases (DB)—is notoriously difficult. To address this, researchers have introduced CycleQD, a novel framework that leverages evolutionary "Quality Diversity" (QD) algorithms to merge specialized LLMs into a single, multi-skilled agent. By cyclically rotating task objectives and using SVD-based mutations, CycleQD allows an 8B-parameter model to match the performance of much larger models like GPT-3.5-Turbo on complex agentic tasks without losing general language capabilities.

The Challenge of Multi-Skill Training

Standard fine-tuning approaches face two major hurdles when attempting to instill multiple skills into a single model:

  1. Data Imbalance: Finding the perfect recipe for mixing datasets is a manual, laborious process. Over-representing one task often leads to "catastrophic forgetting" of another.
  2. Misaligned Objectives: Most LLMs are trained on next-token prediction, which does not always correlate with actual task success (e.g., a model might predict the next word perfectly but fail to write a functional, executable script).

While model merging—combining the weights of specialized "expert" models—is a popular alternative, it often traps the resulting model within the "convex hull" of its parents. This means the merged model struggles to meaningfully outperform the original experts.

The CycleQD Methodology

CycleQD adapts the MAP-Elites algorithm, a staple of Quality Diversity research, for the LLM era. It maintains an "archive" of models that perform differently across tasks, allowing the system to keep sub-optimal solutions that might contain specific, useful layer configurations for future generations.

The CycleQD process cyclically swaps which task is the Quality objective and which are Behavioral Characteristics.

The framework relies on three key innovations:

  • Cyclic Adaptation: Instead of optimizing for all tasks simultaneously, CycleQD rotates its focus. In one generation, "Coding" might be the Quality metric (the primary goal), while "OS" and "DB" performance serve as Behavioral Characteristics (the diversity axes). In the next generation, these roles swap. This rotational focus eliminates the need for complex data ratio tuning.
  • Model Merging Crossover: Instead of traditional genetic crossovers that swap random parameters, CycleQD uses task vectors ($\tau = \theta_{expert} - \theta_{base}$) to merge models in weight space. This preserves the structural integrity and foundational knowledge of the LLM.
  • SVD-Based Mutation: To break out of the limitations of the initial experts, the authors use Singular Value Decomposition (SVD) to decompose the model's weight matrices. They then perturb the model along its principal components. This allows the algorithm to explore meaningful directions in the parameter space rather than adding random, destructive noise.
SVD-based mutation scales components of the task vector to explore new capabilities and break out of the convex hull of parent models.

Experimental Setup

The researchers evaluated CycleQD using a rigorous mix of agentic and general benchmarks:

  • Agentic Tasks: AgentBench (specifically the OS and DB subsets) and MBPP+ (a rigorous Python programming dataset).
  • Generalization Tasks: HumanEval+, BigCodeBench, GSM8K (math), and MMLU (general knowledge).
  • Cross-Domain Application: To prove the method's generality, CycleQD was also applied to the Segment Anything Model (SAM) for image segmentation tasks.

Key Findings

The results demonstrate that CycleQD is a powerful alternative to traditional multi-task fine-tuning:

  • Parity with Giants: A Llama-3-8B model trained with CycleQD achieved an average score of 52.4 across Coding, OS, and DB tasks. This nearly matches GPT-3.5-Turbo (53.7), despite the massive difference in parameter count.
  • Superior to Fine-Tuning: The CycleQD model outperformed a baseline model fine-tuned on all three datasets simultaneously (which scored 47.0), proving that evolutionary merging is more effective than simple data mixing.
  • Robustness: Unlike specialized experts that often crash on unrelated tasks, the CycleQD model retained strong performance on general benchmarks like GSM8K and MMLU.
  • Extrapolation via SVD: The SVD mutation proved to be the "secret sauce" that allowed the model to surpass its specialized parents, effectively stretching the skills learned during fine-tuning into new, higher-performing territories.

Limitations and Future Work

The success of CycleQD depends heavily on the compatibility of the source models; if the initial experts are too divergent, merging them might lead to model collapse.

Looking ahead, the archive of diverse, high-performing agents produced by CycleQD opens the door for Multi-Agent Collaboration, where these models could be deployed together to solve even more complex problems. Additionally, incorporating more efficient search strategies (like CMA-ME) could significantly reduce the computational overhead required to illuminate the archive.

Summary updated

BibTeX
@inproceedings{kuroki2025agent,
  author = {So Kuroki and Taishi Nakamura and Takuya Akiba and Yujin Tang},
  title = {{Agent Skill Acquisition for Large Language Models via CycleQD}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Kvdh12wGC0},
}
Figure