Table of Contents
Fetching ...

GraphChain: Large Language Models for Large-scale Graph Analysis via Tool Chaining

Chunyu Wei, Wenji Hu, Xingjia Hao, Xin Wang, Yifan Yang, Yueguo Chen, Yang Tian, Yunhai Wang

TL;DR

GraphChain addresses the core challenge of applying large language models to large graphs by introducing dynamic tool chaining. It combines Progressive Graph Distillation to learn compact, task-focused sequences and Structure-aware Test-Time Adaptation to tailor strategies to graph topology via a lightweight adapter and Laplacian-based fingerprints. The approach leverages a graph processing tool library and reinforcement learning (PPO with GAE) to optimize tool sequences while respecting memory and relevance constraints, framed through an information bottleneck lens. Empirically, GraphChain outperforms state-of-the-art baselines by about 20.7% relative accuracy on diverse graph domains and scales to graphs with up to ~200,000 nodes, with strong transferability and robustness across models and tool sets, highlighting practical impact for scalable graph analytics with LLMs.

Abstract

Large Language Models (LLMs) face significant limitations when applied to large-scale graphs, struggling with context constraints and inflexible reasoning. We present GraphChain, a framework that enables LLMs to analyze complex graphs through dynamic sequences of specialized tools, mimicking human exploratory intelligence. Our approach introduces two key innovations: (1) Progressive Graph Distillation, a reinforcement learning mechanism that generates optimized tool sequences balancing task relevance with information compression, and (2) Structure-aware Test-Time Adaptation, which efficiently tailors tool selection strategies to diverse graph topologies using spectral properties and lightweight adapters without costly retraining. Experiments show GraphChain significantly outperforms prior methods, enabling scalable and adaptive LLM-driven graph analysis.

GraphChain: Large Language Models for Large-scale Graph Analysis via Tool Chaining

TL;DR

GraphChain addresses the core challenge of applying large language models to large graphs by introducing dynamic tool chaining. It combines Progressive Graph Distillation to learn compact, task-focused sequences and Structure-aware Test-Time Adaptation to tailor strategies to graph topology via a lightweight adapter and Laplacian-based fingerprints. The approach leverages a graph processing tool library and reinforcement learning (PPO with GAE) to optimize tool sequences while respecting memory and relevance constraints, framed through an information bottleneck lens. Empirically, GraphChain outperforms state-of-the-art baselines by about 20.7% relative accuracy on diverse graph domains and scales to graphs with up to ~200,000 nodes, with strong transferability and robustness across models and tool sets, highlighting practical impact for scalable graph analytics with LLMs.

Abstract

Large Language Models (LLMs) face significant limitations when applied to large-scale graphs, struggling with context constraints and inflexible reasoning. We present GraphChain, a framework that enables LLMs to analyze complex graphs through dynamic sequences of specialized tools, mimicking human exploratory intelligence. Our approach introduces two key innovations: (1) Progressive Graph Distillation, a reinforcement learning mechanism that generates optimized tool sequences balancing task relevance with information compression, and (2) Structure-aware Test-Time Adaptation, which efficiently tailors tool selection strategies to diverse graph topologies using spectral properties and lightweight adapters without costly retraining. Experiments show GraphChain significantly outperforms prior methods, enabling scalable and adaptive LLM-driven graph analysis.

Paper Structure

This paper contains 50 sections, 1 theorem, 15 equations, 7 figures, 13 tables.

Key Result

Proposition 4.1

Let the input be $X=(G, \mathcal{Q})$, containing task-relevant information $Y=\mathcal{A}_{\mathcal{Q}}$ (the answer) and task-irrelevant information $IR$, with the Markov structure $(Y, IR) \rightarrow X \rightarrow \mathbf{m}_t$. Assuming the relevance proxy $\mathrm{Rel}_t$ positively correlates

Figures (7)

  • Figure 1: Comparison of Graph Processing Approaches with LLMs.Left: Methods suffer from Context Exhaustion where large graphs exceed LLM context windows. Center: Single-tool approaches face Reasoning Hallucination with fixed, predefined tools. Right: Our GraphChain framework enables human-like exploratory analysis through sequential tools that progressively narrow focus in large-scale graphs.
  • Figure 2: (1) Training Phase: Progressive graph distillation where the RL agent learns to select tool sequences that iteratively reduce the memory state's ($\mathbf{m}$) Graph Description Length (GDL) while maximizing task relevance. (2) Structure-aware Test-Time Adaptation: A lightweight adapter ($\mathcal{A}_{\psi}$) tuned by minimizing chain length and KL divergence generates a structure-specific soft prompt $\mathbf{P}_G$ based on the graph's SVD-derived fingerprint $\mathbf{z}_G$.
  • Figure 3: Impact of removing graph distillation or test-time adaptation.
  • Figure 4: Comparison with varying Graph Sizes and Query Complexity.
  • Figure 5: Distribution of tool types utilized by GraphChain across different graph domains.
  • ...and 2 more figures

Theorems & Definitions (1)

  • Proposition 4.1