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 · DOI

Abstract

Function calling allows Large Language Models (LLMs) to interact with external tools, yet models often struggle with relevance detection—knowing when to invoke a tool—and maintaining performance in non-English contexts. This paper presents a systematic study by MediaTek Research on optimizing LLM tool-use. We introduce three primary strategies: optimized prompt formats, a "Decision Token" mechanism to reduce hallucinations, and a structure-aware translation pipeline for multilingual support. Experimental results using the Breeze-7B model demonstrate significant improvements in tool-use accuracy and relevance detection without compromising general conversational abilities.

1. Introduction

The ability of LLMs to execute function calls is essential for creating autonomous agents capable of interacting with real-world APIs and databases. However, current models face three significant challenges. First, Relevance Detection: models frequently "hallucinate" tool usage, attempting to call functions even when a direct text response is more appropriate. Second, Prompt Sensitivity: there is no standard for where to place tool descriptions within a prompt, leading to inconsistent performance. Third, the Multilingual Gap: most function-calling datasets are English-centric, and standard translation methods often corrupt the rigid JSON structures required for tool execution.

2. Methodology

The researchers fine-tuned the Breeze-7B model (a Mistral-7B derivative) using several novel architectural and prompting strategies.

2.1 The Decision Token Mechanism

A core contribution of this work is the "Decision Token." Instead of allowing the model to generate a response immediately, it is forced to output a specific classification token: <|answer|> for direct text or <|use_tool|> for a function call. This acts as a binary classification step that "anchors" the model's intent before generating the full sequence, effectively reducing false-positive tool calls.

2.2 Prompt Formatting and Roles

The study compared two primary methods for providing tool descriptions: providing them in a dedicated tools role versus embedding them within the standard system role.

Comparison of conditional prompt formats and generation types, including the Decision Token mechanism.

3. Data Strategy and Multilingual Support

To improve model robustness, the researchers employed a data-blending strategy and a specialized translation pipeline.

3.1 Data Blending and Negative Samples

The training set combined 110,000 instruction-following (IF) samples with 110,000 function-calling (FC) samples. Additionally, a new synthetic dataset, NF-1k (Non-Function-call), was created. This dataset consists of tool-use samples where the relevant tool is removed from the prompt, training the model to recognize when it lacks the necessary tools to fulfill a request.

3.2 Structure-Aware Translation

To address the multilingual gap, the authors developed a pipeline to translate English datasets into Traditional Chinese (TC-19k). This pipeline uses a commercial-grade LLM to ensure that while the natural language is translated, technical elements like JSON keys and function names remain intact.

4. Results and Discussion

The evaluation utilized the Berkeley Function Calling Leaderboard (BFCL) and MT-Bench to measure both tool-use accuracy and general conversational quality.

4.1 Relevance Detection Performance

The combination of the Decision Token and the NF-1k dataset led to a substantial increase in relevance detection. As shown in the experimental data, the model's ability to avoid unnecessary tool calls improved significantly, particularly when using the system role format with negative sample training.

Performance metrics on the BFCL benchmark showing the impact of the Decision Token and NF-1k data on relevance detection.

4.2 Structural Accuracy and Multilingual Gains

Including IF data improved the Abstract Syntax Tree (AST) Summary—a measure of JSON structural correctness—from approximately 74% to 85%. In the multilingual context, the Breeze-7B model trained with TC-19k data saw its AST Summary on the ZHTW leaderboard rise from 52.37% to 61.56%.

5. Conclusion

This research demonstrates that function-calling capabilities can be significantly improved through structured prompting and specialized data strategies. The Decision Token provides a simple yet effective way to reduce hallucinations, while structure-aware translation enables robust multilingual tool use. Future work will explore these strategies in complex, multi-turn agentic environments where Chain-of-Thought reasoning may become more critical.

Summary updated

BibTeX
@inproceedings{chen2025enhancing,
  author = {Yi-Chang Chen and Po-Chun Hsu and Chan-Jan Hsu and Da-shan Shiu},
  title = {{Enhancing Function-Calling Capabilities in LLMs: Strategies for Prompt Formats, Data Integration, and Multilingual Translation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.naacl-industry.9},
}
Figure