DroidCall: A Dataset for LLM-powered Android Intent Invocation

Weikai Xie, Li Zhang, Shihe Wang, Rongjie Yi, Mengwei Xu

TL;DR

This paper introduces DroidCall, the first dataset and pipeline for training LLMs to accurately invoke Android intents, enabling more capable on-device mobile agents. By fine-tuning small language models (SLMs) on DroidCall, they achieve performance comparable to or exceeding GPT-40 for intent invocation, while maintaining privacy and reducing latency.

What Problem Does This Paper Address?

The increasing power of Large Language Models (LLMs) presents a huge opportunity for creating intelligent mobile agents that can understand and execute complex user commands on Android devices. These agents can leverage the system's built-in "intents" – essentially, predefined actions that allow apps to communicate and perform tasks like sending messages or setting alarms. However, existing LLMs, especially those suitable for on-device deployment (to address privacy and latency concerns), struggle with accurately mapping natural language instructions to these specific Android intents. This gap prevents the full realization of powerful, private, and responsive mobile agents.

Methods

The core of this work is the DroidCall dataset and its associated data generation pipeline. The pipeline has three main phases:

  1. Functions Predefinition: They identified 24 common Android implicit intents and defined them as functions. This creates a standardized interface for LLMs, abstracting away the complexities of different Android versions.
  2. Data Generation: A flexible pipeline uses GPT-4-turbo to automatically generate user queries and corresponding function calls. It employs a "self-instruct" paradigm, starting with seed data (derived from existing function-calling datasets) and iteratively generating more diverse examples. Crucially, it includes robust filtering to ensure data quality, correctness, and deduplication.
  3. Fine-tuning and Evaluation: Small Language Models (SLMs) are fine-tuned on the DroidCall dataset. The paper also details an end-to-end Android demo showcasing how these fine-tuned models can be integrated into a real application.

Datasets

  • DroidCall: A newly introduced dataset comprising 10,000 training samples and 200 test samples for Android intent invocation. It's designed to be flexible and reusable.
  • xlam-function-calling-60k: Used as a baseline for comparison.

Key Insights and Ideas

  • On-device LLMs are crucial for privacy and latency: Relying on cloud-based LLMs for mobile agents introduces privacy risks and delays. DroidCall enables more capable on-device solutions.
  • Task-specific datasets are key: General-purpose LLMs, even powerful ones, struggle with specialized tasks like Android intent invocation without targeted fine-tuning data. DroidCall fills this gap.
  • Small models can be surprisingly powerful: Fine-tuning SLMs (like Gemma2-2B) on DroidCall allows them to match or even surpass the performance of much larger models (like GPT-40) on this specific task, using significantly fewer tokens.
  • Automated data generation is feasible and effective: The pipeline significantly reduces manual effort while producing high-quality, diverse data for training.

Key Results

  • Fine-tuned SLMs (e.g., Gemma2-2B) achieved up to 85% accuracy on Android intent invocation tasks after training on DroidCall, compared to GPT-40's 77% with simpler prompts.
  • The code_short prompt format proved effective, achieving comparable results to json with fewer tokens, making it suitable for efficient fine-tuning.
  • An ablation study showed that both simple and complex examples in DroidCall contribute significantly to model performance, with the combined dataset yielding the highest accuracy.

Limitations and Future Work

  • Coverage Limitations: The 24 predefined functions cover common intents but are not exhaustive, especially considering custom intents from third-party apps.
  • Scalability and Generalizability: The manual predefinition of functions limits scalability to new tasks or platforms. Future work could explore automated methods for discovering and defining intents.
  • Data Quality: While robust filtering is used, synthetic data might still introduce biases. Future work could explore hybrid data generation combining synthetic and real-world user data.
  • Future Directions: Research into automated intent discovery, parameter grounding, and cross-platform generalization is suggested.

Summary updated

BibTeX
@inproceedings{xie2025droidcall,
  author = {Weikai Xie and Li Zhang and Shihe Wang and Rongjie Yi and Mengwei Xu},
  title = {{DroidCall: A Dataset for LLM-powered Android Intent Invocation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure