Search papers, labs, and topics across Lattice.
This paper addresses the challenge of optimal skill selection in large language model (LLM) agents by framing it as an optimization problem that balances task performance and token cost. The authors introduce the Best Prefix Selection (BPS) algorithm, which achieves a bicriteria approximation guarantee and significantly outperforms existing methods on a contaminated BigCodeBench variant. BPS achieves a task success rate of 0.73 while using 28% fewer tokens compared to the best released skill routers, demonstrating its efficiency and effectiveness in skill selection.
Skill selection in LLMs can be optimized to achieve a 0.73 task success rate while using 28% fewer tokens than existing methods.
Loading reusable skill documents into a bounded context window is now the primary way large language model (LLM) agents acquire task-specific capabilities, which makes skill selection a first-order determinant of task performance and token cost. Yet current agents score skills independently by semantic relevance and assemble the set by top-$k$ or greedy packing, with no quality guarantee or cost awareness on the selected set. As a result, redundant or poorly chosen skills waste scarce context tokens and can even degrade performance. We give the first model of how the selected skill set shapes execution outcomes and cast skill selection as an optimization problem: choose a skill set under a hard token budget to maximize a monotone submodular benefit minus context penalty. For this problem, we develop Best Prefix Selection (BPS), a polynomial-time algorithm, and prove, to our knowledge, the first performance guarantee for skill selection: a bicriteria $(1-1/e,1)$ approximation whose benefit coefficient is optimal in polynomial time. On a contamination-controlled BigCodeBench variant, BPS outperforms all the baselines, reaching $0.73$ measured task success versus $0.20$--$0.52$ for released skill routers, text retrievers, and the executor's own selection, on $28\%$ fewer tokens than the strongest released router.