RoundTable: Leveraging Dynamic Schema and Contextual Autocomplete for Enhanced Query Precision in Tabular Question Answering

Pratyush Kumar, Kuber Vijaykumar Bellad, Bharat Vadlamudi, Aman ChadhaarXiv 2024 · DOI

Abstract

Large Language Models (LLMs) often struggle with Table Question Answering (TQA) on large-scale enterprise databases due to context window limitations and the "cold start" problem. We present RoundTable, a framework that utilizes Full-Text Search (FTS) to generate dynamic schemas, effectively narrowing the search space for LLMs. By combining data vocabulary indexing with contextual autocomplete, RoundTable significantly improves query precision, particularly for value-based questions in high-cardinality datasets.

Introduction

The transition from natural language to structured queries (Text-to-SQL or Pandas) is a critical capability for modern data interfaces. However, real-world enterprise databases present unique challenges that standard LLM approaches fail to address: hundreds of columns with non-intuitive names and millions of rows containing high-cardinality values (e.g., specific product IDs or customer names).

Existing approaches typically fall into two traps. First, context limits prevent fitting a massive table schema into an LLM's prompt. Second, hallucination occurs when a model fails to map a user's vague term (like "Allianz") to the exact database value (like "Allianz SE"). RoundTable addresses these "cold start" and "precision" problems by providing a guided interface and a filtered metadata context, ensuring the LLM operates on the most relevant data points.

The RoundTable Framework

RoundTable introduces a three-pronged approach to bridge the gap between natural language and structured data. The architecture is designed to prune the search space before the LLM even receives the prompt.

  1. Data Vocabulary Indexing: Before querying, the system pre-processes the table to extract attribute names, identify categorical columns, and build an "Inverse Index" of unique values. It also employs an LLM to generate synonyms for column names (e.g., mapping "Client" to "Customer"), making the search more robust against linguistic variation.
  2. Contextual Autocomplete: To solve the "cold start" issue where users are unfamiliar with the table's contents, RoundTable provides a UI feature that suggests valid attributes and values as the user types. This steers the user toward queries that the system can accurately resolve.
  3. Dynamic Schema Generation: This is the core innovation. When a user submits a query, the system uses Full-Text Search (FTS) against the pre-built index to find the exact columns and values mentioned. Instead of sending the entire database schema to the LLM, RoundTable constructs a Dynamic Schema—a pruned version containing only the metadata relevant to that specific question.
The RoundTable architecture overview, illustrating the flow from data indexing to dynamic schema generation and LLM query production.

Query Formation and Logic

The process of generating the dynamic schema is formalized through a specific algorithm that extracts keywords and searches the inverse index to create a targeted prompt. By acting as a metadata filter, RoundTable ensures that the LLM is provided with less information overall, but significantly more relevant information.

The pseudocode for the GENERATE_DYNAMIC_SCHEMA function, detailing the keyword extraction and index searching steps required for query formation.

Experimental Evaluation

To evaluate the framework, the authors introduced a new benchmark dataset consisting of 1,500 quantitative questions across four domains: B2B Sales, Physical Gem Properties, Supply Chain, and Super Market Sales. Questions were categorized by difficulty and type, specifically distinguishing between Generic queries (about table structure) and Value-Based queries (requiring specific data points).

The framework was tested using a quantized Mistral-7B model. The results demonstrated that with a dynamic schema, a mid-sized, open-source model can outperform much larger models that lack filtered context:

  • B2B Sales: Accuracy for Value-Based questions increased by 66.67%.
  • Physical Gem Properties: Accuracy for Value-Based queries jumped by 55.23%.
  • Generic Stability: While the framework provided slight improvements for generic questions, the most dramatic gains were consistently found in scenarios involving specific data vocabulary.

Conclusion and Future Work

RoundTable demonstrates that the key to high-precision Table Question Answering lies in narrowing the search space. By leveraging Full-Text Search and dynamic schemas, the framework mitigates LLM hallucinations and overcomes context window constraints. While current evaluations rely on human experts, future work will focus on scaling automated testing and integrating more complex multi-step reasoning techniques, such as Chain-of-Table, to further enhance performance on high-dimensionality datasets.

Summary updated

BibTeX
@misc{kumar2024roundtable,
  author = {Pratyush Kumar and Kuber Vijaykumar Bellad and Bharat Vadlamudi and Aman Chadha},
  title = {{RoundTable: Leveraging Dynamic Schema and Contextual Autocomplete for Enhanced Query Precision in Tabular Question Answering}},
  year = {2024},
  eprint = {2408.12369},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.12369},
}
Figure