Skip to main content
QUICK REVIEW

[Paper Review] Text2SQL is Not Enough: Unifying AI and Databases with TAG

A. Biswal, Liana Patel|arXiv (Cornell University)|Aug 27, 2024
Semantic Web and OntologiesComputer Science3 citations
TL;DR

This paper introduces Table-Augmented Generation (TAG), a unified framework that combines large language models (LLMs) with database management systems to answer complex natural language questions requiring world knowledge, semantic reasoning, or data aggregation. Unlike Text2SQL or RAG, TAG uses a three-step pipeline—query synthesis, database execution, and answer generation—achieving up to 65% higher accuracy than baselines on challenging queries, highlighting significant research opportunities in AI-database integration.

ABSTRACT

AI systems that serve natural language questions over databases promise to unlock tremendous value. Such systems would allow users to leverage the powerful reasoning and knowledge capabilities of language models (LMs) alongside the scalable computational power of data management systems. These combined capabilities would empower users to ask arbitrary natural language questions over custom data sources. However, existing methods and benchmarks insufficiently explore this setting. Text2SQL methods focus solely on natural language questions that can be expressed in relational algebra, representing a small subset of the questions real users wish to ask. Likewise, Retrieval-Augmented Generation (RAG) considers the limited subset of queries that can be answered with point lookups to one or a few data records within the database. We propose Table-Augmented Generation (TAG), a unified and general-purpose paradigm for answering natural language questions over databases. The TAG model represents a wide range of interactions between the LM and database that have been previously unexplored and creates exciting research opportunities for leveraging the world knowledge and reasoning capabilities of LMs over data. We systematically develop benchmarks to study the TAG problem and find that standard methods answer no more than 20% of queries correctly, confirming the need for further research in this area. We release code for the benchmark at https://github.com/TAG-Research/TAG-Bench.

Motivation & Objective

  • To address the limitations of existing Text2SQL and Retrieval-Augmented Generation (RAG) methods, which fail to handle natural language questions requiring world knowledge or semantic reasoning over data.
  • To propose a unified paradigm—Table-Augmented Generation (TAG)—that integrates LLMs with database systems for more general and powerful question-answering over custom data sources.
  • To systematically evaluate the TAG problem through a new benchmark, revealing that current methods answer no more than 20% of queries correctly.
  • To demonstrate that hand-written TAG pipelines can achieve up to 65% higher accuracy than baselines, proving the potential of the approach and motivating further research.

Proposed method

  • TAG defines a three-step pipeline: (1) query synthesis maps a natural language request R to an executable database query Q using an LLM.
  • The query execution step (exec) runs Q on the database system to retrieve relevant data T, leveraging the DBMS’s efficiency for exact computation and filtering.
  • The answer generation step (gen) uses both the original request R and the retrieved data T to generate a natural language answer A via an LLM, enabling semantic reasoning and world knowledge use.
  • The framework generalizes both Text2SQL and RAG as special cases, enabling a broader class of queries involving reasoning, aggregation, and external knowledge.
  • The method supports iterative or recursive orchestration of the LLM over data, allowing complex reasoning over large datasets.
  • The approach is designed for efficient batched inference, with low execution time observed in evaluation.
Figure 1 . An example TAG implementation for answering the user’s natural language question over a table about movies. The TAG pipeline proceeds in three stages: query synthesis, query execution, and answer generation
Figure 1 . An example TAG implementation for answering the user’s natural language question over a table about movies. The TAG pipeline proceeds in three stages: query synthesis, query execution, and answer generation

Experimental results

Research questions

  • RQ1Can existing Text2SQL and RAG methods effectively handle natural language questions that require world knowledge beyond the database schema?
  • RQ2To what extent can LLMs perform semantic reasoning over free-text fields or aggregate trends across large data sets when combined with database execution?
  • RQ3How well do current methods generalize to queries that require both relational operations and reasoning over unstructured data or external knowledge?
  • RQ4What is the performance gap between heuristic or hand-written TAG pipelines and automated baselines on complex, real-world-like queries?
  • RQ5What are the key bottlenecks in current AI-database integration that prevent accurate, scalable, and general-purpose natural language question-answering?

Key findings

  • Standard Text2SQL and RAG baselines answer no more than 20% of the benchmark queries correctly, indicating a critical need for new methods.
  • Hand-written TAG pipelines achieve up to 65% higher accuracy than automated baselines on complex queries, demonstrating the feasibility and potential of the approach.
  • The RAG baseline fails to retrieve relevant data for aggregation queries, such as those about races at Sepang International Circuit, due to reliance on point lookups.
  • The Text2SQL + LM baseline cannot utilize database data effectively, relying solely on parametric knowledge and providing no data-driven analysis.
  • Qualitative analysis shows that TAG systems can successfully aggregate large volumes of data and generate informative, contextually rich answers.
  • The TAG framework enables efficient execution with low latency, suggesting that scalable, production-ready systems can be built using this paradigm.
Figure 2 . Example Aggregation Results: The RAG baseline provides an incomplete answer to the query while Text2SQL + LM fails to answer the question using any data from the DB. The Hand-written TAG baseline provides the most thorough answer, synthesizing data from the DB and its own world knowledge.
Figure 2 . Example Aggregation Results: The RAG baseline provides an incomplete answer to the query while Text2SQL + LM fails to answer the question using any data from the DB. The Hand-written TAG baseline provides the most thorough answer, synthesizing data from the DB and its own world knowledge.

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.