Generative Skill Composition for LLM Agents

Xinyu Zhao, Zhen Tan, Vaishnav Tadiparthi, Nakul Agarwal, Kwonjoon Lee, Ehsan Moradi Pari, Hossein Nourkhiz Mahjoub, Tianlong ChenarXiv 2026

TL;DR

As LLM agents increasingly rely on modular "skill libraries" to solve complex tasks, selecting the right combination of skills has become a major bottleneck. This paper introduces SkillComposer, a lightweight, generative framework that treats skill selection as an ordered sequence prediction problem. By jointly optimizing which skills to use, how many are needed, and the exact execution order in a single decoding pass, SkillComposer significantly improves downstream agent success rates while drastically reducing prompt token overhead.

What Problem Does This Paper Address?

Modern LLM agents use "skills"—modular packages of code, prompts, and instructions—to handle specialized subtasks like refactoring code or running test suites. However, as these skill libraries grow, figuring out how to deploy them efficiently at inference time is challenging.

Existing approaches generally fall into two paradigms:

  1. Direct Reasoning (Context Flooding): Exposing the agent to the entire skill library at once. This wastes context window tokens and often confuses the agent.
  2. Flat Retrieval: Using embedding similarity or an LLM-as-a-judge to rank and retrieve a subset of skills.

The core limitation of flat retrieval is that it treats skills independently. It answers which skills might be relevant, but fails to determine how many are needed or in what order they should be executed. For complex, multi-step tasks, swapping or misordering even two skills can completely break the workflow.

Comparison of SkillComposer against existing paradigms like direct reasoning and flat retrieval.

Methods

The authors formalize this challenge as Structured Skill Composition and solve it using SkillComposer, a task-conditioned skill sequence predictor. Instead of relying on a massive generalist model, SkillComposer pairs a frozen text encoder with a tiny, specialized autoregressive decoder (only ~3.9M trainable parameters).

Here is how the architecture works:

  • Task Encoding: A frozen pretrained encoder (Qwen3-Embedding-0.6B) converts the task description, environment context, and compact skill metadata into a dense vector.
  • Constrained Autoregressive Decoding: A small 3-layer Transformer decoder predicts a variable-length sequence of skill tokens from the closed vocabulary of the library, terminating with a STOP token.
  • Factorized Supervision (Auxiliary Heads): To prevent the sequence length signal from being diluted, the model incorporates two auxiliary heads during training: a cardinality head (predicting the total skill count) and a set head (predicting order-agnostic skill relevance).
  • Retrieval-Augmented Decoding: At inference time, the model fuses the decoder's contextual logits with an off-the-shelf sparse retrieval prior (TF-IDF) and the set-head scores to refine the final skill plan.

Datasets

The framework was trained and evaluated using a real, human-curated skill library consisting of 196 skills derived from SkillsBench. The authors curated a dataset of 9,872 task-skill-sequence pairs divided into three categories:

  1. Real Anchors: 65 human-authored software engineering tasks from SkillsBench, with execution orders recovered from agent trajectory logs.
  2. Single-Skill Synthetic Tasks: 2,880 records generated by Gemini 2.5 Flash to ensure uniform coverage of all 196 individual skills.
  3. Multi-Skill Synthetic Tasks: 6,927 records generated by Gemini 2.5 Pro, sampled from a structural skill dependency graph containing data-flow and workflow edges.

Key Insights and Ideas

  • The Coupling Effect: Subset selection, cardinality (count), and ordering are fundamentally non-separable dimensions of skill composition. Generating them jointly in a single decoding pass prevents cascading errors common in multi-stage retrieval pipelines.
  • Sparse Beats Dense for Priors: Surprisingly, when fusing a retrieval prior into the decoder logits at inference time, sparse TF-IDF features outperformed dense embeddings by +5.1 pp Set F1. Because skill names are short and syntactically specific, dense embeddings tend to overgeneralize, whereas token-level overlap provides a higher-precision signal.
  • Small Specialists Generalize Better: Under distribution shifts (testing on held-out real tasks after training on synthetic data), a full 600M parameter Supervised Fine-Tuning (SFT) baseline degraded sharply (-27.5 pp). Meanwhile, SkillComposer's architecture—anchored by a frozen retrieval-tuned encoder—degraded by only 11 pp, demonstrating a much more robust transfer bias.

Key Results

SkillComposer achieves state-of-the-art efficiency and accuracy across multiple benchmarks:

  • Downstream Task Success: When evaluated on SkillsBench using production-grade coding agents (GPT-5.2-Codex and Gemini-3-Pro-Preview), SkillComposer boosted pass rates by +23.1 pp and +18.2 pp respectively over the no-skill baseline.
  • Oracle-Level Performance: It matched or exceeded the performance of an "oracle" retriever (which is pre-told the exact gold skill count) while operating at a lower prompt-token cost than exposing all skills.
  • Efficiency: SkillComposer requires 154× fewer trainable parameters and 25× less training compute than full SFT, while running two orders of magnitude faster than frontier API-based LLM judges.

Limitations and Future Work

The authors note a few key limitations:

  • Short-Sequence Bias: SkillComposer exhibits a slight bias toward under-emitting skills on long-chain tasks (sequences requiring $\ge$ 2–3 skills), reflecting the composition distribution of the synthetic training data.
  • Modality & Domain Constraints: The current implementation is text-only and focused primarily on software engineering workflows.

Future work includes scaling the framework to handle multimodal task specifications (e.g., screenshots, UI elements), adapting to dynamic libraries where skills are updated online, and expanding into physical domains like robotics and scientific workflows.

Summary updated

BibTeX
@misc{zhao2026generative,
  author = {Xinyu Zhao and Zhen Tan and Vaishnav Tadiparthi and Nakul Agarwal and Kwonjoon Lee and Ehsan Moradi Pari and Hossein Nourkhiz Mahjoub and Tianlong Chen},
  title = {{Generative Skill Composition for LLM Agents}},
  year = {2026},
  eprint = {2606.32025},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.32025},
}
Figure