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 )