SkillComposer: Structured Skill Composition Generation for LLM Agents

This paper addresses the skill selection bottleneck faced by large language model agents in complex tasks by proposing SkillComposer, a structured skill composition generation framework. Unlike existing approaches that treat skill selection as independent retrieval or reasoning problems and ignore the strong coupling among skill subsets, quantities, and execution order, SkillComposer formalizes the process as a task-conditioned skill sequence prediction. Using a constrained autoregressive decoder, it jointly determines the activated skill subset, count, and execution order in a single decoding step. Experiments on the SkillsBench benchmark with a human-curated skill library show that SkillComposer improves pass rates by 23.1 and 18.2 percentage points over skillless baselines on GPT-5.2-Codex and Gemini-3-Pro-Preview, respectively, surpassing top-3 retrieval strategies while approaching the upper bound of golden-skill retrieval at lower prompt token cost.

Background and Context

The deployment of Large Language Models (LLMs) into real-world applications has exposed a critical bottleneck: the inability of models to effectively reason over extremely long contexts. While contemporary mainstream models have expanded their context windows to hundreds of thousands or even millions of tokens, empirical testing reveals a significant disparity between "context access" and "effective context utilization." Models can ingest and store vast amounts of information, yet they frequently fail to precisely locate and leverage relevant evidence fragments within complex reasoning tasks. This failure leads to a pronounced performance degradation as context length increases, a phenomenon often referred to as the "lost in the middle" problem or general context dilution. The core challenge lies not in the capacity to store data, but in the mechanism by which the model retrieves and applies specific, high-signal information from a noisy, expansive input stream.

To address this fundamental limitation, a novel framework named SkillComposer has been proposed. This framework introduces a structured approach to skill composition generation for LLM agents, specifically designed to handle the complexities of tool selection and execution order. Unlike traditional methods that treat skill selection as an independent retrieval or reasoning problem, SkillComposer recognizes the strong coupling between skill subsets, quantities, and their execution sequences. By formalizing this process as a task-conditioned skill sequence prediction, the framework aims to optimize how agents interact with external tools and internal capabilities. The motivation behind this approach is to move beyond simple keyword matching or semantic similarity searches, which often fail to capture the procedural dependencies required for complex multi-step tasks.

The development of SkillComposer is driven by the need for more robust and efficient agent architectures in automated programming and complex decision-making scenarios. Existing solutions often rely on static retrieval strategies or unstructured reasoning, which can lead to suboptimal tool usage and increased computational costs. SkillComposer seeks to rectify this by providing a structured paradigm for skill invocation. This involves not just selecting the right tools, but determining the optimal subset of tools, the precise number of tools to activate, and the exact order in which they should be executed. This level of granularity is essential for applications requiring high precision, such as code generation, legal document analysis, and scientific research assistance, where the sequence of operations directly impacts the validity of the outcome.

Deep Analysis

SkillComposer operates by transforming the skill selection process into a constrained autoregressive decoding problem. Instead of treating each potential skill as an independent candidate for retrieval, the framework jointly determines the activated skill subset, the count of skills, and their execution order in a single decoding step. This is achieved through a specialized decoder that enforces structural constraints, ensuring that the generated sequence of skills is logically coherent and executable. The method leverages the internal attention mechanisms of the LLM to identify relevant skills, but unlike standard attention, it applies a recursive evidence replay mechanism. This mechanism dynamically builds a query-conditioned evidence pool, reactivating key information traces within the model's internal state before the final generation phase. This approach effectively decouples evidence organization from answer generation, allowing the model to focus on the most relevant information without being overwhelmed by the full context.

The theoretical foundation of SkillComposer is rooted in an associative memory framework. In this view, the long context is treated as a massive memory repository, the user query serves as a retrieval cue, and the attention mechanism acts as the correlation process between cues and memory traces. The evidence replay process is defined as the reactivation of these traces, enhancing the model's ability to retrieve specific details. This design cleverly exploits the inherent properties of the Transformer architecture without requiring external memory modules or extensive parameter fine-tuning. By avoiding the need for model weight modifications or aggressive context pruning, SkillComposer offers a non-invasive enhancement that can be integrated into existing inference pipelines. This makes it particularly attractive for industrial applications where model stability and deployment simplicity are paramount.

Experimental validation of SkillComposer was conducted on the SkillsBench benchmark, utilizing a human-curated skill library to ensure high-quality training and evaluation data. The framework was tested on leading models, including GPT-5.2-Codex and Gemini-3-Pro-Preview. The results demonstrated significant improvements over skillless baselines, with pass rates increasing by 23.1 percentage points on GPT-5.2-Codex and 18.2 percentage points on Gemini-3-Pro-Preview. Notably, SkillComposer surpassed traditional top-3 retrieval strategies while approaching the upper bound of golden-skill retrieval performance. Crucially, it achieved this with lower prompt token costs, indicating a more efficient use of context. Ablation studies further confirmed the importance of the recursive selection process, showing that dynamically constructed evidence pools offer substantial advantages over static filtering methods. These findings underscore the efficacy of the structured composition approach in enhancing agent performance.

Industry Impact

The introduction of SkillComposer represents a significant shift in how LLM agents manage tools and skills, with profound implications for both the open-source community and industrial deployment. For the open-source community, the framework offers a low-cost, high-efficiency paradigm for optimizing long-context reasoning. Because it requires no additional training or parameter updates, researchers and developers with limited computational resources can easily adopt and replicate the method to enhance their models' performance. This democratization of advanced reasoning capabilities allows smaller teams to compete with larger entities by leveraging sophisticated inference-time strategies rather than relying solely on massive model scaling. The availability of the framework's code further encourages experimentation and innovation, potentially leading to a new wave of optimized agent architectures.

In industrial settings, SkillComposer addresses critical pain points related to accuracy and robustness in long-text tasks. Applications such as legal document review, code repository analysis, and comprehensive report summarization require precise information retrieval and logical sequencing. Traditional retrieval methods often struggle with these tasks due to noise and context dilution. SkillComposer's ability to dynamically select and sequence skills ensures that the agent focuses on the most relevant evidence, reducing errors and improving the reliability of outputs. This is particularly valuable in high-stakes environments where mistakes can have significant financial or legal consequences. The framework's compatibility with existing inference pipelines means that companies can integrate these improvements without overhauling their current infrastructure, leading to faster adoption and immediate ROI.

Furthermore, SkillComposer's theoretical insights into associative memory and attention mechanisms provide a new lens for understanding how LLMs process information. This deeper understanding can inspire future research into attention optimization and memory enhancement, potentially leading to more efficient and interpretable models. By demonstrating that structured skill composition can outperform unstructured retrieval, the framework challenges existing assumptions about agent design and encourages a more systematic approach to tool usage. This shift could influence the development of next-generation agent frameworks, which may prioritize structured reasoning and dynamic skill management as core features. The broader impact extends to the automation of complex workflows, where reliable and efficient tool invocation is essential for achieving human-level performance.

Outlook

Looking ahead, SkillComposer is poised to become a foundational tool in the field of long-context reasoning and agent-based automation. As the demand for LLMs capable of handling increasingly complex and lengthy inputs grows, the need for efficient retrieval and reasoning strategies will become even more critical. The framework's success in surpassing traditional retrieval methods while maintaining low token costs suggests that structured composition will be a key trend in future agent development. Researchers are likely to explore variations of this approach, applying the principles of constrained autoregressive decoding and recursive evidence replay to other domains such as multi-modal reasoning and real-time decision-making.

The open-source nature of the framework is expected to accelerate its adoption and refinement. Community contributions may lead to optimizations for specific model architectures, extensions to handle multi-modal inputs, and integrations with popular agent frameworks. This collaborative effort could result in a standardized set of best practices for skill management and tool invocation, reducing the fragmentation currently seen in the agent ecosystem. As more developers adopt SkillComposer, the collective knowledge gained from its application will provide valuable insights into the limitations and potential of current LLM architectures, guiding future model design and training strategies.

Ultimately, SkillComposer represents a step toward more reliable and efficient AI agents. By addressing the core challenges of context utilization and skill selection, it enables models to perform complex tasks with greater precision and lower resource consumption. This advancement is crucial for the widespread deployment of LLMs in critical applications, where accuracy and reliability are non-negotiable. As the technology matures, we can expect to see more sophisticated agent systems that leverage structured reasoning and dynamic skill composition to solve problems that were previously intractable. The journey toward fully autonomous and intelligent agents is ongoing, and frameworks like SkillComposer are essential milestones on that path, paving the way for a future where AI seamlessly integrates into complex, real-world workflows.

Sources