ICLR 2025

Published as a conference paper at ICLR 2025
FACILITATING MULTI-TURN FUNCTION CALLING FOR
LLMS VIA COMPOSITIONAL INSTRUCTION TUNING
Mingyang Chen1∗, Haoze Sun1∗, Tianpeng Li1∗, Fan Yang1, Hao Liang2, Keer Lu2,
Bin Cui2, Wentao Zhang2†, Zenan Zhou1†, Weipeng Chen1
1Baichuan Inc., 2 Peking University
{chenmingyang, sunhaoze, litianpeng, zhouzenan}@baichuan-inc.com
wentao.zhang@pku.edu.cn
ABSTRACT
Large Language Models (LLMs) have exhibited significant potential in perform-
ing diverse tasks, including the ability to call functions or use external tools to
enhance their performance. While current research on function calling by LLMs
primarily focuses on single-turn interactions, this paper addresses the overlooked
necessity for LLMs to engage in multi-turn function calling—critical for handling
compositional, real-world queries that require planning with functions but not only
use functions. To facilitate this, we introduce an approach, BUTTON, which gen-
erates synthetic compositional instruction tuning data via bottom-up instruction
construction and top-down trajectory generation. In the bottom-up phase, we gen-
erate simple atomic tasks based on real-world scenarios and build compositional
tasks using heuristic strategies based on atomic tasks. Corresponding function def-
initions are then synthesized for these compositional tasks. The top-down phase
features a multi-agent environment where interactions among simulated humans,
assistants, and tools are utilized to gather multi-turn function calling trajectories.
This approach ensures task compositionality and allows for effective function and
trajectory generation by examining atomic tasks within compositional tasks. We
produce a dataset BUTTONInstruct comprising 8k data points and demonstrate
its effectiveness through extensive experiments across various LLMs 1.
1
INTRODUCTION
Large Language Models (LLMs) have demonstrated remarkable capabilities across various
tasks (OpenAI, 2023; Dubey et al., 2024). Beyond gener...