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

## Abstract

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 D ynamically R efining tool documentation through the A nalysis of F eedback and T rails 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.

## 1 Introduction

Tool learning (Mialon et al., ; Qin et al., ; Schick et al., ; Qu et al., ), which integrates external tools with large language models (LLMs), has significantly enhanced the capability of LLMs to address complex real-world tasks (Nakano et al., ; Qin et al., ; M. Bran et al., ).
By leveraging external tools, LLMs are able to mitigate the limitations of outdated pre-training data and the text-in-text-out interface, enabling them to access up-to-date information, interact with dynamic environments, and take actions beyond their original scope (Zhuang et al., ; Wang et al., ).
To effectively utilize these external tools, LLMs are typically provided with tool documentation as context (Shen et al., ; Song et al., ; Xu et al., ).
This documentation provides essential information on how tools function, their potential uses, and the ways in which they can be leveraged to solve complex tasks.
By incorporating tool documentation within the task instructions, LLMs can leverage their in-context learning abilities to understand and utilize the tools efficiently (Wei et al., ; Hsieh et al., ).
Therefore, tool documentation is an indispensable component driving the success of tool learning, serving as a bridge between LLMs and external tools.

Figure: Figure 1: (a): An illustration showcasing issues in current tool documentation, including incomplete, redundant, and inaccurate information. (b): An illustration of how LLMs incrementally enhance their understanding of tool usage through iterative exploration, transitioning from untested functionalities (gray) to discovered capabilities (white) via a trial-and-error process. (c): The comparison between the raw and improved tool documentation regarding its usefulness on three tool learning datesets, highlighting that DRAFT is able to produce tool documentations that are more favored by LLMs.
Refer to caption: x1.png

However, existing tools primarily originate from pre-established, human-engineered code repositories and are not explicitly tailored for the utilization of LLMs from their inception, let alone the corresponding tool documentation.
In fact, orchestrating an ideal documentation for an external tool that adapts to the specific requirements of LLMs remains a challenging endeavor.
First, the original human-crafted tool documentation is typically created with human intuition in mind, and is often fraught with inconsistency and ambiguities, as it primarily caters to human understanding and usually lacks the precision required for machine interpretation (Chemero, ; Yuan et al., ).
As illustrated in Figure 1 (a), incomplete documentation makes it difficult for LLMs to clearly understand the purpose of a tool and when it should be invoked, while redundant documentation, containing excessive irrelevant information, obscures key details and increases token consumption in prompts.
Additionally, inaccurate documentation that does not reflect the tool’s actual capabilities can lead to discrepancies between the tool’s outputs and its description, leading to the potential misuse of the tool by LLMs.
These issues obstruct the effective utilization of tools by LLMs.
Second, manual modification of these documentations, even with meticulous revisions, struggle to fully encompass all aspects of tool usage, since discerning the specific scope a tool can manage and identifying its edge use-cases often necessitates considerable hands-on experience.
For example, as depicted in Figure 1 (a), incomplete documentation also fails to mention certain constraints on the parameters, and the LLM, being unaware of this undocumented constraint, generates an error when invoking the tool with an invalid parameter value.
Addressing these issues by manually correcting or enhancing tool documentation is time-consuming and labor-intensive. Moreover, this may not scale to a substantial number of tools effectively.
Furthermore, the dynamic nature of tool development further exacerbates this issue, as functionalities of tools are frequently updated, deprecated, or extended. Maintaining an up-to-date and accurate representation of such evolving functionalities within the tool documentation becomes an arduous task.
This misalignment between the tool documentation with the current state of the tool hinders the efficient and correct utilization of tools by LLMs.

Humans, on the contrary, acquire proficiency in tool usage through repeated interactions and hands-on experiences, capable of maintaining an updated comprehension of these tools despite their evolving functionalities.
In light of this, this paper proposes a novel framework, DRAFT, conceptualized to automate the adjustment and optimization of tool documentation based on the outcomes and feedback derived from the LLM’s interaction with the tool, aiming explicitly at bridging the comprehension gap between LLMs and external tools.

More concretely, DRAFT implements a trial-and-error methodology to incrementally improve the tool documentation.
As shown in Figure 2, DRAFT orchestrates three dynamically interlinked phases: experience gathering, learning from experience, and documentation rewriting, which collectively facilitate the iterative process of documentation enhancement.
It first undertakes the simulation of potential tool application scenarios, crafting explorative instances and capturing tool execution outcomes through a designed explorer.
Subsequently, the analyzer dissects the prevailing documentation, amalgamating insights from the explorer’s findings and feedback to moot documentation modification propositions.
Finally, the rewriter amalgamates these insights, refining the tool documentation while simultaneously guiding further explorative pursuits by the explorer.
To optimize this process, we design a diversity-promoting exploration strategy to ensure diversity in exploration, thus providing a wider range of samples for subsequent rewriting.
Recognizing that different tools vary in complexity for LLMs to comprehend, we introduce a tool-adaptive termination mechanism to improve efficiency during modifications by halting the iterative process once the documentation aligns with the comprehension of LLMs, thereby saving time and resources while preventing overfitting.
Through this collaborative, iterative framework, the documentation progressively morphs, aligning more coherently with LLMs operational requisites, and thus empowering LLMs to leverage external tools more effectively in their problem-solving endeavors.

In summary, our contributions are as follows:
(1) We highlight that due to the inherent understanding gap between LLMs and humans,
inefficiencies and inaccuracies within existing tool documentation hamper the effective utilization of tools by LLMs.
(2) We introduce a novel framework, DRAFT,
designed to dynamically adjust and optimize tool documentation based on the interaction feedback between LLMs and external tools, which significantly bridges the gap between them by enabling the LLMs to better comprehend and utilize the tools at their disposal, thereby enhancing the overall tool-using capabilities of LLMs.
(3) Extensive experiments demonstrate that DRAFT significantly improves the quality of tool documentation and enhances the ability of LLMs to utilize external tools.

Figure: Figure 2: Schematic illustration of our proposed self-driven iterative improvement framework, DRAFT. The left part illustrates the three distinct learning phases in our framework. The middle part shows the two specialized mechanisms designed to optimize the process. The right part depicts an example of using DRAFT to iteratively modify the tool documentation.
Refer to caption: x2.png

## 2 Methods

In this section, we will first introduce the overview of DRAFT, and then provide detailed explanations of the three included learning stages.
The learning algorithm is presented in Algorithm 1.

### 2.1 Overview of DRAFT

To address the challenges of inadequate, ambiguous, and outdated tool documentation that hinder LLMs from effectively utilizing external tools, we propose DRAFT, a framework that iteratively refines tool documentation to bridge the comprehension gap between LLMs and tools. As illustrated in Figure 2, DRAFT operates through three interconnected phases: experience gathering, learning from experience, and documentation rewriting.
In the experience gathering phase, an explorer simulates diverse tool usage scenarios, collecting data on how the LLM interacts with the tool based on the current documentation, thus uncovering misunderstandings and limitations.
The learning from experience phase involves an analyzer examining this data to identify discrepancies between intended and actual tool usage, pinpointing ambiguities or inaccuracies in the documentation, and proposing targeted improvements.
In the documentation rewriting phase, a rewriter integrates these insights to update the documentation, enhancing clarity and alignment with the tool’s functionalities.
Through this trial-and-error framework, DRAFT is capable of simulating the process by which humans acquire proficiency in tool usage through repeated interactions and hands-on experiences, thereby automating the creation of tool documentation specifically designed for LLMs.
Furthermore, by employing the diversity-promoting
exploration strategy and tool-adaptive termination mechanism, DRAFT efficiently converges on optimized documentation, enabling LLMs to utilize external tools more effectively despite the initial documentation shortcomings.

Figure: Algorithm 1 The Learning Algorithm of DRAFT

### 2.2 Experience Gathering

Figure: Figure 3: Prompt template for explorer.
Refer to caption: x3.png

In the experience gathering phase, we design an Explorer $\mathcal{A}_{E}$ to simulate plausible scenarios in which the tool may be utilized.
This approach parallels the manner in which individuals investigate the potential applications of a new tool when they are unable to comprehend the accompanying manual.

Specifically, at the $i$-th iteration, the Explorer generates an exploration instance $e_{i}$ based on the current tool documentation $t_{i-1}$, next-step exploration direction $d_{i-1}$ from the Rewriter, and the previous history $\mathcal{H}_{i}=\{(e_{j},r_{j})|j<i\}$, which consists of prior exploration instances $e_{<i}$ and their corresponding return results of the tool $r_{<i}$. This process is formalized as follows:

$$ $e_{i}=\mathcal{M}_{E}(t_{i-1},d_{i-1},\mathcal{H}_{i}),$ (1) $$

where $e_{i}$ consists of a user query $e^{q}_{i}$ related to the tool and the necessary parameters $e^{p}_{i}$. The initial tool documentation is denoted as $t_{0}$, representing the raw documentation provided in the dataset. After generating $e_{i}$, the Explorer invokes the tool to obtain the result $r_{i}$ returned by the tool.

Given that tool utilization often involves complex parameter ranges, combinations, and potential error sources, it is crucial to ensure diversity in the exploration phase to cover a wide spectrum of possible scenarios. To address this, besides maintaining a record of all previously explored queries—which we provide to the Explorer to instruct it to generate instances that differ from those already generated—we also implement a diversity-promoting exploration strategy:

Similarity Constraint. When generating a new instance, the Explorer calculates the cosine similarity between the new generated query $e^{q}_{i}$ and all prior queries $e^{q}_{j}$ for $j<i$, using embedding vectors obtained from OpenAI’s *text-embedding-ada-002*(^1^11[https://openai.com/index/new-and-improved-embedding-model/](https://openai.com/index/new-and-improved-embedding-model/)). The similarity is computed as:

$$ $\max_{j<i}\mathrm{sim}(\mathbf{e}^{q}_{i},\mathbf{e}^{q}_{j})<\phi,$ (2) $$

where $\mathrm{sim}(\cdot,\cdot)$ denotes the cosine similarity function, and $\phi$ is a predefined threshold controlling the allowed similarity. This constraint ensures that the new query is sufficiently different from all previous queries, promoting diversity in exploration.

Self-Reflection. If the similarity constraint is not satisfied (i.e., the new query is too similar to previous ones), the Explorer engages in self-reflection. It discards the current instance and analyzes the reasons for the overlap, adjusting its approach to generate a new query that explores different aspects of the tool. This iterative self-reflection process continues until the Explorer produces an instance that meets the diversity criterion.

By incorporating this diversity-promoting exploration strategy, we enhance the exploration coverage of the Explorer, allowing it to investigate a broader range of tool functionalities and edge cases. This comprehensive set of exploration instances is crucial for identifying potential misunderstandings and gaps in the tool documentation, thereby providing valuable experiential data for subsequent analysis and documentation rewriting. Figure 3 illustrates our prompt template for Explorer.

### 2.3 Learning from Experience

Figure: Figure 4: Prompt template for analyzer.
Refer to caption: x4.png

Analogous to how humans learn—acquiring familiarity with new tools through practical experiences and then consulting manuals to deepen understanding—the insights gained during the experience gathering phase provide a foundation for informed and targeted enhancements to the documentation. Thus, building upon the experience gathered in the first phase, the second phase focuses on analyzing this data to refine the tool documentation. In this phase, we introduce an Analyzer designed to identify and address issues within the current tool documentation, thereby guiding the Rewriter in making effective revisions.

Formally, at the $i$-th iteration, the Analyzer takes the following inputs: current tool documentation $t_{i-1}$, exploration instance $e_{i}$, tool feedback $r_{i}$ provided by the Explorer, and the history of documentation revisions $\mathcal{T}_{i}=\{t_{j}\mid j<i\}$. Then the Analyzer analyzes these inputs to identify issues and generate revision suggestions $s_{i}$:

$$ $s_{i}=\mathcal{M}_{A}(t_{i-1},e_{i},r_{i},\mathcal{T}_{i}).$ (3) $$

To ensure that the Analyzer can provide high-quality and relevant revision suggestions, we establish several evaluation criteria, including consistency with tool outputs, comprehensiveness, and conciseness without irrelevant information (as detailed in Appendix B).
These criteria enable Analyzer to identify and assess issues present within the existing tool documentation.
By considering the historical evolution of the documentation through the revision history $\mathcal{T}_{i}$, the Analyzer gains valuable insights into past updates, helping it avoid redundant or repetitive suggestions and focus on areas that still require improvement.
The prompt template for Analyzer is illustrated in Figure 4.

Furthermore, the Analyzer delivers its feedback in natural language, offering detailed and nuanced guidance to the Rewriter for subsequent updates. This approach contrasts with providing mere scalar feedback, as it ensures the Rewriter receives comprehensive insights that facilitate accurate and effective revisions, ultimately enhancing the clarity and usability of the tool documentation.

### 2.4 Documentation Rewriting

Figure: Figure 5: Prompt template for rewriter.
Refer to caption: x5.png

Building upon the experiences gathered and the revision suggestions obtained from the previous two phases, the final phase focuses on refining the tool documentation to enhance its clarity, accuracy, and usability, ensuring it aligns with the comprehension capabilities of LLMs. This phase also provides suggestions for future exploration directions in the next iteration of the experience gathering phase.

Specifically, we design a Rewriter to synthesize information from the exploration instances $e_{i}$ and the corresponding tool return results $r_{i}$ provided by the Explorer, as well as the revision suggestions $s_{i}$ from the Analyzer.
It is important to note that the Rewriter also takes into account the rewrite history $\mathcal{T}_{i}$, which includes all previous versions of the tool documentation up to iteration $i$.
By integrating these inputs, the Rewriter produces an updated version of the tool documentation $t_{i}$ and provides suggestions for the next round of exploration directions $d_{i}$. This process is formalized as:

$$ $d_{i},t_{i}=\mathcal{M}_{R}(t_{i-1},e_{i},r_{i},s_{i},\mathcal{T}_{i}).$ (4) $$

By incorporating the revision history into its process, the Rewriter ensures that each version of the documentation builds upon its predecessors, resulting in continuous improvements in clarity, accuracy, and usability.
The prompt template to get Rewriter is shown in Figure 5.

Furthermore, recognizing that different tools vary in their complexity and the ease with which LLMs can comprehend them, we implement a tool-adaptive termination mechanism to adaptively determine when to cease modifications for each tool. Analogous to recipes requiring different levels of expertise, some tools may reach optimal documentation faster than others. We consider the iterative process to have converged when there is minimal change between two consecutive versions of the documentation, indicating that the Rewriter has sufficiently aligned the documentation with the LLM’s understanding.

Specifically, we measure the degree of change $\Delta$ between iterations by calculating both the word-match metric (e.g., BLEU score (Papineni et al., )) and the semantic-match metric (e.g., cosine similarity of embeddings):

$$ $\Delta=\frac{\mathrm{sim}(\mathbf{e}^{t}_{i},\mathbf{e}^{t}_{i-1})+\mathrm{ BLEU}(t_{i},t_{i-1})}{2},$ (5) $$

where $\mathbf{e}^{t}_{i}$ and $\mathbf{e}^{t}_{i-1}$ are the embedding vectors of $t_{i}$ and $t_{i-1}$ obtained using OpenAI’s *text-embedding-ada-002*. The function $\mathrm{sim}(\cdot,\cdot)$ calculates the cosine similarity between the semantic embedding vectors of two documentation versions, and $\mathrm{BLEU}(\cdot,\cdot)$ measures the n-gram overlap between them. If $\Delta$ exceeds a predefined termination threshold $\tau$, we stop the iterative modifications.

This tool-adaptive termination mechanism offers several advantages: First, it enhances efficiency by ceasing iterations when the documentation is adequately aligned with the LLM’s comprehension, conserving computational resources and time. Second, it prevents unnecessary modifications that could lead to overfitting, thus optimizing the quality of the documentation. By employing both the BLEU score and cosine similarity, we ensure a balanced assessment of structural and semantic alignment, ultimately yielding high-quality documentation tailored for effective LLM utilization.

### 2.5 DRAFT ’s Strengths

In this section, we outline the key strengths of the proposed DRAFT framework.
First and foremost, DRAFT operates in a fully automated manner, which significantly reduces resource consumption in comparison to the time-consuming and labor-intensive manual modifications that are typically required.
Furthermore, by employing a trial-and-error methodology, DRAFT continuously updates tool documentation based on feedback regarding tool usage obtained from LLMs, thereby enhancing the alignment between tool documentation and the operational understanding of LLMs.
Additionally, DRAFT is capable of dynamically maintaining an accurate and up-to-date representation of evolving features within the tool documentation as the tools develop.
It also provides inherent explainability, as the entire process is presented in natural language. Users can easily track the history of modifications and seamlessly integrate expert insights into the updating process.

## 3 Experiments

### 3.1 Experimental Setup

Datasets.
To verify the effectiveness of DRAFT, we conduct experiments on two benchmarks: ToolBench and RestBench.
ToolBench (Qin et al., ) is a large-scale benchmark of real-world APIs collected from RapidAPI and BMTools, commonly used to evaluate the capability of LLMs in tool usage.
Due to budget constraints, we focus on the most challenging subset of ToolBench, namely I3-Instruction, which contains complex user requests requiring multiple tools from different categories.
RestBench (Song et al., ) is a benchmark consisting of two real-world scenarios: TMDB, which includes 54 movie-related APIs, and Spotify, which has 40 music-related APIs.

Evaluation Metrics.
Following previous work (Song et al., ; Qin et al., ; Yuan et al., ), we evaluate performance using two widely adopted metrics: (1) Correct Path Rate (CP%), which measures the proportion of instances where the model-generated sequence of tool calls contains the ground truth tool path as a subsequence, allowing for straightforward accuracy assessment.
(2) Win Rate (Win%), which evaluates effectiveness through pairwise comparisons by a ChatGPT-based evaluator, capturing nuanced performance differences not reflected by rule-based metrics.

Baselines.
Following Qin et al. () and Yuan et al. (), we compare our method with widely adopted baselines, including: (1) ReAct (Yao et al., ), which integrates reasoning with action, enabling LLMs not only to justify their actions but also to refine their reasoning processes based on feedback from the environment.
(2) DFSDT (Qin et al., ), which addresses the issue of error propagation by incorporating a depth-first search strategy to enhance decision-making accuracy.
(3) EasyTool (Yuan et al., ), which achieves more concise tool descriptions by using ChatGPT to directly rewrite the documentation and incorporate guidelines, thereby enhancing the comprehension of LLMs regarding tool functions and parameter requirements.

Implementation Details.
For the main experiments, we use the *GPT-4o* as the backbone model for DRAFT, which means that we employ this model to refine the tool documentation by incorporating its own tool usage feedback.
We set the similarity threshold $\phi$ to $0.9$ for diversity-promoting exploration strategy, and termination threshold $\tau$ to $0.75$ for tool-adaptive termination mechanism.
We select three of the latest LLMs to ensure our evaluation reflects the current state of the field including the closed-source models *GPT-4o* (^2^22[https://platform.openai.com/playground/chat?models=gpt-4o-2024-08-06](https://platform.openai.com/playground/chat?models=gpt-4o-2024-08-06)) and *GPT-4o-mini* (^3^33[https://platform.openai.com/playground/chat?models=gpt-4o-mini](https://platform.openai.com/playground/chat?models=gpt-4o-mini)), as well as the open-source model *Llama-3-70B* (^4^44[https://huggingface.co/meta-llama/Meta-Llama-3-70B](https://huggingface.co/meta-llama/Meta-Llama-3-70B)).
Our code is available at [https://github.com/quchangle1/DRAFT](https://github.com/quchangle1/DRAFT).

### 3.2 Experimental Results

**Table 1: Performance comparison of different methods on three datasets. CP%, Win% are short for Correct Path Rate and Win Rate, respectively. Win% is calculated by comparing each method with ReAct. The term “-” means that EayTool has not been implemented on the Spotify dataset. The best result for each LLM is in bold.**
| Model | Method | RestBench-TMDB | RestBench-Spotify | ToolBench |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| CP% | Win% | CP% | Win% | CP% | Win% |  |  |
| GPT-4o-mini | ReAct | 48.00 | 50.00 | 24.56 | 50.00 | 35.00 | 50.00 |
| DFSDT | 50.00 | 68.00 | 35.08 | 61.40 | 37.00 | 84.00 |  |
| EasyTool | 56.00 | 75.00 | - | - | 42.00 | 85.00 |  |
| DRAFT (Ours) | 62.00 | 82.00 | 43.85 | 78.94 | 47.00 | 88.00 |  |
| Llama-3-70B | ReAct | 72.00 | 50.00 | 26.31 | 50.00 | 41.00 | 50.00 |
| DFSDT | 74.00 | 38.00 | 63.15 | 61.40 | 42.00 | 54.00 |  |
| EasyTool | 76.00 | 64.00 | - | - | 46.00 | 60.00 |  |
| DRAFT (Ours) | 86.00 | 64.00 | 66.66 | 64.91 | 53.00 | 62.00 |  |
| GPT-4o | ReAct | 71.00 | 50.00 | 28.07 | 50.00 | 37.00 | 50.00 |
| DFSDT | 74.00 | 61.00 | 64.91 | 56.14 | 41.00 | 73.00 |  |
| EasyTool | 79.00 | 62.00 | - | - | 45.00 | 77.00 |  |
| DRAFT (Ours) | 88.00 | 71.00 | 70.17 | 84.21 | 51.00 | 78.00 |  |

We present our experimental results in Table 1.
Based on these results, we have the following observations:
While EasyTool can slightly improve experimental performance, it does not incorporate the experience feedback from LLMs to iteratively revise the tool documentation.
As a result, it cannot fully align with the understanding of LLMs.
In contrast, our method effectively addresses these issues and achieves more significant improvements.
We observe that all LLMs achieve better performance when using the tool documentation modified by DRAFT.
This indicates that although our tool documentation was revised through utilizing tool usage feedback from a single model, it exhibits robust cross-model generalization capabilities.
Notably, on the ToolBench dataset, the *GPT-4o-mini* enhanced with DRAFT even surpasses the performance of the *GPT-4o* without DRAFT.
These improvements demonstrate the effectiveness of DRAFT, which can be attributed to the fact that DRAFT iteratively learns from the tool usage experiences of LLMs to refine the tool documentation.
In this way, DRAFT creates tool documentation specifically aligned with the understanding of LLMs.

### 3.3 Further Analysis

How does the number of iteration rounds affect the performance of tool learning?
A key feature of DRAFT is its iterative refinement of tool documentation with a tool-adaptive termination mechanism.
We examine the effectiveness of these designs by analyzing how the number of iteration rounds influences the performance of downstream tool learning.
The results presented in Figure 6 demonstrate a general trend where performance enhances with an increasing number of iterations, followed by a subsequent decline. This suggests that iterative modifications are crucial for enhancing tool documentation quality and the ability of LLMs to utilize tools effectively. Such modifications facilitate the exploration of a wider array of examples and the incorporation of additional feedback derived from the tool usage experiences of LLMs, ultimately refining the tool descriptions to achieve superior performance. However, a decline in performance is observed after a certain number of iterations. This decline may be attributed to the introduction of redundant information as the number of iterations increases, potentially leading to overfitting. Therefore, we implement a tool-adaptive termination mechanism to prevent performance degradation and ensure optimal results.

Figure: (a) GPT-4o-mini
Refer to caption: x6.png

Figure: Figure 7: An analysis of cross-model generalization.
Refer to caption: x15.png

Does using other models as backbones also ensure cross-model generalization?
Our preliminary experiments have demonstrated that employing *GPT-4o* as the backbone to refine tool documentation by integrating its own usage feedback results in revised documentation that exhibits cross-model generalization, enhancing the performance of other models.
This observation prompts an inquiry into whether using other models as a backbone would similarly yield cross-model generalization.
To investigate this, we conduct experiments on RestBench-TMDB using *Llama-3-70B* as a backbone, which led to the generation of a new set of tool documentation informed by its usage feedback.
As illustrated in Figure 7, our findings indicate that it also demonstrates cross-model generalization, enhancing the tool usage capabilities across all LLMs.
This may result from decoder-only models sharing similar transformer structures and common pre-training corpora, allowing them to achieve consensus on knowledge mastery and needs.
Furthermore, we also find that employing *GPT-4o* as a backbone yields superior performance compared to *LLama-3-70B*. This suggests that our method can benefit from the continuous improvements in foundational models.

**Table 2: Ablation study of the proposed DRAFT.**
| Mehtods | TMDB |  |
| --- | --- | --- |
| CP% | Win% |  |
| DRAFT | 88.00 | 71.00 |
| *w/o* diversity | 84.00 | 69.00 |
| *w/o* adaptive | 80.00 | 68.00 |

Are the two mechanisms we proposed truly effective for DRAFT?
We conduct ablation studies on RestBench-TMDB using *GPT-4o* to assess the impact of the two mechanisms incorporated within DRAFT. The results presented in Table 2, highlight the significance of each mechanism:
*w/o* diversity refers to a variant that the explorer generates exploration instances without applying similarity constraint, meaning that all generated instances are considered.
The absence of the diversity-promoting exploration strategy leads to a notable performance drop, underscoring the need for its implementation to enhance exploration diversity.
*w/o* adaptive refers to a variant that does not terminate prematurely based on the iteration conditions; rather, it guarantees that each iteration of the tool documentation completes the designated maximum number of iteration rounds before ceasing operations.
The significant decline in performance observed in this variant further emphasizes the benefits of introducing the tool-adaptive termination mechanism, which serves to prevent overfitting while improving efficiency.
The results with other LLMs and datasets demonstrate similar trends and are provided in Appendix A.

**Table 3: Comparison of tool retrieval performance between raw documentation and our method. We report NDCG@1 and NDCG@10.**
| Retriever | Documentation | TMDB | Spotify |  |  |
| --- | --- | --- | --- | --- | --- |
| @1 | @10 | @1 | @10 |  |  |
| BM25 | Raw | 24.0 | 35.0 | 43.9 | 53.9 |
| DRAFT | 29.0 | 39.4 | 43.9 | 54.2 |  |
| Contriever | Raw | 29.0 | 40.4 | 45.6 | 49.6 |
| DRAFT | 31.0 | 44.1 | 47.4 | 49.2 |  |

Does the modified tool documentation improve the performance of tool retrieval?
In real-world scenarios, there are often numerous tools, making it impractical to input the descriptions of all tools into LLMs (Qu et al., ). Therefore, effective tool retrieval is crucial for downstream tool learning.
In this analysis, we evaluate whether the modified tool documentation not only enhances the ability of LLMs to use tools effectively but also improves the effectiveness of tool retrieval.
The results presented in Table 3 indicate that the revised documentation enhances the performance of tool retrieval methods, including the sparse retrieval method BM25 (Robertson et al., ) and the dense retrieval method Contriever (Izacard et al., ).
This demonstrates that the modifications not only improve the readability of the documentation but also enhance its semantic quality, thereby improving the different stages of the whole pipeline for tool learning.

Does the tool documentation modified by DRAFT also improve human comprehension?
In the previous experiments, we have demonstrated that tool documentation modified by DRAFT can help LLMs better understand and utilize external tools.
Next, we aim to verify whether this improvement extends to human understanding of the tools as well.
Specifically, we conduct a human evaluation, inviting three well-educated doctor students to evaluate the raw tool documentation and the documentation modified by DRAFT based on three criteria: completeness: whether the documentation is comprehensive, conciseness: whether it is clear and concise, accuracy: whether it reflects the tool’s functionality accurately.
We randomly sampled 50 cases from RestBench and ToolBench for this evaluation.

**Table 4: Human evaluation comparing the quality of the raw documentation with ours.**
|  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Dataset | Completeness | Conciseness | Accuracy |  |  |  |  |  |  |
| RestBench | Ours | Raw | Equal | Ours | Raw | Equal | Ours | Raw | Equal |
| 40% | 16% | 44% | 36% | 20% | 44% | 30% | 0% | 70% |  |
| ToolBench | Ours | Raw | Equal | Ours | Raw | Equal | Ours | Raw | Equal |
| 68% | 4% | 28% | 56% | 4% | 40% | 56% | 0% | 44% |  |
|  |  |  |  |  |  |  |  |  |  |

The results, as shown in Table LABEL:tab:quality_evaluation, indicate that the tool documentation modified by DRAFT demonstrates significant improvements, particularly in terms of completeness and accuracy (some cases are presented in Appendix C).
This can be attributed to the fact that DRAFT incorporates feedback from LLMs based on their tool usage experience, which provides execution results during the revision process, ensuring better alignment between the documentation and the actual tool behavior.
Moreover, our design of a tool-adaptive termination mechanism effectively prevents unnecessary redundancy, leading to more concise documentation.
Additionally, the results suggest that ToolBench tools have significantly lower documentation quality than those in the RestBench dataset, as the readability of ToolBench tools exhibited a more substantial improvement after modification by DRAFT.
This further highlights the necessity of revising the existing tool documentation.

## 4 Related Work

Tool Learning.
Recent studies have highlighted the potential of LLMs to utilize external tools in addressing complex problems (Qu et al., ; Wang et al., ). With the aid of external tools, LLMs can obtain up-to-date information (Nakano et al., ; Gou et al., ; ), enhance domain-specific knowledge (M. Bran et al., ; Zhang et al., ), process multi-modal information (Surís et al., ; Gao et al., ), and more.
Existing tool learning approaches can be categorized into two types: tuning-based and tuning-free methods (Gao et al., ).
Tuning-based methods enhance the tool-using capabilities of LLMs by fine-tuning them on tool-related datasets (Patil et al., ; Hao et al., ; Yang et al., ; Qin et al., ; Liu et al., ).
However, this approach is only applicable to open-source models and requires substantial computational resources.
In contrast, tuning-free methods provide LLMs with tool documentation and a few demonstrations (Wei et al., ; Hsieh et al., ; Paranjape et al., ; Du et al., ; Shi et al., ), relying on the in-context learning ability of LLMs to understand how to use tools.
This approach requires no additional training and allows for the plug-and-play integration of external tools.
However, this method necessitates high-quality tool documentation that is aligned with the comprehension of LLMs (Yuan et al., ).
In this paper, we propose a method to align with LLMs understanding and improve the quality of tool documentation to enhance the tool-using capabilities of LLMs.

Learning from Feedback.
Recent studies show that LLMs can improve their initial responses through self-correction, leading to improved performance (Shinn et al., ; Madaan et al., ; Pan et al., ; Huang et al., ).
However, some researchers observe that relying exclusively on self-correction without external feedback may yield minimal improvements or worsen performance (Zhao et al., ).
In contrast, incorporating learning from feedback has been shown to improve various tasks (Jin et al., ; Gao et al., ; Wang et al., ; Pan et al., ; Welleck et al., ; Zhang et al., ).
The forms of feedback are categorized into scalar and natural language types (Gou et al., ).
Scalar feedback provides coarse-grained information and typically serves as a reward signal in reinforcement learning frameworks (Ziegler et al., ), while natural language feedback provides detailed insights and is used in prompts for LLMs to enhance performance (Jin et al., ).
The sources of feedback are diverse, including humans (Ouyang et al., ), critic models (), external tools (Wang et al., ; Qiao et al., ), and even the LLM itself.
To ensure that tool documentation genuinely reflects the purpose of the tool, we obtain feedback by actually using the tool to get the returned results, thereby producing high quality tool documentation.

## 5 Conclusion

In this paper, we highlight that the misalignment between the existing, primarily human-centric tool documentation and the interpretive requirements of LLMs acts as a pivotal barrier obstructing the full potential of tool learning with LLMs.
To remedy this, inspired by trial-and-error, we introduce DRAFT, a dynamic and self-improving framework specifically designed to iteratively refine tool documentation based on direct interactions and feedback loops between LLMs and external tools.
Through extensive experimentation, our findings substantiate the assertion that our proposed DRAFT markedly enhances the alignment between tool documentation and the operational understanding of LLMs, thereby fostering more effective tool usage.

## Appendix

## Appendix A More Experiments

We also conduct analysis experiments on three datesets using other LLMs.
As illustrated in Table 5, both *GPT-4o-mini* and *LLama-3-70B* display trends that are consistent with those observed in *GPT-4o*.
The absence of our proposed diversity-promoting exploration strategy and tool-adaptive termination mechanism results in a decline in performance, thereby underscoring the importance of our design innovations.
An intuitive explanation posits that, in the absence of the diversity-promoting exploration strategy, the examples generated during each round of exploration may exhibit significant similarity. This similarity could render multiple iterations indistinguishable from a single iteration, thereby undermining the advantages of repeated exploration. Likewise, the absence of the tool-adaptive termination mechanism may result in excessive iterations, which could produce redundant information and contribute to overfitting.

**Table 5: An ablation study of the proposed model, DRAFT, was conducted across three LLMs utilizing three distinct datasets.**
| Model | Method | RestBench-TMDB | RestBench-Spotify | ToolBench |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| CP% | Win% | CP% | Win% | CP% | Win% |  |  |
| GPT-4o-mini | DRAFT (Ours) | 62.00 | 82.00 | 43.85 | 78.94 | 47.00 | 88.00 |
| *w/o* diversity | 60.00 | 79.00 | 42.10 | 70.17 | 42.00 | 86.00 |  |
| *w/o* adaptive | 55.00 | 77.00 | 38.59 | 57.89 | 36.00 | 87.00 |  |
| Llama-3-70B | DRAFT (Ours) | 86.00 | 64.00 | 66.66 | 64.91 | 53.00 | 62.00 |
| *w/o* diversity | 84.00 | 62.00 | 63.15 | 63.15 | 48.00 | 61.00 |  |
| *w/o* adaptive | 79.00 | 55.00 | 59.64 | 57.89 | 44.00 | 56.00 |  |
| GPT-4o | DRAFT (Ours) | 88.00 | 71.00 | 70.17 | 84.21 | 51.00 | 78.00 |
| *w/o* diversity | 84.00 | 69.00 | 64.91 | 73.68 | 44.00 | 72.00 |  |
| *w/o* adaptive | 80.00 | 68.00 | 59.64 | 68.42 | 46.00 | 76.00 |  |

## Appendix B Detailed Prompts

Table 6 provides a comprehensive overview of the prompts utilized during the three learning stages of DRAFT, which include experience gathering, learning from experience, and documentation rewriting.

## Appendix C Case Study

### C.1 ToolBench

Table 7 displays the comparison of original tool documentation and modified versions using DRAFT in some cases from the ToolBench dataset.
Each case highlights a specific issue found in the raw documentation, including incompleteness, ambiguity, redundancy, and inaccuracy, all of which are effectively addressed by our proposed method.

### C.2 RestBench

Table 8 displays the comparison of original tool documentation and modified versions using DRAFT in some cases from the RestBench dataset.
Although the overall quality of the tools in RestBench is generally superior to that of ToolBench, there remain significant issues, including irrelevance, ambiguity, and incomplete information.
This further highlights the necessity of employing our method, which iteratively refines the documentation through interactions with the tools.
By systematically addressing these issues, our approach guarantees that the documentation evolves in a way that enhances clarity, relevance, and completeness. This, in turn, minimizes the likelihood of misunderstandings or misuse of the APIs and enhances the ability of LLMs to utilize external tools.

## Appendix D Revision Trajectory

Table 9 and Table 10 respectively present the revision trajectory of tool documentation through the first, second, and third rounds of modifications using DRAFT.
An analysis of these tables reveals that the original tool documentation is characterized by the inclusion of irrelevant information and a notable absence of guidance regarding the necessity of a valid ID, as well as procedures for addressing errors associated with the provision of an invalid ID. These observations underscore significant deficiencies in the original documentation that necessitate revision.

Through an analysis of the revision trajectory, it becomes evident that during the first round, the experience of encountering an invalid ID is documented. The analyzer promptly identifies the issue and provids suggestions for improvement. Subsequently, the rewriter utilizes this feedback to make appropriate updates to the tool documentation, recommending that future exploration should concentrate on retrieving results associated with a valid ID. By the third iteration, the exploration successfully yields results with a valid ID, leading to further updates in the documentation. This process underscores the necessity of conducting multiple iterations. Furthermore, in the absence of a diversity-promoting exploration strategy designed to facilitate diverse exploration, the system may repeatedly encounter similar scenarios, thereby hindering the discovery of valid IDs and obstructing effective updates. This situation emphasizes the critical importance of implementing a diversity-promoting exploration strategy.

Table 11 and Table 12 show the revision trajectories from the fourth and fifth rounds, respectively.
Upon analysis, it is evident that as the number of iterations increases, the documentation for the tool becomes increasingly lengthy, leading to the inclusion of redundant information. This redundancy may impede the effective utilization of the tool by LLMs, thereby underscoring the necessity of the tool-adaptive termination mechanism that we have developed.

**Table 6: The full prompt for three learning stages of DRAFT.**
| I: Experience Gathering |
| --- |
| /* Task prompt */<br>Your task is to answer the user’s query as best you can. You have access to the following tools, which you<br>can use via API call to help with your response: {Tool Documentation}<br>Now you have the chance to explore the available APIs. You can do this by 1) synthesizing some natural user<br>query that calling the API could help, 2) extracting the parameters needed to call these APIs from the gener-<br>ated query, and 3) Here, you can focus on queries that only require calling the API once.<br>Now, first input your synthesized user query. You should make the query natural - for example, try to avoid<br>using the provided API descriptions or API names in the query, as the user does not know what APIs you ha-<br>ve access to. However, please make sure that the user query you generate includes the parameters required to<br>call the API, for which you need to generate random information. For required parameters like IP address, l-<br>ocation, coordinates, etc., provide specific details. For example, instead of simply stating ‘an address’, provi-<br>de the exact road and district names. Please note that if the required parameters are ID or username, which y-<br>ou do not know what are valid, you should use the default parameters provided in the API documentation di-<br>rectly. Also try to make the query as specific as possible. Next you need to extract the parameters needed to<br>call the APIs from your generated user queries based on the provided API documentation descriptions.<br>Here is an example: {"User Query": " ", "Parameters"::{ }}<br>/* Memory Mechanisms */<br>Below are queries you have already explored: {Explored queries}<br>Based on these, try to explore queries that can help you understand the API further; Avoid synthesizing quer-<br>ies that are too close to the existing ones. Here are some suggestions to explore the API: {Suggestions}<br>Now you know a bit more about the API. You can synthesize another user query to explore the API a bit fur-<br>ther and consolidate your understanding of the API, based on things that you discovered about this API. You<br>should cherish the opportunity to explore, as each time is precious. Therefore, you should generate new exp-<br>lorations that are different from previous ones as much as possible. |
| II: Learning from Experience |
| /* Task prompt */<br>You task is to provide suggestions for modifying the tool documentation based on the current tool document-<br>ation, the explored query and parameters, and the results returned by the tool. You have access to the follow-<br>ing tools: {Tool Documentation}<br>Please note that the existing tool documentation may be incomplete or noisy. Previously, you generated some<br>user queries and required parameters to explore this API based on the API documentation. Now, you will be<br>provided with the output of this API under these parameters.<br>You need to consider the following when provi-<br>ding suggestions: For instance, consider whether the current description is consistent with the actual results<br>returned by the tool, whether the description is comprehensive, and whether it is concise and free of irreleva-<br>nt information. Provide suggestions for modifications based on these aspects.<br>Below are explored queries, the<br>required parameters and the outputs of the tool: {Explored examples}<br>Here is an example: {"Suggestions": " "}<br>/* Memory Mechanisms */<br>The following is the history of you modifying the tool description: {History}<br>Based on the above information, provide more constructive suggestions. |
| III: Documentation Rewriting |
| /* Task prompt */<br>Your task is to refine the description of the tool based on the queries and parameters you’ve explored, the ou-<br>tputs provided by the tool, as well as the suggestions provided. You have access to the following tools:<br>{Tool Documentation}<br>Please note that the existing tool documentation may be incomplete or noisy. The revised description should<br>focus solely on the functionalities of the API, omitting any irrelevant details. Below are explored queries, the<br>required parameters and the outputs of the tool: {Explored examples}<br>Based on the feedback provided, here are some guidelines for updating the tool description: {Suggestions}<br>Due to the limited number of explorations you can perform, you need to value each opportunity. What aspec-<br>ts of this API would you like to explore next? Please provide some suggestions for your next query generati-<br>on. Just give a direction of the next exploration, don’t give a full example of the exploration directly.<br>Here is an example:{ "Rewritten description": " ", "Suggestions for exploring": " "}<br>/* Memory Mechanisms */<br>The following is the history of you modifying the tool description: {History}<br>Based on the above information, provide more constructive suggestions. |

**Table 7: Comparison of original tool documentation and modified versions using DRAFT in some cases from the ToolBench Dataset.**
| Raw Tool Description (Incomplete) |
| --- |
| {"Tool Name": "GetSearchImage", "description": " "} |
| Ours |
| {"Tool Name": "GetSearchImage", "description": "Retrieve an image using the specified image identifier and search context ID, with optional parameters for folder and storage."} |
| Raw Tool Description (Ambiguous) |
| {"Tool Name": "il", "description": "Turkish plates. 1 to 81"} |
| Ours |
| {"Tool Name": "il", "description": "Provides location details for Turkish plate numbers based on the plate number parameter, including city, district, neighborhood, and postal code."} |
| Raw Tool Description (Redundant) |
| {"Tool Name": "QR Code Image Generator", "description": "A QR code generator API is a tool that enables developers to generate QR codes within their applications. QR codes are two-dimensional barcodes that can be scanned using a smartphone camera and decoded using QR code reader software. The API allows developers to easily integrate QR code generation functionality into their existing applications, such as mobile apps, web apps, and software.This API can be used to generate QR codes for a variety of purposes, such as:Contact information: Generate a QR code containing your contact information, such as your phone number or email address.Links: Create a QR code that links to a website, YouTube video, or other online content.Payments: Create a QR code for making payments through a mobile wallet or payment app.Events: Generate a QR code for an event, such as a concert or conference, to provide attendees with all the necessary information.Coupons: Create a QR code for a coupon or promo code to be redeemed at a physical store or online.Overall, a QR code generator API is a versatile tool that can help businesses and individuals streamline their processes and improve the user experience for their customers."} |
| Ours |
| {"Tool Name": "QR Code Image Generator", "description": "A QR code generator API is a versatile tool that enables developers to generate QR codes for various purposes, such as contact information, links, payments, events, and coupons. Users should be prepared for potential connectivity issues, including connection timeouts, and are advised to contact the API provider for support in case of errors like ’Connection timed out’. Implementing retry mechanisms and checking network connectivity can help handle such situations effectively."} |
| Raw Tool Description (Inaccurate) |
| {"Tool Name": "SQUAKE", "description": "SQUAKE helps businesses to build sustainable products! With the most performant API in the market, we help travel, mobility, and logistics companies calculate carbon emissions and purchase certified climate contributions in real-time. Implemented within mins!", "Return Results:" "I’m a teapot."} |
| Ours |
| {"Tool Name": "il", "description": "A tool that checks the health status of a specific system and provides relevant information or error messages. It may occasionally return unexpected or humorous responses.", "Return Results:" "I’m a teapot."} |

**Table 8: Comparison of original tool documentation and modified versions using DRAFT in some cases from the RestBench Dataset.**
| Raw Tool Description (Irrelevant) |
| --- |
| {"Tool Name": "GET_trending_media_type_time_window", "description": "Get the daily or weekly trending items. The daily trending list tracks items over the period of a day while items have a 24 hour half life. The weekly list tracks items over a 7 day period, with a 7 day half life.#### Valid Media Types| **Media Type** | **Description** || - | - || all | Include all movies, TV shows and people in the results as a global trending list. || movie | Show the trending movies in the results. || tv | Show the trending TV shows in the results. || person | Show the trending people in the results. |#### Valid Time Windows| **Time Window** | **Description** || - | - || day | View the trending list for the day. || week | View the trending list for the week. |"} |
| Ours |
| {"Tool Name": "GET_trending_media_type_time_window", "description": "This API provides access to trending items on a daily or weekly basis, including movies, TV shows, or people. The ’media_type’ parameter is required and specifies the type of media: ’movie’ for movies, ’tv’ for TV shows, ’person’ for people, or ’all’ to include all types. The ’time_window’ parameter is also required and can be set to ’day’ for daily trends or ’week’ for weekly trends. The API response includes a list of trending items with fields such as ’id’, ’name’, ’original_name’, ’media_type’, ’popularity’, ’gender’, ’known_for_department’, ’profile_path’, and ’known_for’. For each ’known_for’ item, details like ’title’, ’original_title’, ’overview’, ’poster_path’, ’media_type’, ’original_language’, ’genre_ids’, ’popularity’, ’release_date’, ’vote_average’, and ’vote_count’ are included. Pagination is supported, allowing navigation through results using the ’page’ parameter, with ’total_pages’ and ’total_results’ indicating the number of pages and total results available. The API can filter content based on language preferences (’original_language’) and content restrictions (’adult’)."} |
| Raw Tool Description (Ambiguous) |
| {"Tool Name": "GET_person_person_id_tv_credits", "description": "Get the TV show credits for a person. You can query for some extra details about the credit with the [credit method](#endpoint:xPWdEBLkvCNZSicLN)."} |
| Ours |
| {"Tool Name": "GET_person_person_id_tv_credits", "description": "This API retrieves TV show credits for a person using their unique ’person_id’. It returns two main categories of credits: ’cast’ and ’crew’. Each credit includes details such as the TV show’s name, first air date, overview, popularity, and the person’s role (e.g., Director). The ’crew’ category provides additional information like department, job, and episode count. A valid ’person_id’ is required, and if an invalid or non-existent ’person_id’ is provided, the API will return an error message. The tool does not require any additional parameters. Ensure that the ’person_id’ is correctly formatted and exists in the database to avoid errors. Additional details about the TV show credits can be queried using the credit method."} |
| Raw Tool Description (Error Message) |
| {"Tool Name": "GET_tv_latest", "description": "Get the most newly created TV show. This is a live response and will continuously change."} |
| Ours |
| {"Tool Name": "GET_tv_latest", "description": "Retrieve live, comprehensive details about the most recently created TV show, including its name, air dates, episodes, production status, genres, networks, production companies, and countries. The tool also provides information on the latest and upcoming episodes, as well as metadata like popularity and vote statistics. Note that some fields may be empty if the information is not available at the time of the query."} |
| Raw Tool Description (Incomplete) |
| {"Tool Name": "GET_genre_tv_list", "description": "Get the list of official genres for TV shows."} |
| Ours |
| {"Tool Name": "GET_genre_tv_list", "description": "Retrieve the official list of TV show genres from The Movie Database (TMDb). This tool provides a JSON object containing an array of genre objects, each with an ’id’ and a ’name’. It is specifically designed for TV show genres and does not require any input parameters."} |

**Table 9: Revision trajectory of tool documentation through the first two iterations of modifications using DRAFT.**
| Raw Tool Documentation |
| --- |
| {"tool name": "GET_person_person_id_tv_credits",<br>"tool description": "Get the TV show credits for a pers-<br>on. You can query for some extra details about the credit with the [credit method](#endpoint:xPWdEBLkvC-<br>NZSicLN)."} |
| First Iteration |
| /* Explorer */<br>{"User Query": "Can you tell me about the TV shows that actor John Doe has been a part of?", "url":<br>"http://api.themoviedb.org/3/person/{person_id}/tv_credits", "Parameters": {}, "API_Response": {"success":<br>false, "status_code": 6, "status_message": "Invalid id: The pre-requisite id is invalid or not found."}}<br>/* Analyzer */<br>The tool description should clarify that a valid ’person_id’ is required to retrieve TV show credits for a pers-<br>on. The current description does not mention the necessity of this parameter, which is crucial for the tool to<br>function correctly. Additionally, the description should specify that the tool will return an error message if<br>an invalid or non-existent ’person_id’ is provided. This will help users understand the importance of providi-<br>ng correct input and what to expect in case of an error.<br>/* Rewriter */<br>{ "Rewritten description": "Retrieve TV show credits for a person using their unique ’person_id’. A valid<br>’person_id’ is required to access this information. If an invalid or non-existent ’person_id’ is provided, the<br>tool will return an error message indicating the issue. Additional details about the TV show credits can be<br>queried using the credit method.",<br>"Suggestions for exploring": "To further explore this API, it would be beneficial to understand the structure<br>of the response when a valid ’person_id’ is used. This includes the types of information returned about each<br>TV show credit, such as the role played, the show’s title, and the dates of involvement. Additionally, explor-<br>ing how to obtain a valid ’person_id’ for a given actor or actress could be useful, as well as understanding<br>any rate limits or restrictions on the number of queries that can be made."} |
| Second Iteration |
| /* Explorer */<br>{"User Query": "What TV shows has actress Jane Smith been involved in throughout her career?", "url":<br>"http://api.themoviedb.org/3/person/{person_id}/tv_credits", "Parameters": {}, "API_Response": {"success":<br>false, "status_code": 6, "status_message": "Invalid id: The pre-requisite id is invalid or not found."}}<br>/* Analyzer */<br>The tool retrieves TV show credits for a person using their unique ’person_id’. It is essential to provide a<br>valid ’person_id’ to access this information. If an invalid or non-existent ’person_id’ is provided, the tool<br>will return an error message with a status code and a status message indicating the issue. The tool does<br>not require any additional parameters. Additional details about the TV show credits can be queried using the<br>credit method. Ensure that the ’person_id’ is correctly formatted and exists in the database to avoid errors.<br>/* Rewriter */<br>{ "Rewritten description": "This API retrieves TV show credits for a person using their unique ’person_id’.<br>A valid ’person_id’ is essential to access the information. If an invalid or non-existent ’person_id’ is provided,<br>the API will return an error message with a status code and a status message indicating the issue. The tool<br>does not require any additional parameters. Ensure that the ’person_id’ is correctly formatted and exists in the<br>database to avoid errors. Additional details about the TV show credits can be queried using the credit method.",<br>"Suggestions for exploring": "To further explore this API, consider testing with a known valid ’person_id’ to<br>observe the structure and details of a successful response. Additionally, explore how the API handles edge<br>cases, such as a ’person_id’ that exists but has no TV credits. Investigate the format and type of additional<br>details that can be retrieved using the credit method to understand the full capabilities of the API."} |

**Table 10: Revision trajectory of tool documentation in the third round of modifications using DRAFT.**
| Third Iteration |
| --- |
| /* Explorer */<br>{"User Query": "Can you provide the TV show credits for the person with ID 12345?", "url":<br>"http://api.themoviedb.org/3/person/12345/tv_credits", "Parameters": {}, "API_Response": {"cast": [],<br>"crew": [{ "adult": false, "backdrop_path": "/fmPo20ZTzxNketxL2jt6ZX6KSPi.jpg", genre_ids": [10759, 18,<br>10765,80], "id": 2384, "origin_country": [ "US" ], "original_language": "en", "original_name": "Knight<br>Rider", "overview": "Michael Long, an undercover police officer, is shot while investigating a case and left<br>for dead by his assailants. He is rescued by Wilton Knight, a wealthy, dying millionaire and inventor who<br>arranges life-saving surgery, including a new face and a new identity–that of Michael Knight. Michael is then<br>given a special computerized and indestructible car called the Knight Industries Two Thousand (nicknamed<br>KITT), and a mission: apprehend criminals who are beyond the reach of the law. The series depicts Michael’s<br>exploits as he and KITT battle the forces of evil on behalf of the Foundation for Law and Government.",<br>"popularity": 204.362, "poster_path": "/t57NXzTrwp5rnPXiaX4BThrDxt1.jpg", "first_air_date": "1982-09-26",<br>"name": "Knight Rider", "vote_average": 7.5, "vote_count": 1227, "credit_id": "55bb4faec3a3684fc0002cd4",<br>"department": "Directing", "episode_count": 1, "job": "Director"}}<br>/* Analyzer */<br>The API retrieves TV show credits for a person using their unique ’person_id’. It returns two main categories<br>of credits: ’cast’ and ’crew’, with details such as the TV show’s name, first air date, overview, popularity, and<br>the person’s role (e.g., Director). The ’crew’ category includes additional information like department, job,<br>and episode count. A valid ’person_id’ is required, and if an invalid or non-existent ’person_id’ is provided,<br>the API will return an error message. The tool does not require any additional parameters. Ensure that the<br>’person_id’ is correctly formatted and exists in the database to avoid errors. Additional details about the TV<br>show credits can be queried using the credit method.<br>/* Rewriter */<br>{"Rewritten description": "This API retrieves TV show credits for a person using their unique ’person_id’.<br>It returns two main categories of credits: ’cast’ and ’crew’. Each credit includes details such as the TV show’s<br>name, first air date, overview, popularity, and the person’s role (e.g., Director). The ’crew’ category provides<br>additional information like department, job, and episode count. A valid ’person_id’ is required, and if an<br>invalid or non-existent ’person_id’ is provided, the API will return an error message. The tool does not<br>require any additional parameters. Ensure that the ’person_id’ is correctly formatted and exists in the datab-<br>ase to avoid errors. Additional details about the TV show credits can be queried using the credit method.",<br>"Suggestions for exploring": "To further explore the API, consider querying for different ’person_id’ values<br>to see how the API handles various cases, such as when a person has only cast credits or only crew credits.<br>Additionally, explore how the API responds to edge cases, such as when a person has no TV credits at all.<br>Investigate the structure of the ’cast’ category to understand the type of information provided there, as the<br>current exploration focused on the ’crew’ category. Finally, test the API’s error handling by intentionally<br>using invalid ’person_id’ values to observe the error messages returned."} |

**Table 11: Revision trajectory of tool documentation in the fourth round of modifications using DRAFT.**
| Fourth Iteration |
| --- |
| /* Explorer */<br>{"User Query": "Can you look up the TV show credits for the person with ID 99999 and let me know if<br>they have any crew roles?", "url": "http://api.themoviedb.org/3/person/99999/tv_credits", "Parameters": {},<br>"API_Response": {"success": false, "status_code": 34, "status_message": "The resource you requested could<br>not be found."}}<br>/* Analyzer */<br>The API retrieves TV show credits for a person using their unique ’person_id’. It categorizes credits into ’cast’<br>and ’crew’, providing details such as the TV show’s name, first air date, overview, popularity, and the person’s<br>role. For crew credits, it includes additional information like department, job, and episode count. A valid<br>’person_id’ is required to access this information. If an invalid or non-existent ’person_id’ is provided, the API<br>will return an error message with a status code and status message indicating the issue. The tool does not<br>require any additional parameters. Ensure that the ’person_id’ is correctly formatted and exists in the database.<br>Additional details about the TV show credits can be queried using the credit method. The API response will<br>include a ’success’ flag and, if unsuccessful, a ’status_code’ and ’status_message’ to indicate the problem.<br>/* Rewriter */<br>{"Rewritten description": "This API retrieves TV show credits for a person using their unique ’person_id’. It<br>categorizes credits into ’cast’ and ’crew’, providing details such as the TV show’s name, first air date, overv-<br>iew, popularity, and the person’s role. For crew credits, it includes additional information like department, job,<br>and episode count. A valid ’person_id’ is required to access this information. If an invalid or non-existent<br>’person_id’ is provided, the API will return an error message with a status code and status message indicating<br>the issue. The tool does not require any additional parameters. Ensure that the ’person_id’ is correctly<br>formatted and exists in the database. Additional details about the TV show credits can be queried using the<br>credit method. The API response will include a ’success’ flag and, if unsuccessful, a ’status_code’ and ’statu-<br>s_message’ to indicate the problem.",<br>"Suggestions for exploring": "To further explore this API, consider querying with a valid ’person_id’ to exa-<br>mine the structure and content of a successful response. This will help understand the data fields returned for<br>both ’cast’ and ’crew’ credits. Additionally, explore edge cases such as querying with a ’person_id’ that has<br>only cast credits or only crew credits to see how the API handles these scenarios. Investigating the response<br>for a ’person_id’ associated with a highly popular TV show could also provide insights into how popularity<br>metrics are represented."} |

**Table 12: Revision trajectory of tool documentation in the fifth round of modifications using DRAFT.**
| Fifth Iteration |
| --- |
| /* Explorer */<br>{"User Query": "Can you look up the TV show credits for the person with ID 24680 and let me know if they<br>have any credits in both cast and crew roles?", "url": "http://api.themoviedb.org/3/person/24680/tv_credits",<br>"Parameters": {}, "API_Response": {"cast": [], "crew": [{ "adult": false, "backdrop_path": "/d1wj4WQ87tj7<br>dLgXCKfPOe8AOz4.jpg","genre_ids": [18], "id": 19649, "origin_country": ["IT", "GB"], "original_langua-<br>ge": "en", "original_name": "Jesus of Nazareth", "overview": "Dramatizes the Birth, Life, Ministry, Crucifix-<br>ion, and Resurrection of Jesus Christ, largely according to the Holy Bible’s New Testament Gospels.", "popu-<br>larity": 38.929, "poster_path": "/dlGmVpZ2rpGRDZsSa64nzyu90xk.jpg", "first_air_date": "1977-03-27", "n-<br>ame": "Jesus of Nazareth", "vote_average": 7.727, "vote_count": 479, "credit_id": "59147af2c3a368423c00e-<br>100", "department": "Sound", "episode_count": 4, "job": "Sound Recordist"}], "id": 24680}<br>/* Analyzer */<br>The API retrieves TV show credits for a person using their unique ’person_id’. It categorizes credits into ’cast’<br>and ’crew’, providing details such as the TV show’s name, first air date, overview, popularity, and the person’s<br>role. For crew credits, it includes additional information like department, job, and episode count. A valid<br>’person_id’ is required to access this information. If an invalid or non-existent ’person_id’ is provided, the API<br>will return an error message with a status code and status message indicating the issue. The tool does not requi-<br>re any additional parameters. Ensure that the ’person_id’ is correctly formatted and exists in the database. Note<br>that the API response does not include a ’success’ flag; instead, it provides the ’cast’ and ’crew’ lists directly.<br>Additional details about the TV show credits can be queried using the credit method.<br>/* Rewriter */<br>{"Rewritten description": "This API retrieves TV show credits for a person using their unique ’person_id’. It<br>categorizes credits into ’cast’ and ’crew’, providing details such as the TV show’s name, first air date, overvi-<br>ew, popularity, and the person’s role. For crew credits, it includes additional information like department, job,<br>and episode count. A valid ’person_id’ is required to access this information. If an invalid or non-existent ’p-<br>erson_id’ is provided, the API will return an error message with a status code and status message indicating<br>the issue. The tool does not require any additional parameters. Ensure that the ’person_id’ is correctly format-<br>ted and exists in the database. The API response does not include a ’success’ flag; instead, it provides the ’cast’<br>and ’crew’ lists directly. Additional details about the TV show credits can be queried using the credit method.",<br>"Suggestions for exploring": "Consider exploring how the API handles edge cases, such as when a person has<br>no TV credits at all or when they have credits in both cast and crew roles. Additionally, investigate if the API<br>provides any sorting or filtering options for the credits, such as by date or popularity. Another area to explore<br>could be the level of detail provided in the ’overview’ field and whether it varies significantly between differ-<br>ent TV shows."} |

## Peer Reviews

confidence: 4
contribution: 4
initial_rating: 8
presentation: 4
questions: 1. The paper highlights how the count of iteration impacts the performance of DRAFT mentioning - ‘a decline in performance is observed after a certain number of iterations. This decline may be attributed to the introduction of redundant information as the number of iterations increases, potentially leading to overfitting’. Is it possible to measure the count of redundant information in the system? It would be nice to see some sort of hallucination error measurement on top of DRAFT.
soundness: 3
strengths: 1. DRAFT significantly outperforms across two benchmarks and outperforms three baselines.
2. It also verifies the results through a small human study — showing its effectiveness in practical use cases.
3. The paper provides an in-depth analysis of the impact of iteration count on the performance as well as the improved performance for retrieval in the rewritten documentation.
summary: This paper highlights the importance of proper tool documentation to improve tool learning. Due to incomplete documentation or consideration of human intuition, tool documentation may not include all the information to be useful for an LLM. To resolve these issues, the paper proposed DRAFT that iteratively gathers ‘experience’, learns from it, and rewrites the documentation for future usage.
weaknesses: 1. According to the first contribution highlighted in the introduction, DRAFT highlights ‘inefficiencies and inaccuracies within existing tool documentation hamper the effective utilization of tools by LLMs’. However, the paper does not show any quantitative evaluation of this claim rather than explaining the problems associated with it. Hence, I think the ‘highlight’ itself may not be a novel contribution as much as the framework.
2. For ‘tool-adaptive termination mechanism’, is it possible to measure the impact of different threshold on the performance of DRAFT?

---

confidence: 4
contribution: 4
initial_rating: 8
presentation: 3
questions: Check above. In general, this paper is well written, and the experiments are quite convincing to me. Please check above for clarifications about (1) parameter space exploration, (2) analysis of example quality and (3) types of documentations DRAFT best at targeting comparing to others.
soundness: 4
strengths: This paper provides a well designed approach for improving LLMs' tool using ability without additional training. The document refinement approach, while not new, is well designed considering how to leverage LLMs' self-reflection ability and trial-and-error approach to enhance document quality. This paper has the following strengths:

1. Leveraging diversity of exploration and trial-and-error to compensate potential limitation of the the initial document. Where other refinement approach like EasyTool may not be able to obtain such extra information.
2. The evaluation has fair comparison with related work to highlight performance gain. The detailed analysis show additional benefits of this approach.
summary: This paper addresses the tool usage challenge for LLMs. The core idea is to develop a explore-analyze-rewrite approach to refine tool documentation to improve LLMs' ability to use tools that may have lower quality documentation. To enhance tool documentation refinement, DRAFT encourages diverse queries to try out different queries to trigger different tool behaviors; these execution results are then leveraged into the analysis phase for documentation rewriting. 

DRAFT is evaluated on ToolBench and RestBench, results on CP% and WIN% shows that the refined document improves task completion, especially compared to closely related EasyTool. Detailed analysis of iteraction rounds, ablation results on diversity and adaptive shows significance of features in DRAFT. Also, it's interesting to learn that refined document could also potentially benefit tool retrieval and human understanding.
weaknesses: This paper can be improved upon the following two areas:

1. Please elaborate more in detail about Explorer design and evaluation. DRAFT relies on diverse queries/parameters to trigger different tool behaviors. It looks like the query generation depends on LLM to sample parameters automatically based on tool signature as provided by toolbench. It would be ideal to analyze how diverse in terms of parameter coverage, especially for certain types of parameter like arrays / strings. I imagine if the document is indeed incomplete as mentioned in the intro, these special cases may be less likely going to be hit during exploration. While existing benchmarks conveniently provide well defined parameter domain, it would worth the authors to include in the discussion about how to generalize this for tool documents without good parameter documentation.

2. The exploration-revision loop essentially helps the system to collect more input-output examples that previously doesn't exist in the document. A qualitative analysis between examples generated by revision-only based tool like EasyTool and new examples generated by DRAFT would be helpful to understand this nuance difference.

3. The intro motivates different types of documentation limiations (incomplete, redundant, inaccurate), it would be good to provide qualitative feedback about which scenarios DRAFT is best at improving, especially comparing to prior tools.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 3
questions: - Equation 1: What is M? Is this supposed to be A, the Explorer?
- Line 209: How do the two components come together to make up the diversity promoting exploration strategy? Two different constraints were explained, but how do they come together to promote diversity? Is this explicitly included in Algorithm 1 somewhere? Also, is there any citation or support for why self-reflection would promote diversity? How do we know this works?
- Equation 3: Again, what is M?
- Line 281 - “Analogous to recipes requiring different levels of expertise, some tools may reach optimal documentation faster than others”. Any citation for this? What is “optimal” in this case? Also, what does faster mean? Is it in terms of the number of trials? Or the number of explorations needed?
- Equation 5: How did you come up with this? Ignoring empirical performance, why does similarity score + BLEU score work for measuring the degree of change? Why are they weighted equally (e.g. why not weigh surface form similarity / BLEU higher than semantic similarity?)
- Experimental Setup: How many rounds of DRAFT iterations were run (did DRAFT ever not terminate within a certain number of steps)? Were the initial documentations the original ones from DFSDT or ReAct?
- Typo Line 326 - “EayTool”
- The human study detailed in Line 473 onwards feels like it could be better explained. Are the doctor-al (Line 477) students part of the author group? What examples or guidelines did the human annotators use to judge the three criteria correctly? Did the human annotators generally agree with each other (Fleiss Kappa score)?
- Section 2 read a bit repetitive at times - was this section written with the assistance of a language model? It may be easier to read with less redundancy. Specifically, the beginnings of each of the subsections essentially repeat what was stated in the introduction and prior subsections.
soundness: 2
strengths: The motivation established by the authors is sound and makes sense. In addition, the formalizations introduced in Section 2 make it easy to follow how the outputs on one prompt feed into the next. The use of an exploration phase is interesting, similar to fuzzing of a program for software engineering tests. The experiments are sound and it follows prior works. The related work covered by the authors is quite comprehensive. The ablations are complete, as the authors do a good job examining the several parameters of DRAFT.
summary: This work introduces a new prompting workflow for improving tool documentation iteratively called DRAFT. While prior tool documentation is typically iterated on manually and laboriously, this work focuses on automating the process of improving documentation via a three step procedure that can be repeated multiple times. The outputs of prior phases (e.g. Explorer, Analyzer) are fed into subsequent phases (Analyzer, Rewriter), where each phase produces prior experiences and filtering that is then used to refine the prompt further. To encourage diverse exploration and ensure that DRAFT terminates at some point, the authors introduce new strategies that encourage such convergence. Following the experimental setup of prior works, the authors show that DRAFT outperforms previous interactive prompting methods and run ablations demonstrating the effect of different parameters and effects of DRAFT.
weaknesses: - While they are clearly thoughtfully made, I would recommend Figures 1 and 2 be simpler to make it easier for a reader to understand what is going on. The captions would also benefit from being more specific about what is going on in the diagram. For instance, for Figure 2, I did not understand what “Trail” (I think this was supposed to be “Trial”?) refers to, is it an iteration of explorer/analyzer/rewriter?
- The methodology section, while clear in how the symbols relate to one another, feels somewhat ungrounded in terms of why certain equations or prompt templates were used. For instance, on line 299 - “when the documentation is adequately aligned with comprehension” - what does this mean? What is adequately aligned? I think introducing more citations and explanations for why contributions such as the diversity and termination mechanisms would be needed for a more rigorous justification of why this method is interesting, and not just a prompt based workflow that happens to work.
- DSPy (Khattab 2022) performs prompt optimization with multiple rounds of trial/error against a validation set. What makes DRAFT different from DSPy as a prompt optimization technique?
- Although the method is proven to be effective in the experimental results, I think it would be nice to see, qualitatively, the effects of better documentation on downstream performance. While it seems that DRAFT improves the quality of the documentation, it is not obvious why better documentation improves empirical performance. For instance, it may also be possible that more “concise” documentation does not necessarily lead to improvements in downstream performance.

Meta-review: The paper highlights the importance of proper documentation for tools in the context of LLM tool usage. They propose a method to improve this documentation, and show its effectiveness. The paper provides an important observation along with a novel solution for the issue. The reviews appreciated the depth of the analysis, including not just the bottom-line results but motivation for chosen made. The positioning against related work is agreed by the reviewers to be well-written and thorough, and the empirical evidence of the advantages provided by the technique is solid and convincing. 

One key issue, raised by CrZf, was a need for a better comparison with a previous work (DSPy), but this was mitigated by the authors’ response. I urge the authors to make this issue clear in the final version of the paper. Concluding, the paper provides a novel solution for an important problem along with convincing empirical evidence of its effectiveness. It would be a great addition to ICLR.

Decision: Accept (Oral)