LLMs as Zero-shot Graph Learners: Alignment of GNN Representations with LLM Token Embeddings

Zero-shot graph machine learning, especially with graph neural networks (GNNs), has garnered significant interest due to the challenge of scarce labeled data. While methods like self-supervised learning and graph prompt learning have been extensively explored, they often rely on fine-tuning with task-specific labels, limiting their effectiveness in zero-shot scenarios. Inspired by the zero-shot capabilities of instruction-fine-tuned large language models (LLMs), we introduce a novel framework named Token Embedding-Aligned Graph Language Model (TEA-GLM) that leverages LLMs as cross-dataset and cross-task zero-shot learners for graph machine learning. Concretely, we pretrain a GNN, aligning its representations with token embeddings of an LLM. We then train a linear projector that transforms the GNN's representations into a fixed number of graph token embeddings without tuning the LLM. A unified instruction is designed for various graph tasks at different levels, such as node classification (node-level) and link prediction (edge-level). These design choices collectively enhance our method's effectiveness in zero-shot learning, setting it apart from existing methods. Experiments show that our graph token embeddings help the LLM predictor achieve state-of-the-art performance on unseen datasets and tasks compared to other methods using LLMs as predictors.

Paper

Similar papers

Peer review

Reviewer LAU54/10 · confidence 3/52024-06-17

Summary

This paper proposes TEA-GLM to align the GNN representations with LLM token embeddings for zero-shot graph machine learning. TEA-GLM enables cross-dataset and cross-task learning without fine-tuning the LLM. Extensive experiments demonstrate its state-of-the-art performance on unseen tasks and datasets.

Strengths

The paper is well-written and easy to follow, effectively conveying the design and motivation behind LLM-GS. The proposed framework employs only a linear projector to incorporate with the LLM, which is efficient. The idea of mapping graph embedding to token embedding is also interesting.

Weaknesses

The experimental results are somewhat questionable. The vanilla Vicuna-7B even outperformed LLaGA, which leveraged Vicuna-7B as its base model. Furthermore, the results on E-commerce-Children show no difference between Vicuna-7B and the proposed TEA-GLM. From my perspective, this paper marks LLaGA as the strongest baseline. However, I find that the experimental settings are totally different from LLaGA. Is it possible to conduct some experiments following LLaGA? The ablation studies are also questionable. Even without GT or without FC, the model achieves at least equivalent performance to that of Vicuna-7B, right?

Questions

Please see Weaknesses.

Rating

4

Confidence

3

Soundness

2

Presentation

3

Contribution

2

Limitations

N/A

Authorsrebuttal2024-08-12

Dear Reviewer LAU5, We greatly appreciate your time and effort in reviewing our manuscript, especially during this busy period. Since there will be no second stage of author-reviewer discussions, we are writing to inquire about the **current status of your review** of our submission. We sincerely hope that our responses have effectively resolved your concerns. Additionally, we are eager to address any further questions you may have, as your input will help us improve our work. Thank you once more for your invaluable guidance and support.

Reviewer 65Wi5/10 · confidence 4/52024-07-10

Summary

The paper propose a GNN plus LLM model for zero-shot learning in the graph domain. They first use contrastive learning to pretrain a GNN that can be applied to arbitrary graphs. They added a feature-wise contrastive learning objective on the projected representation to the PCA of LLM token embeddings to bridge the gap between contrastively learned embedding and LLM token embeddings. After training the GNN, they train additional linear projector to the map the GNN output to a sequence of graph tokens, and the tokens are combined with special prompt designed for graph learning tasks for LLM to perform downstream tasks. The methods does not need to fine-tune the LLM and acheived good performance on most of the datasets.

Strengths

The PCA-based alignment with the LLM input is interesting, and potentially can shed lights on future research on GNN and LLM alignment. The experimental results seem promising on most datasets compared to both LLM and GNN+LLM baselines. Especially, the model shows some-level of cross-task transferrability where the GNN and linear projector are pretrained only on node classification but, but show non-trivial performance on link prediction tasks.

Weaknesses

My major concern about the paper is its novelty. Several important components, including using self-supervised learning to generate general node embedding [1], alignning graph representation with LLM input with linear projector [2], and the prompt design are proposed and already widely adopted in the research area. The feature-wise contrastive learning seems to be the main technical contribution, yet it is not studied and invectigated in details. For example, why pre-training on node classification leads to non-trivial link prediction results? According to the ablation study, feature-wise CL seems to be the key, yet no knowledge about link-prediction is injected into the model in any step of the method. Related to the main concern, I think the experimental results do not fully justify the authors claim. The author claims that the aligned graph tokens provide the LLM with graph information. However, they still feed the node texts as direct text input to the LLM, for some datasets LLM can do well solely using node texts. To show that the pretraining process indeed brings in inductive/transferrable knowledge of the graph, the author should either show that by completely removing node text to from LLM text input (it is ok to keep task text), the model can still work or provide results of baseline models that tune the LLM on the node texts (tuning the LLM weight or use a soft prompt), and such baseline can not transfer or performs poorly. Note that the ablation study between w/o FC and w/o graph token is not enough. Essentially, if a soft prompt tuning can achieve similar effect, the proposed work is just adding linear layers as a substitute to soft prompts. [1] He, Yufei, and Bryan Hooi. "UniGraph: Learning a Cross-Domain Graph Foundation Model From Natural Language." arXiv preprint arXiv:2402.13630 (2024). [2] Tang, Jiabin, et al. "Graphgpt: Graph instruction tuning for large language models." arXiv preprint arXiv:2310.13023 (2023).

Questions

- Why do you need to map a single GNN node representation to multiple graph tokens? They should contain exactly the same amount of information. - What is the prompt used for baseline LLM? Is it the same prompt as the one used for GNN? If so, what happen when you provide it with a more detailed prompt, but still only on the target node? - For edge and graph tasks, you used the sum of node representation to compute graph tokens, wouldn't that break the aligned distribution as the pretraining only happens on node.

Rating

5

Confidence

4

Soundness

2

Presentation

3

Contribution

2

Limitations

N/A

Authorsrebuttal2024-08-12

Thank you for taking the time to review our rebuttal. We are grateful for the increased score and are enthusiastic about addressing your remaining concerns to enhance our submission further. > Question 1 We appreciate your feedback on feature-wise CL, and will elaborate on its mechanism in the revised paper. In addition to rows, columns of feature matrix also have semantic information. [1] proposed that these columns could be regarded as representations of clusters. It is possible to consider the columns as soft labels for features and to perform discrimination among groups of similar features. This approach inspires us to learn generalizable node representations for LLM, independent of other instances [1], enhancing transferability across datasets. To obtain node representations understandable by LLMs, we employ PCA to select the top k principal components from the LLM token embedding space. Given that in high-dimensional spaces, vectors are almost invariably orthogonal [2], these k principal components serve as the axes that maximize variance in the LLM token embedding space. By projecting the original feature matrix onto these k principal components and then applying FC, we can achieve node representations that are aligned with LLM and possess enhanced generalizability. Existing experimental results have confirmed that FC indeed achieves more generalizable node representations, playing a crucial role in handling cross-task challenges. Additionally, we report the legality rate of the model without FC (more about legality rate see Appendix B.1). Results in **bold** indicate the **poorest** outcomes, indicating a minimal impact on the language model by FC. This further demonstrates that FC yields node representations that are more easily understood by LLMs. ||Arxiv|Computer|Pubmed|Cora|Children|History|Photo|Sports| |:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:|:----:| |Vicuna-7B-v1.5|**99.3**|**96.7**|100.0|95.8|99.2|98.9|94.1|99.6 | |LLaGA|100.0|100.0|**98.9**|**79.9**|93.1|**92.4**|**77.8**|**94.3**| |TEA-GLM (without FC)|100.0|100.0|100.0|89.0|**92.9**|99.6|98.4|98.1| |TEA-GLM|100.0|100.0|100.0|92.6|97.0|99.6|99.2|98.5| > Question 2 Our approach of mapping a single node representation to multiple LLM tokens (graph tokens) is not meant to introduce new or extra information. Rather, it ensures that the complex information within graph structures is adequately conveyed. Our experiments on the number of graph tokens (Figure 3, Appendix C) confirm the necessity of multiple tokens. This approach achieves SOTA zero-shot performance without fine-tuning the LLM, demonstrating its novelty. > Question 3 Our code is publicly available, and if necessary, we can provide the trained model files. Appendix D includes the prompt for the link prediction task. For instance, for citation datasets, the LLM would respond with either 'These two papers have citation relationships' or 'These two papers may not have citation relationships'. > Question 4 We agree on the importance of pooling information. Our design avoids inputting all neighboring node tokens into the prompt, as the order significantly influences the LLM's output, conflicting with the graph's node permutation invariance. We use a readout operation to extract representations, then map them to a fixed number of graph tokens. We conducted experiments using both mean and max readout operations, though due to time constraints, these were limited to citation datasets. The results clearly show that the choice of readout operation influences the experimental outcomes. However, both sum and mean readout operations produced effective results, enabling the model to perform inference successfully. This suggests that an OOD (Out-of-Distribution) scenario may not be present. A possible reason is that, in GNNs, node representations are computed as a weighted sum of the central node and its neighbors. Since both sum and mean readout operations are essentially special cases of a weighted sum, the link representations generated still align with the distribution of node representations produced by GNNs. Therefore, the OOD scenario may not be applicable in this context. Thank you once more for your constructive feedback. We have enhanced the presentation to provide a clearer explanation of the key concepts in our paper. We believe that our revisions adequately address your concerns. **We would greatly appreciate it if you could consider raising your score further.** If you have any further concerns, we are ready to address them quickly to enhance our submission. ||Arxiv|Pubmed|Cora| |:----:|:----:|:----:|:----:| |Vicuna-7B|0.513|0.543|0.527| |GraphGPT-std|0.649|0.501|0.520| |LLaGA|0.570|0.569|0.537| |SoftPrompt|0.537|0.535|0.565| |TEA-GLM(max)|0.639|0.650|0.566| |TEA-GLM(sum)|0.657|0.689|0.586| |TEA-GLM(mean)|**0.659**|**0.690**|**0.588**| [1] Li Y, et al. Contrastive clustering. AAAI. 2021. [2] Hopcroft, et al. Computer Science in the Information Age. 2017.

Reviewer 65Wi2024-08-12

The authors provide reasonable explanations to my questions and I am impressed by their diligence in improving and defending their work, and I am leaning towards acceptance. On the other hand, my doubts still remain, but the authors justification and empirical evidence make sense. In particular, for tasks other than node classification (link-prediction in particular, since graph classification is not empirically evaluated), my guess is that if two connected nodes are dissimilar, the pooling generate non-decodable embedding, and vice versa, and Vicuna has the bias from pretraining that happens to align link prediction output with these two scenarios. For the pooling mechanism, max pooling does make sense to me, while sum pooling does not, the domain of input to the model is very different, potentially, you might have employed some normalization trick not documented in your paper, so that the output can still roughly fall into the range.

Authorsrebuttal2024-08-13

We sincerely appreciate your timely and detailed response, especially considering your busy schedule! Thank you for recognizing and reassessing our work! We understand and acknowledge your concerns. Based on our current experimental results, max pooling—which intuitively should not produce OOD issues—does not perform better than sum pooling. Additionally, we did not fine-tune Vicuna in these experiments. Under these conditions, only graph tokens that the LLM can decode and comprehend contribute to its predictions. If the graph tokens are non-decodable, the LLM struggles to make accurate predictions or even generate responses. Thus, our empirical results suggest that the representations obtained through pooling remain within the model's domain. Your feedback is highly valuable! We will include a discussion of different pooling methods in our paper and consider using max pooling and mean pooling, which are less likely to produce OOD issues, as our final approach. Thank you again for your responsible reply and valuable suggestions. If our explanations have addressed your concerns, we would greatly appreciate it if you could consider improving our score. If you have any further concerns, we are committed to addressing them promptly.

Reviewer 64Q88/10 · confidence 4/52024-07-14

Summary

The motivation of this work is to utilize the zero-shot learning capacity in LLMs for structural data. The basic idea is to connect GNNs with LLMs, by aligning its representations with the token embeddings of an LLM, such that GNNs can encode the structural information and LLMs can do zero-shot inference. The experiments were conducted with two different domains and seven baseline methods, and demonstrate the performance of the proposed method.

Strengths

- The research question is interesting and important. Generalizing the capacity of LLMs for zero-shot graph learner is a good idea to use the zero-shot capacity for structural information. - The proposed method is properly described with sufficient technical details. The pipeline of two-step adjustment is convincing. - Although more experiments can certainly be done, the current experiments answer three important research questions aligned with the topic, each of them is answered with a good amount of evidence.

Weaknesses

I do not have any major concern about this work. On the other hand, I do think the presentation of this work can be better. Some parts of the paper (especially section 2) are a little bit difficult to understand.

Questions

No further question, just some minor comments.

Rating

8

Confidence

4

Soundness

3

Presentation

3

Contribution

3

Limitations

The limitations have been listed in the paper.

Reviewer 65Wi2024-08-11

Thank you for the detailed reply. My concern about the empirical evaluation is addressed. I am raising my score to borderline, but slightly toward rejection. The reason for not giving it a higher rating is that the authors' response to my question on the novelty is not as convincing. Specifically, - I agree that feature-wise contrastive learning is an important contribution as I mentioned in my initial review. I do not complain about its novelty but about studying the mechanism behind it. The reference mentioned is about conventional (instance-wise in the paper) CL, while the feature-wise CL, in my opinion, serves more as an alignment and is not carefully examined. - Agree to disagree, I still don't believe mapping one embedding to multiple tokens is a noteworthy contribution. Note that this is significantly different from the vision-LLM alignment approaches you mentioned. They have a strong image encoder to directly map an image to a sequence of tokens without explicit information bottleneck. On the other hand, the information contained in the representation of your approach is bottlenecked. (Pooling for link and graph.) Mapping a single representation to multiple token representations does not inject new information into the system. Hence, I believe the design is not necessary. - The node-to-link transfer is surprising and hard to believe. I will try to replicate the results, and meanwhile, it would be great if you could share some examples of the LLM's answers to the link tasks. - The way to pool information is, I believe, critical in your approach. If you use sum-pooling (mean-pooling too, but sum is the most intuitive) and only train on node tasks, link and graph representations essentially become OOD input for your model, and it is very difficult to convince myself that such representation results in reasonable output from LLM

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC