Disentangled Representation Learning with Large Language Models for Text-Attributed Graphs

Yijian Qin, Xin Wang, Ziwei Zhang, Wenwu ZhuarXiv 2023 · DOI

TL;DR

The Disentangled Graph-Text Learner (DGTL) bridges the gap between Large Language Models (LLMs) and graph data. By injecting "disentangled" structural information from Graph Neural Networks (GNNs) directly into frozen LLMs, DGTL enables high-performance node classification and provides natural language explanations for its predictions without the computational burden of full LLM fine-tuning.

What Problem Does This Paper Address?

Text-Attributed Graphs (TAGs)—where nodes represent textual entities like research papers or products and edges represent relationships like citations or co-purchases—are everywhere. Traditionally, we used GNNs to handle the structure and simple embeddings for the text.

Recently, researchers tried using LLMs for TAGs, but they hit a "prompting bottleneck." Most methods try to describe a node's neighborhood using text prompts (e.g., "This paper cites Paper A and Paper B..."). This approach is flawed because:

  1. Token Limits: Describing a complex neighborhood quickly exceeds an LLM's context window.
  2. Surface-Level Understanding: LLMs struggle to grasp the mathematical nuances of graph topology through text alone.
  3. Computational Cost: Fine-tuning an entire LLM for a specific graph task is prohibitively expensive.
Comparison of LLM performance with and without structural information injection.

Methods

The authors propose DGTL, a three-step framework designed to give LLMs "graph vision" while keeping the heavy-duty language model frozen.

The three-step DGTL framework: Text Embedding, Disentangled Graph Learning, and Information Injection.
  1. Text Embedding Generation: Instead of using a single "End-of-Sentence" token, DGTL passes node text through an upstream LLM and averages the features from the last layer. This creates a rich semantic foundation for each node.
  2. Disentangled Graph Learning: This is the "secret sauce." The model uses a tailored GNN to capture neighborhood information. Crucially, it uses disentangled layers to separate different structural factors (like topology vs. semantic similarity). This ensures the model doesn't just "blur" all neighbors together but understands the specific reasons why nodes are connected.
  3. Neighborhood Information Injection: Rather than writing a long prompt, DGTL injects the learned GNN features directly into the downstream LLM’s attention layers as "soft tokens." This allows the LLM to process structural data as if it were part of the natural language context.

By keeping the LLM frozen and only training the GNN and a few projection layers (a "delta-tuning" approach), the model remains efficient and avoids "catastrophic forgetting" of its pre-trained knowledge.

Datasets

The model was evaluated on three diverse TAG benchmarks:

  • Cora: A classic citation network of computer science papers categorized by sub-field.
  • PubMed: A large-scale citation network of biomedical literature.
  • Books-History: An e-commerce graph from Amazon where nodes are history books and edges represent "frequently purchased together" relationships.

Key Insights and Ideas

  • Averaging is Better: The authors found that averaging the hidden states of the last LLM layer provides a more comprehensive node representation than just using the final token.
  • Structure as Language: By injecting GNN features into the LLM's key/query projection functions, the model treats graph structure as a first-class citizen alongside text.
  • The Power of "Why": Because the LLM is generative, DGTL doesn't just output a label (e.g., "Rule Learning"). It can generate a sentence explaining why, such as: "The paper also cites several references related to rule-based machine learning." This significantly boosts model interpretability.

Key Results

DGTL consistently outperformed or matched state-of-the-art baselines across all datasets:

  • Accuracy Boosts: On the PubMed dataset, DGTL achieved 87.10% accuracy, significantly outperforming standard GNNs (GCN at 78.86%) and LLM-only prompting methods (Neighbor Summary at 67.70%).
  • E-commerce Success: On the Books-History dataset, DGTL reached 55.70% accuracy, nearly tripling the performance of vanilla LLM prompting (17.70%), proving that structural context is vital in non-academic domains.
  • Efficiency: The model achieves these results while keeping the backbone LLM (Llama-2-13B) frozen, making it much more accessible for researchers with limited GPU resources.

Limitations and Future Work

While DGTL is a major step forward, the authors and the architecture suggest a few areas for growth:

  • Scalability: While mini-batching is used, very dense graphs with massive neighborhoods might still pose a challenge for the disentangled GNN layers.
  • Task Variety: The paper focuses primarily on node classification. Future work could explore how DGTL handles link prediction or graph-level reasoning.
  • LLM Dependency: The performance is still tied to the quality of the underlying LLM. As models like Llama-3 or GPT-4 evolve, the "injection" method will need to be adapted to different attention architectures.

Summary updated

BibTeX
@misc{qin2023disentangled,
  author = {Yijian Qin and Xin Wang and Ziwei Zhang and Wenwu Zhu},
  title = {{Disentangled Representation Learning with Large Language Models for Text-Attributed Graphs}},
  year = {2023},
  eprint = {2310.18152},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.18152},
}
Figure