AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning

Shirley Wu, Shiyu Zhao, Qian Huang, Kexin Huang, Michihiro Yasunaga +4 more
2/3/2026

No official code found. Best implementation: zou-group/avatar (242 stars, last commit 2025-06-10).

Abstract

Large language model (LLM) agents have demonstrated impressive capabilities in utilizing external tools and knowledge to boost accuracy and reduce hallucinations. However, developing prompting techniques that enable LLM agents to effectively use these tools and knowledge remains a heuristic and labor-intensive task. Here, we introduce AvaTaR, a novel and automated framework that optimizes an LLM agent to effectively leverage provided tools, improving performance on a given task. During optimization, we design a comparator module to iteratively deliver insightful and comprehensive prompts to the LLM agent by contrastively reasoning between positive and negative examples sampled from training data. We demonstrate AvaTaR on four complex multimodal retrieval datasets featuring textual, visual, and relational information, and three general question-answering (QA) datasets. We find AvaTaR consistently outperforms state-of-the-art approaches across all seven tasks, exhibiting strong generalization ability when applied to novel cases and achieving an average relative improvement of 14% on the Hit@1 metric for the retrieval datasets and 13% for the QA datasets. Code and dataset are available at https://github.com/zou-group/avatar.

View on arXivView PDF

Code Implementations(1)

zou-group/avatarCommunity100%

(NeurIPS 2024) AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning

24227Shell, PythonJun 14, 20241 years ago
agentsknowledge-basellmsretrievaltool-use

Similar Papers

Cite this paper

@article{wu2026avatar,
  title  = {AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning},
  author = {Shirley Wu and Shiyu Zhao and Qian Huang and Kexin Huang and Michihiro Yasunaga and V. Ioannidis and Karthik Subbian and J. Leskovec and James Zou},
  year   = {2026},
  eprint = {2406.11200},
  archivePrefix = {arXiv},
  doi    = {10.52202/079017-0817},
  url    = {https://arxiv.org/abs/2406.11200},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.11200.svg)](https://codeofpaper.com/paper/2406.11200)

Discussion