HammerBench: Fine-Grained Function-Calling Evaluation in Real Mobile Device Scenarios

Jun Wang, Jiamu Zhou, Muning Wen, Xiaoyun Mo, Haoyu Zhang, Qiqiang Lin, Cheng Jin, Xihuai Wang, Weinan Zhang, Qiuying PengarXiv 2024 · DOI

Abstract

HammerBench is a comprehensive benchmark designed to evaluate Large Language Models (LLMs) in the context of real-world mobile device function-calling. Unlike existing benchmarks that focus on static, single-turn interactions, HammerBench introduces complex multi-turn scenarios including imperfect instructions, intent shifts, and external context references. Our evaluation of leading models reveals significant performance gaps in handling dynamic user behavior, particularly argument shifts and anaphora resolution, highlighting the need for models that can maintain state across messy conversational processes.

Introduction

While LLMs have become proficient at calling APIs in isolation, real-world mobile assistants operate in a chaotic environment. Users rarely provide all necessary parameters in a single, perfect sentence. Instead, they might provide vague instructions, change their destination halfway through a booking, or use pronouns that require resolving references to external data like SMS or notes.

Existing benchmarks often fail to capture this "process dynamic." They typically evaluate whether an agent reaches the correct final state, ignoring the "process defects" that occur during the conversation. There is a significant gap in evaluating how agents maintain parameter consistency over multiple turns and how they handle the "long-tail" of unpredictable user behaviors. HammerBench addresses this by simulating the messiness of real-world mobile assistant interactions.

The HammerBench Pipeline

The authors introduce a systematic four-stage pipeline to construct HammerBench, ensuring the dataset is both realistic and high-quality.

The HammerBench construction pipeline, from toolset collection to semantic validation.
  1. Toolset Collection: A curated set of 1,063 tools across 60 functional categories based on popular mobile app functionalities.
  2. API Generation & Validation: LLMs generated API definitions (names, descriptions, parameters), which were then manually refined by humans to ensure they were user-friendly and realistic.
  3. Data Generation: Using a "self-instruct" method, thousands of instances were generated, categorized into single-turn (perfect, imperfect, irrelevant) and multi-turn scenarios.
  4. Semantic Validation: To ensure quality, a consistency check was implemented, comparing model outputs across zero-shot and one-shot settings to filter out hallucinations.

Dataset Composition

The HammerBench dataset is built from anonymized user logs and popular app functionalities. It includes several challenging categories:

  • Imperfect Instructions: Queries missing key parameters to test "slot-filling" abilities.
  • Diverse Q&A Trajectories: Testing different conversational paths, such as the agent asking for multiple parameters at once versus one by one.
  • Intent Shifts: Scenarios where a user suddenly switches tasks (e.g., from booking a flight to setting an alarm).
  • Argument Shifts: Cases where users override previous values (Slot Overriding) or update parameters after a tool has already run.
  • External Individual Information: Instances involving anaphora resolution (pronouns) linked to external context like messages or clipboards.

Key Insights: Snapshots and Hallucinations

A key methodological contribution is the Function Calling Snapshots approach. Instead of just evaluating the final API call, HammerBench evaluates the model at every turn. The authors found that fine-tuning models to provide a "snapshot" of the function call at every turn—even if incomplete—outperformed the traditional "Learning to Ask" paradigm by 16% in success rate. This approach effectively decouples information recognition from question generation.

Furthermore, the study identified that models have a high Parameter Hallucination Rate (PHR) when context is incomplete. Models tend to "fill in the blanks" with plausible-sounding but incorrect data rather than asking the user for clarification. Argument shifts also proved to be an "Achilles' heel"; models frequently struggle when a user corrects themselves, often "sticking" to old values.

Experimental Results

The researchers benchmarked 10 leading LLMs, including GPT-4o, Claude 3.5 Sonnet, and various open-source models.

Performance of leading LLMs across single-turn and multi-turn evaluation categories in HammerBench.

GPT-4o and Claude 3.5 Sonnet led the pack with overall accuracies around 70-71%. However, open-source models showed resilience in specific areas; for instance, Qwen2.5-72B-Instruct performed remarkably well on Intent Shifts (89.79%), outperforming proprietary models in that category.

A significant "Multi-Turn Drop" was observed across most models. Performance degraded sharply in multi-turn scenarios compared to single-turn "perfect" instructions, particularly when handling Argument Shifts, where success rates often dipped below 50% for smaller models like Ministral-8B.

Conclusion

HammerBench reveals that even top-tier models struggle when users change their minds mid-conversation or refer to external context. While the benchmark provides a stable evaluation framework, the authors acknowledge that fixed datasets do not fully capture the dynamic, self-exploring nature of live agents. Future work will focus on real-time, dynamic trajectory generation and expanding the benchmark to include multi-agent coordination and complex multi-tool dependencies.

Summary updated

BibTeX
@misc{wang2024hammerbench,
  author = {Jun Wang and Jiamu Zhou and Muning Wen and Xiaoyun Mo and Haoyu Zhang and Qiqiang Lin and Cheng Jin and Xihuai Wang and Weinan Zhang and Qiuying Peng and Jun Wang},
  title = {{HammerBench: Fine-Grained Function-Calling Evaluation in Real Mobile Device Scenarios}},
  year = {2024},
  eprint = {2412.16516},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.16516},
}
Figure