NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Granite-Function Calling Model: Introducing Function Calling Abilities via Multi-task Learning of Granular Tasks

Ibrahim Abdelaziz, Kinjal Basu, Mayank Agarwal, Sadhana Kumaravel, Matthew Stallone, Rameswar Panda, Yara Rizk, G. P. Shrivatsa Bhargav, Maxwell Crouse, R. Chulaka Gunasekara, Shajith Ikbal, Sachindra Joshi, Hima Karanam, Vineet Kumar, Asim Munawar, Sumit Neelam, Dinesh Raghu, Udit Sharma, Adriana Meza Soria, Dheeraj Sreedhar, Praveen Venkateswaran, Merve Unuvar, David Cox, Salim Roukos, Luis A. Lastras, Pavan Kapanipathi

Abstract

While Large Language Models (LLMs) excel at reasoning and text generation, their utility in autonomous agentic workflows is often limited by their inability to interact reliably with external tools and APIs. This paper introduces GRANITE-20B-FUNCTIONCALLING, an open-source model designed to bridge the gap between proprietary and open-source tool-use capabilities. By decomposing the monolithic challenge of function calling into seven granular sub-tasks—ranging from name detection to parameter-value pairing—and employing a multi-task learning strategy, we present a 20B parameter model that outperforms significantly larger models, including Meta-Llama-3-70B-Instruct. At the time of release, GRANITE-20B-FUNCTIONCALLING ranks as the top-performing open model on the Berkeley Function Calling Leaderboard (BFCL).

1. Introduction

Modern LLMs are frequently constrained by their training data cutoff, leading to hallucinations when queried about real-time or proprietary information. To function as effective autonomous agents, these models must master "function calling": the capacity to identify, format, and execute calls to external APIs. However, existing open-source models often struggle with generalizability across diverse API formats and fail when faced with complex, nested, or chained function calls.

Most current approaches treat function calling as a single, end-to-end generation task. In contrast, this work posits that function calling is a sequence of distinct logical steps. By training specifically on these granular components, we can achieve higher precision and lower hallucination rates even with a relatively modest parameter count.

2. Methodology

2.1 Model Architecture and Training

The model is built upon the Granite-20B-Code-Instruct base. We utilized QLoRA fine-tuning (rank 8, alpha 32) over three epochs to specialize the model for agentic tasks. To ensure the model could handle diverse data sources without overfitting to specific schemas, we implemented a JSON Format Unification layer. This layer standardizes all API specifications and model outputs into a consistent, human-readable JSON format.

2.2 Granular Task Decomposition

The core innovation of this model is the decomposition of function calling into seven distinct sub-tasks, categorized into three levels:

  • Low-Level Tasks: Function Name Detection, Parameter-Value Pair Detection, and Next-Best Function prediction. These tasks focus on the structural accuracy of the call.
  • High-Level Tasks: Nested Function Calling, Function Chaining, and Parallel Functions. These tasks address the logic of complex, multi-step tool use.
  • Final Output: Natural Language Response Generation, ensuring the model can communicate the results of a tool call back to the user effectively.

3. Data and Evaluation

3.1 Training Mixture

The model was trained on a curated mixture of approximately 142,000 examples. This dataset primarily consists of:

  • API-BLEND: A diverse collection including SeqSGD, SeqSNIPS, SeqTopV2, SeqATIS, and SeqMultiWOZ.
  • Glaive-V2: Specifically integrated to enhance the model's ability to handle complex function chaining and natural language responses.

3.2 Evaluation Framework

Performance was primarily measured using the Berkeley Function Calling Leaderboard (BFCL), comprising 1,700 instances. Additionally, the model was tested against several out-of-domain benchmarks to assess zero-shot generalization, including ToolLLM, RestGPT, API-Bank, ToolBench, ToolAlpaca, and NexusRaven.

4. Key Results and Insights

4.1 Leaderboard Performance

GRANITE-20B-FUNCTIONCALLING achieved an overall accuracy of 84.71% on the BFCL. This performance placed the model 4th overall and 1st among all open-license models. Notably, the 20B Granite model outperformed the 70B Llama-3-Instruct model, demonstrating that targeted multi-task data can be more effective than raw scale for specialized agentic behavior.

4.2 Precision and Hallucination Resistance

By training on granular tasks like "Function Name Detection," the model learned to be exceptionally precise. The hallucination rate—defined as the model predicting an API that does not exist in the provided context—was reduced to less than 0.1%. On the ToolLLM benchmarks, the model outperformed its closest competitors by 8% in F1 score for name detection and 11% in Exact Match scores for complex sequences.

4.3 Zero-Shot Generalization

Despite the specific training set, the model demonstrated robust out-of-domain performance. It successfully executed calls to APIs it had never encountered during training, suggesting that the granular training approach taught the underlying logic of function calling rather than mere pattern matching of API signatures.

5. Limitations and Future Work

While highly effective, the model faces constraints regarding its 8,192-token context window. In scenarios involving massive API libraries (some benchmarks include over 94 functions), function signatures occasionally had to be truncated to fit the prompt. Furthermore, the model exhibited some brittleness in specific programming contexts, such as Java and JavaScript, where language-specific syntax norms (e.g., object instantiation) proved challenging.

Future research will focus on implementing Rotary Position Embedding (RoPE) to extend the context length, enabling the model to process entire, un-truncated API documentation libraries and improving its performance in diverse programming environments.

6. Conclusion

GRANITE-20B-FUNCTIONCALLING demonstrates that a granular, multi-task approach to training can produce highly efficient and reliable agentic models. By outperforming much larger models on industry-standard leaderboards, it provides a powerful, open-source alternative for developers building autonomous systems that require precise tool integration.

Summary updated

BibTeX
@inproceedings{abdelaziz2024granite,
  author = {Ibrahim Abdelaziz and Kinjal Basu and Mayank Agarwal and Sadhana Kumaravel and Matthew Stallone and Rameswar Panda and Yara Rizk and G. P. Shrivatsa Bhargav and Maxwell Crouse and R. Chulaka Gunasekara and Shajith Ikbal and Sachindra Joshi and Hima Karanam and Vineet Kumar and Asim Munawar and Sumit Neelam and Dinesh Raghu and Udit Sharma and Adriana Meza Soria and Dheeraj Sreedhar and Praveen Venkateswaran and Merve Unuvar and David Cox and Salim Roukos and Luis A. Lastras and Pavan Kapanipathi},
  title = {{Granite-Function Calling Model: Introducing Function Calling Abilities via Multi-task Learning of Granular Tasks}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-industry.85},
}
Figure