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

Research from MediaTek Research provides a systematic evaluation of methodologies to transform standard Large Language Models (LLMs) into reliable autonomous agents. By optimizing prompt structures, integrating specialized data, and introducing a novel "Decision Token," the researchers significantly improved tool-use accuracy and relevance detection in the Breeze-7B model.

The Challenge of LLM Agents

While LLMs excel at natural language conversation, their deployment as agents capable of calling external APIs (function calling) faces three primary hurdles:

  1. Relevance Detection: Models often suffer from "hallucinations," attempting to invoke tools even when a user's request is purely conversational.
  2. Prompt Variance: There is no industry consensus on the optimal placement of function descriptions—whether within the system prompt or a dedicated "tools" block.
  3. Multilingual Decay: Most function-calling datasets are English-centric. Standard translation often breaks rigid JSON structures or incorrectly translates technical function names that must remain in English to function.

Methodology: Decision Tokens and Prompt Engineering

The researchers fine-tuned Breeze-7B (a Mistral-7B derivative optimized for Traditional Chinese) using several innovative strategies.

The Decision Token

The most distinct contribution of this work is the introduction of a "Decision Token." Before generating a full response, the model is forced to output a specific token: either <|answer|> for direct text replies or <|use_tool|> for API calls. This architectural choice transforms the initial step of the response into a high-stakes classification task, forcing the model to commit to a path before generating content.

Prompt Formatting and Negative Data

The study compared two primary formatting strategies: using a dedicated "tools" role for JSON function descriptions versus embedding descriptions directly into the "system" role. To combat hallucinations, the team created NF-1k, a dataset of "negative" samples where the correct tool is removed from the available list, teaching the model to recognize when it cannot fulfill a request with the provided tools.

Overview of conditional prompt structures and generation examples including the Decision Token.

Multilingual Integration

To address the gap in Traditional Chinese support, the researchers developed a "schema-aware" translation pipeline. This pipeline translates user queries and arguments to maintain natural interaction while strictly preserving function names and JSON keys in English. This ensures the technical interface remains functional across languages.

Key Results and Insights

Improved Relevance Detection

The combination of the Decision Token and synthetic negative data (NF-1k) yielded the most significant gains. Relevance detection accuracy improved from 39.58% to 65.42% when using the system role format.

Impact of the Decision Token and non-function-call data (NF-1k) on relevance detection and AST summary scores.

Performance Benchmarks

  • Function Accuracy: On the Berkeley Function Calling Leaderboard (BFCL), the model achieved an Abstract Syntax Tree (AST) Summary score of ~85-86%, demonstrating that a 7B parameter model can compete with much larger models when properly tuned.
  • Multilingual Success: In Traditional Chinese benchmarks, the tailored translation approach improved the AST Summary score from 52.37% to 61.56%.
  • Instruction Integrity: General performance remained robust, with the model maintaining a score of 5.57 on MT-Bench, proving that specialized function-calling training does not necessarily degrade general conversational ability.

Conclusion

The research highlights that instruction following (IF) data acts as a "force multiplier" for function calling, helping the model parse complex semantic structures. While Chain-of-Thought (CoT) reasoning did not provide a significant boost in current benchmarks, the introduction of the Decision Token serves as an effective "speed bump," reducing hallucinated tool calls and providing a clear path for future scaling in autonomous agent development.

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