用知识图谱向量增强大模型,不改结构、少用token,事实记忆提升超2倍。
ConceptFormer: Towards Efficient Use of Knowledge-Graph Embeddings in Large Language Models
- 在模型嵌入空间生成概念向量,直接注入知识图谱信息
- 注入单个向量使维基百科事实召回率提升213%,最高达348%
- 相比文本化知识图谱,输入token减少130倍,适合资源受限场景
检索增强生成(RAG)近年来受到关注,大语言模型(LLM)整合世界知识的重要性日益凸显。现有RAG方法通常修改预训练语言模型(PLM)架构或依赖将知识图谱(KG)文本化,造成令牌使用效率低下。本文提出ConceptFormer,一种无需改动模型内部结构、也无需依赖KG文本输入的新型方法,可将结构化知识(如Wikidata)高效融入大语言模型。ConceptFormer在语言模型嵌入空间中创建并注入封装节点信息的“概念向量”,与冻结的LLM联合训练,生成涵盖所有KG节点的概念向量映射表。该方法通过原生处理概念向量,显著增强模型的事实记忆能力。实验表明,在GPT-2 0.1B上加入概念向量后,对维基百科句子的事实召回率(Hit@10)提升最高达272%,对合成句提升最高达348%;仅注入一个概念向量,维基百科句子的召回率仍提升213%,显著优于基于图文本化的RAG,同时输入令牌消耗减少130倍。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。