Large language models (LLMs) have shown remarkable generalization capability with exceptional performance in various language modeling tasks. However, they still exhibit inherent limitations in precisely capturing and returning grounded knowledge. While existing work has explored utilizing knowledge graphs (KGs) to enhance language modeling via joint training and customized model architectures, applying this to LLMs is problematic owing to their large number of parameters and high computational cost. Therefore, how to enhance pre-trained LLMs using grounded knowledge, e.g., retrieval-augmented generation, remains an open question. In this work, we propose Graph Neural Prompting (GNP), a novel plug-and-play method to assist pre-trained LLMs in learning beneficial knowledge from KGs. GNP encompasses various designs, including a standard graph neural network encoder, a cross-modality pooling module, a domain projector, and a self-supervised link prediction objective. Extensive experiments on multiple datasets demonstrate the superiority of GNP on both commonsense and biomedical reasoning tasks across different LLM sizes and settings. Code is available at https://github.com/meettyj/GNP.
翻译:大型语言模型(LLMs)在各类语言建模任务中展现出卓越的泛化能力与优异性能。然而,它们在精确获取和返回基于事实的知识方面仍存在固有局限性。现有研究尝试通过联合训练和定制化模型架构利用知识图谱(KGs)增强语言建模,但由于LLMs参数规模庞大且计算成本高昂,将其直接应用于大语言模型存在诸多困难。因此,如何利用基于事实的知识(如检索增强生成)增强预训练LLMs仍是一个开放性问题。本文提出图神经网络提示(GNP)方法——一种新颖的即插即用方法,可辅助预训练LLMs从知识图谱中学习有益知识。GNP包含多种设计模块:标准图神经网络编码器、跨模态池化模块、领域投影器以及自监督链路预测目标函数。在多个数据集上的大量实验表明,GNP在不同规模与配置的LLMs上,于常识推理和生物医学推理任务中均展现出显著优越性。代码已开源:https://github.com/meettyj/GNP。