Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tools are Under-documented: Simple Document Expansion Boosts Tool Retrieval (ICLR 2026)

Paper License

Tool-REX (Tool Retrieval with EXpansion) is a benchmark and framework that enhances tool retrieval by systematically enriching tool documentation using Large Language Models (LLMs).

Note: Tool-REX was previously known as Tool-DE (as referred to in our initial research). We have rebranded the project to Tool-REX (Tool Retrieval with EXpansion) to better reflect its core mechanism and framework capabilities.

📖 Introduction

Tool-REX is a new benchmark and framework that enhances tool retrieval by systematically enriching tool documentation using Large Language Models (LLMs). Existing benchmarks (e.g., ToolBench, ToolACE, ToolRet) reveal a key bottleneck — incomplete and inconsistent tool documentation hinders retrieval quality.

Incomplete field coverage across tool-use datasets

Figure 1: Incomplete field coverage across the 35 tool-use datasets.

To address this, Tool-REX introduces an LLM-driven document expansion pipeline that generates structured fields such as function_description, when_to_use, limitations, and tags. We further release two models built upon this data:

  • Tool-Embed – a dense retriever trained on 50k expanded documents
  • Tool-Rank – an LLM-based reranker trained on 200k pairs

Tool-REX achieves new state-of-the-art results on both ToolRet and its own benchmark, setting a foundation for data-centric tool retrieval research.

🔗 Resources

Datasets

Benchmark

Training Datasets

Models

Tool-Embed

Tool-Rank


🧩 Environment

Tested with Python 3.10+ and CUDA-enabled GPUs for large models.

Install dependencies:

conda env create -f requirements.yml
conda activate tool-rex

🚀 Quickstart

All examples assume you are in the repository root.

1) Retrieval (dense retriever)

Use eval_retrieval in tool_de/eval.py or run the example script.

python example/embedding.py

Direct call:

from tool_de.eval import eval_retrieval

results = eval_retrieval(
    model_name="Lux1997/Tool-Embed-0.6B",
    tasks="all",
    category="all",
    batch_size=8,
    output_file="./results/output_embed_0.6b.json",
    top_k=100,
    is_inst=False,
    is_print=True
)

2) Reranking (ToolRank / reranker)

ToolRank uses eval_toolrank in tool_de/eval.py.

python example/rerank_single_task.py

Direct call:

from tool_de.eval import eval_toolrank

output, results = eval_toolrank(
    model_name="Lux1997/Tool-Rank-4B",
    tasks="all",
    instruct=True,
    from_top_k=100,
    batch_size=4,
    context_size=32000,
    num_gpus=1,
    force_rethink=0,
    retrieval_results_path="./results/output/your_retrieval_output.json"
)

🔁 How to switch models

You can change models in two ways:

  1. Pass a different model_name at runtime:
eval_retrieval(model_name="Lux1997/Tool-Embed-4B", ...)
eval_toolrank(model_name="Lux1997/Tool-Rank-8B", ...)
  1. Update defaults in tool_de/config.py:
  • _EMBEDDING_MODEL
  • _RERANKING_MODEL
  • _QUERY_REPO / _TOOL_REPO

📝 Notes

  • Reranking requires retrieval outputs first. Provide the retrieval output path via retrieval_results_path.
  • Datasets are loaded from Hugging Face via the dataset IDs in tool_de/config.py.

📚 Citation

@inproceedings{
lu2026tools,
title={Tools are under-documented: Simple Document Expansion Boosts Tool Retrieval},
author={Xuan Lu and Haohang Huang and Rui Meng and Yaohui Jin and Wenjun Zeng and Xiaoyu Shen},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=g9D9MgG7iW}
}

Credits

Part of the code is adapted from tool-retrieval-benchmark.

About

No description, website, or topics provided.

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages