Do LLMs Know Tool Irrelevance? Demystifying Structural Alignment Bias in Tool Invocations
Authors: Yilong Liu, Xixun Lin, Pengfei Cao, Ge Zhang, Fang Fang, Yanan Cao
Organizations: Institute of Information Engineering, Chinese Academy of Sciences, Beijing, China · School of Cyber Security, University of Chinese Academy of Sciences, Beijing, China · Institute of Automation, Chinese Academy of Sciences, Beijing, China · School of Computer Science and Technology, Donghua University, Shanghai, China
Large language models (LLMs) have demonstrated impressive capabilities in utilizing external tools. In practice, however, LLMs are often exposed to tools that are irrelevant to the user's query, in which case the desired behavior is to refrain from invocations. In this work, we identify a widespread yet overlooked mechanistic flaw in tool refusal, which we term structural alignment bias: Even when a tool fails to serve the user's goal, LLMs still tend to invoke it whenever query attributes can be validly assigned to tool parameters. To systematically study this bias, we introduce SABEval, a new dataset that decouples structural alignment from semantic relevance. Our analysis shows that structural alignment bias induces severe tool-invocation errors in LLMs, yet remains largely unaccounted for in existing evaluations. To investigate the internal mechanisms underlying this bias, we propose Contrastive Attention Attribution, which reveals two competing pathways for semantic checking and structural matching. The relative strength of these pathways drives LLMs' tool invocation decisions. Based on these findings, we further introduce a rebalancing strategy that effectively mitigates structural alignment bias, as demonstrated by extensive experiments, without degrading general tool-use capabilities.
Figures & tables
Figure 1: Illustration of erroneous tool invocation driven by the model’s strong reliance on structural alignment.
Figure 2: SABEval construction with three steps. Samples are semantically irrelevant but structurally aligned.
Model
Random
SABEval
Δ
Qwen3-4B
0.16
40.04
+39.88
Qwen3-8B
0.04
34.26
+34.22
Qwen3-14B
0.04
41.86
+41.82
ToolACE-2.5-8B
0.12
40.67
+40.55
Watt-Tool-8B
0.00
10.51
+10.51
Table 1: Tool invocation rate (%) on randomly paired samples and SABEval ( D0 ).
Figure 3: Tool invocation rate (%) on SABEval subsets D0,…,D4 with increasing structural alignment degree.
User Query: Can you tell me if ‘ Spider-Man: Miles Morales ’ is on sale on the Canadian PlayStation Store?
Original Tool: check_ nintendo_switch _game_on_sale Params: game_title , region
Counterfactual
Strategy
Tool Name
Parameters
Structural
Param Substitution
check_ nintendo_switch _game_on_sale
game_title , include_dlc
Param Removal
check_ nintendo_switch _game_on_sale
game_title
Param Addition
check_ nintendo_switch _game_on_sale
game_title , region , include_dlc
Semantic
Target Tool
check_ playstation _game_on_sale
game_title , region
Table 2: Example of counterfactuals. We construct structural counterfactuals by intervening on the original tool parameters via three strategies ( substitution , removal , and addition ) while retaining the original query. The semantic counterfactual includes a valid tool that serves the user’s goal, which is utilized for pathway discovery in § 5.1 .
Figure 4: Tool invocation rate (%) on original samples and their structural counterfactuals from D1 .
Figure 5: Semantic (left) and structural (right) pathways in Qwen3-8B from top- k attention weights ( k=23 , corresponding to 2% of the attention heads).
Model
Method
SABEval ↓
ACEBench ↑
D0
D1
D2
D3
D4
Single
Parallel
Qwen3-4B
Base
37.61
57.85
73.41
85.56
89.76
65
60
Prompt
27.12
42.20
56.83
69.71
75.95
66
57
CAA (Ours)
8.29
14.29
20.29
27.76
36.00
63
61
Qwen3-8B
Base
30.39
51.61
66.29
75.56
82.44
71
62
Prompt
19.90
34.29
48.73
57.66
66.20
72
66
Table 3: Evaluation results on all subsets of SABEval and ACEBench. We report the tool invocation rate ( ↓ ) on SABEval and accuracy ( ↑ ) on ACEBench. Base denotes the performance of the original model.
Figure 6: Comparison of pathway strengths between invocation and non-invocation cases for Qwen3-8B.
Figure 7: TIR under different scaling coefficients for Qwen3-8B ( k=23 ).
Appendix figures & tables31 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Distribution of derived class counts (left) and parameter counts (right) across tool templates.
Figure 9: Tool invocation rate (%) across 10 randomly sampled tool templates. The red line denotes the overall TIR aggregated over these 10 groups, while the gray lines represent individual tool template groups.
Model
Add
Remove
Substitute
Qwen3-4B
38.81
68.57
70.30
Qwen3-8B
42.65
72.67
76.71
Qwen3-14B
42.43
66.48
73.76
ToolACE-2.5-8B
81.92
80.55
90.65
Watt-Tool-8B
86.63
91.05
96.45
Appendix
Table 4: Percentage of samples in which the probability of wtool drops by more than 5% relative to its original value under structural counterfactuals.
Models
Original
Instantiate Param Count
1
2
3
4
sim(t,q)
52.26
54.72
57.48
60.57
63.09
Qwen3-4B
89.76
87.39
81.56
73.50
65.11
Qwen3-8B
83.05
77.64
71.60
64.30
57.07
Qwen3-14B
90.44
88.10
82.14
77.96
70.99
ToolACE-2.5
71.47
69.66
70.00
66.71
63.09
Appendix
Table 5: TIR for cases flattened with different numbers of parameters (from D4 of SABEval). The similarity score sim(t,q) is also reported.
User Query: I need hiking shoes recommendations for males dealing with overpronation .
Tool Name: sandals _prep
Original
Tool Description: Provides a specific list of sandals recommendations for common foot conditions.
Tool Parameters: foot_condition , gender
Flattened
Tool Description: Provides a specific list of male sandals recommendations for common foot conditions.
Tool Parameters: foot_condition
Appendix
Table 6: An illustration of the structurally flattened case.
Table 7: Tool-call tokens wtool , their string representations, and concrete tool-call formats
Model
Refusal tokens
Refusal tokens string
Example refusal
Qwen3 family
{785, 40, 4064, 2132}
{"The", "I", "None", "It"}
“ It seems there might be a misunderstanding. The provided function is for comparing VR headsets, not drones. If you’d like to compare VR headsets……”
ToolACE-2.5-8B
{791, 40}
{"The", "I"}
“ I ’m sorry, but I can only provide the current price for a game on the PlayStation platform. I do not have access to GOG prices.”
Watt-Tool-8B
{791, 40}
{"The", "I"}
“ The given question lacks the parameters required by the function. The available function is for basketball, not lacrosse.”
Appendix
Table 8: Refusal tokens for each model, corresponding string representations, and an example refusal. These tokens cover over 98% of refusal cases.
Strategy
Qwen3-8B
Qwen3-14B
Disabled
Enabled
Disabled
Enabled
Original
47.2
30.8
50.8
29.2
Substitute
21.6
15.6
26.8
14.0
Appendix
Table 9: TIR (%) with thinking mode disabled and enabled on Qwen3-8B and 14B models, evaluated on a subset of D1 .
Strategy
Qwen3-4B
Qwen3-8B
Qwen3-14B
Qwen3-32B
Original
60.44
53.43
60.40
62.22
Add
52.85
46.20
50.24
55.41
Remove
33.80
26.08
35.27
41.52
Substitute
32.08
23.17
29.90
34.47
Appendix
Table 10: TIR (%) across different Qwen3 model sizes on D1 .
Method
D0
D1
D2
D3
D4
Base
30.39
51.61
66.29
75.56
82.44
Prompt
19.90
34.29
48.73
57.66
66.20
CAA (Ours)
4.29
6.49
7.27
8.98
11.12
One-shot (r)
63.71
84.05
91.22
94.78
96.98
One-shot (s)
30.54
49.37
60.14
69.80
79.95
Fine-tuning
1.41
2.48
2.10
3.51
4.39
Appendix
Table 11: TIR (%) of additional baselines on Qwen3-8B across SABEval. (r) and (s) denote raw and summarized one-shot formats, respectively.
Figure 10: Pathways in Qwen3-4B.
Figure 11: Pathways in Qwen3-14B.
Figure 12: Pathways in ToolACE-2.5-8B.
Figure 13: Pathways in Watt-Tool-8b.
Figure 14: Comparison of pathway strengths between invocation and non-invocation cases for Qwen3-4B.
Figure 15: Comparison of pathway strengths between invocation and non-invocation cases for Qwen3-14B.
Figure 16: Comparison of pathway strengths between invocation and non-invocation cases for ToolACE-2.5-8B.
Figure 17: Comparison of pathway strengths between invocation and non-invocation cases for Watt-Tool-8B.
Figure 18: Pathway strengths across degrees of structural alignment for Qwen3-8B and ToolACE-2.5-8B.
Figure 19: TIR at different top- k thresholds under varying scaling coefficients for Qwen3-4B.
Figure 20: TIR at different top- k thresholds under varying scaling coefficients for Qwen3-8B.
Figure 21: TIR at different top- k thresholds under varying scaling coefficients for Qwen3-14B.
Figure 22: TIR at different top- k thresholds under varying scaling coefficients for ToolACE-2.5-8B.
Figure 23: TIR at different top- k thresholds under varying scaling coefficients for Watt-Tool-8B.
Span Name
Span Content
system-start
“<|im_start|>system\n”
tool-instruction
“# Tools\n\nYou may call one or more functions to assist with the user query.\n\nYou are provided with function signatures within <tools></tools> XML tags:\n”
tool-start
“<tools>\n”
tool-definition
tool definition
tool-end
“</tools>\n\n”
output-instruction
For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:\n<tool_call>\n"name": <function-name>, "arguments": <args-json-object>\n</tool_call>
Appendix
Table 12: Spans for Qwen3 models (4B, 8B, and 14B).
Span Name
Span Content
BOS
“<|begin_of_text|>”
system-start
“<|start_header_id|>system<|end_ header_id|>\n\n”
background
“Cutting Knowledge Date: December 2023\nToday Date: …\n\n”
tool-instruction
“You are an expert in composing functions. You are given a question and a set of possible functions. Based on the question, you will need to make one or more function/tool calls to achieve the purpose.\nIf none of the function can be used, point it out. If the given question lacks the parameters required by the function, also point it out.\nYou should only return the function call in tools call sections.\n\n”
output-instruction
“If you decide to invoke any of the function(s), you MUST put it in the format of [func_name1(params_ name1=params_value1, params_name2=params_value2…), func_name2(params)]\nYou SHOULD NOT include any other text in the response.\n”
tool-start
“Here is a list of functions in JSON format that you can invoke.\n”
Appendix
Table 13: Spans for ToolACE-2.5-8B and Watt-Tool-8B models (identical partitioning, except Watt-Tool-8B has no background span).
Figure 24: An example annotation illustrating a base class, derived classes, and a tool template.
Figure 25: Query-generation prompt used during dataset construction.
Figure 26: Prompt for adding additional parameters during dataset extension.
Figure 27: Default system prompt for Qwen3-4B, Qwen3-8B and Qwen3-14B
Figure 28: Default system prompt for ToolACE-8B and Watt-Tool-8B
Tool-augmented LLMs invoke external functions to extend their capabilities, but errors in the invocation decision, such as calling a tool when none is needed or omitting a needed call, can produce unreliable outputs and unnecessary cost. A lightweight remedy is to prepend retrieved examples so LLMs decide tool use in context. However, existing retrievers rank examples by semantic similarity alone. Lexically close or semantically close queries can require opposite behavior, so the retrieved examples may be behaviorally inconsistent and silently mislead the model. We propose Behavior Aligned Retrieval (BAR), a backbone-agnostic training recipe that teaches a dense retriever a behavior-aware similarity, keeping semantically related candidates close only when their tool-use behavior is compatible. BAR does not predict invocation labels; instead, it ranks demonstrations while leaving the final tool-use decision to the LLM. Applied to multiple retrieval backbones, including BERT, Contriever, and Qwen-based representation backbone, BAR consistently improves invocation reliability and reduces unnecessary API calls across 14 LLMs and 3 benchmarks.
Yixin Chen, Ying Xiong, Shangyu Wu +4
City University of Hong Kong · Mohamed Bin Zayed University of Artificial Intelligence · McGill University
Large language models (LLMs) are increasingly deployed with external tools that extend what they can do beyond their own knowledge. Tools help on tasks that need external information, but their availability may also change how a model handles questions that do not need them. Prior work has mostly asked whether models select and use tools appropriately; whether an unnecessary tool changes the correctness of answers has received less attention. We ask whether making a related but unnecessary tool available affects a model's ability to answer from its own knowledge, and whether a preceding tool interaction changes this behaviour. We construct 500 query pairs across 10 knowledge domains. Each pair consists of a tool query, which needs the domain's tool, and a closed-domain query, which does not. Six LLMs are evaluated with the tool unavailable, available, and available after a prior tool call. Across 3,000 baseline trials the pooled answer rate is 98.2%. When an unnecessary tool is available it falls to 63.5%, with large differences between models. The decrease occurs even when the tool is rarely called, so it cannot be explained by unnecessary tool invocation alone. A one-sentence scope-aware system instruction recovers most of the lost answers.
Saanvi Paturi, Arsen Kenzhebayev, Arham Sethi +3
Spark AI Research · UWCSEA East Campus · Haileybury Astana +2
Equipping LLMs with external tools effectively addresses internal reasoning limitations. However, it introduces a critical yet under-explored phenomenon: tool overuse, the unnecessary tool-use during reasoning. In this paper, we first reveal this phenomenon is pervasive across diverse LLMs. We then experimentally elucidate its underlying mechanisms through two key lenses: (1) First, by analyzing tool-use behavior across different internal knowledge availability regions, we identify a knowledge epistemic illusion: models misjudge internal knowledge boundaries and fail to accurately perceive their actual knowledge availability. To mitigate this, we propose a knowledge-aware epistemic boundary alignment strategy based on direct preference optimization, which reduces tool usage in by 82.8% while yielding an accuracy improvement. (2) Second, we establish a causal link between reward structures and tool-use behavior by visualizing the tool-augmented training process. It reveals that outcome-only rewards inadvertently encourage tool overuse by rewarding only final correctness, regardless of tool efficiency. To verify this, we balance reward signals during training rather than relying on outcome-only rewards, cutting unnecessary tool calls by 66.7% (7B) and 60.7% (32B) without sacrificing accuracy. Finally, we provide theoretical justification in this two lenses to understand tool overuse.
Yirong Zeng, Shen You, Yufei Liu +9
Harbin Institute of Technology, SCIR · Huawei Technologies Co., Ltd · Peking University