LLM4GNAS: A Large Language Model Based Toolkit for Graph Neural Architecture Search

Yang Gao, Hong Yang, Yizhi Chen, Junxian Wu, Peng Zhang, Haishuai WangarXiv 2025 · DOI

Abstract

LLM4GNAS is a novel toolkit that utilizes Large Language Models (LLMs) as a natural-language controller for Graph Neural Architecture Search (GNAS). By replacing traditional, rigid search algorithms with iterative LLM prompting, the framework automates node feature augmentation, architecture discovery, and hyperparameter optimization. Experimental results across diverse benchmarks demonstrate that LLM4GNAS achieves state-of-the-art performance with rapid convergence, offering a flexible and accessible approach to automated graph learning.

Introduction

Designing effective Graph Neural Networks (GNNs) is a complex task due to the varying structural properties of graphs, such as homophily and heterophily. While Graph Neural Architecture Search (GNAS) was developed to automate this design process, existing tools are often "brittle," requiring significant manual effort to adapt to new search spaces or operators. This creates a high barrier to entry and limits the scalability of automated graph learning.

LLM4GNAS addresses these challenges by reimagining GNAS as a natural-language task. By leveraging the reasoning and generative capabilities of LLMs (e.g., GPT-4), the framework provides a "plug-and-play" system that automates the entire pipeline from feature engineering to model deployment.

Methodology

The core innovation of LLM4GNAS is the use of an LLM as a central controller managing three iterative modules:

  1. LLM-enhanced Node Augmentation: The toolkit uses LLMs to generate text-based explanations or pseudo-labels for nodes, which are then converted into high-quality initial embeddings. This enriches the feature set before the architecture search begins.
  2. Prompt-based GNAS: Instead of Reinforcement Learning or Gradient Descent, LLM4GNAS describes the search space in natural language prompts. The LLM proposes candidate architectures, receives feedback on validation performance, and iteratively refines its suggestions.
  3. LLM-driven Hyperparameter Optimization (HPO): The LLM suggests training configurations, such as learning rates and dropout, reducing the need for computationally expensive grid or random searches.
The LLM4GNAS framework utilizes an LLM as a central controller for node augmentation, architecture search, and hyperparameter optimization.

The toolkit is built on top of industry-standard libraries like PyTorch Geometric (PyG) and Hugging Face Transformers, facilitating integration into existing research workflows.

Experimental Evaluation

The authors evaluated LLM4GNAS across a wide range of benchmarks, including node classification (Cora, Pubmed, ogbn-products), graph classification (IMDB-B, MUTAG), link prediction (NS, Power), and heterogeneous graphs (ACM, DBLP).

Key Insights

  • Prompting as Programming: Adapting to new search spaces is simplified to modifying natural language prompts rather than rewriting core search algorithms.
  • Iterative Learning: LLMs effectively "learn" from previous iterations. By including the performance of the last 10 architectures in the prompt, the LLM identifies patterns and converges on superior designs faster than random search.
  • Semantic Enrichment: Ablation studies show that node augmentation using LLMs to understand node attribute semantics (e.g., paper abstracts) significantly boosts the accuracy floor.

Key Results

LLM4GNAS consistently matched or outperformed state-of-the-art GNAS methods like AutoGEL and GraphNAS.

  • Rapid Convergence: LLM4GNAS typically finds high-performing architectures within 10 iterations, often surpassing the best models found by traditional automated methods.
  • Link Prediction: The framework achieved near-perfect accuracy on the NS (99.88%) and Router (99.33%) datasets.
  • Heterogeneous Performance: On the ACM dataset, it reached 92.97% accuracy, outperforming specialized baselines like HAN and HGT.
  • Controller Selection: GPT-4 proved to be the most effective controller, significantly outperforming GPT-3, Llama-2, and GLM-3 in navigating complex search spaces.
Accuracy comparison over search iterations across different datasets, showing LLM4GNAS's superior convergence speed.

Conclusion and Future Work

LLM4GNAS demonstrates the potential of LLMs to simplify and enhance automated graph learning. However, challenges remain, including context window constraints that limit the history of search iterations and the cost/latency associated with high-end LLM APIs. Future work will focus on automating search prompt design and exploring transferable LLM-based GNAS methods to carry knowledge across different graph tasks.

Summary updated

BibTeX
@misc{gao2025llm,
  author = {Yang Gao and Hong Yang and Yizhi Chen and Junxian Wu and Peng Zhang and Haishuai Wang},
  title = {{LLM4GNAS: A Large Language Model Based Toolkit for Graph Neural Architecture Search}},
  year = {2025},
  eprint = {2502.10459},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.10459},
}
Figure