Skip to main content
QUICK REVIEW

[论文解读] A Benchmark to Understand the Role of Knowledge Graphs on Large Language Model's Accuracy for Question Answering on Enterprise SQL Databases

Juan Sequeda, Dean Allemang|arXiv (Cornell University)|Nov 13, 2023
Topic Modeling被引用 7
一句话总结

本文提出一个基准测试,用于评估大型语言模型(LLM)在企业级SQL数据库上的问答准确性,结果表明集成知识图谱(KG)可显著提升性能。使用GPT-4进行零样本提示时,准确率从原始SQL的16.7%提升至使用数据库知识图谱表示时的54.2%,凸显知识图谱在实现可靠的企业级LLM应用中的关键作用。

ABSTRACT

Enterprise applications of Large Language Models (LLMs) hold promise for question answering on enterprise SQL databases. However, the extent to which LLMs can accurately respond to enterprise questions in such databases remains unclear, given the absence of suitable Text-to-SQL benchmarks tailored to enterprise settings. Additionally, the potential of Knowledge Graphs (KGs) to enhance LLM-based question answering by providing business context is not well understood. This study aims to evaluate the accuracy of LLM-powered question answering systems in the context of enterprise questions and SQL databases, while also exploring the role of knowledge graphs in improving accuracy. To achieve this, we introduce a benchmark comprising an enterprise SQL schema in the insurance domain, a range of enterprise queries encompassing reporting to metrics, and a contextual layer incorporating an ontology and mappings that define a knowledge graph. Our primary finding reveals that question answering using GPT-4, with zero-shot prompts directly on SQL databases, achieves an accuracy of 16%. Notably, this accuracy increases to 54% when questions are posed over a Knowledge Graph representation of the enterprise SQL database. Therefore, investing in Knowledge Graph provides higher accuracy for LLM powered question answering systems.

研究动机与目标

  • 解决当前缺乏面向企业级场景的、基于LLM的SQL数据库问答任务的基准测试问题。
  • 评估知识图谱在降低幻觉现象并提升企业级LLM应用准确性方面的影响。
  • 提供一个可复现的基准测试,包含真实企业级数据库模式、复杂自然语言问题以及上下文本体层。
  • 衡量在真实企业环境中,直接使用SQL提示与基于知识图谱增强提示之间的性能差距。
  • 通过识别企业级LLM应用中的关键挑战,为未来的研究与开发提供指导。

提出的方法

  • 基准测试采用OMG财产与意外(PC)数据模型,该模型是保险领域中一个真实的企业关系型数据库模式,包含25张表及复杂的外键关系。
  • 包含43个与企业相关的自然语言问题,涵盖报告、指标和关键绩效指标(KPI),按问题与模式复杂度分为四个象限。
  • 通过定义业务概念、属性和关系的本体,构建上下文层,并建立从SQL模式到本体的映射,形成知识图谱。
  • 评估采用GPT-4进行零样本提示:一种条件直接查询原始SQL数据库,另一种使用知识图谱表示。
  • 准确率通过比较LLM生成的SQL查询与标准答案查询来衡量,结合精确匹配与执行结果验证。
  • 该基准设计具有可扩展性,企业可使用自身数据库模式、问题和上下文层复现结果。
Figure 1: P&C Conceptual Model
Figure 1: P&C Conceptual Model

实验结果

研究问题

  • RQ1LLM能否在不借助额外上下文的情况下,通过零样本提示准确回答直接基于原始企业级SQL数据库的复杂、与企业相关的自然语言问题?
  • RQ2知识图谱的集成在多大程度上提升了LLM在企业级SQL数据库问答中的准确性?
  • RQ3在不同复杂度的问题与数据库模式下,LLM使用原始SQL与基于知识图谱增强表示的性能差异如何?
  • RQ4使用业务上下文层(本体及映射关系)是否能减少幻觉现象并提升企业级LLM应用的可靠性?
  • RQ5所提出的基准测试能否作为评估未来LLM与知识图谱在企业数据系统中集成的可靠、可复现标准?

主要发现

  • 使用GPT-4进行零样本提示时,基于原始企业级SQL数据库的LLM问答任务准确率仅为16.7%。
  • 当同一组问题通过数据库的知识图谱表示进行提问时,准确率提升至54.2%,实现了37.5个百分点的提升。
  • 在低问题复杂度/低模式复杂度象限中,准确率从SQL的25.5%提升至KG的71.1%,表明简单查询中收益显著。
  • 在高问题复杂度/低模式复杂度象限中,准确率从SQL的37.4%提升至KG的66.9%,表明KG在复杂报告类问题中同样有效。
  • 在低问题复杂度/高模式复杂度象限中,KG将准确率从SQL的16.7%提升至54.2%,证明其在复杂模式场景下的有效性。
  • 结果证实,知识图谱能显著减少幻觉现象并提升可靠性,尤其在复杂、真实的企业级环境中。
Figure 2: Four quadrants to classify questions: (1) Low Question/Low Schema Complexity, (2) High Question/Low Schema Complexity, (3) Low Question/High Schema Complexity, and (4) High Question/High Schema Complexity
Figure 2: Four quadrants to classify questions: (1) Low Question/Low Schema Complexity, (2) High Question/Low Schema Complexity, (3) Low Question/High Schema Complexity, and (4) High Question/High Schema Complexity

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。