Abstract
Graph structured data are widely existed and applied in the real-world applications, while it is a challenge to handling these diverse data and learning tasks on graph in an efficient manner. When facing the complicated graph learning tasks, experts have designed diverse Graph Neural Networks (GNNs) in recent years. They have also implemented AutoML in Graph, also known as AutoGraph, to automatically generate data-specific solutions. Despite their success, they encounter limitations in (1) managing diverse learning tasks at various levels, (2) dealing with different procedures in graph learning beyond architecture design, and (3) the huge requirements on the prior knowledge when using AutoGraph. In this paper, we propose to use Large Language Models (LLMs) as autonomous agents to simplify the learning process on diverse real-world graphs. Specifically, in response to a user request which may contain varying data and learning targets at the node, edge, or graph levels, the complex graph learning task is decomposed into three components following the agent planning, namely, detecting the learning intent, configuring solutions based on AutoGraph, and generating a response. The AutoGraph agents manage crucial procedures in automated graph learning, including data-processing, AutoML configuration, searching architectures, and hyper-parameter fine-tuning. With these agents, those components are processed by decomposing and completing step by step, thereby generating a solution for the given data automatically, regardless of the learning task on node or graph. The proposed method is dubbed Auto$^2$Graph (or GL-Agent), and demonstrates comparable performance on different datasets and learning tasks, as well as human-like decision-making capabilities.
Introduction
Graph learning is notoriously "fragmented." Real-world graph data—ranging from social networks to molecular structures—varies wildly in its properties. Consequently, a model that works for node classification on a citation network might fail miserably at predicting properties of a chemical compound. Currently, researchers tackle this through AutoML, pre-training, or LLM "flattening" (converting graphs to text). However, these methods often struggle with task versatility, distribution shifts, or context window limitations on large-scale graphs.
To address these challenges, we introduce GL-Agent (Graph Learning Agent), a framework that leverages LLMs not as the model itself, but as the architect of the machine learning pipeline. By orchestrating specialized agents, GL-Agent can handle any graph task at any scale by translating natural language instructions into executable, optimized graph learning workflows.
System Architecture
GL-Agent is a multi-agent system built using LangChain and PyTorch Geometric (PyG). The framework decomposes the complex graph learning process into a structured workflow managed by specialized LLM-based agents.
As shown in the architecture overview, the system transitions from a user's natural language request to a final response through a series of automated steps. Unlike standard AutoML, GL-Agent uses LLM reasoning to "read" documentation and apply human-like expertise to prune the search space before any code is executed.
The Agentic Workflow
The core of GL-Agent lies in its specialized agents, each responsible for a distinct phase of the pipeline:
- Manager Agent: Parses natural language instructions to extract key metadata such as dataset names, learning targets, and hardware constraints.
- Data Agent: Selects appropriate feature engineering techniques (e.g., adding self-loops or converting directed graphs) by browsing relevant documentation.
- Configuration Agent: Defines the search space for GNN layers and selects appropriate search algorithms (e.g., Random Search vs. Differentiable Search).
- Searching Agent: Generates and executes code to perform Neural Architecture Search (NAS), identifying the optimal model structure.
- Tuning Agent: Fine-tunes hyperparameters like learning rate and dropout using tools like HyperOPT.
- Response Agent: Consolidates logs and results into a human-readable summary for the user.
Experimental Evaluation
GL-Agent was evaluated on 11 widely used benchmarks across three levels: node-level (e.g., Cora, Genius), graph-level (e.g., NCI1, PROTEINS), and link-level (e.g., Epinions).
Key Results
- Node Classification: On the complex Genius dataset, GL-Agent achieved 90.51% accuracy, outperforming standard GCN (89.10%) and direct LLM-suggested architectures (89.31%).
- Graph Classification: It achieved an average rank of 2.0 across four datasets, outperforming established methods like DGCNN and DiffPool.
- Recommendation: In item ranking (Recall@20), GL-Agent (0.0453) significantly outperformed standard Neural Collaborative Filtering (0.0344) on the Epinions dataset.
- Efficiency: The agent logic typically takes less than a minute to generate the entire pipeline configuration, with an average cost of roughly $0.31 USD per task (using GPT-3.5-turbo).
Discussion and Insights
The primary innovation of GL-Agent is the realization that LLMs are more effective at designing a GNN than acting as one. By letting the LLM write the configuration and allowing the AutoML engine to handle the heavy lifting, the system bypasses the context window limitations of LLMs. Furthermore, the injection of "human expertise" into prompts allows agents to make nuanced decisions, such as choosing specific aggregation functions for non-homophilous graphs.
While highly effective, the system remains dependent on the reasoning capabilities of the underlying LLM; smaller models occasionally struggle with complex logic like algorithm selection. Future work will focus on implementing multi-round dialogues and self-correction mechanisms to further enhance robustness.
Summary updated