Model Generalization on Text Attribute Graphs: Principles with Large Language Models

Haoyu Wang, Shikun Liu, Rongzhe Wei, Pan LiarXiv 2025 · DOI

Introduction

Text-Attributed Graphs (TAGs), such as citation networks and e-commerce platforms, are ubiquitous in modern data science. A primary challenge in this domain is performing zero-shot node classification—categorizing nodes without the need for expensive, human-annotated training data. While Large Language Models (LLMs) offer powerful text-understanding capabilities, applying them to graphs is hindered by context-length limitations and the difficulty of aligning graph structural information with textual token spaces.

The Limitations of Current Graph-LLM Methods

Existing approaches often attempt to bridge the gap between graphs and LLMs using trained "adapters" or projectors. However, these methods face two significant hurdles:

  1. Context Constraints: Feeding a node's entire textual neighborhood into an LLM prompt is often computationally infeasible due to context window limits.
  2. Generalization Failure: Unlike vision-language models, graph domains lack the massive datasets required to train robust adapters. Consequently, these models often fail to generalize to unseen graph structures, sometimes performing worse than basic text encoders that ignore graph topology entirely.

The LLM-BP Framework

To address these issues, the authors introduce LLM-BP, a training-free framework built on two core principles designed to maximize the synergy between LLMs and classical graph algorithms.

Principle I: Task-Adaptive Node Embeddings

Rather than using generic text embeddings, LLM-BP employs a task-conditional strategy. By providing an LLM-based encoder (e.g., LLM2Vec) with the specific task description and candidate classes alongside the raw node text, the resulting embeddings are naturally clustered according to the classification goal. This approach leverages the LLM's ability to utilize context to refine semantic representations.

Principle II: Generalizable Graph Aggregation via Belief Propagation

Instead of training a neural network for aggregation, LLM-BP utilizes Belief Propagation (BP), a mathematically principled algorithm for statistical inference on graphs. To make BP adaptive, a lightweight LLM agent estimates the graph's homophily ratio—the likelihood that connected nodes share the same label—by examining a small sample of edge pairs. This ratio parameterizes the BP algorithm, allowing it to function effectively across both homophilic (similar nodes connected) and heterophilic (dissimilar nodes connected) graphs.

Overview of the LLM-BP framework, illustrating task-adaptive embedding and the adaptive BP mechanism.

Experimental Evaluation

The framework was evaluated on 11 real-world TAG benchmarks spanning citation networks, e-commerce, knowledge graphs, and school webpages. These datasets represent a diverse range of structural properties, from highly homophilic to significantly heterophilic.

Key Results

LLM-BP achieved state-of-the-art zero-shot performance, securing the top average rank across all 11 datasets. Key findings include:

  • Embedding Superiority: Task-conditional embeddings improved zero-shot accuracy by an average of 8.10% over standard language model encoders.
  • Aggregation Efficiency: The BP-based aggregation provided an additional 1.71% performance boost. Notably, the LLM agent could accurately estimate homophily using as few as 40 to 100 sampled edges, making the process highly efficient.
  • Adapter Critique: The study confirmed that many existing graph-LLM adapters do not effectively learn graph reasoning; their performance is largely driven by the underlying text encoder.
Zero-shot accuracy comparison across 11 benchmarks showing the performance of Task-Adaptive Embeddings.

Conclusion

LLM-BP demonstrates that complex, data-hungry adapters are not always necessary for graph generalization. By combining task-adaptive LLM embeddings with principled, parameter-efficient classical algorithms like Belief Propagation, researchers can achieve superior zero-shot performance that is both generalizable and computationally efficient.

Summary updated

BibTeX
@misc{wang2025model,
  author = {Haoyu Wang and Shikun Liu and Rongzhe Wei and Pan Li},
  title = {{Model Generalization on Text Attribute Graphs: Principles with Large Language Models}},
  year = {2025},
  eprint = {2502.11836},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.11836},
}
Figure