Table of Contents
Fetching ...

Enhancing Function-Calling Capabilities in LLMs: Strategies for Prompt Formats, Data Integration, and Multilingual Translation

Yi-Chang Chen, Po-Chun Hsu, Chan-Jan Hsu, Da-shan Shiu

TL;DR

The paper tackles enabling robust function-calling in LLMs by examining prompt formats, data integration with instruction-following data, a novel Decision Token, chain-of-thought reasoning, and a translation pipeline for multilingual support. It demonstrates that incorporating instruction-following data significantly improves function-calling accuracy and relevance detection, while the Decision Token paired with synthetic non-function-call data further enhances relevance detection. A tailored translation pipeline yields substantial gains in Traditional Chinese, addressing multilingual limitations. Overall, the work advances practical, multilingual function-calling capabilities in LLMs with implications for real-world autonomous agents and tool integration.

Abstract

Large language models (LLMs) have significantly advanced autonomous agents, particularly in zero-shot tool usage, also known as function calling. This research delves into enhancing the function-calling capabilities of LLMs by exploring different approaches, including prompt formats for integrating function descriptions, blending function-calling and instruction-following data, introducing a novel Decision Token for conditional prompts, leveraging chain-of-thought reasoning, and overcoming multilingual challenges with a translation pipeline. Our key findings and contributions are as follows: (1) Instruction-following data improves both function-calling accuracy and relevance detection. (2) The use of the newly proposed Decision Token, combined with synthetic non-function-call data, enhances relevance detection. (3) A tailored translation pipeline effectively overcomes multilingual limitations, demonstrating significant improvements in Traditional Chinese. These insights highlight the potential for improved function-calling capabilities and multilingual applications in LLMs.

Enhancing Function-Calling Capabilities in LLMs: Strategies for Prompt Formats, Data Integration, and Multilingual Translation

TL;DR

The paper tackles enabling robust function-calling in LLMs by examining prompt formats, data integration with instruction-following data, a novel Decision Token, chain-of-thought reasoning, and a translation pipeline for multilingual support. It demonstrates that incorporating instruction-following data significantly improves function-calling accuracy and relevance detection, while the Decision Token paired with synthetic non-function-call data further enhances relevance detection. A tailored translation pipeline yields substantial gains in Traditional Chinese, addressing multilingual limitations. Overall, the work advances practical, multilingual function-calling capabilities in LLMs with implications for real-world autonomous agents and tool integration.

Abstract

Large language models (LLMs) have significantly advanced autonomous agents, particularly in zero-shot tool usage, also known as function calling. This research delves into enhancing the function-calling capabilities of LLMs by exploring different approaches, including prompt formats for integrating function descriptions, blending function-calling and instruction-following data, introducing a novel Decision Token for conditional prompts, leveraging chain-of-thought reasoning, and overcoming multilingual challenges with a translation pipeline. Our key findings and contributions are as follows: (1) Instruction-following data improves both function-calling accuracy and relevance detection. (2) The use of the newly proposed Decision Token, combined with synthetic non-function-call data, enhances relevance detection. (3) A tailored translation pipeline effectively overcomes multilingual limitations, demonstrating significant improvements in Traditional Chinese. These insights highlight the potential for improved function-calling capabilities and multilingual applications in LLMs.

Paper Structure

This paper contains 16 sections, 1 figure, 3 tables.

Figures (1)

  • Figure 1: An illustration of prompt templates used for function calling and instruction following in LLMs. During training, LLMs are given conditional prompts (shown on the left) and tasked with generating corresponding text completions (shown on the right). When a function call is required, the model generates structured function calls in the form of a list of functions, where each function is specified with its arguments in the format func_name(arg1=value1, ...). Special tokens, including <s>, <|im_start|>, <|im_end|>, <|answer|>, and <|use_tool|>, are each represented by a single token after tokenization. For more details, refer to Section \ref{['sec:method-prompt']}.