TableRAG: Million-Token Table Understanding with Language Models

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.

Paper

Similar papers

Peer review

Reviewer aMG95/10 · confidence 4/52024-07-05

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.

Strengths

- the idea of schema-cell retrieval seems reasonable and shows better performance compared to baselines on some types of questions. - this paper seems contribute to new benchmarks concerning million-token sized tables and enhances the understanding of LLM performance in large-scale table comprehension.

Weaknesses

- 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

- 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?

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

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.

Reviewer 6sEk5/10 · confidence 4/52024-07-06

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.

Strengths

1. The overall method is relatively simple and intuitive. 2. Experimental results on three datasets show the effectiveness of the proposed method.

Weaknesses

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

N/A

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

N/A

Reviewer yX7T4/10 · confidence 4/52024-07-07

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.

Strengths

1) The proposed approach significantly outperforms the baseline models, particularly in retrieving cell values, showing a substantial improvement in recall metric. 2) Unlike previous works in the table question answering domain, which focused on small-scale tables that do not accurately represent real-world databases, this approach tackles a more challenging setting. It addresses scenarios where tables can contain millions of rows and numerous columns. The authors also developed two new datasets specifically designed for large-scale table question answering. 3) The paper includes well-conducted ablation studies and experiments that compare their method against their baseline methods. These studies demonstrate the effectiveness of each component of their approach.

Weaknesses

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

Not applicable

Rating

4

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

Not applicable

Reviewer YK6m4/10 · confidence 4/52024-07-11

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.

Strengths

1. **Scalability**: The framework is scalable for larger tables, as demonstrated by new benchmarks sourced from real-world datasets and synthetic data from TabFact. 2. **State-of-the-Art Performance**: TableRAG achieves the highest retrieval quality and new state-of-the-art performance on large-scale table understanding tasks.

Weaknesses

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

1. Why not evaluate on more models? 2. Why not evaluation on commonly used TableQA benchmarks like WikiTableQA?

Rating

4

Confidence

4

Soundness

2

Presentation

3

Contribution

3

Limitations

Yes, the paper discusses the limitations.

Authorsrebuttal2024-08-07

TabFact Example

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.

Reviewer aMG92024-08-08

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!

Authorsrebuttal2024-08-08

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.

Authorsrebuttal2024-08-12

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!

Reviewer YK6m2024-08-12

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.

Authorsrebuttal2024-08-13

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!

Authorsrebuttal2024-08-12

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!

Authorsrebuttal2024-08-13

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!

Reviewer 6sEk2024-08-14

Thank you for the response! For the concern about the novelty of the paper, I keep my rating.

Authorsrebuttal2024-08-12

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!

Authorsrebuttal2024-08-13

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!

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC