SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.20015 · EMNLP · 2024

ToolBeHonest: A Multi-level Hallucination Diagnostic Benchmark for Tool-Augmented Large Language Models

Cheng Yang, Yujiu Yang, Chufan Shi, Xinyu Zhu, Yaxin Liu, Junjie Wang, Yuxiang Zhang, Zihao Lin, Jing Chen, Tetsuya Sakai, Tian Feng, Hanwen Wan, and 1 more

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.20015.json · badge: /api/ran/2406.20015.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
toolbehonest/toolbehonest canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
calculate_group_metrics Ran
ran, honoured the contract we drafted
toolbehonest/toolbehonest/utils/calculate_metrics.py
code served (permissive licence) · get_code("6fb1a0169bd1be3b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from itertools import chain

# Construct the metrics dictionary
# The function expects metrics to be indexed by task name, then by level
# Each level contains a list of metric dictionaries

metrics = {
    'task_1': {
        'level_1': [
            {'unsolvable': 0.5},
            {'unsolvable': 0.7}
        ],
        'level_2': [
            {'unsolvable': {'progress_rate': 0.6}},
            {'unsolvable': {'progress_rate': 0.8}}
        ],
        'level_3': [
            {'unsolvable': {'progress_rate': 0.65, 'scorers': [0.1, 0.2, 0.3]}},
            {'unsolvable': {'progress_rate': 0.75, 'scorers': [[0.4, 0.5], [0.6]]}}
        ]
    },
    'task_2': {
        'level_1': [
            {'unsolvable': 0.55}
        ],
        'level_2': [
            {'unsolvable': {'progress_rate': 0.7}}
        ],
        'level_3': [
            {'unsolvable': {'progress_rate': 0.72, 'scorers': [0.2, 0.3]}}
        ]
    }
}

# Define tasks list
tasks = ['task_1', 'task_2']

# Define level parameter
level = 'level_1'

ARGS = {
    'metrics': metrics,
    'tasks': tasks,
    'level': level
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_metrics Ran
ran, honoured the contract we drafted
toolbehonest/toolbehonest/utils/calculate_metrics.py
code served (permissive licence) · get_code("391471f665ef5fbb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from itertools import chain

# Construct the metrics dictionary structure
# The function expects: metrics[task][level] to be a list of metric dictionaries

metrics = {
    'task_1': {
        'level_1': [
            {'unsolvable': 0.85},
            {'unsolvable': 0.90},
        ],
        'level_2': [
            {'unsolvable': {'progress_rate': 0.75}},
            {'unsolvable': {'progress_rate': 0.80}},
        ],
        'level_3': [
            {
                'unsolvable': {
                    'progress_rate': 0.70,
                    'scorers': [[0.5, 0.6], [0.7]]
                }
            },
            {
                'unsolvable': {
                    'progress_rate': 0.72,
                    'scorers': [[0.55, 0.65, 0.75], [0.8, 0.9]]
                }
            },
        ]
    },
    'task_2': {
        'level_1': [
            {'unsolvable': 0.88},
            {'unsolvable': 0.92},
        ],
        'level_2': [
            {'unsolvable': {'progress_rate': 0.78}},
            {'unsolvable': {'progress_rate': 0.82}},
        ],
        'level_3': [
            {
                'unsolvable': {
                    'progress_rate': 0.68,
                    'scorers': [[0.4, 0.5], [0.6, 0.7, 0.8]]
                }
            },
        ]
    }
}

task = 'task_1'
level = 'level_1'

ARGS = {
    'metrics': metrics,
    'task': task,
    'level': level,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_progress_rate Ran
ran, honoured the contract we drafted
toolbehonest/toolbehonest/utils/evaluation_func.py
code served (permissive licence) · get_code("b3f0a50ef6d3855a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Analyzing the function:
# - pred_planning_tool_list: list that supports len() and indexing with ==
# - golden_planning_tool_list: list that supports len() and indexing with ==
# - calculate_type: string, either 'hard' or 'soft'

# The function compares lists of planning tools element-by-element
# For 'hard': stops at first mismatch, requires exact prefix match
# For 'soft': uses two pointers, allows skipping elements in pred list

# Create sample planning tool lists (using strings as tool identifiers)
pred_planning_tool_list = ['tool_a', 'tool_b', 'tool_c', 'tool_d']
golden_planning_tool_list = ['tool_a', 'tool_b', 'tool_c']

calculate_type = 'hard'

ARGS = {
    'pred_planning_tool_list': pred_planning_tool_list,
    'golden_planning_tool_list': golden_planning_tool_list,
    'calculate_type': calculate_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_scorers Ran
ran, honoured the contract we drafted
toolbehonest/toolbehonest/utils/evaluation_func.py
code served (permissive licence) · get_code("48f662460933098c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity


class MockEmbeddingModel:
    """Mock embedding model supporting both minilm and gemini interfaces"""
    def encode(self, text):
        """For minilm interface"""
        return np.random.rand(4).astype(np.float32)
    
    def __call__(self, text):
        """For gemini interface"""
        return {'embedding': np.random.rand(4).astype(np.float32)}


class MockArgs:
    def __init__(self, embedding_model='minilm'):
        self.embedding_model = embedding_model


# Create mock embedding model
emb_model = MockEmbeddingModel()

# Create task embedding structure with embeddings and names
tools_embedding = {
    'task_1': {
        'embeddings': np.random.rand(3, 4).astype(np.float32),
        'name': ['tool_a', 'tool_b', 'tool_c']
    }
}

# Construct arguments
pred_subgoal_texts = [
    'Subgoal 1: find the nearest restaurant',
    'Subgoal 2: check opening hours'
]

pred_planning_tool_list = ['UnsolvableQuery', 'tool_b']

golden_planning_tool_list = ['UnsolvableQuery', 'tool_b']

origin_provided_subgoal_dict = {
    'tool_a': 'Subgoal 1: search for restaurants',
    'tool_b': 'Subgoal 2: verify business hours',
    'tool_c': 'Subgoal 3: make reservation'
}

solvable_planning_tool_list = ['tool_a', 'tool_b']

task = 'task_1'

args = MockArgs(embedding_model='minilm')

ARGS = {
    'pred_subgoal_texts': pred_subgoal_texts,
    'pred_planning_tool_list': pred_planning_tool_list,
    'golden_planning_tool_list': golden_planning_tool_list,
    'origin_provided_subgoal_dict': origin_provided_subgoal_dict,
    'solvable_planning_tool_list': solvable_planning_tool_list,
    'emb_model': emb_model,
    'tools_embedding': tools_embedding,
    'task': task,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_hf_data Ran
ran; our contract draft was wrong, not the code
toolbehonest/toolbehonest/utils/process.py
code served (permissive licence) · get_code("4df6e9bfa123391f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function expects items to be an iterable of dicts, where each dict
# has at least a 'subtask' key. It groups items by their 'subtask' value.

items = [
    {'subtask': 'classification', 'data': torch.randn(2, 4), 'label': 0},
    {'subtask': 'classification', 'data': torch.randn(2, 4), 'label': 1},
    {'subtask': 'regression', 'data': torch.randn(2, 4), 'value': 0.5},
    {'subtask': 'regression', 'data': torch.randn(2, 4), 'value': 0.3},
    {'subtask': 'clustering', 'data': torch.randn(2, 4), 'cluster': 2},
]

ARGS = {
    'items': items
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
flatten Ran
ran, honoured the contract we drafted
toolbehonest/toolbehonest/utils/calculate_metrics.py
code served (permissive licence) · get_code("85def4810dd23c07")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The flatten function takes a single parameter 'data' which can be:
# - a list
# - a tuple
# - a numpy array
# - or nested combinations of these containing scalar elements

# Create a nested structure with lists, tuples, and numpy arrays
ARGS = {
    "data": [
        1,
        [2, 3],
        (4, 5),
        np.array([6, 7, 8]),
        [
            (9, 10),
            np.array([11, 12]),
            13
        ]
    ]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rate_limited Ran
ran; our contract draft was wrong, not the code
toolbehonest/toolbehonest/utils/generation_func.py
code served (permissive licence) · get_code("d5c69ffdd4162e91")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import time

def rate_limited(max_per_minute):
    min_interval = 60.0 / float(max_per_minute)

    def decorate(func):
        last_called = [0.0]

        def rate_limited_function(*args, **kwargs):
            elapsed = time.time() - last_called[0]
            left_to_wait = min_interval - elapsed
            if left_to_wait > 0:
                time.sleep(left_to_wait)
            last_called[0] = time.time()
            return func(*args, **kwargs)
        return rate_limited_function
    return decorate


def sample_function(x, y):
    return x + y


ARGS = {
    "max_per_minute": 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
remove_finish_if_last Ran
ran; our contract draft was wrong, not the code
toolbehonest/toolbehonest/utils/extract_func.py
code served (permissive licence) · get_code("26fbd3a16ca609af")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# Test case 1: tools list with 'finish' at the end
tools_with_finish = ['tool1', 'tool2', 'finish']

# Test case 2: tools list without 'finish' at the end
tools_without_finish = ['tool1', 'tool2', 'tool3']

# Test case 3: tools list with 'Finish' (different case)
tools_with_finish_caps = ['tool1', 'FINISH']

# Test case 4: empty tools list
tools_empty = []

# Test case 5: single 'finish' element
tools_single_finish = ['finish']

# Choose one test case for ARGS
ARGS = {
    'tools': tools_with_finish
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_tools_embeddings Not yet run
unverified (harvested, no recorded run)
toolbehonest/toolbehonest/utils/generation_func.py
code served (permissive licence) · get_code("638f0013e2a9e95f")
How it ran

no invocation recorded.

load_results Not yet run
unverified (harvested, no recorded run)
toolbehonest/toolbehonest/utils/load_save.py
code served (permissive licence) · get_code("4cfcb6ed2385c374")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Tool-augmented large language models (LLMs) are rapidly being integrated into real-world applications. Due to the lack of benchmarks, the community has yet to fully understand the hallucination issues within these models. To address this challenge, we introduce a comprehensive diagnostic benchmark, ToolBH. Specifically, we assess the LLM's hallucinations through two perspectives: depth and breadth. In terms of depth, we propose a multi-level diagnostic process, including (1) solvability detection, (2) solution planning, and (3) missing-tool analysis. For breadth, we consider three scenarios based on the characteristics of the toolset: missing necessary tools, potential tools, and limited functionality tools. Furthermore, we developed seven tasks and collected 700 evaluation samples through multiple rounds of manual annotation. The results show the significant challenges presented by the ToolBH benchmark. The current advanced models Gemini-1.5-Pro and GPT-4o only achieve total scores of 45.3 and 37.0, respectively, on a scale of 100. In this benchmark, larger model parameters do not guarantee better performance; the training data and response strategies also play crucial roles in tool-enhanced LLM scenarios. Our diagnostic analysis indicates that the primary reason for model errors lies in assessing task solvability. Additionally, open-weight models suffer from performance drops with verbose replies, whereas proprietary models excel with longer reasoning. * Equal contribution.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.20015")
get_code_for_paper("2406.20015")
have("2406.20015")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.20015.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.20015.svg)](https://syntology.ai/paper/2406.20015)

Connect an agent — have() is free.