GraphTranslator: Aligning Graph Model to Large Language Model for Open-ended Tasks

Mengmei Zhang, Mingwei Sun, Peng Wang, Shen Fan, Yanhu Mo, Xiaoxiao Xu, Hong Liu, Cheng Yang, Chuan Shi

Abstract

Graph Neural Networks (GNNs) excel at pre-defined tasks like node classification but lack the flexibility for open-ended reasoning. Conversely, Large Language Models (LLMs) possess strong reasoning capabilities but struggle with graph data due to a significant "modality gap." We present GraphTranslator, a framework that aligns graph model embeddings with LLM token space. By utilizing a "Producer" to textualize graph information and a "Translator" to map embeddings to language tokens, GraphTranslator enables frozen LLMs to perform complex, open-ended tasks on graphs without extensive retraining. Evaluations on Taobao and ArXiv datasets demonstrate that GraphTranslator significantly outperforms vanilla LLM prompting and traditional baselines in zero-shot classification and qualitative reasoning.

Introduction

Graph Neural Networks (GNNs) are the standard for tasks like predicting user purchases or categorizing research papers. However, these models are typically rigid, confined to pre-defined categories, and unable to explain the reasoning behind their predictions. LLMs offer a potential solution through their open-ended reasoning, but they do not inherently understand graph structures.

Comparison of existing LLM-graph integration strategies versus GraphTranslator.

Previous integration attempts generally fall into two categories: LLM-as-Enhancer, which uses LLMs to refine text features for a GNN, and LLM-as-Predictor, which feeds raw text descriptions of nodes directly into an LLM. The former remains locked into pre-defined tasks, while the latter suffers from high computational costs and hallucinations due to the "modality gap" between raw graph data and linguistic patterns. GraphTranslator addresses these issues by treating the graph model as a specialized sensor and providing a translation layer to the LLM.

Methodology

GraphTranslator employs a three-part architecture designed to keep both the Graph Model (GM) and the LLM frozen, focusing training on a lightweight bridge.

The Producer and Translator

The Producer is a data-generation pipeline that uses an LLM to "textualize" the graph. It summarizes node attributes, neighbor attributes, and the "model bias" (commonalities between them), creating a high-quality alignment dataset. The Translator, inspired by the Q-Former architecture, learns to map node embeddings from the GM into the LLM’s token space using query tokens to extract semantic information.

Detailed architecture of GraphTranslator, including the Producer, Translator, and two-stage training process.

Two-Stage Training

  1. Stage 1 (Alignment): The Translator is trained to align graph embeddings with the textual descriptions generated by the Producer.
  2. Stage 2 (Instruction Tuning): The Translator is fine-tuned to ensure its output serves as an effective "soft prompt," allowing the LLM to follow specific human instructions based on the graph data.

Experimental Results

The model was evaluated on the Taobao e-commerce dataset and the ArXiv citation network.

  • Zero-Shot Classification: On ArXiv, GraphTranslator achieved a 28.48% Top-1 Accuracy, significantly outperforming Vanilla LLM prompting (17.90%).
  • Intent Capture: In predicting "Cat Owners" on Taobao, GraphTranslator reached a 95.69% recall, nearly double the 45.56% achieved by text-only LLM approaches. This indicates that the Translator captures implicit behavioral patterns in the embeddings that are not explicitly stated in text.
  • Instruction Following: GraphTranslator maintained a high "legality rate" (up to 98.97%), showing superior ability to follow output format constraints compared to standard prompting.

Conclusion

GraphTranslator successfully bridges the gap between specialized graph representations and general-purpose language reasoning. By translating complex embeddings into a language the LLM understands, the framework enables sophisticated, open-ended graph analysis—such as explaining why two users are connected—without the need for expensive end-to-end retraining. Future work will explore incorporating more structural topology information and scaling the framework to even larger language models.

Summary updated

BibTeX
@inproceedings{zhang2024graphtranslator,
  author = {Mengmei Zhang and Mingwei Sun and Peng Wang and Shen Fan and Yanhu Mo and Xiaoxiao Xu and Hong Liu and Cheng Yang and Chuan Shi},
  title = {{GraphTranslator: Aligning Graph Model to Large Language Model for Open-ended Tasks}},
  booktitle = {The Web Conference},
  year = {2024},
}
Figure