Elamur Research⌕
☰
home / papers / 2023 / On the Tool Manipulation Capability of Open-source Large Language Models

On the Tool Manipulation Capability of Open-source Large Language Models

Paper · 2023 · Qiantong Xu, Fenglu Hong, Bo Li et al.

Summary

Most work on LLM-driven tool use relies on proprietary APIs. That is a problem for companies that cannot send internal workflows and data to external services. The authors ask whether open-source LLMs can match closed models at turning natural-language goals into executable API calls without heavy human effort.

They first diagnose why open models fail:

  • they pick the wrong API functions,
  • they fill in argument values incorrectly,
  • they emit extra prose instead of runnable code.

To address each failure, they adapt three established techniques: instruction tuning on template-generated synthetic data (model alignment), a retriever that inserts similar in-context demonstrations, and a system prompt that constrains output format.

To measure the effect, they release ToolBench, an open benchmark of eight real software tools with predefined test cases scored on actual execution. With all three techniques, open models such as LLaMA gain up to 90% in success rate and reach GPT-4-level results on half the tasks. Each tool needs only about one developer day of curation, which makes the approach realistic for private deployment.

Key points

  • Initial gap: On a house-search tool, GPT-4 reached 77% success, while LLaMA and CodeGen scored 0% and StarCoder 7%.
  • ToolBench coverage: The eight tools range from Google Sheets to robot control. Tasks require choosing among up to roughly 100 candidate API functions, in both single-step and multi-step settings.
  • Results after enhancement: Open models were competitive with GPT-4 on Open Weather, The Cat API, VirtualHome and WebShop. For Home Search and Trip Booking, open models still trailed GPT-4, but only by 11% and 13.4%. Reasoning-heavy tools such as Google Sheets and Tabletop remain weak.
  • Human supervision cost: Each task needed 10–83 demonstration examples and usually fewer than 100 alignment templates, about one developer day per tool.
  • Ablation: Model alignment contributes most. Removing it hurt up to 7 tasks, compared with up to 5 for the demonstrations and up to 3 for the system prompt.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

Cite

Cite as Qiantong Xu, Fenglu Hong, Bo Li, Changran Hu, Zhengyu Chen and Jian Zhang. 2023. On the Tool Manipulation Capability of Open-source Large Language Models. arXiv:2305.16504.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2305.16504 · arXiv 2305.16504

@misc{xu2023tool,
  title = {{On the Tool Manipulation Capability of Open-source Large Language Models}},
  author = {Qiantong Xu, Fenglu Hong, Bo Li, Changran Hu, Zhengyu Chen and Jian Zhang},
  year = {2023},
  doi = {10.48550/arxiv.2305.16504},
  eprint = {2305.16504},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2305.16504}
}

References

70 references, 30 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, L. Zettlemoyer, N. Cancedda, and T. Scialom, “Toolformer: Language models can teach themselves to use tools,” arXiv preprint arXiv:2302.04761, 2023.
  2. M. Li, F. Song, B. Yu, H. Yu, Z. Li, F. Huang, and Y. Li, “Api-bank: A benchmark for tool-augmented llms,” arXiv preprint arXiv:2304.08244, 2023. — [arXiv:2304.08244](https://arxiv.org/abs/2304.08244) find
  3. Y. Qin, S. Hu, Y. Lin, W. Chen, N. Ding, G. Cui, Z. Zeng, Y. Huang, C. Xiao, C. Han et al., “Tool learning with foundation models,” arXiv preprint arXiv:2304.08354, 2023.
  4. S. Gravitas. (2023) Auto-gpt: An autonomous gpt-4 experiment. [Online]. Available: https://github.com/Significant-Gravitas/Auto-GPT ↗
  5. Y. Shen, K. Song, X. Tan, D. Li, W. Lu, and Y. Zhuang, “Hugginggpt: Solving ai tasks with chatgpt and its friends in huggingface,” arXiv preprint arXiv:2303.17580, 2023.
  6. W.-L. Chiang, Z. Li, Z. Lin, Y. Sheng, Z. Wu, H. Zhang, L. Zheng, S. Zhuang, Y. Zhuang, J. E. Gonzalez, I. Stoica, and E. P. Xing, “Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality,” March 2023. [Online]. Available: https://vicuna.lmsys.org ↗
  7. T. Computer, “Openchatkit: An open toolkit and base model for dialogue-style applications,” 3 2023. [Online]. Available: https://github.com/togethercomputer/OpenChatKit ↗
  8. O.-A. Team, “Laion: Open-assistant,” April 2023. [Online]. Available: https://open-assistant.io/ chat ↗
  9. Databricks, “Databricks’ dolly, a large language model trained on the databricks machine learning platform,” 3 2023. [Online]. Available: https://github.com/databrickslabs/dolly ↗
  10. Bloomberg. (2023) Samsung bans staff’s ai use after spotting chatgpt data leak. [Online]. Available: https://www.bloomberg.com/news/articles/2023-05-02/ samsung-bans-chatgpt-and-other-generative-ai-use-by-staff-after-leak\#xj4y7vzkg ↗
  11. CNN. (2023) Jpmorgan restricts employee use of chatgpt. [Online]. Available: https://www.cnn.com/2023/02/22/tech/jpmorgan-chatgpt-employees/index.html ↗
  12. P. Liang, R. Bommasani, T. Lee, D. Tsipras, D. Soylu, M. Yasunaga, Y. Zhang, D. Narayanan, Y. Wu, A. Kumar et al., “Holistic evaluation of language models,” arXiv preprint arXiv:2211.09110, 2022. find
  13. OpenAI, “GPT-4 technical report,” Mar. 2023.
  14. L. Ouyang, J. Wu, X. Jiang, D. Almeida, C. Wainwright, P. Mishkin, C. Zhang, S. Agarwal, K. Slama, A. Ray et al., “Training language models to follow instructions with human feedback,” Advances in Neural Information Processing Systems, vol. 35, pp. 27 730–27 744, 2022.
  15. Y. Bai, S. Kadavath, S. Kundu, A. Askell, J. Kernion, A. Jones, A. Chen, A. Goldie, A. Mirhoseini, C. McKinnon et al., “Constitutional ai: Harmlessness from ai feedback,” arXiv preprint arXiv:2212.08073, 2022.
  16. S. Borgeaud, A. Mensch, J. Hoffmann, T. Cai, E. Rutherford, K. Millican, G. B. Van Den Driessche, J.-B. Lespiau, B. Damoc, A. Clark et al., “Improving language models by retrieving from trillions of tokens,” in International conference on machine learning. PMLR, 2022, pp. 2206–2240. find
  17. H. Li, Y. Su, D. Cai, Y. Wang, and L. Liu, “A survey on retrieval-augmented text generation,” arXiv preprint arXiv:2202.01110, 2022. — [arXiv:2202.01110](https://arxiv.org/abs/2202.01110) find
  18. O. Ram, Y. Levine, I. Dalmedigos, D. Muhlgay, A. Shashua, K. Leyton-Brown, and Y. Shoham, “In-context retrieval-augmented language models,” arXiv preprint arXiv:2302.00083, 2023. find
  19. A. Glaese, N. McAleese, M. Tr˛ebacz, J. Aslanides, V. Firoiu, T. Ewalds, M. Rauh, L. Weidinger, M. Chadwick, P. Thacker et al., “Improving alignment of dialogue agents via targeted human judgements,” arXiv preprint arXiv:2209.14375, 2022.
  20. J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. Florence, and A. Zeng, “Code as policies: Language model programs for embodied control,” arXiv preprint arXiv:2209.07753, 2022. find
  21. D. Jurafsky and J. H. Martin, Speech and Language Processing, Jan 2023. find
  22. T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell et al., “Language models are few-shot learners,” Advances in neural information processing systems, vol. 33, pp. 1877–1901, 2020.
  23. V. Sanh, A. Webson, C. Raffel, S. H. Bach, L. Sutawika, Z. Alyafeai, A. Chaffin, A. Stiegler, T. L. Scao, A. Raja et al., “Multitask prompted training enables zero-shot task generalization,” arXiv preprint arXiv:2110.08207, 2021.
  24. M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. d. O. Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman et al., “Evaluating large language models trained on code,” arXiv preprint arXiv:2107.03374, 2021.
  25. P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W.-t. Yih, T. Rocktäschel et al., “Retrieval-augmented generation for knowledge-intensive nlp tasks,” Advances in Neural Information Processing Systems, vol. 33, pp. 9459–9474, 2020. find
  26. G. Izacard, P. Lewis, M. Lomeli, L. Hosseini, F. Petroni, T. Schick, J. Dwivedi-Yu, A. Joulin, S. Riedel, and E. Grave, “Few-shot learning with retrieval augmented language models,” arXiv preprint arXiv:2208.03299, 2022. find
  27. D. GmbH. (2023) Haystack documentation. [Online]. Available: https://docs.haystack.deepset. ai/docs/retriever\#bm25-recommended ↗
  28. H. W. Chung, L. Hou, S. Longpre, B. Zoph, Y. Tay, W. Fedus, E. Li, X. Wang, M. Dehghani, S. Brahma et al., “Scaling instruction-finetuned language models,” arXiv preprint arXiv:2210.11416, 2022.
  29. X. Puig, K. Ra, M. Boben, J. Li, T. Wang, S. Fidler, and A. Torralba, “Virtualhome: Simulating household activities via programs,” 2018. find
  30. W. Huang, P. Abbeel, D. Pathak, and I. Mordatch, “Language models as zero-shot planners: Extracting actionable knowledge for embodied agents,” in International Conference on Machine Learning. PMLR, 2022, pp. 9118–9147.
  31. S. Yao, H. Chen, J. Yang, and K. Narasimhan, “Webshop: Towards scalable real-world web interaction with grounded language agents,” 2023.
  32. H. Touvron, T. Lavril, G. Izacard, X. Martinet, M.-A. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar et al., “Llama: Open and efficient foundation language models,” arXiv preprint arXiv:2302.13971, 2023.
  33. R. Li, L. B. Allal, Y. Zi, N. Muennighoff, D. Kocetkov, C. Mou, M. Marone, C. Akiki, J. Li, J. Chim et al., “Starcoder: may the source be with you!” arXiv preprint arXiv:2305.06161, 2023. find
  34. E. Nijkamp, B. Pang, H. Hayashi, L. Tu, H. Wang, Y. Zhou, S. Savarese, and C. Xiong, “Codegen: An open large language model for code with multi-turn program synthesis,” arXiv preprint arXiv:2203.13474, 2022. find
  35. C. Lattner, M. Amini, U. Bondhugula, A. Cohen, A. Davis, J. Pienaar, R. Riddle, T. Shpeisman, N. Vasilache, and O. Zinenko, “Mlir: A compiler infrastructure for the end of moore’s law,” arXiv preprint arXiv:2002.11054, 2020. find
  36. L. B. Allal, R. Li, D. Kocetkov, C. Mou, C. Akiki, C. M. Ferrandis, N. Muennighoff, M. Mishra, A. Gu, M. Dey et al., “Santacoder: don’t reach for the stars!” arXiv preprint arXiv:2301.03988, 2023.
  37. S. Yang, O. Nachum, Y. Du, J. Wei, P. Abbeel, and D. Schuurmans, “Foundation models for decision making: Problems, methods, and opportunities,” arXiv preprint arXiv:2303.04129, 2023. find
  38. G. Mialon, R. Dessì, M. Lomeli, C. Nalmpantis, R. Pasunuru, R. Raileanu, B. Rozière, T. Schick, J. Dwivedi-Yu, A. Celikyilmaz et al., “Augmented language models: a survey,” arXiv preprint arXiv:2302.07842, 2023.
  39. S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao, “React: Synergizing reasoning and acting in language models,” arXiv preprint arXiv:2210.03629, 2022.
  40. Y. Liang, C. Wu, T. Song, W. Wu, Y. Xia, Y. Liu, Y. Ou, S. Lu, L. Ji, S. Mao et al., “Taskmatrix. ai: Completing tasks by connecting foundation models with millions of apis,” arXiv preprint arXiv:2303.16434, 2023. — [arXiv:2303.16434](https://arxiv.org/abs/2303.16434) find
  41. K. Cobbe, V. Kosaraju, M. Bavarian, M. Chen, H. Jun, L. Kaiser, M. Plappert, J. Tworek, J. Hilton, R. Nakano et al., “Training verifiers to solve math word problems,” arXiv preprint arXiv:2110.14168, 2021.
  42. A. Parisi, Y. Zhao, and N. Fiedel, “Talm: Tool augmented language models,” arXiv preprint arXiv:2205.12255, 2022.
  43. M. Ahn, A. Brohan, N. Brown, Y. Chebotar, O. Cortes, B. David, C. Finn, K. Gopalakrishnan, K. Hausman, A. Herzog et al., “Do as i can, not as i say: Grounding language in robotic affordances,” arXiv preprint arXiv:2204.01691, 2022.
  44. I. Singh, V. Blukis, A. Mousavian, A. Goyal, D. Xu, J. Tremblay, D. Fox, J. Thomason, and A. Garg, “Progprompt: Generating situated robot task plans using large language models,” arXiv preprint arXiv:2209.11302, 2022.
  45. S. Vemprala, R. Bonatti, A. Bucker, and A. Kapoor, “Chatgpt for robotics: Design principles and model abilities,” 2023, 2023. find
  46. R. Nakano, J. Hilton, S. Balaji, J. Wu, L. Ouyang, C. Kim, C. Hesse, S. Jain, V. Kosaraju, W. Saunders et al., “Webgpt: Browser-assisted question-answering with human feedback,” arXiv preprint arXiv:2112.09332, 2021.
  47. C. Wu, S. Yin, W. Qi, X. Wang, Z. Tang, and N. Duan, “Visual chatgpt: Talking, drawing and editing with visual foundation models,” arXiv preprint arXiv:2303.04671, 2023.
  48. G. Kim, P. Baldi, and S. McAleer, “Language models can solve computer tasks,” arXiv preprint arXiv:2303.17491, 2023.
  49. A. Ratner, S. H. Bach, H. Ehrenberg, J. Fries, S. Wu, and C. Ré, “Snorkel: Rapid training data creation with weak supervision,” in Proceedings of the VLDB Endowment. International Conference on Very Large Data Bases, vol. 11, no. 3. NIH Public Access, 2017, p. 269. find
  50. J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. Florence, and A. Zeng, “Code as policies: Language model programs for embodied control,” 2023. find
  51. A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” Advances in neural information processing systems, vol. 30, 2017.
  52. N. Muennighoff, T. Wang, L. Sutawika, A. Roberts, S. Biderman, T. L. Scao, M. S. Bari, S. Shen, Z.-X. Yong, H. Schoelkopf et al., “Crosslingual generalization through multitask finetuning,” arXiv preprint arXiv:2211.01786, 2022.
  53. BigScience Workshop, “BLOOM (revision 4ab0472),” 2022. [Online]. Available: https://huggingface.co/bigscience/bloom ↗
  54. Chavez. (2023) chavinlo/gpt4-x-alpaca. [Online]. Available: https://huggingface.co/chavinlo/ gpt4-x-alpaca ↗
  55. R. Taori, I. Gulrajani, T. Zhang, Y. Dubois, X. Li, C. Guestrin, P. Liang, and T. B. Hashimoto, “Stanford alpaca: An instruction-following llama model,” https://github.com/tatsu-lab/stanford_ alpaca, 2023. ↗
  56. S. Iyer, X. V. Lin, R. Pasunuru, T. Mihaylov, D. Simig, P. Yu, K. Shuster, T. Wang, Q. Liu, P. S. Koura et al., “Opt-iml: Scaling language model instruction meta learning through the lens of generalization,” arXiv preprint arXiv:2212.12017, 2022.
  57. S. Zhang, S. Roller, N. Goyal, M. Artetxe, M. Chen, S. Chen, C. Dewan, M. Diab, X. Li, X. V. Lin et al., “Opt: Open pre-trained transformer language models,” arXiv preprint arXiv:2205.01068, 2022.
  58. A. Andonian, Q. Anthony, S. Biderman, S. Black, P. Gali, L. Gao, E. Hallahan, J. Levy-Kramer, C. Leahy, L. Nestler, K. Parker, M. Pieler, S. Purohit, T. Songz, W. Phil, and S. Weinbach, “GPT-NeoX: Large Scale Autoregressive Language Modeling in PyTorch,” 8 2021. [Online]. Available: https://www.gith… ↗
  59. L. Gao, S. Biderman, S. Black, L. Golding, T. Hoppe, C. Foster, J. Phang, H. He, A. Thite, N. Nabeshima et al., “The pile: An 800gb dataset of diverse text for language modeling,” arXiv preprint arXiv:2101.00027, 2020. find
  60. S. Black, S. Biderman, E. Hallahan, Q. Anthony, L. Gao, L. Golding, H. He, C. Leahy, K. McDonell, J. Phang et al., “Gpt-neox-20b: An open-source autoregressive language model,” arXiv preprint arXiv:2204.06745, 2022.
  61. Together, LAION, and Ontocord.ai. (2023) The oig dataset. [Online]. Available: https://huggingface.co/datasets/laion/OIG ↗
  62. S. Biderman, H. Schoelkopf, Q. Anthony, H. Bradley, K. O’Brien, E. Hallahan, M. A. Khan, S. Purohit, U. S. Prashanth, E. Raff et al., “Pythia: A suite for analyzing large language models across training and scaling,” arXiv preprint arXiv:2304.01373, 2023. find
  63. Databricks, “dolly-v2-12b,” 2023. [Online]. Available: https://huggingface.co/databricks/ dolly-v2-12b ↗
  64. Stablility-AI. (2023) Stablelm. [Online]. Available: https://github.com/Stability-AI/StableLM ↗
  65. C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu, “Exploring the limits of transfer learning with a unified text-to-text transformer,” The Journal of Machine Learning Research, vol. 21, no. 1, pp. 5485–5551, 2020.
  66. D. Koeplinger, M. Feldman, R. Prabhakar, Y. Zhang, S. Hadjis, R. Fiszel, T. Zhao, L. Nardi, A. Pedram, C. Kozyrakis et al., “Spatial: A language and compiler for application accelerators,” in Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation, 2018, pp.… find
  67. R. Prabhakar, Y. Zhang, D. Koeplinger, M. Feldman, T. Zhao, S. Hadjis, A. Pedram, C. Kozyrakis, and K. Olukotun, “Plasticine: A reconfigurable architecture for parallel pa-terns,” ACM SIGARCH Computer Architecture News, vol. 45, no. 2, pp. 389–402, 2017. find
  68. R. Prabhakar and S. Jairath, “Sambanova sn10 rdu: Accelerating software 2.0 with dataflow,” in 2021 IEEE Hot Chips 33 Symposium (HCS). IEEE, 2021, pp. 1–37. find
  69. J. Davis and M. Goadrich, “The relationship between precision-recall and roc curves,” in Proceedings of the 23rd international conference on Machine learning, 2006, pp. 233–240. find
  70. J. Hauke and T. Kossowski, “Comparison of values of pearson’s and spearman’s correlation coefficients on the same sets of data,” Quaestiones geographicae, vol. 30, no. 2, pp. 87–93, 2011. find

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/xu-2023-tool-manipulation-capability-open-source/