TL;DR
Large Language Models (LLMs) show promise for complex data tasks, but evaluating their ability to answer questions across multiple relational tables is challenging. This paper introduces TQA-Bench, a new benchmark designed to rigorously test LLMs on multi-table question answering with varying context lengths and symbolic reasoning capabilities, revealing significant performance gaps compared to single-table QA.
What Problem Does This Paper Address?
Answering questions that require synthesizing information from multiple interconnected relational tables is a common and crucial task in real-world applications like finance and healthcare. However, existing benchmarks for evaluating Large Language Models (LLMs) on table-based question answering (QA) primarily focus on single tables. This limitation fails to capture the complexities of multi-table reasoning, such as handling heterogeneous schemas, large serialized data, and intricate relationships between tables. Furthermore, many current benchmarks use small tables that don't fully leverage the long-context capabilities of modern LLMs, and their static nature can lead to models exploiting dataset-specific patterns rather than genuine reasoning. This paper aims to bridge this gap by introducing a comprehensive and scalable multi-table QA benchmark.
Methods
The authors introduce TQA-Bench, a novel benchmark constructed through a systematic four-phase process:
- Data Collection: They curated diverse, real-world relational databases from sources like WorldBank, DataGov, and BIRD, deliberately excluding Wikipedia-derived data to avoid potential contamination and ensure models face unfamiliar structures.
- Relational Data Sampling: To accommodate LLMs' varying context lengths, they developed a controlled sampling mechanism. This process generates database subsets with serialized lengths ranging from 8K to 64K tokens, preserving structural integrity and relationships. A topological sort of tables based on foreign keys ensures referential integrity during sampling.
- Evaluation Task Definition: They defined three primary question categories—Entity Lookup, Aggregation, and Complex Calculation—further divided into seven subcategories, designed to cover a broad spectrum of reasoning requirements.
- Question Generation with Symbolic Extension: To move beyond simple retrieval and assess deeper reasoning, they employed symbolic extensions. This involves using structured question templates with placeholder variables that are then instantiated to create diverse questions and their corresponding Python-based solutions. This approach allows for automated generation of questions and ensures scalability and reliability.
Datasets
The benchmark is built upon real-world relational databases from:
- WorldBank: Selected for its long-context, multi-table structures.
- DataGov: Including datasets like Water Quality Data and Food Facility Inspections.
- BIRD: A benchmark originally designed for Text2SQL tasks, adapted to include its complex foreign key relationships.
TQA-Bench itself is a newly introduced benchmark, featuring ten distinct multi-table database instances, each sampled to create variations across four context lengths (8K, 16K, 32K, 64K). This results in a total of 56,000 question instances.
Key Insights and Ideas
- Single-table vs. Multi-table Performance Gap: LLMs consistently perform significantly worse on multi-table QA tasks compared to single-table tasks, highlighting the inadequacy of existing single-table benchmarks.
- Serialization Format Matters: Markdown emerged as the most effective serialization format for LLMs, offering better readability and performance compared to CSV, JSON, and HTML.
- Instruction-Tuned LLMs Lead: Instruction-tuned LLMs generally outperform chat-oriented and domain-specific models, especially in longer context settings.
- Context Length is a Major Hurdle: Performance generally degrades as context length increases, particularly for aggregation and complex calculation tasks, indicating persistent challenges in handling long tabular data.
- Symbolic Extension Enhances Robustness: The sampling and symbolic extension strategies improve benchmark diversity, robustness, and reduce evaluation instability.
Key Results
- LLMs achieved up to 20% higher accuracy in single-table settings compared to multi-table settings.
- Markdown serialization consistently yielded better performance than CSV, JSON, and HTML across most LLMs and context lengths.
- Instruction-tuned LLMs, especially larger ones, showed a clear trend of improved accuracy with scale.
- For most models, performance steadily declined as the table context grew from 8K to 64K tokens.
- In Experiment 5, comparing direct LLM prompts with Text2SQL, Text2SQL methods showed more stable performance across context lengths, but both struggled with complex analytical queries.
Limitations and Future Work
The authors acknowledge several limitations and suggest future directions:
- Scope of Analytical Tasks: TQA-Bench currently focuses on retrieval, aggregation, comparison, and correlation. Future work could extend to tasks like summarization, induction, and open-ended information extraction.
- Symbolic Extension Limitations: While effective, the current symbolic extension primarily uses multiple-choice questions (MCQs). A supplementary open-ended pilot showed a significant drop in accuracy when answer options were removed, especially for numerical and statistical questions, indicating that free-form answer generation remains a challenge.
- Benchmark Scale: While extensive, the benchmark could be further expanded to include deeper schema structures, a broader range of task families, newer frontier models, and more advanced table-specific reasoning mechanisms (e.g., table-state evolution, hierarchical decomposition).
- Text2SQL Bottlenecks: Complex analytical SQL remains a significant challenge for LLMs, even for specialized Text2SQL models. Future research could focus on improving the generation of complex SQL queries.
Summary updated