TableRAG: Million-Token Table Understanding with Language Models

Authors: si-an  chen
lesly  miculicich
julian martin eisenschlos
zifeng  wang
zilong  wang
yanfei  chen
yasuhisa  fujii
hsuan-tien  lin
chen-yu  lee
tomas  pfister
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-15 02:49:20

Abstract: Recent advancements in language models (LMs) have notably enhanced their ability to reason with tabular data, primarily through program-aided mechanisms that manipulate and analyze tables.
However, these methods often require the entire table as input, leading to scalability challenges due to the positional bias or context length constraints.
In response to these challenges, we introduce TableRAG, a Retrieval-Augmented Generation (RAG) framework specifically designed for LM-based table understanding.
TableRAG leverages query expansion combined with schema and cell retrieval to pinpoint crucial information  before providing it to the LMs.
This enables more efficient data encoding and precise retrieval, significantly reducing prompt lengths and mitigating information loss.
We have developed two new million-token benchmarks from the Arcade and BIRD-SQL datasets to thoroughly evaluate TableRAG's effectiveness at scale.
Our results demonstrate that TableRAG's retrieval design achieves the highest retrieval quality, leading to the new state-of-the-art performance on large-scale table understanding.

Main paper: 
 introduction: 
 Recent advancements have leveraged language models (LMs) for table understanding tasks [5] . This typically involves prompting LMs with entire tables to ensure thorough analysis [24, 3, 11, 22, 10, 29] . However, scaling to larger tables poses several challenges. First, LMs face context-length constraints; for example, a medium-sized table with 100 columns and 200 rows translates into over 40,000 tokens, surpassing the limits of popular LMs like LLaMA and the GPT series. Additionally, long contexts can degrade reasoning capabilities, a phenomenon known as the Lost-in-the-Middle [9] . Finally, computation costs and latency increase significantly with table size. Therefore, developing a scalable solution that efficiently handles large tables remains a critical area of research.Naive approaches to making large table understanding feasible, such as truncating the table or only reading the schema, often result in the loss of critical information. To address this, previous works have attempted to retrieve key rows and columns to construct a sub-table that captures essential information for answering queries [8, 17] . These methods encode entire rows and columns into sparse or dense embeddings to reduce token costs for LMs, yet they still face computational and performance challenges with extremely large tables. Encoding entire rows and columns requires processing the whole table, which is infeasible for large tables containing millions of cells. Furthermore, compressing long rows and columns into a fixed-size embedding can obscure semantic meaning, particularly when the table contains diverse or less semantically rich content (e.g., numerical values). : The LM reads the entire table, which is often infeasible for large tables. (b) Read Schema: The LM reads only the schema, consisting of column names and data types, resulting in a loss of information from the table content. (c) Row-Column Retrieval:Rows and columns are encoded and then selected based on their similarity to the question. Only the intersection of these rows and columns is presented to the LM. It is still infeasible to encode all rows and columns for large tables. (d) Schema-Cell Retrieval (our work): Column names and cells are encoded and retrieved based on their relevance to LM-generated queries about the question. Only the retrieved schema and cells are provided to the LM, enhancing efficiency in both encoding and reasoning. (e) Retrieval results on the ArcadeQA dataset show that TableRAG outperforms other methods in both column and cell retrieval, thereby enhancing the subsequent table reasoning process.The Read Table technique is excluded as reading entire tables is typically infeasible in this context.In this work, we introduce, TableRAG, a scalable framework that leverages retrieval-augmented generation (RAG) for LM-based table understanding. We illustrate the key differences between prior table prompting approaches and the proposed TableRAG in Fig. 1 .Our method integrates schema retrieval and cell retrieval to extract essential information from tables, enabling a program-aided LM agent to solve queries based on the provided information. Schema retrieval allows LMs to identify crucial columns and their data types solely by column names, avoiding the need to encode entire columns. Cell retrieval enables the identification of keywords for indexing or pinpointing columns that contain necessary but hard-to-find information missed by schema retrieval alone. To build the database for cell retrieval, TableRAG encoded each cell independently, addressing the issue faced when encoding entire rows and columns. Furthermore, TableRAG only encodes distinct and the most frequent categorical values, reducing the encoder's token cost (as shown in Fig. 3 ) and operating within a user-specified budget effectively. Both retrieval processes in TableRAG are enhanced by query expansion [21] with dedicated prompts for schema retrieval and cell retrieval, ensuring thorough and relevant data extraction.Existing TableQA benchmarks typically feature only small tables with dozens of rows and columns.To verify the scalability of TableRAG for larger tables, we build two new benchmarks sourced from the real-world Arcade [26] and BIRD-SQL [7] datasets. Additionally, to assess performance across various scales, we generated synthetic data expanding tables from the TabFact dataset to larger sizes, while maintaining consistent questions and key table content for evaluation. Our experimental results demonstrate that TableRAG outperforms existing table prompting methods significantly and consumes fewer tokens across different table sizes.Our contributions can be summarized as follows:• We conduct the first extensive study exploring the application of LMs to large-scale, real-world tables, analyzing the scalability and limitations of existing LM-based table reasoning approaches.• We introduce two new real-world benchmarks derived from Arcade and BIRD-SQL, along with an expanded synthetic dataset from TabFact. These datasets include tables ranging from tens to millions of cells (Table 7 ), enabling comprehensive evaluation of LM capabilities across various table scales.• We develop TableRAG, an efficient framework for LM-based table understanding that demonstrates superior performance on large tables while minimizing token consumption. We conduct a detailed ablation study to validate the effectiveness of each component within TableRAG. 
related work: 
 Research in table understanding has evolved from fine-tuning specialized architectures [6, 4] to leveraging LMs in few-shot setups [22, 10] , capitalizing on the emerging reasoning capability of these models. To enable LMs to understanding tables, table information must be included in the prompts. Representative works like Dater [24] , Binder [3] and subsequent works [22, 29, 11, 10, 28] typically require LMs to process entire tables. These methods, while effective in leveraging LMs' reasoning and programming capabilities for question answering, are often not feasible for larger tables due to the context length constraints.To address the limitations of processing full tables, two main streams have emerged: schema-based and row-column retrieval methods. Schema-based methods, such as Text2SQL [30] and more recent developments [20, 18, 13, 14] , focus primarily on schema understanding to generate SQL commands. This significantly reduces token complexity but at the cost of omitting valuable cell data. Rowcolumn retrieval methods, such as ITR [8] and TAP4LM [17] , attempt to address scalability issues by encoding and retrieving essential rows and columns. While this strategy reduces input lengths for reasoning, it still requires substantial computation to encode entire rows and columns and can suffer from poorer embedding quality for long sequences.Our approach, TableRAG, innovates by combining schema retrieval with selective cell value retrieval and frequency-aware truncation. This creates an efficient table prompting method where the input length to LMs is independent of table sizes. This strategy significantly reduces computational demands while preserving the benefits of accessing table contents, leading to superior performance compared to other methods across various scales.3 TableRAGQuestion: Does the paper discuss the limitations of the work performed by the authors? Answer: [Yes] Justification: Section 6 Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.• The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. Guidelines:• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics. • The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction). 
motivation: 
 An illustration of the workflow of our method is shown in Fig. 2 . The core idea is to incorporate schema retrieval and cell retrieval to obtain necessary information for solving the questions by program-aided LMs. In practice, we often find that processing the entire table for LMs is unnecessary. Instead, the critical information usually lies in specific column names, data types, and cell values that directly relate to the question. For example, consider the question "What is the average price for wallets?" To address this, a program may simply need to extract rows related to "wallets" and then calculate the average from the price column. Knowing just the relevant column names and how "wallets" are represented in the table suffices to write the program. Our method, TableRAG, leverages the observation and addresses the context length limitations by RAG.In large-scale table understanding, we are presented with a table T , represented asT = v ij | i ≤ N, j ≤ M ,where N is the number of rows, M is the number of columns, and v ij is the cell value at row i and column j. We address a natural language question Q and aim to produce an answer A by an LM L. Given the often impractical size of T for direct processing, a table prompting method P is employed to transform T into a more manageable prompt P (T ), allowing L to effectively generate the answer A = L(P (T )). Our objective is to develop an efficient P that significantly reduces the size of the prompt, |P (T )|, compared to the original table, |T |, making it feasible for the LM to process large tables.Tabular Query Expansion To effectively manipulate the table, it is essential to pinpoint the precise column names and cell values necessary for the query. Unlike previous works [8, 17] that may use the question as a single query, we propose generating separate queries for both schema and cell values. For instance, for a question like "What is the average price for wallets?", the LM is prompted to produce potential queries for column names such as "product" and "price", and for relevant cell values like "wallet". These are then used to retrieve relevant schema and cell values from the table. The table is utilized to build the schema and cell databases. A question is then expanded into multiple schema and cell queries by LMs. These queries are sequentially utilized to retrieve schemas and column-cell pairs. The top K candidates from each query are combined and fed into the LM solver's prompt to answer the question. The pseudocode and an answering example on ArcadeQA can be found in Alg. 1 and Fig. 8 respectively.Schema Retrieval Following the generation of queries, the schema retrieval fetches pertinent column names using a pre-trained encoder f enc , which encodes the queries and matches them against the encoded column names to determine relevance. The retrieved schema data includes column names, data types, and example values. We convert columns to integer, float, or datetime data types when feasible; otherwise, we keep them as categorical columns. For columns identified as numerical or datetime data type, we display the minimum and maximum values as example values. Conversely, for categorical columns, we present the three most frequent categories as example values. We combine the top-K retrieval results for each query and rank them by their similarity to the closest query. The retrieved schema provides a structured overview of the table's format and content that will be used for more targeted data extraction.Cell Retrieval Following schema retrieval, we proceed to extract specific cell values needed to answer the question. This involves building a database of distinct column-value pairs from T , denoted as V = ij (C j , v ij ), where C j is the column name of the j-th column. In practice, the set of distinct values is often much smaller than the total number of cells, as illustrated in Fig. 3 . This discrepancy significantly enhances the efficiency of cell retrieval.Cell retrieval plays an crucial role in TableRAG. It enhances LM's table understanding capabilities in:1. Cell Identification: It allows LMs to accurately detect the presence of specific keywords within the table, which is essential for effective indexing. For example, it can distinguish between terms like "tv" and "television", ensuring that searches and operations are based on precise data entries.2. Cell-Column Association: It also enables LMs to associate particular cells with their relevant column names. This is crucial when questions pertain to specific attributes, such as linking the term "wallet" directly to the "description" column, thereby enables row-indexing.It should be noted that cell retrieval is primarily beneficial when indexing by cell values is required.In other scenarios, simply knowing the schema may suffice. For example, to answer the question "What is the average price?", identifying the relevant column name for prices is sufficient because the actual computation of the average can be handled programmatically. Nevertheless, cell retrieval still improves TableRAG with additional key values from the table, which will be shown in Sec 4.8.Cell Retrieval with Encoding Budget In the worst case, the number of distinct values could match the total number of cells. To maintain the feasibility of TableRAG in such cases, we introduce a cell encoding budget B. If the number of distinct values exceeds B, we restrict our encoding to the B most frequently occurring pairs, thus improving efficiency when processing large tables. It is important to note that the encoding budget impacts only the cell retrieval process. Even if a cell is not included for retrieval, the subsequent solver can still access the cell if its column name is known through schema retrieval or other cells. For instance, as shown in Fig. 8 , the "description" column contains free-form text, which likely results in a high number of unique values, many of which may Dater [24] Binder [3] MultiTableQA [11] Chain-of-Table [22] Mix-SC [10] TableLlama [28] ReAcTable [29] Reasoning be truncated due to the cell encoding budget. Nevertheless, as long as the solver recognizes the column, it can still perform operations on that column to extract the required information.Program-Aided Solver After obtaining the column names and cell values relevant to the question, the LMs can use these information to effectively interact with the table. TableRAG is compatible with LM agents which can interact with tables programmatically. In this work, we consider ReAct [23] , which is a popular approach to extend the capability of LMs and has been used in recent literature to achieve state-of-the-art results in Table QA benchmarks [10, 29] . An example of how TableRAG works with ReAct is illustrated in Fig. 8 .The efficiency and latency of invoking LMs are significantly influenced by the number of input tokens. Therefore, we focus on analyzing token complexity, which refers to the complexity introduced by the number of tokens in the LM's input. We examine the token complexity of each operation within the TableRAG framework and other table prompting methods. We assume that the length of a column name, a cell value, and the question are all O(1). Note that N represents the number of rows, M represents the number of columns, D is the number of distinct text cell values, B is the cell encoding budget, and K is the number of top retrieval results.The token complexity of primary table prompting approaches are shown in Table 1 .• Read Table feeds the entire table to LMs, resulting O(N M ) tokens for reasoning.• Read Schema only feeds the schema to LMs, which is O(M ) tokens, but loss the information from the table content.• Row-Column Retrieval encodes all rows and columns to embeddings, resulting O(N M ) tokens for encoding. Then it retrieves top-K rows and columns to construct aK × K sub-table for reasoning, which is O(K 2 ).We analyze the token complexity of each step in TableRAG as follows:• Tabular Query Expansion: The prompt to the LM is primarily based on the question, which typically comprises only a few words, thus the token complexity for this component is O(1).• Building Schema Database: Each column name is encoded using the encoder function f enc , resulting in a token complexity of O(M ) for the encoder.• Building Cell Database: This operation involves encoding distinct column-value pairs using f enc . The total number of distinct pairs D is capped at B when exceeding the limit. Therefore, the token complexity for building the cell database is O(min(D, B)), ensuring that the most frequent data is processed to optimize performance. Note that it takes O(N M ) CPU time to build the cell database, but the computation cost is negligible compared to LM calls. For example, computing the distinct values from 10 6 elements takes only 60 ms on a personal laptop, while it takes 1 second to encode merely hundreds of words on CPUs 2 .• LM Reasoning: The query expansion process generally produces approximately 3-5 queries, which are considered O(1). Each query then retrieves the top-K results, leading to a total complexity of O(K) for the columns and cell values included in the LM's prompt. This step ensures that the LM processes only the most pertinent information from the table, enhancing efficiency and effectiveness in generating responses.Overall, given that typically M B and D, the token complexity for TableRAG is O(min(D, B)) for encoding and O(K) for reasoning, with neither being dependent on the overall size of the table. Consequently, TableRAG maintains manageable costs even for large tables, optimizing computational resources and response times for large-scale table understanding tasks. 
empirical studies 4.1 dataset: 
 Existing TableQA benchmarks such as TabFact [2] and WikiTableQA [12] feature small web tables that fall within the context limits of most LMs, while others like Spider dataset [27] are designed purely as text-to-SQL tasks with access only to the schema. To better assess reasoning capabilities over larger, more realistic tables, we have developed two extensive table QA datasets, ArcadeQA and BirdQA, derived from the Arcade [26] and BIRD-SQL [7] datasets, respectively. ArcadeQA comprises tables with an average of 79, 000 rows and a maximum of 7 million cells, while BirdQA tables feature an average of 62, 000 rows with a peak at 10 million cells. Furthermore, we expanded TabFact to include synthetic tables ranging from 100 × 100 to 1, 000 × 1, 000, equivalent to a million of cells, to examine the impact of different table sizes under the same question and key information. Detailed methodology for dataset generation and the statistics of these datasets are provided in Appendix C and summarized in Table 7 .We compare TableRAG to four different approaches for incorporating table information into LMs. To ensure a fair comparison of table access strategies, we have implemented the baselines and our TableRAG based on the same PyReAct [10, 29] solver.ReadTable This common approach in recent research includes embedding the entire table in the prompt, then asking the LMs to solve the problem with the provided table information. This approach is limited by the context length of the LMs. We discard data instances and consider them failures when the table size exceeds the context length.ReadSchema Widely-used in Text2SQL literature, this method assumes that table content is not directly accessible. It incorporates column names and data types into the prompt, enabling LMs to execute commands based on these column names without direct access to the row data. Our experiments employ GPT-3.5-turbo [1] , Gemini-1.0-Pro [19] and Mistral-Nemo-Instruct-24073 as LM solvers. In ablation study, we use GPT-3.5-turbo if not specified. We use OpenAI's textembedding-3-large 4 as the encoder for dense retrieval. For TableRAG, we set the cell encoding budget B = 10, 000 and the retrieval limit K = 5. For RandRowSampling and RowColRetrieval, we increase the retrieval limit to K = 30. Each experiment is conducted 10 times and evaluated by majority-voting to ensure the stability and consistency. The evaluation metric is the exact-match accuracy if not specified.In evaluations across the datasets shown in Table 2 , TableRAG consistently outperformed other methods, achieving the highest accuracies across all LMs on both ArcadeQA and BirdQA. The ReadTable method underperforms on both in ArcadeQA and BirdQA, indicating it suffers from long context. Among the three LMs, GPT 3.5 Turbo consistently delivers the best performance, regardless of the table prompting method used. These results demonstrate the effectiveness of TableRAG in handling large-scale TableQA tasks.To better understand the retrieval quality of various table prompting approaches, in Table 3 , we assessed the recall, precision and f1 score for the prompts fed to LMs for reasoning. The ground truths are extracted from the program annotations in the ArcadeQA and BirdQA datasets. In column retrieval, while all methods achieved high recall due to the small number of columns, TableRAG demonstrated superior precision across both datasets, indicating its effectiveness in identifying the most relevant columns concisely. In contrast, ReadSchema and RowColRetrieval showed lower precision, suggesting that they retrieved more irrelevant columns. For cell retrieval, TableRAG consistently outperformed other methods on all metrics. TableRAG's high recall in cell retrieval marks a significant improvement over other table prompting methods, indicating it can retrieve most necessary cells for the subsequent reasoning. In summary, this analysis underscores TableRAG's efficacy in retrieving essential information in both the column and cell aspects. TaBERT [25] 52.30 Text-to-SQL [15] 52.90 Binder [3] 56.74 Dater [24] 52.81TableRAG (Ours) 57.03 To evaluate performance on small-scale TableQA datasets, we compared TableRAG with state-ofthe-art approaches that rely on reading entire tables, using the commonly used WikiTableQA [12] benchmark. As shown in Table 4 , TableRAG surpasses all existing methods, including TaBERT [25] , Text-to-SQL [15] , Binder [3] , and Dater [24] . This highlights TableRAG's effectiveness, even in small-scale settings. These results confirm that, while TableRAG is designed for large-scale TableQA, its approach is versatile and maintains state-of-the-art performance across different table sizes and complexities.Impact of Retrieval Methods in TableRAG: Table 5 compares different retrieval approaches within TableRAG. BM25 [16] , a well-known statistical retrieval method, excels in efficiency and can process all cells but lacks semantic understanding. We also compare it with our embedding-based retrieval and Table 6 : Ablation study of schema retrieval (Rows 1 vs 3 and 2 vs 4) and cell retrieval (Rows 1 vs 2 and 3 vs 4). The first column indicates whether the LM processed all schemas or only retrieved schemas. The second column indicates whether the LM ignored cell values or processed retrieved column-cell pairs. Schema retrieval leads to an improvement in accuracy of up to 9.4%, while cell retrieval results in an increase of up to 11.5%. a hybrid approach that combines scores from both methods. The results show that embedding-based retrieval achieves the best performance, outperforming both BM25 and the hybrid method, despite not processing the entire table due to encoding constraints. This underscores the importance of semantic understanding in retrieval, where embedding-based methods offer better comprehension of table data, significantly enhancing TableRAG's performance.Number of Top Retrieval Results K: Fig 5 illustrates the impact of varying the number of top retrieval results (K) on the performance and the token cost for the subsequent LM reasoning. The results demonstrate that that increasing the number K, while increasing the prompt lengths, does not consistently improve performance. Though larger K allows LMs access to more information, it also results in a longer context which can exacerbate the lost-in-the-middle phenomenon. In contrast, TableRAG excels by requiring fewer K values, thus reducing the context tokens needed and lowering subsequent reasoning costs while still outperforming other methods.Encoding Budget B: The results from Fig. 6 demonstrate how different token encoding budgets (B) affect the performance of TableRAG and RowColRetrieval. While a higher budget theoretically allows for more information to be retrieved, the results show that it does not always lead to better performance. Specifically, RowColRetrieval shows a decline in performance with increased budgets, potentially due to the retrieval of more rows that complicate selecting the correct ones and produce noisier embeddings from longer column sequences. In contrast, TableRAG maintains consistent performance across various budgets, indicating that its approach of building the corpus by cell frequency effectively captures essential information even with limited budgets.The effectiveness of our query expansion method is analyzed in Fig. 7 . The results demonstrate that query expansion consistently enhances TableRAG's performance across various datasets and LMs.We analyze the impact of schema retrieval and cell retrieval on performance in Table 6 . The results demonstrate that schema retrieval consistently enhances reasoning performance across datasets and LMs, with a maximum improvement of 9.4%, regardless of whether cell values are considered. The results indicate that even for tables with small number of columns (average 20.5 columns in ArcadeQA and 11.1 columns in BirdQA), schema retrieval is still helpful to only provide relevant columns for the subsequent reasoning. Similarly, cell retrieval consistently improves accuracies across all datasets and LMs, with a maximum improvement of 11.5%, indicating cell retrieval can effectively extract key information from the table contents. 
conclusion: 
 In this work, we have presented TableRAG, the first framework to demonstrate effective and efficient LM-based table understanding with millions of tokens. To fill in the evaluation gap, we have introduced three new million-token scale table understanding benchmarks. TableRAG's retrieval design, combining schema and cell retrieval with frequency-aware truncation, significantly reduces computational costs and token usage without sacrificing performance. Our extensive experiments on both real-world and synthetic datasets showcase TableRAG's superior performance across various table sizes. TableRAG paves the way for future research on even larger and more complex table understanding tasks. 
limitations: 
 Theoretically, the worst-case complexity for cell retrieval could reach O(N M ) if all cell values are distinct, potentially leading to loss of crucial information even with frequency-based truncation. Also, our evaluation is limited to QA and verification tasks due to the scarcity of large-scale table benchmarks. Finally, we focus on benchmarking on comparing TableRAG with other representative table prompting methods using the same LM solver, rather than against the latest state-of-the-art techniques, to specifically assess its efficacy on large tables.  
broader impacts: 
 Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?Answer: [NA]Justification: Our research solely focus on table understanding. There is no societal impact of the work performed.Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.• The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?Answer: [NA] Justification: We only use public APIs and tabular datasets.Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?Answer: [Yes]Justification: Section 4Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.• If this information is not available online, the authors are encouraged to reach out to the asset's creators. 13. New Assets Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets? Answer: [Yes] Justification: Section 4, Appendix C Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
 
 Appendix: SchemaSee Alg. 1.Algorithm 1: TableRAG Algorithm Data: T : table, Q: questions, L: LM, K: number of retrieval results, B: token encoding budget, f enc : encoder Result: Â is the predicted answer to the question 1 Function TableRAG(T, Q, L, K, B, f enc ): 2 schema_db ← BuildSchemaDB(T, f enc ); 3 cell_db ← BuildCellDB(T, B, f enc ); 4 foreach q ∈ Q do 5 Q schema , Q cell ← TabularQueryExpansion(L, q); 6 R schema ← MultiQueryRetrieve(f enc , Q schema , K, schema_db); 7 R cell ← MultiQueryRetrieve(f enc , Q cell , K, cell_db); 8 Â ← ProgramAidedSolver(L, q, T, R schema , R cell );V ← getDistinctColumnCellPairbyFreq(T ); 20 V ← V [: B]; 21 foreach (C j , v ij ) ∈ V do 22 corpus ← corpus ∪ (f Enc ((C j , v ij )), (C j , v ij ))Here we describe the generation of each datasets. The statistics of each dataset are shown in Table 7 .ArcadeQA The ARCADE dataset [26] consists of a collection of annotated data science notebooks with natural language to code annotations for every cell. The notebooks executes on large scale Kaggle ML datasets 5 . We extract the examples where there is an executed result, and that result is either a single primitive value or a list of values (single column table). In contrast, examples that focus on data wrangling without a returned value, or where the result is a table are skipped. In total we obtain 130 examples with questions such as "How many countries are south of the equator?" and "What is the city that had cash on delivery as the most common payment method?".BirdQA We leverage a subset of BIRD dataset [7] , a collection for large-scale database grounded text-to-SQL. It also contains annotations for columns descriptions, and external knowledge evidence in some examples. To convert the task to table-QA, we extract 308 examples where a single table was used. We use only the table and question without additional helper annotations such as descriptions and external knowledge evidence. The tables have 40 thousand rows in average and it comprises on single an multiple value answers.Synthetic TabFact To complement existing datasets and better evaluate LMs on larger table structures, we have synthesized an extension of the TabFact dataset to include tables of significantly greater sizes. This synthesis involves a series of steps designed to expand original small tables into larger ones without losing the integrity of the data or the logical consistency required for correct query answering. We utilize LM-generated column names, sampling functions, and solution programs to create tables and validate them through a rigorous process where solution programs verify the correctness of answers, ensuring the synthetic tables maintain the challenge and integrity of the original dataset. Please answer with a list of keywords in JSON format without any additional explanation. Example: ["keyword1", "keyword2", "keyword3"] ======================================= Completion ======================================= ["leather wallets", "average price", "amazon seller", "order status prediction", "orders data"] You are working with a pandas dataframe regarding "amazon seller order status prediction orders data" in Python. The name of the dataframe is 'df'. Your task is to use ' python_repl_ast' to answer the question: "What is the average price for leather wallets?"Tool description: -'python_repl_ast': A Python interactive shell. Use this to execute python commands. Input should be a valid single line python command.Since you cannot view the table directly, here are some schemas and cell values retrieved from the table.Schema Retrieval Results: {"column_name": "item_total", "dtype": "object", "cell_examples": ['$449.00', '$399.00', ' $549.00']} {"column_name": "quantity", "dtype": "int64", "min": 1, "max": 4} {"column_name": "order_no", "dtype": "object", "cell_examples": • The answer NA means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.RandRowSampling This method is a prevalent rule-based sampling approach[17] that randomly selects rows from the table with equal probabilities. When the total number of rows exceeds K, we select K rows to form a representative sample. This baseline is employed to underscore the benefits of more targeted retrieval methods, illustrating how they can provide more relevant and efficient data selection compared to random sampling.RowColRetrieval This state-of-the-art approach reduces table sizes prior to LM reasoning. Following the methodology of Sui et al.[17], we encode rows and columns and then retrieve the top K rows and columns based on their similarity to the question's embedding to form a sub-table. Since encoding all rows and columns requires 2N M tokens, which is impractical for large tables with millions of cells, we truncate the tables to B 2M rows. This truncation limits the number of tokens encoded to B, aligning with the token limit in our TableRAG implementation.2 https://kennethenevoldsen.github.io/scandinavian-embedding-benchmark/https://mistral.ai/news/mistral-nemo/https://openai.com/index/new-embedding-models-and-api-updates/https://www.kaggle.com/datasets 


Decision: LM-based table retrieval suffers from scalability challenges in case of large schema and tables.  This submission introduces TableRAG reduces these scalability challenges by query expansion and retrieval mechanisms.  The submission and rebuttal include a thorough  evaluation on benchmarks sourced from real-world datasets and synthetic data from TabFact.  TableRAG shows better performance and lower LM token costs.

This submission represents a nice systems-level work that seems effective and intuitive. Because of the nature of systems built around LMs, the paper does not fit the template of algorithmic ML papers with high creativity or intellectual depth.  In aggregate, reviewers found the paper borderline.  The authors reported on substantial additional experiments during rebuttal, and resolved several issues reported by reviewers.

The authors must publish code and data if the paper is accepted.

Reviews: review: paper_summary: paper_summary: The paper introduces TableRAG, a novel framework that improves LM-based table understanding by incorporating advanced query expansion and retrieval mechanisms. TableRAG addresses the critical scalability challenges associated with large-scale tables by efficiently encoding data and employing precise retrieval techniques. Through a comprehensive evaluation on self-constructed benchmarks sourced from real-world datasets and synthetic data from TabFact, TableRAG demonstrates superior performance and reduced token consumption across various table sizes.
strength_weakness: strength_weakness: 1. **Lack of Novelty** Many papers about RAG reveals that the accuracy of the evidence is crucially important for the performance, and the idea of this paper is to is another practice in the TableQA domain.
2. **Lack of evaluation robustness** The paper only evaluates the model on closed models gpt-3.5 and gemini, but fails to evaluate on open models like Mistral, Llama etc.
questions: questions: 1. Why not evaluate on more models?
2. Why not evaluation on commonly used TableQA benchmarks like WikiTableQA?
limitations: limitations: Yes, the paper discusses the limitations.
paper_summary: paper_summary: This paper introduces a novel approach to retrieving cell values and database schema within the table question answering domain. The method operates as follows:
1) It expands the initial question by identifying potential queries for column retrieval or cell value retrieval.
2) For each query generated in the first step, the method identifies the top-K columns using their embeddings.
3) Within a given encoding budget for cell retrieval, it proposes embedding the most frequent B distinct values for each column and retrieves them based on their similarity to each query.
Additionally, the authors have developed two new datasets for large-scale table question answering. Their approach demonstrates improved cost efficiency and effectiveness on these large-scale datasets compared to previous methods.
strength_weakness: strength_weakness: 1) My primary concern pertains to the comprehensiveness of the baselines used. While the paper correctly mentions that the table schema is predominantly considered in the text-to-SQL domain, cell values also play a crucial role in SQL generation. Notably, papers like CodeS [1] have proposed using BM25 retrieval to find cell values, which would serve as an excellent baseline for comparison. Additionally, schema linking—the process of identifying the correct rows and columns—is well-explored. Approaches proposed in studies like TaBERT [2] could also be utilized as baselines.

2) Given an encoding budget, the strategy of retaining only the most frequent distinct cell values seems problematic, especially for queries that require data from columns containing names, addresses, etc. Heuristic-based methods, such as those using syntactic similarity with edit distance, can effectively filter most of the cell values and might be more appropriate.

[1]: CodeS: Towards Building Open-source Language Models for Text-to-SQL
[2]: TaBERT: Pretraining for Joint Understanding of Textual and Tabular Data
questions: questions: Not applicable
limitations: limitations: Not applicable
paper_summary: paper_summary: The paper introduces TableRAG, a framework that enhances LM-based table understanding by incorporating query expansion and retrieval mechanisms. TableRAG aims to improve the performance of large-scale table understanding tasks by efficiently encoding data and utilizing precise retrieval techniques. The framework achieves state-of-the-art results on various benchmarks and datasets.
strength_weakness: strength_weakness: 1. The contribution of the paper is relatively small. The author mainly builds upon the original Row Column Retrieval and further reduces the retrieval cost by Scheme Cell Retrieval. The original work has included column selection, but this paper only further reduces the returned row to only return specific cells.
2. The baseline of the experimental comparison is relatively weak, and the advantage of finer grained retrieval is obvious.
questions: questions: N/A
limitations: limitations: N/A
paper_summary: paper_summary: This paper primarily concentrates on the scalability challenges associated with encoding entire tables as input for LLM reasoning. It introduces a retrieval-augmented generation (RAG) framework, named TableRAG, which utilizes query expansion along with schema and cell retrieval to identify essential information effectively. Furthermore, this study contributes to establishing new benchmarks for million-token-sized tables, significantly enhancing the understanding of LLM performance in large-scale table analysis.
strength_weakness: strength_weakness: - while the idea of schema-cell retrieval seems reasonable, the generalizability of the method is not very clear, especially for some questions that cannot be directly addressed by manipulating the tables (also noted in the limitation section)
- the experiments only consider GPT-3.5-turbo and Gemini-Pro as LLMs which are limited, further testing on more open-sourced and close-sourced models is necessary to prove the consistency of the proposed method.
- the performance in Table 4 appears effective solely for the ArcadeQA dataset, with the retrieval of schema and cells proving useful. However, for BirdQA, the enhancements seem limited. I'm little concerned about the method consistency when adding more datasets.
questions: questions: - for figure 8, I am slightly confused by the results obtained from the solver. It appears the query intends to request the average price for all types of wallets. Yet, in the provided example, the third action only yields the average price of leather wallets (leather_wallet_prices.means()), rather than the average for all wallets (wallet_prices.means()). I'm uncertain if this discrepancy stems from a misrepresentation or if there's potential confusion in the example.
- for controlling the budget in cell retrieval, how does the paper manage a column like "description," which consists of long sentences that might exhaust the entire budget, preventing other cells from being processed?
- for schema/cell retrieval, if the query expansion driven by LLMs fails to generate keywords that align with the schema/cells in the table, what will the outcomes be, or are there any solutions proposed in the paper? Additionally, I am curious about how the paper attempts to align the schema mentioned in the table with the knowledge from LLMs themselves, or does it simply rely on the generalizability of LLMs?
limitations: limitations: - the proposed method seems to primarily support the questions that can be answered by manipulating the tables, such as "What is the average price of the wallet?" Here, queries can be transformed into specific table operations (e.g., df['item_total'] = df['item_total'].str.replace('$','').str.replace(',','').astype(float)). However, it may not perform as well with more complex reasoning tasks. For instance, in the Tabfact dataset, where one must determine from a Wikipedia table and its caption which statements are supported or contradicted, the method might not show promising results for such reasoning tasks.

Comments: title: TabFact Example
comment: Thank you for the response! For the concern about the novelty of the paper, I keep my rating.
Dear reviewer, we're hoping you might get a chance to check out the rebuttal before the deadline today. We'd love to get your feedback!
Dear reviewer, we're hoping you might get a chance to check out the rebuttal before the deadline today. We'd love to get your feedback!
Thank you for reading our rebuttal and sharing your valuable feedback. We appreciate the opportunity to address the concerns regarding novelty. We believe the following points highlight the unique contributions and innovative aspects of our work:

- While existing TableQA methods often focus on small tables, real-world applications frequently involve large and complex tables. **Even those using RAG techniques struggle to effectively encode entire large tables or resort to random truncation**, compromising accuracy. Our specialized RAG framework for table understanding directly tackles this challenge, offering a more **scalable** and accurate solution.
- Applying cell retrieval to TableQA is non-trivial. We address the difficulty of identifying relevant information without viewing the entire table through LM-based **query expansion** and **embedding-based retrieval**. This approach is supported by our ablation study (Figure 7) and further validated by additional experiments presented in our rebuttal.
- We also tackle the computational expense of encoding large tables by strategically encoding only distinct cells in categorical columns and representative cells in numerical columns, along with frequency-based filtering. Our empirical study (Figure 6) demonstrates that TableRAG maintains robust performance despite these optimizations, unlike other RAG methods that suffer from performance degradation due to random truncation.
- The benefits of cell retrieval extend beyond direct use. As shown in our general response, retrieved cells significantly aid the LLM in recognizing cell formats and identifying relevant columns that standard row/column retrieval methods might miss. This is especially valuable in complex tables, making our approach a substantial advancement for TableQA tasks.
- Current TableQA **benchmarks** primarily focus on **small tables**, limiting insights into real-world industrial scenarios. To address this, we introduce two new **large-scale** TableQA benchmarks, pushing the boundaries of the field and providing a deeper understanding of LLM capabilities on large tables.

We firmly believe these points clearly demonstrate the novelty and significant impact of our work. Please let us know if we can provide further details for any of the specific points. Thanks!
Thank you for the response! I still have concern about the novelty of the paper and it has not been addressed. I will keep my rating.
We've submitted our rebuttal, and Reviewer aMG9 has already found it helpful enough to increase their rating.  We're hoping you might also get a chance to check it out before the deadline in two days – we'd love to hear your thoughts!
We've submitted our rebuttal, and Reviewer aMG9 has already found it helpful enough to increase their rating.  We're hoping you might also get a chance to check it out before the deadline in two days – we'd love to hear your thoughts!
We've submitted our rebuttal, and Reviewer aMG9 has already found it helpful enough to increase their rating.  We're hoping you might also get a chance to check it out before the deadline in two days – we'd love to hear your thoughts!
Thank you for recognizing the contribution of this work and increasing the review rating! We appreciate your valuable feedback and will incorporate it into the final version.
Thank you for addressing my concerns. I'm now willing to increase my rating from 4 to 5. I think the contributions are clear, and reasonable, including (1) schema-cell retrieval and (2) new benchmark considering million-token size tables. Cheers!
To help reviewers better understand how TableRAG works and its capabilities, we provide a real example from TabFact for reference. When asked to verify, **“the game against New Orleans didn't have the highest attendance,”** TableRAG successfully answered the question with the following procedure:

> Schema Retrieval Queries: **opponent, attendance**  
> Schema Retrieval Results:  
> *{"column_name": "location attendance", "dtype": "object", "cell_examples": ['us airways center 18422', 'american airlines center 20301', 'new orleans arena 17781']}*  
> … (omit other retrieval results)  
>   
> Cell Retrieval Queries: **2008-09 phoenix suns season, game against new orleans, highest attendance**  
> Cell Retrieval Results:  
> *{"column_name": "team", "cell_value": "new orleans"}*  
> … (omit other retrieval results)  
>  
> Thought: **I need to find the attendance for the game against New Orleans and compare it with the attendance for other games.**  
> Action: `df[df['team']=='new orleans']['location attendance']`  
> *Observation:*   
> *3    new orleans arena 17781*  
> *Name: location attendance, dtype: object*  
> Thought: **The attendance for the game against New Orleans was 17,781.**  
> Action: `df['location attendance'].str.split(' ').str[-1].astype(int).max()`  
> *Observation: ValueError: invalid literal for int() with base 10: 'center'*  
> Thought: **I need to adjust the approach to extract and compare attendance values correctly.**  
> Action: `df['location attendance'].str.split(' ').str[-1].str.replace('center', '').astype(int).max()`  
> *Observation: ValueError: invalid literal for int() with base 10: ''*  
> Thought: **I need to handle the case where the attendance value is not a valid integer.**  
> Action: `df['location attendance'].str.extract('(\d+)').astype(float).max()`  
> *Observation:*   
> *0    20301.0*  
> *dtype: float64*  
> Thought: **The highest attendance in the table is 20,301, which is not for the game against New Orleans with an attendance of 17,781.  
> Final Answer: Yes**  

In this example, TableRAG performs the following steps:
1. Successfully retrieve relevant schema and cells.
2. Write the correct program to obtain the score against Team New Orleans.
3. Recognizes that the cell values are compound strings rather than numerical values.
4. Writes and corrects the program to parse the numerical values from the column and find the maximum.
5. Compare the two numbers and conclude the final answer.

This example demonstrates TableRAG’s capability in understanding, reasoning, and planning, which goes beyond simple table manipulation and Text2SQL.