Upload folder using huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
configs:
|
| 3 |
+
- config_name: single_hop
|
| 4 |
+
data_files:
|
| 5 |
+
- split: train
|
| 6 |
+
path: single_hop/train-*.parquet
|
| 7 |
+
- split: test
|
| 8 |
+
path: single_hop/test-*.parquet
|
| 9 |
+
- config_name: multi_hop
|
| 10 |
+
data_files:
|
| 11 |
+
- split: train
|
| 12 |
+
path: multi_hop/train-*.parquet
|
| 13 |
+
- split: test
|
| 14 |
+
path: multi_hop/test-*.parquet
|
| 15 |
+
license: mit
|
| 16 |
+
task_categories:
|
| 17 |
+
- question-answering
|
| 18 |
+
language:
|
| 19 |
+
- en
|
| 20 |
+
tags:
|
| 21 |
+
- tool-use
|
| 22 |
+
- agents
|
| 23 |
+
- llm
|
| 24 |
+
- benchmark
|
| 25 |
+
pretty_name: When2Tool
|
| 26 |
+
size_categories:
|
| 27 |
+
- 1K<n<10K
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# When2Tool
|
| 31 |
+
|
| 32 |
+
Benchmark dataset for **"LLM Agents Already Know When to Call Tools — Even Without Reasoning"** ([arXiv:2605.09252](https://arxiv.org/abs/2605.09252)).
|
| 33 |
+
|
| 34 |
+
## Overview
|
| 35 |
+
|
| 36 |
+
When2Tool is a benchmark of 18 environments designed to study *when* LLM agents should call tools. Tasks range from trivially solvable without tools to impossible without them, across three categories of tool necessity:
|
| 37 |
+
|
| 38 |
+
- **Computational Scale** (5 envs): Calculator, Statistics, Counting, Matrix, Prime
|
| 39 |
+
- **Knowledge Boundaries** (5 envs): Retriever, Historical Year, Game Rule, Hash, Decoding
|
| 40 |
+
- **Execution Reliability** (5 envs): List Manipulation, DateTime, Code Executor, Schedule, Regex Match
|
| 41 |
+
- **Multi-hop** (3 envs): Calculator, Retriever, Code Executor (3-step chains)
|
| 42 |
+
|
| 43 |
+
Each environment has three difficulty levels (easy, medium, hard) that create a clear decision boundary between tool-necessary and tool-unnecessary tasks.
|
| 44 |
+
|
| 45 |
+
## Dataset Structure
|
| 46 |
+
|
| 47 |
+
### Configs
|
| 48 |
+
|
| 49 |
+
- `single_hop`: 15 single-hop environments (900 train / 2,250 test)
|
| 50 |
+
- `multi_hop`: 3 multi-hop environments with 3-step chains (180 train / 450 test)
|
| 51 |
+
|
| 52 |
+
### Fields
|
| 53 |
+
|
| 54 |
+
| Field | Type | Description |
|
| 55 |
+
|-------|------|-------------|
|
| 56 |
+
| `id` | int | Unique task identifier |
|
| 57 |
+
| `difficulty` | str | `easy`, `medium`, or `hard` |
|
| 58 |
+
| `multi_step` | bool | Whether the task requires multiple tool calls |
|
| 59 |
+
| `instruction` | str | The task instruction given to the agent |
|
| 60 |
+
| `env_name` | str | Environment name (e.g., `CalculatorEnv`) |
|
| 61 |
+
| `tools` | str (JSON) | Available tools for this environment |
|
| 62 |
+
| `parameters` | str (JSON) | Environment parameters (e.g., corpus for retriever) |
|
| 63 |
+
| `answer` | str | Expected final answer |
|
| 64 |
+
| `steps` | str (JSON) | Intermediate steps for multi-hop tasks |
|
| 65 |
+
| `tags` | str (JSON) | Environment and task type tags |
|
| 66 |
+
|
| 67 |
+
### Loading
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from datasets import load_dataset
|
| 71 |
+
|
| 72 |
+
# Single-hop tasks
|
| 73 |
+
ds = load_dataset("Trustworthy-ML-Lab/When2Tool", "single_hop")
|
| 74 |
+
|
| 75 |
+
# Multi-hop tasks
|
| 76 |
+
ds_mh = load_dataset("Trustworthy-ML-Lab/When2Tool", "multi_hop")
|
| 77 |
+
|
| 78 |
+
# Access a sample
|
| 79 |
+
print(ds["test"][0]["instruction"])
|
| 80 |
+
print(ds["test"][0]["env_name"])
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
## Citation
|
| 84 |
+
|
| 85 |
+
```bibtex
|
| 86 |
+
@article{sun2026when2tool,
|
| 87 |
+
title={LLM Agents Already Know When to Call Tools -- Even Without Reasoning},
|
| 88 |
+
author={Sun, Chung-En and Liu, Linbo and Yan, Ge and Wang, Zimo and Weng, Tsui-Wei},
|
| 89 |
+
journal={arXiv preprint arXiv:2605.09252},
|
| 90 |
+
year={2026},
|
| 91 |
+
url={https://arxiv.org/abs/2605.09252}
|
| 92 |
+
}
|
| 93 |
+
```
|
multi_hop/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a8bb3450f5afcc834dae260aa56e33674f5edbc9c6ce7096693198d372f634a
|
| 3 |
+
size 158017
|
multi_hop/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ce97ecbff40e1bdcab0863fc67b9aa012b7b3b5310d4935d8c28f575abe8be2
|
| 3 |
+
size 79725
|
single_hop/test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8e4997be7bf697a1d8ffa9b273c7f81c30f47a70d92d2fad40b2ad7c20cfc55
|
| 3 |
+
size 513056
|
single_hop/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ef525737e47b02f7f94badcd9b7a64d30e0387b3406fe127091d01d81c7d430
|
| 3 |
+
size 275249
|