Skip to main content
QUICK REVIEW

[Paper 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 ModelingComputer Science7 citations
TL;DR

This paper introduces a benchmark to evaluate Large Language Model (LLM) accuracy in question answering over enterprise SQL databases, demonstrating that integrating Knowledge Graphs (KGs) significantly improves performance. Using GPT-4 with zero-shot prompting, accuracy rose from 16.7% on raw SQL to 54.2% when using a KG representation of the database, highlighting KGs as a critical enabler for reliable enterprise LLM applications.

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.

Motivation & Objective

  • To address the lack of enterprise-aligned benchmarks for LLM-powered question answering on SQL databases.
  • To evaluate the impact of Knowledge Graphs in reducing hallucinations and improving accuracy in enterprise LLM applications.
  • To provide a reproducible benchmark with real-world enterprise schema, complex natural language questions, and a contextual ontology layer.
  • To measure the performance gap between direct SQL prompting and KG-augmented prompting in realistic enterprise settings.
  • To guide future research and development by identifying key challenges in enterprise LLM adoption.

Proposed method

  • The benchmark uses the OMG Property and Casualty (PC) Data Model, a real enterprise relational schema in the insurance domain with 25 tables and complex foreign key relationships.
  • It includes 43 enterprise-relevant natural language questions spanning reporting, metrics, and KPIs, categorized across four quadrants of question and schema complexity.
  • A context layer is constructed via an ontology defining business concepts, attributes, and relationships, along with mappings from the SQL schema to the ontology to form a Knowledge Graph.
  • The evaluation uses GPT-4 with zero-shot prompting: one condition queries the raw SQL database directly, the other uses the KG representation.
  • Accuracy is measured by comparing LLM-generated SQL queries to gold-standard queries, with exact match and execution result validation.
  • The benchmark is designed to be extensible, allowing enterprises to reproduce results using their own schemas, questions, and context layers.
Figure 1: P&C Conceptual Model
Figure 1: P&C Conceptual Model

Experimental results

Research questions

  • RQ1To what extent can LLMs accurately answer complex, enterprise-relevant natural language questions directly over raw enterprise SQL databases?
  • RQ2How does the integration of a Knowledge Graph affect the accuracy of LLM-based question answering on enterprise SQL databases?
  • RQ3What is the performance difference between LLMs using raw SQL versus KG-augmented representations across varying levels of question and schema complexity?
  • RQ4Does the use of a business context layer (ontology and mappings) reduce hallucinations and improve reliability in enterprise LLM applications?
  • RQ5Can the proposed benchmark serve as a reliable, reproducible standard for evaluating future LLM and KG integration in enterprise data systems?

Key findings

  • LLM-powered question answering over raw enterprise SQL databases using GPT-4 with zero-shot prompting achieved only 16.7% accuracy.
  • When the same questions were posed over a Knowledge Graph representation of the database, accuracy increased to 54.2%, representing a 37.5 percentage point improvement.
  • In the Low Question/Low Schema quadrant, accuracy improved from 25.5% (SQL) to 71.1% (KG), indicating strong gains for simpler queries.
  • In the High Question/Low Schema quadrant, accuracy rose from 37.4% (SQL) to 66.9% (KG), showing that KGs help even with complex reporting questions.
  • For the Low Question/High Schema quadrant, the KG improved accuracy from 16.7% (SQL) to 54.2% (KG), demonstrating effectiveness in complex schema scenarios.
  • The results confirm that Knowledge Graphs significantly reduce hallucinations and enhance reliability, especially in complex, real-world enterprise settings.
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

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.