Robust Function-Calling for On-Device Language Model via Function Masking
Qiqiang Lin, Muning Wen, Qiuying Peng, Guanyu Nie, Junwei Liao, Jun Wang, Xiaoyun Mo, Jiamu Zhou, Cheng Cheng, Yin Zhao, Jun Wang, Weinan Zhang
Abstract
Large language models have demonstrated impressive value in performing as autonomous agents when equipped with external tools and API calls. Nonetheless, effectively harnessing their potential for executing complex tasks crucially relies on enhancements in their function-calling capabilities. This paper identifies a critical gap in existing function-calling models, where performance varies significantly across benchmarks, often due to being misled by specific naming conventions. To address such an issue, we introduce Hammer, a novel family of foundation models specifically engineered for on-device function calling. Hammer employs an augmented dataset that enhances models' sensitivity to irrelevant functions and incorporates function masking techniques to minimize misleading. Our empirical evaluations reveal that Hammer not only outperforms larger models but also demonstrates robust generalization across diverse benchmarks, achieving state-ofthe-art results. Our open-source contributions include a specialized dataset for irrelevance detection, a tuning framework for enhanced generalization, and the Hammer models, establishing a new standard for function-calling performance.
Ask Lune
Ask anything. The answer quotes the paper.
Lune reads all of it and the papers around it, then shows you the passages behind every answer.
Lune answers from
the full paper · 6 top-tier papers that cite it · related work
Free to start. No credit card required.
Cited by top-tier papers6
- Procedural Environment Generation for Tool-Use AgentsMichael Sullivan, Mareike Hartmann, Alexander KollerEMNLP 2025 · 12 citations
- ResT: Reshaping Token-Level Policy Gradients for Tool-Use Large Language ModelsZihan Lin, Xiaohan Wang, Jie Cao, Jiajun Chai et al.ICLR 2026 · 10 citations
- STAR: Similarity-guided Teacher-Assisted Refinement for Super-Tiny Function Calling ModelsJiliang Ni, Jiachen Pu, Zhongyi Yang, Jingfeng Luo et al.ICLR 2026
- Distilling Task-Level Coordination Policies for Generalizable Multi-Agent CooperationZimo Zhai, Manjie Xu, Wei LiangICML 2026
- TInR: Exploring Tool-Internalized Reasoning in Large Language ModelsQiancheng Xu, Yongqi Li, Fan Liu, Hongru Wang et al.ACL 2026
Builds on7
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Gorilla: Large Language Model Connected with Massive APIsShishir G. Patil, Tianjun Zhang, Xin Wang, Joseph E. GonzalezNeurIPS 2024 · 1,715 citations
- WebShop: Towards Scalable Real-World Web Interaction with Grounded Language AgentsShunyu Yao, Howard Chen, John Yang, Karthik NarasimhanNeurIPS 2022 · 1,477 citations
- An LLM Compiler for Parallel Function CallingSehoon Kim, Suhong Moon, Ryan Tabrizi, Nicholas Lee et al.ICML 2024 · 142 citations
- API-Bank: A Comprehensive Benchmark for Tool-Augmented LLMsMinghao Li, Yingxiu Zhao, Bowen Yu, Feifan Song et al.EMNLP 2023 · 72 citations
Related papers
- HammerBench: Fine-Grained Function-Calling Evaluation in Real Mobile Assistant ScenariosJun Wang, Jiamu Zhou, Xihuai Wang, Xiaoyun Mo et al.ACL Findings 2025 · 5 citations
- HAMMER: Harnessing MLLMs via Cross-Modal Integration for Intention-Driven 3D Affordance GroundingLei Yao, Yong Chen, Yuejiao Su, Yi Wang et al.CVPR 2026
- Function Calling as a Flexible LLM Defense Add-On: Capability and Application ExplorationZhenlan Ji, Daoyuan Wu, Wenxuan Wang, Pingchuan Ma et al.ISSTA 2026
- Lost in Execution: On the Multilingual Robustness of Tool Calling in Large Language ModelsZheng Luo, Thirulogasankar Pranav Kutralingam, Ogochukwu N. Okoani, Wanpeng Xu et al.ACL 2026 · 3 citations
- Dynamic Tool Dependency Retrieval for Lightweight Function CallingBhrij Patel, Davide Belli, Amir Jalalirad, Maximilian Arnold et al.ACL Findings 2026
