HiddenTables & PyQTax: A Cooperative Game and Dataset For TableQA to Ensure Scale and Data Privacy Across a Myriad of Taxonomies

William Watson, Nicole Cho, Tucker Balch, Manuela Veloso · DOI

Introduction

Researchers at J.P. Morgan AI Research have introduced HiddenTables, a novel framework designed to address the inherent tensions between Large Language Models (LLMs), data privacy, and computational scalability in Table Question Answering (TableQA). By reframing TableQA as a cooperative game where the LLM never sees the underlying data, the framework achieves significant token cost reductions and ensures data privacy, supported by a massive new dataset called PyQTax.

The Privacy and Scalability Challenge

Standard TableQA approaches typically involve "stuffing" as much of a table as possible into an LLM’s context window. This method faces three critical hurdles:

  1. Scalability: Large tables with thousands of rows quickly exceed context window limits.
  2. Cost: Sending extensive table data to third-party APIs like GPT-4 is prohibitively expensive.
  3. Privacy: In highly regulated sectors like finance or healthcare, uploading proprietary or personally identifiable information (PII) to external providers is often a non-starter.

HiddenTables addresses these by withholding the data itself, testing whether a model can reason about the structure of information rather than just performing extractive pattern matching.

The HiddenTables Framework

The architecture consists of two primary agents operating in a "cooperative game" loop:

  • The Oracle (On-Premise): Resides behind a secure firewall with the actual data. It provides the Solver only with the table schema (column names and data types) and the user's natural language question.
  • The Solver (Off-Premise LLM): An external model (e.g., gpt-3.5-turbo) that acts as a programmer. It generates Python/pandas code intended to answer the query.
The HiddenTables architecture showing the interaction between the on-premise Oracle and off-premise Solver.

As shown in the figure above, the Oracle executes the Solver's code within a Secure Interpreter—a sandboxed environment with restricted libraries and no internet access. If the code fails (e.g., due to a KeyError), the Oracle returns a sanitized error message, allowing the Solver to self-correct for up to seven rounds.

The PyQTax Dataset

To evaluate this framework, the authors introduced PyQTax, a comprehensive dataset derived from classic benchmarks like WikiSQL, WikiTableQuestions (WikiTQ), and SQA. PyQTax contains 116,671 triplets of questions, table schemas, and verified Python code. This dataset is uniquely categorized by difficulty, operator type (e.g., SUM, MIN, MAX), and table size, providing a granular diagnostic tool for LLM-based code generation in data retrieval tasks.

Key Insights and Results

Efficiency and Scalability

In traditional TableQA, token usage grows quadratically $O(r \times c)$ with the number of rows and columns. In HiddenTables, complexity is reduced to $O(c)$, as it only depends on the number of columns. Empirically, the HiddenTables approach used only 48.5% of the tokens required by holistic table-encoding methods, making it viable for datasets with millions of rows.

Performance and the "Privacy Tax"

While the framework ensures privacy, it introduces a performance trade-off. A state-of-the-art holistic model like TaPEx reaches ~89% accuracy on WikiSQL, whereas HiddenTables (using GPT-3.5) reached ~68%. However, performance remained remarkably consistent regardless of table size, proving the system scales effectively to "Big Data" scenarios where context windows would normally fail.

Detailed performance metrics on the WikiSQL dataset across various categories like difficulty, operator, and table size.

Failure Modes

The most common errors were "No Code Provided" (51% of failures) and IndexError (14%), typically occurring when the model attempted to access specific rows it could not see. This highlights the "semantic gap"—the difficulty of aligning natural language queries with specific column names without seeing data examples.

Conclusion

HiddenTables demonstrates that it is possible to perform complex TableQA while maintaining strict data privacy and reducing costs. While a "privacy tax" exists in terms of raw accuracy, the framework's scalability and the introduction of the PyQTax dataset provide a robust foundation for future research into privacy-preserving AI for structured data.

Summary updated

BibTeX
@inproceedings{watson2023hiddentables,
  author = {William Watson and Nicole Cho and Tucker Balch and Manuela Veloso},
  title = {{HiddenTables \& PyQTax: A Cooperative Game and Dataset For TableQA to Ensure Scale and Data Privacy Across a Myriad of Taxonomies}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.442},
}
Figure