Tool Documentation Enables Zero-Shot Tool-Usage with Large Language Models

Cheng-Yu Hsieh, Si-An Chen, Chun-Liang Li, Yasuhisa Fujii, Alexander Ratner, Chen-Yu Lee, Ranjay Krishna, Tomas PfisterarXiv 2023 · DOI

Introduction

As Large Language Models (LLMs) transition from conversational interfaces to autonomous agents, their ability to interact with external tools—such as calculators, search engines, and specialized vision models—becomes paramount. Traditionally, teaching LLMs to utilize these tools has relied on few-shot demonstrations: providing specific examples of input-output pairs for tool calls. However, this approach faces significant challenges in terms of data scarcity, sensitivity to example choice, and poor scalability as tool libraries expand.

Overview of the tool-use planning framework where an LLM utilizes a tool set to solve a query.

Methodology: From Demonstrations to Documentation

The core proposal of this research is a shift from "showing" (demonstrations) to "telling" (documentation). By providing the LLM with a "manual" or README-style description of each tool's functionality and syntax, the model can engage in zero-shot tool usage. This method leverages the inherent reasoning capabilities of LLMs to interpret technical specifications rather than mimicking specific patterns.

Comparison between few-shot demonstrations and zero-shot tool documentation.

Experimental Evaluation

The researchers evaluated this approach across several benchmarks: ScienceQA, TabMWP, NLVRv2, and a custom-built "LLM Cloud CLI" benchmark. The latter involved 200 renamed commands to prevent the model from relying on pre-existing training data, forcing it to rely solely on the provided documentation. To handle the large volume of tools, a TF-IDF retrieval system was used to select the most relevant documentation for the model's context window.

Key Results and Insights

Results indicate that zero-shot documentation frequently outperforms few-shot demonstrations. For instance, on ScienceQA, documentation-based prompting achieved 79.91% accuracy compared to 79.20% for 10-shot demos. In the high-scale LLM Cloud CLI task, the documentation approach significantly outperformed demos (F1 score of 0.45 vs 0.19), which failed to cover the broad API surface.

Furthermore, the study observed a "re-invention" phenomenon where LLMs independently combined documented tools (like object detectors and segmentors) to create complex pipelines previously established as state-of-the-art research projects. This suggests that documentation provides a more neutral and comprehensive "teacher" than specific examples, which can often lead to biased or brittle tool usage.

Limitations and Conclusion

While effective, the approach is limited by the context window of current LLMs; performance tends to degrade when documentation exceeds approximately 600 words. Future work will focus on improving retrieval mechanisms for large-scale documentation libraries and enhancing multi-step reasoning capabilities. In conclusion, providing clear, technical documentation is a more scalable and robust way to enable LLMs to use external tools than manual curation of examples.

Summary updated

BibTeX
@misc{hsieh2023tool,
  author = {Cheng-Yu Hsieh and Si-An Chen and Chun-Liang Li and Yasuhisa Fujii and Alexander Ratner and Chen-Yu Lee and Ranjay Krishna and Tomas Pfister},
  title = {{Tool Documentation Enables Zero-Shot Tool-Usage with Large Language Models}},
  year = {2023},
  eprint = {2308.00675},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.00675},
}
Figure