NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Versatile Graph Learning Approach through LLM-based Agent

Lanning Wei, Zhiqiang He, Huan Zhao, Quanming Yao, Yao, Quanming · DOI

Abstract

Designing versatile graph learning approaches is important, considering the diverse graphs and tasks existing in real-world applications. Existing methods have attempted to achieve this target through automated machine learning techniques, pre-training and fine-tuning strategies, and large language models. However, these methods are not versatile enough for graph learning, as they work on either limited types of graphs or a single task. In this paper, we propose to explore versatile graph learning approaches with LLM-based agents, and the key insight is customizing the graph learning procedures for diverse graphs and tasks. To achieve this, we develop several LLM-based agents, equipped with diverse profiles, tools, functions and human experience. They collaborate to configure each procedure with task and data-specific settings step by step towards versatile solutions, and the proposed method is dubbed GL-Agent. By evaluating on diverse tasks and graphs, the correct results of the agent and its comparable performance showcase the versatility of the proposed method, especially in complex scenarios. The low resource cost and the potential to use open-source LLMs highlight the efficiency of GL-Agent.

Introduction

Graph-structured data is incredibly diverse, ranging from social networks and e-commerce logs to molecular structures. Because every graph has different properties (e.g., homophily vs. heterophily), a "one-size-fits-all" model rarely works. Current solutions like AutoML require significant expertise to configure, while pre-training strategies often struggle to generalize across vastly different graph domains. Furthermore, Large Language Models (LLMs) cannot "read" large-scale graphs directly due to context window limits and lack the specialized inductive biases of Graph Neural Networks (GNNs).

To bridge this gap, we introduce GL-Agent, a framework that uses LLMs not to process the graph data itself, but to manage the specialized tools that do. By acting as an orchestrator that configures specialized Automated Machine Learning (AutoML) tools, GL-Agent achieves state-of-the-art performance across diverse tasks at a fraction of the human effort and cost.

Overview of the GL-Agent framework showing the interaction between user instructions, LLM-based agents, and the underlying graph learning procedures.

Methodology: Multi-Agent Collaboration

The core of the GL-Agent framework is the decomposition of the graph learning process into a multi-agent collaboration. The system is built using LangChain for agent orchestration and leverages PyTorch Geometric (PyG) as the underlying graph engine.

Specialized Agent Roles

  • Manager Agent: Acts as the interface, parsing natural language instructions to extract key metadata (task type, dataset, evaluation metrics, and hardware constraints).
  • Data Agent: Browses PyG documentation to select appropriate feature engineering techniques.
  • Configuration Agent: Defines the neural architecture search (NAS) space and selects the search algorithm (e.g., random vs. differentiable search).
  • Searching Agent: Generates and executes bash scripts to run the AutoML search.
  • Tuning Agent: Uses HyperOPT to fine-tune hyperparameters like learning rate and dropout.
  • Response Agent: Consolidates the logs and results into a human-readable summary.
Detailed workflow of GL-Agent, illustrating the specific functions and plugin tools (e.g., web browser, code generation, API calls) used by each agent to customize the graph learning pipeline.

Experimental Evaluation

The authors evaluated GL-Agent on 11 widely used benchmarks across node-level (e.g., Cora, genius), graph-level (e.g., NCI1, PROTEINS), and link-level (e.g., Epinions) tasks.

Key Results

  • State-of-the-Art Performance: GL-Agent consistently matched or outperformed specialized AutoML baselines. For example, on the Cora dataset, it achieved 86.81% accuracy, outperforming standard GCN (85.68%) and direct LLM suggestions (84.64%).
  • Robustness in Complex Scenarios: On the genius dataset (non-homophilous), GL-Agent achieved 90.51% accuracy, significantly higher than the LLM-GNN baseline (89.31%), proving it can handle "tricky" graph structures where standard GNNs often fail.
  • Efficiency: Running a full pipeline cost approximately $0.31 USD in API tokens and took only a few minutes of "agent thinking" time, making it a viable alternative to manual data science for routine tasks.

Discussion and Future Work

The "aha moment" of GL-Agent is that LLMs are better at high-level planning and tool manipulation than at performing actual graph convolutions. By letting the LLM write the configuration and the GNN do the math, the system achieves the best of both worlds.

While highly effective, the framework's performance is currently tied to the reasoning capabilities of the underlying LLM (e.g., GPT-4). Future iterations could benefit from a reflection mechanism where agents review their own errors and retry, as well as more interactive multi-round dialogues between the user and the Manager Agent.

Summary updated

BibTeX
@misc{wei2023versatile,
  author = {Lanning Wei and Zhiqiang He and Huan Zhao and Quanming Yao and Yao, Quanming},
  title = {{A Versatile Graph Learning Approach through LLM-based Agent}},
  year = {2023},
  eprint = {2309.04565},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.04565},
}
Figure