Manuscript Offprint

arXiv:2610.09624

How Do Agentic LLMs Decide to Call Tools? A Tool-Call Vector Shaped by Suppression

Xijie Gong, Tingxu Han, Jiahao Zhang, Wei Song, Ziqi Ding, Hanqi Yan, Youcheng Sun, Lijie Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Tool calling, invoking external tools on demand, is central to agentic LLMs, yet the mechanism that decides whether a model calls a tool or responds directly remains poorly understood. Agentic prompts are long and heavily scaffolded, combining role instructions, tool schemas, format templates, and the user's request across hundreds of tokens, creating a noisy, highly entangled context in which no single controllable variable for mechanistic analysis is obvious. To obtain such a variable, we propose a method that converts complex agentic prompts into minimal contrastive pairs in which a single request verb determines the tool-call decision: replacing an execution-verb (e.g., write) with an analysis-verb (e.g., discuss) reliably flips the decision, suggesting it is mediated by a compact internal state. We construct 500 such paired prompts across Python, Java, and C++ (300 for mechanistic analysis, 200 held out for evaluation). We trace the decision to a vector, μΔ\mu_{\Delta}, that is both causally necessary and sufficient and generalizes beyond the discovery prompts to native multi-turn τ2\tau^{2}-Bench trajectories and verb-free requests. Behavioral ablations show that the scaffold establishes a tool-call prior; Transcoder decomposition then reveals that analysis verbs suppress this prior through features signaling that tool use is unnecessary, whereas execution verbs largely leave it intact. Downstream scaffold-reading attention heads and MLP features read out the resulting state, and the same mechanism recurs across seven models from the Qwen, Mistral, and Granite families. Our code is available at https://github.com/XijieGo/MI4ToolCalling.

1 Introduction

AI agents, from personal AI assistants to software engineering agents, are now widely deployed across industry and research. These agents are powered by agentic LLMs whose core capability is tool calling: invoking external tools on demand to act in the world. Given an agentic prompt containing a tool-call prompt scaffold (role instructions, tool schemas, and format templates) alongside the user's request, the LLM can generate a structured tool call specifying the selected tool and its arguments, enabling it to search the web, execute code [1, 2]. For any agentic prompt, the LLM faces the decision of whether to call a tool or respond directly. We call this the call-or-no-call decision. An incorrect decision causes the model to call tools unnecessarily or fail to call a tool when one is needed.

*Equal contribution †Project lead ‡Corresponding author. Lijie Hu lijie.hu@mbzuai.ac.ae

Preprint.

Figure

Figure 1: Roadmap of the paper’s mechanistic analysis. The three numbered blocks summarize the stages of our analysis: (1) verb substitution turns long agentic prompts into a controlled causal interface; (2) the call-or-no-call decision passes through a tool-call vector, μΔ\mu_{\Delta}, that is causally sufficient and necessary; and (3) this vector reflects suppression of a scaffold-induced tool-call default and generalizes across the model families. The six lettered steps show how the evidence is built.

Frontier LLMs with dedicated agentic training often signal this call-or-no-call decision through a special token. In Qwen3, for instance, <tool_call> appears as the first generated token precisely when the model decides to call a tool [3]. In this setting, the call-or-no-call decision reduces to a simple question: is <tool_call> the model's top-1 prediction for the first generated token? This makes the call-or-no-call decision tractable for mechanistic analysis: a single-token output prediction is the natural target for mechanistic tools such as activation patching and direct logit attribution.

Yet what drives this decision has not been studied mechanistically. Existing work on tool calling has focused on whether LLMs select the right tools and how to improve their accuracy [1, 4–7]. Prior mechanistic work has typically examined short prompts of 10–30 tokens, where a single variable can be varied while holding the rest fixed [8, 9]. Agentic prompts are fundamentally different: the prompt scaffold (role instructions, tool schemas, and format templates) is packed alongside the user's request across several hundred tokens. With so many components that could each plausibly influence the decision, it is not clear which single element to vary to construct a reliable contrastive pair [10, 11]. This complexity makes it hard to isolate a single controllable variable for mechanistic analysis.

However, in code completion tasks, we find that the request verb serves as a controllable variable: replacing an execution verb with an analysis verb switches the first generated token in the retained pairs. Matched prompts differ only in the request verb, preserving the prompt scaffold, task body, and available tool. We construct 500 prompt pairs for each of the seven primary models, with 300 used for mechanistic analysis and 200 held out for evaluation. The coding tasks span Python, Java, and C++, drawing from MBPP, APPS, HumanEval, and CodeContests [12–15]. By holding the surrounding prompt fixed while varying a single behaviorally decisive token, these pairs isolate a controlled interface for mechanistic analysis.

We study this mechanism primarily in Qwen3-8B and test whether it generalizes across model scales and families. Activation patching localizes the decisive residual-stream state to layer 24: patching it recovers <tool_call> on 100% of corrupt prompts. Averaging the activation difference at this layer gives the tool-call vector, μΔ\mu_{\Delta}. Adding μΔ\mu_{\Delta} to analysis-verb prompts restores <tool_call>; subtracting it from execution-verb prompts suppresses tool calling. Because these pairs are behaviorally filtered to exhibit the intended contrast, we test whether μΔ\mu_{\Delta} generalizes beyond this construction. Furthermore, μΔ\mu_{\Delta} induces and suppresses tool calls in web retrieval, SQL execution, and email dispatch with new tool schemas and request verbs. The same control extends to native decisions in multi-turn, multi-tool τ2\tau^{2}-Bench trajectories across seven models, using model-specific μΔ\mu_{\Delta} without re-estimation. Even for requests that imply a need for tools without containing the execution or analysis verbs used in our prompt pairs, subtracting μΔ\mu_{\Delta} still suppresses tool calls. The call-or-no-call decision passes through a compact tool-call vector shared across prompts.

The natural hypothesis is that execution verbs actively generate a tool-call signal. Our evidence points to a different picture. The prompt scaffold establishes a tool-call prior: the role instructions, tool schemas, and format templates bias the model toward predicting <tool_call> first on task-bearing requests rather than empty or unrelated turns. Analysis verbs activate a family of features that signal the tool is unnecessary; they write against this prior through layers 21–23. Execution verbs do not activate them and leave the prior intact. μΔ\mu_{\Delta} is the inverse direction of the suppression signal that these features write into the residual stream. Downstream, scaffold-reading heads shift attention toward the tool-format template and MLP blocks support the opening of a tool-call sequence; both effects weaken when the suppression features are active. The mechanism replicates across the Qwen3-family and additional models, and structurally mirrors refusal [16]: a strong prior is present, and a compact suppressor overrides it. A scaffold-component ablation confirms this pattern behaviorally: the format template alone installs the near-ceiling call prior, and the tool schema makes it sensitive to wording.

To summarize, we make four contributions: (1) A first-generated-token target and controlled prompt pairs provide a clean causal interface for studying the call-or-no-call decision in long, scaffolded prompts (Section 2). (2) A tool-call vector μΔ\mu_{\Delta} at the layer-24 prediction position is causally necessary and sufficient for the call-or-no-call decision, and this control extends unchanged to real multi-turn agent trajectories and to requests with no cued verb at all (Section 3, Section 4). (3) μΔ\mu_{\Delta} is the inverse of the suppression signal that features activated by analysis-verbs write against a scaffold-induced, request-sensitive call prior; a scaffold-component ablation clarifies this prior behaviorally (Section 5). (4) Downstream attention heads and MLP blocks read this vector into the first generated token, and the same mechanism extends across Qwen3 and additional models (Section 6, Section 7).

References (58)