Function-calling language models are essential for agentic AI systems that translate natural language into executable structured actions, yet existing models exhibit severe structural instability when applied to Arabic. We present AISA-AR-FunctionCall, a production-oriented Arabic function-calling framework built on a 270M-parameter FunctionGemma backbone and trained through systematic dataset auditing, schema repair, tool-aware prompt restructuring, and full-parameter supervised fine-tuning. On a held-out test set, fine-tuning reduces parse failures from 87% to below 1%, improves function name accuracy by more than eightfold, and substantially enhances argument alignment across dialects and domains. Error analysis reveals a transition from structural collapse to semantic misalignment, suggesting that serialization stability and decision-level reasoning are separable challenges. We further explore a reasoning-augmented LoRA variant that introduces explicit intermediate reasoning prior to tool invocation. All datasets and models are publicly released under the AISA framework.
Figures & tables
Figure 1: End-to-end transformation pipeline for AISA-AR-FunctionCall. The process includes structural auditing, schema repair, tool optimization, stochastic tool sampling, chat serialization using the FunctionGemma format, and stratified train/validation/test splitting.
Figure 2: Example of serialized training instance using the FunctionGemma control-token format.
Figure 3: Core structured performance comparison between the baseline and the fully fine-tuned model. Metrics include function selection accuracy, full tool-call match, argument alignment (F1 and exact match), and format validity.
Figure 4: Structural stability comparison between the baseline and the fully fine-tuned model. Metrics include parse failure rate and hallucination rate.
Dialect
Baseline
FT Model
MSA
0.0862
0.7613
Gulf
0.0526
0.6972
Egyptian
0.0493
0.6834
Levantine
0.0633
0.6948
Maghrebi
0.0452
0.6158
Table 1: Function Name Accuracy by Dialect
Figure 5: Function Name Accuracy by Domain for the fully fine-tuned AISA-AR-FunctionCall-FT model. Highly structured transactional domains (Utilities, Travel, Islamic Services, Weather) achieve strong performance, while procedurally complex domains such as Government Services remain more challenging.
Error Type
Baseline (%)
FT Model (%)
Parse Failure
80.7
0.76
Tool Hallucination
0.04
24.7
Wrong Function
3.3
23.6
Argument Mismatch
5.4
20.2
Correct
0.3
20.3
Table 2: Error Distribution Shift
Metric
Score
Tool Call Rate
0.992
Think-Before-Call Rate
1.000
Function Name Accuracy
0.992
Argument F1
1.000
Decision Accuracy
0.992
Hallucination Rate
0.000
Table 3: Reasoning Model Results (Strict Evaluation, n=240 )
Function calling represents the core capability of agentic large language models (LLMs). Existing research has focused on enhancing LLMs function-calling accuracy through fine-tuning, reinforcement learning (RL), and multi-agent frameworks, particularly for native function-calling LLMs. This work demonstrates that LLMs achieve superior accuracy in function calling in instruction-following contexts (i.e., standard user-assistant interactions) rather than a tool calling context. We introduce Instruction-Followed Function Calling (IFFC), a novel framework that decouples function-calling logic from the primary LLM and delegates it to a dedicated smaller model operating within the instruction-following paradigm. Our method consistently outperforms both native function calling (NFC) and prompt-based function calling (PFC) baselines, with particularly strong gains on reasoning-oriented LLMs. Furthermore, we demonstrate that IFFC maintains robust performance under aggressive quantization, enabling efficient on-device deployment without significant accuracy degradation. This work establishes a new paradigm for reliable, resource-efficient function calling in edge-computing scenarios.
Yalda Taheri, Mohammad Hassan Heydari, Erfan Naaman +1
Department of Engineering Islamic Azad University · Department of Computer Engineering University of Isfahan
The reliability of Large Language Models (LLMs) for API calling degrades in multilingual settings. A common failure occurs when a model selects the correct tool but generates argument values in an inconsistent language, which we term Argument Language Mismatch (ALM). Although semantically correct, such outputs are operationally invalid and not captured by standard API-calling metrics. We revisit post-training strategies for mitigating ALM and find that, in our benchmark, supervised fine-tuning (SFT) provides a strong baseline, substantially improving argument language consistency and end-to-end function call accuracy. Under consistent model selection, SFT achieves performance comparable to, and sometimes exceeding more complex reinforcement learning (RL) approaches. We further examine whether RL with structured, argument-aware rewards offers additional benefits. While methods such as Group Relative Policy Optimization (GRPO) can improve language consistency and better preserve general reasoning ability, these gains are incremental and most pronounced in generalization and multi-objective trade-offs. Overall, our results suggest that much of the performance in multilingual API grounding can be achieved through careful supervised training, with RL providing targeted rather than fundamental improvements.
Siddharth Chauhan, Thomas Butler, Abhishek Singhania +2
When a tool-calling agent picks the wrong tool, the failure is invisible until execution: the email gets sent, the meeting gets missed. As agents take on consequential actions, one bad tool call can do real damage. We currently have no way to look inside the model and catch the mistake before it happens; this paper shows that we can. Inside the model, the choice of tool is carried by a single direction in activation space, one direction per pair of tools. Adding that direction during generation switches which tool the model picks. Across 12 instruction-tuned and 6 base models spanning Gemma 3, Qwen 3, Qwen 2.5, and Llama 3.1 (270M to 27B), this works at 83-100% accuracy on 4B+ instruction-tuned models on a 15-tool synthetic benchmark and at 77-94% on the real-API benchmark τ-bench airline. The JSON arguments that follow automatically adapt to the new tool's schema, so flipping the name is enough. The same per-tool directions also flag likely errors before they happen: queries where the model is unsure between two tools fail 21x more often than queries where it is not (Gemma 3 27B). This is not just topic injection: random vectors at the same magnitude give a 0% switch rate, and a probe within a single domain (14 airline tools that share one topic) still reads which tool the model will call at top-1 61-89% across five 4B-14B models. Even base models already carry the right tool internally before they can emit it: reading the chosen tool off the model's internal state (cosine readout) recovers 61-82% accuracy on BFCL while base generation lands at 2-10%, suggesting pretraining forms the representation and instruction tuning later wires it to the output. Our results cover single-turn, fixed-menu settings; on multi-turn agent loops the same intervention is less stable (matched-baseline gain or loss of up to 30 percentage points with no consistent direction).
Zekun Wu, Ze Wang, Seonglae Cho +4
University College London · Holistic AI · Imperial College London