TL;DR
This paper introduces AutoDroid, a novel framework that leverages Large Language Models (LLMs) to automate arbitrary tasks on Android applications without requiring manual developer effort. By combining LLM reasoning with app-specific knowledge derived from dynamic analysis, AutoDroid achieves significant improvements in task completion accuracy and efficiency compared to existing methods.
What Problem Does This Paper Address?
Automating tasks on smartphones is a long-standing goal, aiming to create more intuitive and hands-free user experiences. However, current approaches, whether developer-centric or demonstration-based, suffer from poor scalability and require substantial manual effort. Existing LLM-based attempts often lack the deep, domain-specific knowledge of individual apps, leading to suboptimal performance. This paper addresses the challenge of enabling LLMs to understand and interact with the complex, dynamic interfaces of Android applications to perform a wide range of tasks autonomously.
Methods
AutoDroid tackles this problem through a multi-pronged approach:
- GUI Representation: It converts the Android UI into a simplified HTML-style text representation, making it digestible for LLMs. This representation preserves crucial element attributes and handles complex UI structures.
- Exploration-based Memory Injection: AutoDroid performs offline exploration of target apps to build an "App Memory." This memory contains a UI Transition Graph (UTG) and synthesized simulated tasks, which provide LLMs with app-specific knowledge about how functionalities are achieved. This knowledge is then injected into LLM prompts to guide decision-making.
- Multi-granularity Query Optimization: To reduce the computational cost and latency associated with LLM queries, AutoDroid employs several techniques:
- Merging Functionally Equivalent Elements: It prunes and merges redundant or functionally similar UI elements in the HTML representation to shorten prompts.
- Shortcuts and GUI Merging: It identifies simple actions that can be executed directly using the App Memory, bypassing LLM calls. It also merges multiple UI states into a single prompt when necessary.
- Task-oriented UI Prompting: The system generates prompts that clearly present the current UI state, task description, and relevant app memory information to the LLM, while restricting the output format to ensure valid action generation.
- Fine-tuning Local LLMs: For cost-effectiveness, AutoDroid can fine-tune smaller, on-device LLMs (like Vicuna) using app-specific data and simulated tasks, significantly improving their performance.
Datasets
- DroidTask: A newly introduced benchmark suite consisting of 158 high-level tasks extracted from 13 popular Android apps. It provides tasks, corresponding GUI action traces, and an exploration environment for apps, enabling reproducible evaluation.
- MoTiF: Used for training baseline methods and for fine-tuning LLMs, particularly for tasks involving input and completion judgment.
Key Insights and Ideas
- App-specific knowledge is crucial: Simply relying on LLMs' general knowledge is insufficient for robust mobile task automation. Integrating dynamically learned app-specific information (via App Memory) dramatically improves performance.
- LLMs can learn to "see" and "act" on UIs: By converting UIs into a structured text format (HTML-style), LLMs can effectively process and reason about visual interfaces.
- Simulated tasks are powerful: Synthesizing tasks from UI exploration provides a rich source of "how-to" knowledge for LLMs, enabling them to learn complex action sequences.
- Cost optimization is key for practical deployment: Techniques like prompt shortening and intelligent LLM call reduction are essential for making LLM-powered automation feasible on mobile devices.
Key Results
AutoDroid demonstrated impressive performance:
- Action Accuracy: Achieved 90.9% action accuracy with GPT-4 and 71.3% with Vicuna-7B on the DroidTask benchmark.
- Task Completion Rate: Outperformed baselines by 36.4% to 39.7% with GPT-4.
- Efficiency: Reduced LLM query costs by 51.7% on average and decreased inference latency by 21.3%.
- Memory Augmentation: Memory injection improved overall completion rate significantly, especially for smaller LLMs.
Limitations and Future Work
- Latency: While optimized, LLM inference still contributes to latency, especially for on-device models. The authors suggest collaborative approaches with smaller models and instruction caching for further improvement.
- Randomness of LLMs: Setting the temperature parameter requires a trade-off between consistency and creativity.
- Risky Actions: Identifying and handling risky actions (those that could alter user data) requires user confirmation, adding an extra step.
- Future Work: The authors suggest exploring collaborative LLM-smaller model approaches, instruction caching, and further research into making LLM agents truly intelligent and helpful personal assistants.
Summary updated