轻量框架让小模型高效利用知识图谱推理
LightPROF: A Lightweight Reasoning Framework for Large Language Model on Knowledge Graph
- 通过检索-嵌入-推理流程,融合知识图谱结构与事实信息
- 在两个基准上用小模型超越现有方法,推理耗时更少
- 仅训练适配器,兼容任意开源大模型,资源消耗低
大型语言模型(LLMs)在文本理解与零样本推理方面表现卓越,但知识更新延迟可能导致错误推理或有害输出。知识图谱(KGs)通过结构化组织实体与关系,为LLM推理提供丰富可靠的上下文信息。现有基于KG的推理方法仅以文本形式注入知识,忽视其结构信息,且多依赖闭源或参数庞大的开源模型,导致资源消耗高。为此,我们提出轻量高效的提示学习-推理框架LightPROF,充分利用LLM能力,以参数高效方式处理复杂推理任务。LightPROF采用‘检索-嵌入-推理’流程:首先通过检索模块精准稳定地从知识图谱中提取相关推理路径;随后,基于Transformer的知识适配器精细提取并整合事实与结构信息,将其映射至LLM的词元嵌入空间,生成适合LLM使用的友好提示;最后由LLM完成推理。LightPROF仅需训练知识适配器,可兼容任意开源大模型。在两个公开知识图谱问答基准上的实验表明,该框架在小规模模型上实现优异性能,同时显著降低输入标记数与推理时间。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have impressive capabilities in text understanding and zero-shot reasoning. However, delays in knowledge updates may cause them to reason incorrectly or produce harmful results. Knowledge Graphs (KGs) provide rich and reliable contextual information for the reasoning process of LLMs by structurally organizing and connecting a wide range of entities and relations. Existing KG-based LLM reasoning methods only inject KGs' knowledge into prompts in a textual form, ignoring its structural information. Moreover, they mostly rely on close-source models or open-source models with large parameters, which poses challenges to high resource consumption. To address this, we propose a novel Lightweight and efficient Prompt learning-ReasOning Framework for KGQA (LightPROF), which leverages the full potential of LLMs to tackle complex reasoning tasks in a parameter-efficient manner. Specifically, LightPROF follows a "Retrieve-Embed-Reason process", first accurately, and stably retrieving the corresponding reasoning graph from the KG through retrieval module. Next, through a Transformer-based Knowledge Adapter, it finely extracts and integrates factual and structural information from the KG, then maps this information to the LLM's token embedding space, creating an LLM-friendly prompt to be used by the LLM for the final reasoning. Additionally, LightPROF only requires training Knowledge Adapter and can be compatible with any open-source LLM. Extensive experiments on two public KGQA benchmarks demonstrate that LightPROF achieves superior performance with small-scale LLMs. Furthermore, LightPROF shows significant advantages in terms of input token count and reasoning time.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。