Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive Reasoning

About

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.

Shirley Wu, Shiyu Zhao, Qian Huang, Kexin Huang, Michihiro Yasunaga, Kaidi Cao, Vassilis N. Ioannidis, Karthik Subbian, Jure Leskovec, James Zou• 2024

Related benchmarks

TaskDatasetResultRank
Knowledge Graph RetrievalPrime (test)
H@118.4
33
Knowledge Graph RetrievalMAG (test)
H@144.4
33
Knowledge Graph RetrievalSTaRK-Amazon 1.0 (Human)
Hits@158.32
32
Knowledge Graph RetrievalAmazon (test)
Hit@149.9
28
Knowledge Graph RetrievalSTARK AMAZON
H@158
25
Knowledge Graph RetrievalSTARK-PRIME
H@133
25
RetrievalSTaRK AMAZON Synthetic
Recall@2060.57
20
Knowledge Graph RetrievalSTaRK-Amazon Synthetic 1.0
Hits@149.97
20
Knowledge Graph RetrievalSTaRK-MAG Synthetic 1.0
Hits@146.08
20
Knowledge Graph RetrievalSTaRK-Prime Synthetic 1.0
Hits@10.201
20
Showing 10 of 34 rows

Other info

Code

Follow for update