Text to Query Plans for Question Answering on Large Tables DOI: XXXXXXX.XXXXXXX Conference: Make sure to enter the correct conference title from your rights confirmation emai; June 03–05, 2018; Woodstock, NY ISBN: 978-1-4503-XXXX-X/18/06 CCS: Information systems Structured text search

Yipeng Zhang, Chen Wang, Yuzhe Zhang, Jacky Jiang · 2025

Read Text to Query Plans for Question Answering on Large Tables DOI: XXXXXXX.XXXXXXX Conference: Make sure to enter the correct conference title from your rights confirmation emai; June 03–05, 2018; Woodstock, NY ISBN: 978-1-4503-XXXX-X/18/06 CCS: Information systems Structured text search by Yipeng Zhang, Chen Wang, Yuzhe Zhang, Jacky Jiang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-18758.txt.

Introduction

Yipeng Zhang and co-authors turn plain questions into query plans for giant tables, skipping SQL altogether. Asking data questions in code bars most people from large data sets. Text-to-SQL helps but inherits SQL's weakness on huge tables and rich analysis. Their framework instead builds a step-by-step plan of operations.

A language model reads the question and grows the plan one operation at a time. Steps run directly on the data, so the model never swallows the whole table. Classic query commands ride along, plus extras like principal component analysis and anomaly spotting. Tests on standard and large science tables back the design.

Catalog record

CREATORYipeng Zhang, Chen Wang, Yuzhe Zhang, Jacky Jiang
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE60 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2508-18758

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Text to Query Plans for Question Answering on Large Tables DOI: XXXXXXX.XXXXXXX Conference: Make sure to enter the correct conference title from your rights confirmation emai; June 03–05, 2018; Woodstock, NY ISBN: 978-1-4503-XXXX-X/18/06 CCS: Information systems Structured text search Yipeng Zhang, Chen Wang, Yuzhe Zhang, Jacky Jiang Abstract . Efficient querying and analysis of large tabular datasets remain significant challenges, especially for users without expertise in programming languages like SQL. Text-to-SQL approaches have shown promising performance on benchmark data; however, they inherit SQL’s drawbacks, including inefficiency with large datasets and limited support for complex data analyses beyond basic querying. We propose a novel framework that transforms natural language queries into query plans. Our solution is implemented outside traditional databases, allowing us to support classical SQL commands while avoiding SQL’s inherent limitations. Additionally, we enable complex analytical functions, such as principal component analysis and anomaly detection, providing greater flexibility and extensibility than traditional SQL capabilities. We leverage LLMs to iteratively interpret queries and construct operation sequences, addressing computational complexity by incrementally building solutions. By executing operations directly on the data, we overcome context length limitations without requiring the entire dataset to be processed by the model. We validate our framework through experiments on both standard databases and large scientific tables, demonstrating its effectiveness in handling extensive datasets and performing sophisticated data analyses. 1. Introduction Tabular data is widely used for storing information. It plays a crucial role in data analytics in various fields such as finance, healthcare, scientific research, manufacturing and general business process management. With a two-dimensional representation format, tabular data makes it easy for users to manage structured information, enabling complex data analysis and insight extraction methods to be built on it. Complex data analytics require efficient data query and retrieval. Structured Query Language (SQL) is the standard for interacting with tables in relational databases. It allows users to perform operations like filtering, joining, and aggregating data with the support of underlying relational algebra. However, SQL has several disadvantages. First, it is not easily accessible to non-technical users, requiring knowledge of specific syntax and query structures. Second, SQL struggles to handle large datasets efficiently, especially when dealing with super-large tables that exceed database limitations. Complex partitioning and mapping are often required to support SQL executions on partitioned or distributed tables ( Xin et al. 2013 ; Huai et al. 2014 ; Armbrust et al. 2015 ) . Third, SQL supports limited operations and cannot perform complex data analyses such as Principal Component Analysis (PCA), anomaly detection, or advanced pattern recognition. Recent advances in large language models (LLMs) have enabled the approach of feeding the entire table into the LLM and generating answers to natural language queries ( Zhang et al. 2024b ; Li et al. 2024a ) . However, this method encounters significant challenges due to the limited context length of LLMs. To address these context limitations, one solution for table querying relies on compressing or truncating large tables to fit the context limits of the models ( Liu et al. 2023 ) . These methods, however, often result in incomplete analyses and performance degradation, especially when working with complex datasets that contain thousands of columns and rows. Moreover, even with efforts to compress input content or increase token limits, LLMs cannot effectively handle large tables, as they exceed the models’ maximum input size ( Cheng et al. 2023 ; Chen 2023 ; Sui et al. 2023 ) . There are efforts to use Text-to-SQL to address the problem, but many early work ( Androutsopoulos et al. 1995 ) were not widely used due to the difficulty of understanding natural language ( Li and Jagadish 2014 ) . As an alternative, researchers have explored LLM-based methods ( Pourreza and Rafiei 2023 ; Li et al. 2023c ; Dong et al. 2023 ; Gao et al. 2024 ) by providing only the table schema to the LLM. The model generates SQL queries that can be executed on the database according to the schema. This approach significantly alleviates the token limitation problem and has demonstrated good performance in recent studies. However, it still inherits SQL’s inherent disadvantages: inefficiency with large datasets and inability to perform complex data analyses beyond basic querying. Here we particularly consider those datasets whose schemas do not fit into the context window of LLMs. While some efforts have attempted to teach LLMs to generate code directly or use APIs to overcome these limitations, problems related to scalability, efficiency, and the integration of complex analytical functions remain as a challenge for large-scale databases ( Li et al. 2024b ) . While some efforts have attempted to teach LLMs to generate code directly or use APIs to overcome these limitations, problems related to scalability, efficiency, and the integration of complex analytical functions remain as a challenge for large-scale databases ( Li et al. 2024b ) . To address the problems, we propose a novel approach that leverages the advantages of SQL while overcoming its limitations. Instead of converting natural language to SQL queries, we directly convert text-based queries to query plans corresponding to SQL-like queries of the text . This provides flexibility to handle large data stored in the form of spreadsheets or CSV form, while remaining compatible with traditional relational databases. We create a set of SQL-like operators, such as selection by conditions, ordering, union, and joining, but implemented outside the constraints of traditional databases. These operators allow us to mimic SQL functionality without being hindered by database limitations or inefficiencies with large datasets, thus addressing the second disadvantage. Another benefit of generating query plan directly is that operators are extensible and complex analytical functions required for specific tasks, such as dimension reduction, clustering, anomaly detection, and advanced pattern recognition can be easily integrated. This flexibility enables us to perform sophisticated data analyses directly within our framework, effectively solving the third disadvantage. At the core of our approach is the problem of transforming a user’s natural language query into a sequence of operations that retrieves and processes the relevant data from tabular datasets before returning the final answers to the user query. However, determining the optimal sequence of operations is a computationally challenging task. This problem is analogous to the classical NP-hard planning problem. The complexity arises from the vast number of possible operation sequences and the dependencies between operations. Therefore, it is impractical to exhaustively search for the optimal sequence in polynomial time. To overcome this challenge, we employ an iterative approach that incrementally constructs the operation sequence based on the ReAct prompting framework ( Yao et al. 2023 ) . By utilizing LLMs, we can understand the user’s question and reason about the most appropriate next steps based on the current state of the data. LLMs are well-suited for this task due to their capabilities in natural language understanding and in-context learning ( Garg et al. 2022 ; Dong et al. 2022 ) . At each iteration, the model selects the next operation to apply, and the process continues until the final answer is obtained. In addition, we provide a multi-level table description generation mechanism to scale our method to handle large data tables with thousands of columns. We validate our approach through experiments on both

Read the complete text