While Large Language Models (LLMs) have become highly proficient at single-turn tool use, they often stumble when a user query requires a complex, multi-step plan. Most research into "function calling" focuses on a simple paradigm: a user asks a question, and the model picks the right API and arguments.
However, real-world tasks are rarely that simple. If you ask an AI to "Book the first available flight from London to Edinburgh," the model cannot just call a book_flight function immediately. It must first call a get_schedule function, parse the results to find the "first" flight, and then call the booking function. This requires compositional reasoning—the ability to decompose a high-level goal into a sequence of dependent sub-tasks.
To address the scarcity of complex training data, researchers introduce BUTTON (Bottom-Up Then Top-dOwN), a pipeline that synthetically generates compositional instruction tuning data. Using the resulting BUTTONInstruct dataset, the authors significantly boost the multi-turn planning and function-calling capabilities of open-source models like Llama-3 and Qwen-2.
The BUTTON Framework
Existing datasets for multi-turn function calling are scarce because they are incredibly difficult to annotate manually. Furthermore, simply asking an LLM to "generate a complex task" often results in nonsensical or unsolvable trajectories. The authors propose the BUTTON framework to create high-quality, solvable synthetic data through a two-phase process.
1. Bottom-Up Instruction Construction
Instead of starting with complexity, the pipeline begins with "atomic tasks" (simple, one-step actions) derived from real-world scenarios. It then uses heuristic strategies to combine them into complex queries:
- Sequential Composition: Task B depends directly on the output of Task A.
- Parallel-then-Sequential: Tasks A and B can happen at the same time, and Task C uses both of their outputs.
Once the complex task is built, the system generates the necessary function definitions (API documentation) required to solve it. By building tasks "bottom-up" from atomic units, the authors ensure that the complex instructions are actually solvable, avoiding the "hallucinated" logic that plagues direct generation methods.
2. Top-Down Trajectory Generation
To create the "ground truth" for how to solve these tasks, the researchers set up a multi-agent environment:
- A User Agent initiates the query.
- An Assistant Agent (the "brain") plans and calls tools.
- A Tool Agent simulates the API responses based on the generated function definitions.
By letting these agents interact, the system captures a natural, multi-turn dialogue including "Chain-of-Thought" reasoning, tool calls, and error handling. Using a dedicated Tool Agent to simulate outputs creates a realistic feedback loop, forcing the Assistant Agent to actually parse and react to data rather than hallucinating a successful response.
Datasets and Key Results
The BUTTON pipeline was used to generate BUTTONInstruct, a new dataset of 8,000 high-quality multi-turn function-calling data points. The models were evaluated on the GTA (General Tool Agents) and Tool-Query benchmarks, which test multi-step reasoning and tool interaction in domains like weather, movies, and academia.
The impact of tuning on BUTTONInstruct was dramatic, particularly for smaller models:
- Massive Accuracy Gains: On the GTA benchmark, Llama-3-8B's final answer accuracy jumped from a dismal 1.4% to an impressive 30.5%.
- Closing the Gap with Proprietary Models: The larger tuned models (Llama-3-70B-BUTTON and Qwen-2-72B-BUTTON) achieved performance levels comparable to GPT-4o on multi-turn benchmarks. This proves that specialized instruction tuning can help open-source models punch well above their weight class in complex planning.
- Ablation Success: Removing either the "Bottom-Up" or "Top-Down" phases led to significant performance drops, confirming that both the task structure and the multi-agent simulation are vital to the framework's success.
Limitations and Future Work
While highly effective, the quality of the synthetic data still relies on a powerful "teacher" model (like GPT-4o) to drive the multi-agent simulation. Additionally, while the tasks are designed to be solvable by construction, adding a more rigorous automated verification or filtering stage could further improve data purity.
Ultimately, this "planning with tools" approach is a significant stepping stone toward Embodied AI, where models will increasingly need to plan and execute complex sequences of actions in dynamic, real-time environments.
Summary updated