Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
0
744
<|start_of_role|>system<|end_of_role|>Knowledge Cutoff Date: April 2024.
Today's Date: May 05, 2026.
You are Granite, developed by IBM. You are a helpful assistant with access to the following tools. When a tool is required to answer the user's query, respond only with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the a...
<|start_of_role|>available_tools<|end_of_role|>[
{
"type": "function",
"function": {
"name": "write_file",
"description": "Write file.",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"file_path",
"content"
]
}
}
}
]<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Add the function body in solve.py based on the function definition and docstring below:
def decodeString(s: str) -> str:
"""
Decode a string encoded as k[substring] where bracketed substrings repeat k times, supporting nesting, and return the fully expanded string.
>>> decodeString('3[a]2[bc]')
'aaabcbc'
"""
pass<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>
<|start_of_role|>system<|end_of_role|>Knowledge Cutoff Date: April 2024.
Today's Date: May 05, 2026.
You are Granite, developed by IBM. You are a helpful assistant with access to the following tools. When a tool is required to answer the user's query, respond only with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the a...
<|start_of_role|>available_tools<|end_of_role|>[
{
"type": "function",
"function": {
"name": "write_file",
"description": "Write file.",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"file_path",
"content"
]
}
}
}
]<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Add the function body in solve.py based on the function definition and docstring below:
def sol_equa(n):
"""
Return all non-negative integer solutions (x, y) to x^2 - 4*y^2 = n in decreasing order of x.
>>> sol_equa(5)
[[3, 1]]
"""
pass<|end_of_text|>
<|start_of_role|>assistant<|end_of_role|>
<|start_of_role|>system<|end_of_role|>Knowledge Cutoff Date: April 2024.
Today's Date: May 05, 2026.
You are Granite, developed by IBM. You are a helpful assistant with access to the following tools. When a tool is required to answer the user's query, respond only with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the a...
<|start_of_role|>available_tools<|end_of_role|>[
{
"type": "function",
"function": {
"name": "write_file",
"description": "Write file.",
"parameters": {
"type": "object",
"properties": {
"file_path": {
"type": "string"
},
"content": {
"type": "string"
}
},
"required": [
"file_path",
"content"
]
}
}
}
]<|end_of_text|>
<|start_of_role|>user<|end_of_role|>Add the function body in solve.py based on the function definition and docstring below:
End of preview. Expand in Data Studio

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

Paper HuggingFace Dataset HuggingFace Models License: Apache 2.0

Official repository and dataset for the paper:
"How Do Agentic LLMs Decide to Call Tools? A Tool-Call Vector Shaped by Suppression"


πŸ“Œ Overview

Tool calling is central to modern agentic LLMs, yet the internal mechanism dictating whether an LLM decides to invoke an external tool or respond directly (the call-or-no-call decision) has remained poorly understood. Agentic prompts are notoriously long and complex, heavily scaffolded with role instructions, tool schemas, and format templates, making mechanistic analysis difficult.

In this work, we present a mechanistic interpretability study across diverse model families (Qwen, Mistral, Granite):

  • Minimal Contrastive Pairs: We construct minimal contrastive prompt pairs where a single request verb (e.g., an execution verb like write vs. an analysis verb like discuss) reliably flips the tool-call decision (outputting <tool_call> as the first generated token).
  • The Tool-Call Vector ($\mu_\Delta$): We trace the decision to a single internal steering vector $\mu_\Delta$, demonstrating that it is both causally necessary and sufficient to govern the tool-calling decision.
  • Scaffold Default Shaped by Suppression: Using Transcoder analysis (cross-layer Sparse Autoencoders), we uncover how this vector forms: the agentic scaffold establishes tool-calling as the baseline default, while analysis requests actively suppress this default through specific internal features that signal no tool is needed.

πŸ“‚ Dataset Structure

This repository contains the canonical contrastive datasets across multiple model architectures and domains:

datasets/
β”œβ”€β”€ granite_3p3_8b/          # IBM Granite 3.3 8B inputs
β”‚   β”œβ”€β”€ pair/                # Screened native contrastive pairs (train / heldout)
β”‚   β”œβ”€β”€ multi_domain/        # Multi-domain controls (code, retrieval, communication, ops)
β”‚   β”œβ”€β”€ tau2_bench/          # Tau2 trajectory candidate turns
β”‚   └── verb_free/           # Requests with implicit intent
β”œβ”€β”€ mistral_3p2_24b/         # Mistral 3.2 24B inputs
β”œβ”€β”€ qwen3_4b/                # Qwen3 4B inputs
β”œβ”€β”€ qwen3_8b/                # Qwen3 8B inputs (screened native + 300/200 clean reruns)
β”‚   β”œβ”€β”€ controlled/          # 1,200 train and 300 test controlled code-domain pairs
β”‚   β”œβ”€β”€ multi_domain/        # Multi-domain controls
β”‚   β”œβ”€β”€ verb_free/           # 600 cleaned requests + annotated source
β”‚   └── tau2_bench/          # Tau2 benchmark candidate turns
β”œβ”€β”€ qwen3_14b/               # Qwen3 14B inputs
β”œβ”€β”€ qwen35_4b/               # Qwen3.5 4B inputs
└── qwen35_9b/               # Qwen3.5 9B inputs

Dataset Subsets

  • pair/: Minimal contrastive prompt pairs curated to isolate the call-or-no-call decision.
  • controlled/: Code-domain prompt pairs used for precision localization and causal intervention experiments.
  • multi_domain/: Cross-domain tasks spanning code generation, database retrieval, operational workflows, and communication.
  • verb_free/: Natural prompts and requests with implicit intent to evaluate whether the mechanism generalizes beyond explicit imperative verbs.
  • tau2_bench/: Multi-turn dialogue scenarios derived from complex agent trajectories.

πŸš€ Quick Start

Using Hugging Face Datasets

You can inspect and load the dataset directly via Python:

from datasets import load_dataset

# Load the dataset from Hugging Face Hub
ds = load_dataset("XijieGong/MI4ToolCalling")
print(ds)

πŸ”¬ Key Scientific Findings

  1. First-Token Call-or-No-Call Decision: In frontier agentic models (e.g., Qwen3, Mistral), the decision to call a tool is committed at the very first generated token (<tool_call>).
  2. Causal Necessity and Sufficiency: Adding or subtracting the steering vector $\mu_\Delta$ flips the first token between direct response and <tool_call> with near-100% fidelity without degrading downstream generation quality.
  3. Suppression, Not Excitation: Transcoder feature decompositions reveal that the tool-use prompt scaffold pre-activates the tool-calling circuit. Requests that do not require tools actively recruit suppressor features to shut off the tool-calling pathway.

πŸ“– Citation

If you find this repository, dataset, or paper useful in your research, please cite:

@article{mi4toolcalling2026,
  title={How Do Agentic LLMs Decide to Call Tools? A Tool-Call Vector Shaped by Suppression},
  author={Anonymous Authors},
  journal={Advances in Neural Information Processing Systems (NeurIPS)},
  year={2026}
}

πŸ“œ License

This project and its associated datasets are licensed under the Apache License 2.0.

Downloads last month
38