Ming-Der Yang

Author directory

2026

Small Language Models (SLMs) struggle with tool calling, in part because a single API document often serves several usage intents and bundles the parameters of all of them into one schema, even though only a few are relevant to any given query. Providing the complete document forces the model to infer the intended usage scenario and its parameters at the same time, which lengthens the prompt and creates parameter ambiguity within a single API. We propose Dynamic Intent-Driven API Pruning. In an offline stage, an LLM decomposes each API document into Intent Units, each pairing an Intent Scenario with a Key Parameter Subset. At inference time, two-stage intent retrieval identifies the intents that match the query, and Dynamic Flat Union merges their parameter subsets into a query-specific pruned schema, keeping several intents rather than committing to a possibly incorrect top-1 choice. On 35 real-world APIs from ToolBench, our method improves argument correctness over Simulated Trial-and-Error while producing shorter prompts, with the gains concentrated on APIs that support multiple usage intents. Ablation studies confirm that both intent-driven pruning and Dynamic Flat Union reduce intra-API parameter ambiguity.