Are Large Language Models In-Context Graph Learners?

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Li, Jintang, Wu, Ruofan, Zhu, Yuchang, Zhang, Huizhe, Chen, Liang, Zheng, Zibin
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910835625951232
author Li, Jintang
Wu, Ruofan
Zhu, Yuchang
Zhang, Huizhe
Chen, Liang
Zheng, Zibin
author_facet Li, Jintang
Wu, Ruofan
Zhu, Yuchang
Zhang, Huizhe
Chen, Liang
Zheng, Zibin
contents Large language models (LLMs) have demonstrated remarkable in-context reasoning capabilities across a wide range of tasks, particularly with unstructured inputs such as language or images. However, LLMs struggle to handle structured data, such as graphs, due to their lack of understanding of non-Euclidean structures. As a result, without additional fine-tuning, their performance significantly lags behind that of graph neural networks (GNNs) in graph learning tasks. In this paper, we show that learning on graph data can be conceptualized as a retrieval-augmented generation (RAG) process, where specific instances (e.g., nodes or edges) act as queries, and the graph itself serves as the retrieved context. Building on this insight, we propose a series of RAG frameworks to enhance the in-context learning capabilities of LLMs for graph learning tasks. Comprehensive evaluations demonstrate that our proposed RAG frameworks significantly improve LLM performance on graph-based tasks, particularly in scenarios where a pretrained LLM must be used without modification or accessed via an API.
format Preprint
id arxiv_https___arxiv_org_abs_2502_13562
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Are Large Language Models In-Context Graph Learners?
Li, Jintang
Wu, Ruofan
Zhu, Yuchang
Zhang, Huizhe
Chen, Liang
Zheng, Zibin
Machine Learning
Artificial Intelligence
Large language models (LLMs) have demonstrated remarkable in-context reasoning capabilities across a wide range of tasks, particularly with unstructured inputs such as language or images. However, LLMs struggle to handle structured data, such as graphs, due to their lack of understanding of non-Euclidean structures. As a result, without additional fine-tuning, their performance significantly lags behind that of graph neural networks (GNNs) in graph learning tasks. In this paper, we show that learning on graph data can be conceptualized as a retrieval-augmented generation (RAG) process, where specific instances (e.g., nodes or edges) act as queries, and the graph itself serves as the retrieved context. Building on this insight, we propose a series of RAG frameworks to enhance the in-context learning capabilities of LLMs for graph learning tasks. Comprehensive evaluations demonstrate that our proposed RAG frameworks significantly improve LLM performance on graph-based tasks, particularly in scenarios where a pretrained LLM must be used without modification or accessed via an API.
title Are Large Language Models In-Context Graph Learners?
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2502.13562