SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.08197 · ICLR · 2025

From Exploration to Mastery: Enabling LLMs to Master Tools via Self-Driven Interactions

Jun Xu, Ji-Rong Wen, Shuaiqiang Wang, Dawei Yin, Changle Qu, Sunhao Dai, Wei Xiaochi, Hengyi Cai

arXiv · PDF · Open in the Atlas

Code that ran

17 of 27 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; 2 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 13 failures of our instrument; 10 no recorded run), measured 2026-11-23; 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/2410.08197.json · badge: /api/ran/2410.08197.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
quchangle1/draft canonical (classifier label)
classifier basis: classifier_2025
7 ran · 0 no recorded run
quchangle1/DRAFT marked official in Papers with Code
Papers with Code archive
10 ran · 10 no recorded run
FunctionStatusWhere it lives
Info Ran
ran on a synthesized input
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("90652e52f646264e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

INIT_ARGS = {
    'category': 'text_processing',
    'tool_name': 'string_utils',
    'api_name': 'strip_whitespace',
    'tool_input': {'text': 'hello world', 'mode': 'both'},
    'strip': 'leading'
}

ARGS = {}

METHOD = 'model_dump'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, pydantic, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
answer_check Ran
ran, honoured the contract we drafted
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("8fa191b03e06ca45")
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 int, ndim 0, 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 openai
from unittest.mock import Mock, patch

# Mock the OpenAI API to avoid actual network calls
def mock_chat_completion_create(**kwargs):
    return {
        'choices': [
            {
                'message': {
                    'content': '```json{"Reason": "The response accurately answers the question", "Choice": "Yes"}```'
                }
            }
        ]
    }

# Patch openai.ChatCompletion.create before defining ARGS
with patch('openai.ChatCompletion.create', side_effect=mock_chat_completion_create):
    ARGS = {
        'question': 'What is the capital of France?',
        'answer': 'The capital of France is Paris.',
        'model_name': 'gpt-3.5-turbo'
    }
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (fixture:AttributeError)
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
change_name Ran
ran, honoured the contract we drafted
quchangle1/draft/Cal_path_rate.py
code served (permissive licence) · get_code("80196c9b6d0a1371")
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) and returned str. 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

def change_name(name):
    change_list = ['from', 'class', 'return', 'false', 'true', 'id', 'and', '', 'ID']
    if name in change_list:
        name = 'is_' + name.lower()
    return name

# The function takes a single parameter 'name' which is a string
# It checks if the name is in a predefined list and transforms it if so
# Otherwise returns the name unchanged

ARGS = {
    'name': 'from'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
change_name Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("b273ba46971479bb")
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) and returned str. 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)

# Analyzing the function:
# - change_name takes a single parameter 'name' which is a string
# - The function checks if name is in a predefined list
# - If it is, it transforms it to 'is_' + name.lower()
# - Returns the (possibly modified) name

# Test with a name that IS in the change_list
ARGS = {
    'name': 'class'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
choose_parameter Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("20b0113771cb17f2")
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 openai
from unittest.mock import Mock, patch

# Mock the openai.ChatCompletion.create to avoid actual API calls
def mock_chat_completion_create(model, messages, temperature, top_p, max_tokens):
    """Mock OpenAI API response"""
    return {
        'choices': [
            {
                'message': {
                    'content': '```json\n{"Parameters": {"keyword": "test", "language": "en"}}\n```'
                }
            }
        ],
        'error': None
    }

# Patch openai.ChatCompletion.create before calling the function
with patch('openai.ChatCompletion.create', side_effect=mock_chat_completion_create):
    pass

# Define the arguments for choose_parameter
ARGS = {
    'API_instruction': 'This is a sample API documentation. It has required parameters: keyword (string), optional parameters: language (string), region (string). Example: GET /search?keyword=test&language=en',
    'question': 'Search for information about artificial intelligence in English',
    'model_name': 'gpt-3.5-turbo'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
choose_parameter_depend Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("6925fcd2a5d56794")
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 json
from unittest.mock import patch, MagicMock

# Mock the openai module since we can't make real API calls
import sys
from types import ModuleType

openai_mock = ModuleType('openai')
openai_mock.ChatCompletion = MagicMock()
sys.modules['openai'] = openai_mock

# Create mock response
mock_response = {
    'choices': [
        {
            'message': {
                'content': '```json\n{"Parameters": {"keyword": "test", "language": "English"}}\n```'
            }
        }
    ]
}

openai_mock.ChatCompletion.create = MagicMock(return_value=mock_response)

# Now define the arguments
ARGS = {
    'API_instruction': '''
    API Documentation:
    Name: Search API
    Required Parameters:
      - keyword (string): Search term
    Optional Parameters:
      - language (string): Language code
    Example: {"Parameters": {"keyword": "Artificial Intelligence", "language": "English"}}
    ''',
    'question': 'Search for information about machine learning in English',
    'previous_log': 'Previous question: What is AI? Answer: Artificial Intelligence is...',
    'model_name': 'gpt-3.5-turbo'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
choose_tool Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("e0e1e1a4f708f8c7")
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 json
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Mock the openai module since we can't make real API calls
mock_openai = Mock()
mock_response = {
    'choices': [{'message': {'content': '```json{"ID": 1}```'}}],
    'error': None
}
mock_openai.ChatCompletion.create.return_value = mock_response

# Create Tool_dic with sample tools
Tool_dic = [
    {'ID': 1, 'name': 'SearchTool', 'description': 'Search the web'},
    {'ID': 2, 'name': 'CalculatorTool', 'description': 'Perform calculations'},
    {'ID': 3, 'name': 'TranslatorTool', 'description': 'Translate text'},
]

# Create tool_used set
tool_used = set()

# Model name
model_name = 'gpt-3.5-turbo'

# Question for the function
question = "What is the capital of France?"

ARGS = {
    'question': question,
    'Tool_dic': Tool_dic,
    'tool_used': tool_used,
    'model_name': model_name,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai, 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
cosine_similarity Ran
ran, violated the contract we drafted
quchangle1/draft/DRAFT.py
code served (permissive licence) · get_code("fe3dcc49d4415434")
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) and returned float64, 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 numpy as np

# Create two simple vectors for cosine similarity computation
vec1 = [1.0, 2.0, 3.0, 4.0]
vec2 = [5.0, 6.0, 7.0, 8.0]

ARGS = {
    "vec1": vec1,
    "vec2": vec2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 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
dict_shorten Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("1baad03523efe558")
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)

# Construct origin dict with nested structure matching schema
origin = {
    "model_name": "bert",
    "config": {
        "hidden_size": 768,
        "num_layers": 12,
        "dropout": 0.1,
        "extra_field": "remove_me"
    },
    "layers": [
        {
            "weight": 0.5,
            "bias": 0.1,
            "unused": "drop_this"
        },
        {
            "weight": 0.3,
            "bias": 0.2,
            "unused": "drop_this"
        }
    ],
    "remove_top_level": "this_should_go"
}

# Construct schema dict that defines which keys to keep
schema = {
    "model_name": None,
    "config": {
        "hidden_size": None,
        "num_layers": None,
        "dropout": None
    },
    "layers": [
        {
            "weight": None,
            "bias": None
        }
    ]
}

ARGS = {
    "origin": origin,
    "schema": schema
}
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
get_response Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("e247a2919937c8b6")
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 str. 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 openai

# Mock the openai.ChatCompletion.create to avoid actual API calls
class MockResponse:
    def __init__(self):
        self.data = {
            'choices': [
                {
                    'message': {
                        'content': 'This is a mock response from the model.'
                    }
                }
            ]
        }
    
    def get(self, key, default=None):
        return self.data.get(key, default)
    
    def __getitem__(self, key):
        return self.data[key]

# Patch openai.ChatCompletion.create
original_create = openai.ChatCompletion.create if hasattr(openai.ChatCompletion, 'create') else None

def mock_create(model, messages, temperature, top_p, max_tokens):
    return MockResponse()

openai.ChatCompletion.create = mock_create

# Define the arguments
ARGS = {
    'messages': [
        {'role': 'user', 'content': 'Hello, how are you?'},
        {'role': 'assistant', 'content': 'I am doing well, thank you!'}
    ],
    'temperature': 0.2,
    'top_p': 1,
    'max_tokens': 2000,
    'model': 'gpt-3.5-turbo'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
observation_shorten Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("a3869e242f4b29e5")
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 str. 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 json
import random
import os
import re
import tempfile
import shutil

# Create a temporary directory structure for schema files
temp_dir = tempfile.mkdtemp()
schema_root = temp_dir

# Create category and tool directories
category = "test_category"
tool_name = "test_tool"
api_name = "test_api"

category_path = os.path.join(schema_root, category)
os.makedirs(category_path, exist_ok=True)

# Create a schema JSON file
schema_dict = {
    "api_list": [
        {
            "name": "test_api",
            "schema": {
                "field1": {},
                "field2": {},
                "nested": {
                    "subfield1": {},
                    "subfield2": {}
                }
            }
        }
    ]
}

schema_file = os.path.join(category_path, tool_name + '.json')
with open(schema_file, 'w') as f:
    json.dump(schema_dict, f)

# Create response dict with a nested structure
response_dict = {
    "response": {
        "field1": "value1",
        "field2": "value2",
        "field3": "extra_field_not_in_schema",
        "nested": {
            "subfield1": "sub_value1",
            "subfield2": "sub_value2",
            "subfield3": "extra_sub_field"
        }
    }
}

ARGS = {
    "schema_root": schema_root,
    "response_dict": response_dict,
    "category": category,
    "tool_name": tool_name,
    "api_name": api_name,
    "strip_method": "filter"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
prepare_tool_name_and_url Ran
ran; our contract draft was wrong, not the code
quchangle1/draft/Inference_DFSDT.py
code served (permissive licence) · get_code("99eef45bc570d9d0")
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) and returned tuple, 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.

class MockInfo:
    def __init__(self):
        self.category = "Image Processing"
        self.tool_name = "image_resize"
        self.api_name = "resize_image"

ARGS = {
    "tools_root": "my_tools",
    "info": MockInfo()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 tuple, ndim 1, dtype family float — a tuple 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
process_error Ran
ran; our contract draft was wrong, not the code
quchangle1/draft/Inference_DFSDT.py
code served (permissive licence) · get_code("2e8458283ddaa9b4")
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) and returned tuple, 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

# The function process_error takes a single parameter 'response'
# It checks if various error strings are present in str(response)
# So response can be any object that has a meaningful string representation

# Create a simple response object that will trigger one of the error conditions
class MockResponse:
    def __init__(self, message):
        self.message = message
    
    def __str__(self):
        return self.message

# Create a response that contains an error message
response = MockResponse("Unauthorized access to the API")

ARGS = {
    'response': response
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
process_name Ran
ran; our contract draft was wrong, not the code
quchangle1/draft/Cal_path_rate.py
code served (permissive licence) · get_code("9103b4347a03d6f5")
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) and returned str. 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 json
import re

def change_name(name):
    change_list = ['from', 'class', 'return', 'false', 'true', 'id', 'and', '', 'ID']
    if name in change_list:
        name = 'is_' + name.lower()
    return name

def standardize(string):
    res = re.compile('[^\\u4e00-\\u9fa5^a-z^A-Z^0-9^_]')
    string = res.sub('_', string)
    string = re.sub('(_)\\1+', '_', string).lower()
    while True:
        if len(string) == 0:
            return string
        if string[0] == '_':
            string = string[1:]
        else:
            break
    while True:
        if len(string) == 0:
            return string
        if string[-1] == '_':
            string = string[:-1]
        else:
            break
    if string[0].isdigit():
        string = 'get_' + string
    return string

def process_name(name):
    return change_name(standardize(name))

ARGS = {
    'name': 'Hello-World_123'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
run Ran
ran; our contract draft was wrong, not the code
quchangle1/draft/Inference_DFSDT.py
code served (permissive licence) · get_code("8a54f4acce793e65")
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) and returned tuple, 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

torch.manual_seed(0)

# Construct valid arguments for the run function

# toolbench_code_string: a string containing Python code that defines a function
toolbench_code_string = """
def sample_api(param1, param2):
    return {'result': 'success', 'data': [param1, param2]}
"""

# toolbench_api_name: the name of the function to call
toolbench_api_name = "sample_api"

# toolbench_input_params_str: string representation of parameters to pass to the function
toolbench_input_params_str = "'hello', 'world'"

ARGS = {
    'toolbench_code_string': toolbench_code_string,
    'toolbench_api_name': toolbench_api_name,
    'toolbench_input_params_str': toolbench_input_params_str
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
standardize Ran
ran; our contract draft was wrong, not the code
quchangle1/draft/Cal_path_rate.py
code served (permissive licence) · get_code("c25f57d20852531f")
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) and returned str. 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 re

def standardize(string):
    res = re.compile('[^\\u4e00-\\u9fa5^a-z^A-Z^0-9^_]')
    string = res.sub('_', string)
    string = re.sub('(_)\\1+', '_', string).lower()
    while True:
        if len(string) == 0:
            return string
        if string[0] == '_':
            string = string[1:]
        else:
            break
    while True:
        if len(string) == 0:
            return string
        if string[-1] == '_':
            string = string[:-1]
        else:
            break
    if string[0].isdigit():
        string = 'get_' + string
    return string


# Test cases for the standardize function
ARGS = {
    "string": "Hello___World!!!123"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
task_decompose Ran
ran; our contract draft was wrong, not the code
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("1f9fe0a7c687f7f6")
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 openai
from unittest.mock import Mock, patch

# Mock the OpenAI API to avoid actual network calls
def mock_chat_completion_create(**kwargs):
    return {
        'choices': [
            {
                'message': {
                    'content': '```json\n{"Tasks": ["Task 1: Find information", "Task 2: Process data"]}\n```'
                }
            }
        ]
    }

# Patch openai.ChatCompletion.create before defining ARGS
with patch('openai.ChatCompletion.create', side_effect=mock_chat_completion_create):
    pass

# Define the arguments for task_decompose function
ARGS = {
    'question': 'What is the capital of France and what is its population?',
    'Tool_dic': {
        'search': 'Search for information on the web',
        'calculator': 'Perform mathematical calculations',
        'database': 'Query a database for facts'
    },
    'model_name': 'gpt-3.5-turbo'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
answer_generation Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("4a851234c230b4f3")
How it ran

no invocation recorded.

answer_generation_depend Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("166d885b223fec87")
How it ran

no invocation recorded.

answer_summarize Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("f092dbfafd36bcc8")
How it ran

no invocation recorded.

choose_API Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("e1ed82e16201c68a")
How it ran

no invocation recorded.

get_rapidapi_response Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("54fedb6237f6f7d5")
How it ran

no invocation recorded.

openai_response Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("721a78b42e639559")
How it ran

no invocation recorded.

retrieval Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("cdac1abe959ba09c")
How it ran

no invocation recorded.

task_execution Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("8be639625e74f9fc")
How it ran

no invocation recorded.

task_topology Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("19a64bf2fd72679c")
How it ran

no invocation recorded.

update_progress Not yet run
unverified (harvested, no recorded run)
quchangle1/DRAFT/Inference_DFSDT.py
code served (permissive licence) · get_code("479a78407b99eb56")
How it ran

no invocation recorded.

Also present in other papers' code

Of 27 samples lifted from this paper's linked repositories, 27 carry a function identity and 0 do not. Of the 26 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 25 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.

FunctionAlso present inEarliest-datedOthers named
standardize
brick of this paper's assembly: helper
4 other papers
2 dated earlier, 2 later
2403.07714 (2024-03)
StableToolBench: Towards Stable Large-Scale Benchmarking on Tool Learning of Large Language Models
2406.03807 (2024-06)
Tool-Planner: Task Planning with Clusters across Multiple Tools
2412.10198 (2024-12)
From Allies to Adversaries: Manipulating LLM Tool-Calling through Adversarial Injection
and 1 more not named here

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-23.

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 learning enables Large Language Models (LLMs) to interact with external environments by invoking tools, serving as an effective strategy to mitigate the limitations inherent in their pre-training data. In this process, tool documentation plays a crucial role by providing usage instructions for LLMs, thereby facilitating effective tool utilization. This paper concentrates on the critical challenge of bridging the comprehension gap between LLMs and external tools due to the inadequacies and inaccuracies inherent in existing human-centric tool documentation. We propose a novel framework, DRAFT, aimed at Dynamically Refining tool documentation through the Analysis of Feedback and Trials emanating from LLMs' interactions with external tools. This methodology pivots on an innovative trial-and-error approach, consisting of three distinct learning phases: experience gathering, learning from experience, and documentation rewriting, to iteratively enhance the tool documentation. This process is further optimized by implementing a diversity-promoting exploration strategy to ensure explorative diversity and a tool-adaptive termination mechanism to prevent overfitting while enhancing efficiency. Extensive experiments on multiple datasets demonstrate that DRAFT's iterative, feedback-based refinement significantly ameliorates documentation quality, fostering a deeper comprehension and more effective utilization of tools by LLMs. Notably, our analysis reveals that the tool documentation refined via our approach demonstrates robust cross-model generalization capabilities.

For agents

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

get_harvested_code_for_paper("2410.08197")
get_code_for_paper("2410.08197")
have("2410.08197")

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

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

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

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

Connect an agent — have() is free.