Knowledge graph triples GPT-4 accuracy for enterprise QA (16.7% → 54.2%)

November 13, 20237 min

Overview

Decision SnapshotNeeds Validation

The paper gives clear execution-based evidence that KG context improves LLM QA, but it uses one model (GPT-4), zero-shot prompts, a small synthetic dataset and a 13-table subset, so results are promising but preliminary.

Citations7

Evidence Strength0.60

Confidence0.85

Risk Signals12

Trust Signals

Findings with numeric evidence: 3/5

Findings with evidence refs: 5/5

Results with explicit delta: 5/6

Reproducibility

Status: Code + data available

Open source: Partial

At A Glance

Cost impact: 50%

Production readiness: 30%

Novelty: 45%

Authors

Juan Sequeda, Dean Allemang, Bryon Jacob

Links

Abstract / PDF / Code / Data

Why It Matters For Business

Adding a knowledge graph layer (ontology + mappings) substantially improves LLM answer accuracy on enterprise SQL: expect major gains for normalized schemas and KPI-style questions.

Who Should Care

Summary TLDR

The paper builds a small enterprise Text-to-SQL benchmark (insurance domain, 13-table subset of the OMG P&C model, 43 questions, ontology + mappings) and tests GPT-4 with simple zero-shot prompts. Asking GPT-4 directly against the SQL gave 16.7% average accuracy. Asking GPT-4 to generate SPARQL over a knowledge-graph view of the same data gave 54.2% accuracy (a 37.5 percentage-point improvement). The gain is largest when schema complexity grows; SQL dropped to 0% for high-schema questions. Caveats: single model (GPT-4), zero-shot only, synthetic small dataset, and a subset of the full schema.

Problem Statement

Existing Text-to-SQL benchmarks do not match enterprise realities: large, normalized schemas, business metrics/KPIs, and a separate business context layer (ontology, mappings) are missing. The paper asks how well LLMs answer enterprise questions on SQL and whether adding a knowledge graph (KG) context helps.

Main Contribution

A reproducible enterprise-style benchmark: subset of OMG Property & Casualty schema, 43 natural-language questions, and a context layer (OWL ontology + R2RML mappings).

A controlled experiment comparing GPT-4 zero-shot SQL generation vs. SPARQL over a KG, with execution-based accuracy scoring.

Key Findings

Knowledge-graph context raised GPT-4 execution accuracy from 16.7% to 54.2%.

NumbersSQL 16.7% → SPARQL 54.2% (Table 1)

Practical UseIf you add a domain ontology and mappings, LLM-driven QA over enterprise data can become roughly three times more accurate on similar tasks; prioritize KG for production QA.

Evidence RefTable 1; Section 5.1

For low-question/low-schema tasks, SPARQL hit 71.1% vs SQL 25.5%.

NumbersLQ/LS: SQL 25.5% → SPARQL 71.1% (Table 1)

Practical UseEven simple reporting queries benefit strongly from adding business semantics—start by mapping key reporting tables and labels.

Evidence RefTable 1; Section 5.2

Results

MetricValueBaselineDeltaSplit / DatasetEvidenceEvidence Ref
Accuracy16.7%All 43 questionsTable 1; Section 5.1Table 1
Accuracy54.2%SQL 16.7%+37.5 percentage pointsAll 43 questionsTable 1; Section 5.1Table 1

What To Try In 7 Days

Run the provided benchmark repo against a small slice of your schema to measure current LLM accuracy.

Create an OWL ontology and simple R2RML mappings for your top 5 business concepts and test SPARQL vs SQL prompts.

Add post-checks for missing columns and identifier-to-label mapping to catch partial answers.

Reproducibility

Code AvailableYes
Data AvailableYes
Open Source StatusPartial
LicenseUnknown

Data URLs

https://www.omg.org/cgi-bin/doc?dtc/13-04-15.ddldata.world (benchmark workspace with CSVs, OWL, R2RML, reference queries)

Risks & Boundaries

Limitations

Single model (GPT-4) and single prompting style (zero-shot) tested

Subset of full OMG P&C schema (13 of 199 tables) and small synthetic data per table

When Not To Use

When you need guaranteed, auditable correctness without human verification

When your schema and business semantics are not modeled or mapped to a KG

Failure Modes

Column name hallucinations (SQL produced non-existent columns)

Value hallucinations used as filters

Core Entities

Models

GPT-4

Metrics

Accuracy

Datasets

OMG Property & Casualty Data Model (subset, 13 tables)Generated sample CSV data (benchmark instantiation)

Benchmarks

This paper's enterprise Text-to-SQL benchmark

Context Entities

Datasets

OWL ontology (insurance)R2RML mappings