GraphiT:基于提示优化大语言模型的文本属性图高效节点分类
GraphiT: Efficient Node Classification on Text-Attributed Graphs with Prompt Optimized LLMs
AI总结:
针对文本属性图节点分类中LLMs难以高效利用图结构及提示依赖手动调整的问题,提出GraphiT框架,通过编码节点邻域为文本并利用DSPy优化提示,在三个数据集上优于基线,且成本更低、可复现性强。
摘要:
近年来,大语言模型(LLMs)在图数据上的应用受到广泛关注。LLMs使我们能够在文本属性图中使用预训练模型的深度上下文嵌入,而这类图的节点文本属性通常采用浅层嵌入。然而,将图结构和特征高效编码为LLMs可用的序列形式仍具挑战。此外,仅使用LLM的性能高度依赖输入提示的结构,这限制了其作为可靠方法的有效性,且常需迭代手动调整,过程缓慢、繁琐且难以编程复现。本文提出GraphiT(Graphs in Text)框架,用于将图编码为文本格式并优化LLMs提示以完成图预测任务,重点关注文本属性图的节点分类。我们将每个节点及其邻域的图数据编码为简洁文本,使LLMs能更好地利用图中的信息;随后利用DSPy框架以编程方式进一步优化LLMs提示,自动化该步骤并提升效率与可复现性。GraphiT在三个数据集上优于基于LLM的基线模型,且无需手动调整提示,优化步骤即可带来可衡量的性能提升;同时,GraphiT的图编码方法与其他图编码方法相比具有竞争力,且因同一任务使用的token显著更少,成本更低。
英文摘要:
The application of large language models (LLMs) to graph data has attracted a lot of attention recently. LLMs allow us to use deep contextual embeddings from pretrained models in text-attributed graphs, where shallow embeddings are often used for the text attributes of nodes. However, it is still challenging to efficiently encode the graph structure and features into a sequential form for use by LLMs. In addition, the performance of an LLM alone, is highly dependent on the structure of the input prompt, which limits their effectiveness as a reliable approach and often requires iterative manual adjustments that could be slow, tedious and difficult to replicate programmatically. In this paper, we propose GraphiT (Graphs in Text), a framework for encoding graphs into a textual format and optimizing LLM prompts for graph prediction tasks. Here we focus on node classification for text-attributed graphs. We encode the graph data for every node and its neighborhood into a concise text to enable LLMs to better utilize the information in the graph. We then further programmatically optimize the LLM prompts using the DSPy framework to automate this step and make it more efficient and reproducible. GraphiT outperforms our LLM-based baselines on three datasets and we show how the optimization step in GraphiT leads to measurably better results without manual prompt tweaking. We also demonstrated that our graph encoding approach is competitive to other graph encoding methods while being less expensive because it uses significantly less tokens for the same task.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。