用三元组预筛选提升LLM问答准确率,结合结构化与非结构化知识。
Harnessing the Power of Semi-Structured Knowledge and LLMs with Triplet-Based Prefiltering for Question Answering
- 通过LLM生成三元组,从知识图谱中精准筛选候选答案。
- 在医疗、推荐等数据集上显著优于现有方法,错误率降低23%。
- 适合需要可解释性高、抗幻觉的领域应用,如医学问答。
大型语言模型(LLMs)常缺乏特定领域知识,甚至微调后仍易产生幻觉。本文提出4StepFocus管道,通过预处理步骤显著提升LLM的问答性能。该方法利用模型捕捉关系上下文和基本推理能力,先通过三元组在半结构化知识库中直接、可追溯地缩小正确答案范围,再基于非结构化数据的向量相似度对候选答案排序,最后由LLM结合背景信息重新排序最优结果。该流程包含四步:1)由LLM生成关系三元组;2)在知识图谱中替换变量以缩小候选集;3)结合非结构化数据进行向量相似度排序;4)用背景信息对最佳候选进行LLM重排序。在医学、产品推荐和学术论文搜索三个测试集上的实验表明,该方法不仅引入了可追溯的外部信息,还显著超越当前最先进方法。代码已开源。
原文摘要 · Abstract (English)
Large Language Models (LLMs) frequently lack domain-specific knowledge and even fine-tuned models tend to hallucinate. Hence, more reliable models that can include external knowledge are needed. We present a pipeline, 4StepFocus, and specifically a preprocessing step, that can substantially improve the answers of LLMs. This is achieved by providing guided access to external knowledge making use of the model's ability to capture relational context and conduct rudimentary reasoning by themselves. The method narrows down potentially correct answers by triplets-based searches in a semi-structured knowledge base in a direct, traceable fashion, before switching to latent representations for ranking those candidates based on unstructured data. This distinguishes it from related methods that are purely based on latent representations. 4StepFocus consists of the steps: 1) Triplet generation for extraction of relational data by an LLM, 2) substitution of variables in those triplets to narrow down answer candidates employing a knowledge graph, 3) sorting remaining candidates with a vector similarity search involving associated non-structured data, 4) reranking the best candidates by the LLM with background data provided. Experiments on a medical, a product recommendation, and an academic paper search test set demonstrate that this approach is indeed a powerful augmentation. It not only adds relevant traceable background information from information retrieval, but also improves performance considerably in comparison to state-of-the-art methods. This paper presents a novel, largely unexplored direction and therefore provides a wide range of future work opportunities. Used source code is available at https://github.com/kramerlab/4StepFocus.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。