TL;DR
This paper proposes integrating Graph Neural Networks (GNNs) with Large Language Models (LLMs) to improve task planning for AI agents. By treating task planning as a graph decision-making problem, GNNs can better understand task dependencies and overcome LLMs' limitations in graph comprehension, leading to more accurate and efficient task execution.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown impressive capabilities in understanding and generating human language, making them promising for building AI agents that can perform complex tasks. A crucial aspect of these agents is task planning: breaking down a user's natural language request into a sequence of solvable sub-tasks. Current LLM-based approaches primarily rely on prompt engineering, which can be brittle and prone to errors. The authors identify that LLMs struggle with accurately interpreting the structure of task graphs (where tasks are nodes and dependencies are edges), leading to "hallucinations" (incorrect tasks or dependencies) and performance degradation, especially as task graphs grow larger. This paper aims to address this gap by exploring graph learning-based methods as an orthogonal approach to prompt engineering.
Methods
The core of this paper is the integration of Graph Neural Networks (GNNs) with LLMs for task planning. The authors propose two main approaches:
- Training-free GNN-based Approach: This method leverages LLMs to decompose user requests into steps. Then, a pre-trained language model (e.g., e5-335M) embeds these steps and task descriptions. A parameter-free GNN (specifically, SGC) is used to retrieve relevant sub-tasks based on these embeddings and the task graph structure. This approach requires no additional training and can be used in a zero-shot manner.
- Training-required GNN-based Approach: Similar to the training-free method, LLMs handle request decomposition. However, this approach uses parametric GNNs (like GAT or GraphSAGE) that are trained using a Bayesian Personalized Ranking (BPR) loss. This allows the GNN to learn from implicit sub-task rankings, further enhancing performance.
The paper also provides theoretical insights into why LLMs struggle with graph processing, attributing it to the inductive biases of attention mechanisms and the limitations of auto-regressive loss, which can lead to spurious correlations.
Datasets
The authors evaluate their methods on several datasets:
- HuggingFace tasks: A benchmark for task planning using APIs from HuggingFace.
- Multimedia tasks: Tasks involving file downloading and video editing.
- Daily Life API tasks: Tasks related to everyday services like web search and shopping.
- TMDB API tasks: Tasks focused on movie-related search and retrieval.
- UltraTool: A newly released benchmark with a significantly larger task graph (260 nodes) to test scalability.
Key Insights and Ideas
- LLMs struggle with graph structure: The paper provides theoretical and empirical evidence that LLMs, despite their language prowess, have inherent limitations in processing graph-structured data due to their attention mechanisms and auto-regressive training.
- GNNs are a natural fit for task graphs: GNNs are designed to operate on graph structures and can effectively capture task dependencies, overcoming the limitations of LLMs in this domain.
- Graph learning is orthogonal to prompt engineering: Integrating GNNs offers a complementary approach to improving LLM-based agents, rather than solely focusing on prompt design.
- Training-free GNNs are surprisingly effective: Even without task-specific training, GNNs can significantly improve task planning performance, demonstrating their ability to leverage graph structure.
- Task graph size matters: The performance gains from using GNNs increase with the size of the task graph, highlighting their scalability.
Key Results
- Improved performance: The proposed GNN-based methods consistently outperform LLM direct inference and other baselines across various LLMs and datasets. For instance, on the HuggingFace dataset, the training-free SGC method achieved a Node-F1 score of 59.62% with Vicuna-13B, significantly better than direct inference (50.46%).
- Efficiency: The training-free SGC method is highly efficient, achieving comparable or superior performance to BeamSearch while requiring 5-10 times fewer tokens and inference time. Training-based GNNs also train remarkably fast, concluding within minutes.
- Scalability: On the UltraTool benchmark with a large task graph (260 nodes), integrating GNNs significantly enhanced performance, with GPT-4-turbo showing a 9.05% accuracy improvement with GraphSAGE.
- Parameter filling: When provided with GNN-retrieved tasks, LLMs are much better at filling in invocation parameters, with improvements of up to 23% in Parameter-Value F1-score.
Limitations and Future Work
- Ambiguous task steps: The GNN's performance is sensitive to the quality of decomposed task steps. Ambiguous descriptions can mislead the GNN, causing cascading errors.
- Manual graph construction: Currently, constructing the task graph requires manual effort.
- More sophisticated GNNs: The authors suggest that more advanced graph-learning-based decision-making algorithms could offer further improvements.
- Automated graph generation: Investigating techniques for automatically generating task graphs for diverse applications is a promising future direction.
Summary updated