ConceptFormer: Towards Efficient Use of Knowledge-Graph Embeddings in Large Language Models

LLM HDFE Model Editing NLP RAG ML KGE KR / KRR LSKGAC Other KRR
2025年04月10日
检索增强生成(RAG)在近期受到了越来越多的关注,而大型语言模型(LLMs)的最新进展也突显了将世界知识整合到这些系统中的重要性。当前的 RAG 方法通常会修改预训练语言模型(PLMs)的内部架构,或者依赖于将知识图谱(KGs)转化为文本的形式,这在标记符(token)使用效率上并不理想。本文介绍了一种名为 ConceptFormer 的新方法,该方法能够在不改变 LLMs 内部结构、也不依赖知识图谱文本化的情况下,利用来自知识图谱(如 Wikidata)的结构化知识来增强 LLMs。ConceptFormer 在 LLM 嵌入向量空间中运行,通过创建并注入 *概念向量*(concept vectors),直接封装知识图谱节点的信息。ConceptFormer 与一个冻结的 LLM 联合训练,生成一个全面的查找表,将知识图谱节点映射到其对应的概念向量。这种方法旨在通过使 LLMs 能够原生处理这些概念向量,从而高效且可扩展地用结构化世界知识丰富模型,进而提升其事实记忆能力。我们的实验表明,在维基百科句子测试中,为 GPT-2 0.1B 添加概念向量可将其事实记忆能力(Hit@10)提高多达 272%,而在合成生成句子上的提升可达 348%。即使仅在提示词中注入一个概念向量,在维基百科句子上的事实记忆能力(Hit@10)也能提升至多 213%,显著优于基于图谱文本化的 RAG 方法,同时输入标记符的数量减少了 130 倍。
Retrieval Augmented Generation (RAG) has enjoyed increased attention in the recent past and recent advancements in Large Language Models (LLMs) have highlighted the importance of integrating world knowledge into these systems. Current RAG methodologies often modify the internal architecture of pre-trained language models (PLMs) or rely on textifying knowledge graphs (KGs), which is inefficient in terms of token usage. This paper introduces ConceptFormer, a new approach to augment LLMs with structured knowledge from KGs, such as Wikidata, without altering their internal structure or relying on textual input of KGs. ConceptFormer operates in the LLM embedding vector space, creating and injecting \emph{concept vectors} that encapsulate the information of the KG nodes directly. Trained in conjunction with a frozen LLM, ConceptFormer generates a comprehensive lookup table that maps KG nodes to their respective concept vectors. The approach aims to enhance the factual recall capabilities of LLMs by enabling them to process these concept vectors natively, thus enriching them with structured world knowledge in an efficient and scalable manner. Our experiments demonstrate that the addition of concept vectors to GPT-2 0.1B substantially increases its factual recall ability (Hit@10) by up to 272\% when tested on sentences from Wikipedia and up to 348\% on synthetically generated sentences. Even injecting only a single concept vector into the prompt increases factual recall ability (Hit@10) by up to 213\% on Wikipedia sentences, significantly outperforming RAG with graph textification while consuming 130x fewer input tokens.
许愿