TRACE: Task-conditioned Retrieval and Aggregation with Token-Budgeted Compilation for Executable Skill Programs in LLM Agents
Abstract
Skills provide a scalable abstraction for LLM agents by encapsulating reusable procedures, tool affordances, implementation details, validation logic, and failure-handling strategies. However, effectively leveraging large-scale skill repositories remains challenging: existing retrieval methods mainly optimize individual skill relevance, while existing compression methods often reduce context without preserving the execution structure required for multi-skill tasks. We propose TRACE, a task-conditioned skill retrieval, aggregation, and compilation framework that bridges the gap between skill retrieval and reliable execution. TRACE first constructs complementary skill bundles through requirement-conditioned graph routing with dynamic edge activation and then performs token-budgeted compilation to transform retrieved skills into compact executable programs containing dependencies, operations, validators, and fallback policies. For failed executions, TRACE further applies trace-guided repair to patch task-specific executable programs using execution traces and failure feedback without modifying the persistent skill library. Experiments on 51 multi-skill tasks show that TRACE achieves 92.16% execution success with only 2.18K estimated skill-input tokens on average, reducing skill-input cost by approximately 90% compared with raw top-20 skill injection. Moreover, trace-guided repair recovers two of four failed executions and improves the final success rate to 96.08%. Ablation studies further demonstrate the importance of role-balanced selection, validation information, and fallback guidance for reliable skill execution.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.