A Comprehensive Evaluation of Tool-Assisted Generation Strategies (2023)

Abstract: A growing area of research investigates augmenting language models with tools (e.g., search engines, calculators) to overcome their shortcomings (e.g., missing or incorrect knowledge, incorrect logical inferences). Various few-shot tool-usage strategies have been proposed. However, there is no systematic and fair comparison across different strategies, or between these strategies and strong baselines that do not leverage tools. We conduct an extensive empirical analysis, finding that (1) across various datasets, example difficulty levels, and models, strong no-tool baselines are competitive to tool-assisted strategies, implying that effectively using tools with in-context demonstrations is a difficult unsolved problem; (2) for knowledge-retrieval tasks, strategies that *refine* incorrect outputs with tools outperform strategies that retrieve relevant information *ahead of* or *during generation*; (3) tool-assisted strategies are expensive in the number of tokens they require to work—incurring additional costs by orders of magnitude—which does not translate into significant improvement in performance. Overall, our findings suggest that few-shot tool integration is still an open challenge, emphasizing the need for comprehensive evaluations of future strategies to accurately assess their *benefits* and *costs*.

## introduction augmenting language models (lms) with tools has been proposed to overcome lms' inherent weaknesses @xcite , such as the lack of grounding to reliable or updated sources @xcite , incoherent logical ability @xcite and arithmetic ability @xcite , among others. this is done through tool-assisted (ta) generation, where lms are trained or instructed to use external tools, such as search engines over the web-e.g., ## tool-assisted language models we describe existing few-shot strategies for augmenting lms with tools and discuss related work. who lived longer, muhammad ali or alan turing? yes. follow up: how old was muhammad ali when he died? intermediate answer: muhammad ali died at the age of 74. intermediate answer: alan turing was only 41 when he took his own life. follow up: how old was alan turing when he died? search(how old was muhammad ali when he died?) -> muhammad ali died at the age of 74. alan turing was only 41 when he took his own life. search(how old was alan turing when he died?) -> muhammad ali was 74 years old when he died. alan turing was 41 years old when he died. document 1: muhammad ali died at the age of 74. document 2: alan turing was only 41 when he took his own life. turing was 41 years old when he died. muhammad ali was 74 years old when he died. are follow up questions needed here: selfask inline interleaving muhammad ali was 40 years old when he died. alan turing was 41 years old when he died. so the final answer is: muhammad ali search(muhammad ali was 40 years old when he died.) -> muhammad ali died at the age of 74. corrected: muhammad ali was 74 years old when he died. search(alan turing was 41 years old when he died.) -> alan turing was only 41 when he took his own life. correct: alan turing was 41 years old when he died. check & fix muhammad ali was 40 years old when he died. alan turing was 41 years old when he died. so the final answer is: muhammad ali q1: how old was muhammad ali when he died? search(how old was muhammad ali when he died?) -> muhammad ali died at the age of 74. relevant, corrected: muhammad ali was 74 years old when he died. q2: how old was alan turing when he died? search(how old was alan turing when he died?) -> alan turing was only 41 when he took his own life. relevant, correct: alan turing was 41 years old when he died. rarr who lived longer, muhammad ali or alan turing? (a) (b) (c) yes. follow up: how old was muhammad ali when he died? intermediate answer: muhammad ali died at the age of 74. follow up: how old was alan turing when he died? intermediate answer: alan turing was only 41 when he took his own life. search(how old was muhammad ali when he died?) -> muhammad ali was 74 years old when he died. muhammad ali was 74 years old when he died. search(how old was alan turing when he died?) -> alan turing was 41 years old when he died. alan turing was 41 years old when he died. muhammad ali was 74 years old when he died. turing was 41 years old when he died. are follow up questions needed here: selfask -baseline inline -baseline chain of thought -baseline so the final answer is: muhammad ali figure 2: overview of the ta strategies implemented in this work. blue text marks tool queries, tool responses are in turquoise cells, refinement is in orange cells and dashed arrows, and yellow cells are lm generations. and factuality of each claim by generating questions based on the claim, retrieving snippets that answer these questions, and checking if the answers match the information in the claim. if not, the claim is refined to match the snippets. check & fix, a method we introduce in this work, uses each cot step as a search query, and checks whether the step is entailed by the retrieved snippets by prompting the model to classify this entailment. this strategy is similar to jiang et al. (2023, contemporaneous work), which additionally uses low-confidence filtering but omits the entailment verification. ## experimental setup our goal is to conduct a fair and reliable comparison of ta strategies, without being influenced by properties of specific models, tools or prompts. to this end, we focus on few-shot tool usage, a popular ta scheme that allows flexibility around using new tools and adapting tools to specific tasks. in what follows, we describe our experimental setup. what guides this experimental setup is to perform a comprehensive, rigorous evaluation without the pitfalls of §3. our evaluation covers 5 different ta strategies, 4 recent lms, 4 complex reasoning datasets, 3 few-shot prompts, and 2 tools. for each ta strategy + dataset + model combination, we run three experiments with a different number of demonstrations. overall, our evaluation includes an execution of 342 experiments, each of which generates 250 (gpt-3) or 500 (non-gpt-3) longform answers. additional implementation details are in appendix a. tool-assisted strategies. we evaluate the ta strategies shown in figure 2 : selfask, inline, interleaving, c&f and rarr. we additionally include variants of selfask and inline where the model is separately called to summarize tool output in relevant context, as it can often be very long (selfaskqa and inlineqa; see appendix a for details). finally, in the retrieval settings, we use top-1 retrieval for all models, and additionally top-5 retrieval for the flan-palm-540b model (see "models" below) to check whether additional retrieved information can improve performance despite the significantly longer input and processing cost. for selfask and rarr we use the original implementation provided by the methods' creators. we implement interleaving @xcite , as at the time of this research no implementation was available. importantly, this implementation yields similar performance to that of existing approaches that combine cot with retrieval from wikipedia by @xcite al. (2022 datasets. we consider tasks that require complex reasoning, where models could potentially benefit from external tool usage. specifically, we use strat-egyqa @xcite and musique @xcite , which require reasoning about entity knowledge, and gsm8k @xcite and drop @xcite that evaluate arithmetic reasoning. in drop we select examples that have numerical answers. we randomly sample 500 examples from the development set of each dataset (with the exception of strategyqa, whose test set has 229 examples), and use it for performance evaluation of ul2, flan-palm-540b and flan-palm-62b . for gpt-3, we use a subset of 250 examples of that set, due to cost. we use standard evaluation measures for every dataset (f1 in the case of musique). we provide data examples in appendix a. ## comparative results organization of the results. due to the tool vs. no tool. previous work that propose ta strategies found that using such strategies consistently improve performance in comparison to notool baselines @xcite @xcite . figure 3 shows that the ta strategies do not improve performance over the no-tool baselines in our selection of datasets. the figure shows results against the average of the different few-shot scores, though we observe similar trends when using the maximum of scores as well. full results are in appendix b. similarly to us, @xcite al. (2023a, §6.2) found that strategyqa performance slightly decreased with tools in rarr compared to notool baselines for palm-540b (chowdhery et al., 2022), and jiang et al. (2023, §6.2) found that performance decreased on strategyqa in two settings comparable to our implementations of interleaving and check & fix with gpt-3. we conclude that for the settings in this work, the no-tool baselines are stronger than initially expected based on the literature. more research is required to investigate whether this relationship holds in other contexts, though we note that the datasets and models used in our experiments are common in ta research (mialon et al., 2023). additionally, our experiments provide empirical justification to recommendations (2) and (3) in §3. first, we find that the cot and inline baselines outperform each other at a roughly equal rate, and neither emerges as a clear winner. this shows model dataset best strategy gpt-3 strategyqa baseline-inline gpt-3 drop baseline-inline gpt-3 gsm8k check & fix gpt-3 musique inline flan-palm-540b strategyqa baseline-cot flan-palm-540b drop baseline-inline flan-palm-540b gsm8k baseline-inline flan-palm-540b musique rarr-top5 flan-ul2-20b strategyqa baseline-inline flan-ul2-20b drop baseline-inline flan-ul2-20b gsm8k inline flan-ul2-20b musique baseline-cot flan-palm-62b strategyqa baseline-cot flan-palm-62b drop baseline-cot flan-palm-62b gsm8k inline flan-palm-62b musique check & fix ## analytical results we discuss further analyses of our results, findings that (a) our observations generally hold across different levels of example difficulty, and (b) most prediction errors of tool-augmented lms stem from incorrect inputs to the tool and bad outputs from it, and not from a lack of tool usage. ## conclusions and takeaways we conduct a comprehensive assessment of fewshot tool augmentation strategies for lms, covering hundreds of experiments with multiple lms, datasets, and tools. our experiments show that current tool-usage integration approaches are presently a false promise; prompting strategies that do not use tools typically obtain similar task performance, without the high cost of tool execution. controlling for example difficulty, where tools are expected to provide the most benefit, does not explain the relative strength of the no-tool baselines. instead, the primary errors we observe are related to incorrect usage of the tools to begin with (i.e., generating incorrect arguments to the tool). our findings call for more robust evaluation of future ta strategies, primarily in more practical settings where models are not expected to leverage inherent abilities to solve tasks. to this end, our work provides concrete evaluation guidelines, such as employing stronger baselines and factoring in computation costs.