API-Assisted Code Generation for Question Answering on Varied Table Structures
Abstract
A persistent challenge to table question answering (TableQA) by generating executable programs has been adapting to varied table structures, typically requiring domain-specific logical forms. In response, this paper introduces a unified TableQA framework that: (1) provides a unified representation for structured tables as multi-index Pandas data frames, (2) uses Python as a powerful querying language, and (3) uses few-shot prompting to translate NL questions into Python programs, which are executable on Pandas data frames. Furthermore, to answer complex relational questions with extended program functionality and external knowledge, our framework allows customized APIs that Python programs can call. We experiment with four TableQA datasets that involve tables of different structures — relational, multi-table, and hierarchical matrix shapes — and achieve prominent improvements over past state-of-the-art systems. In ablation studies, we (1) show benefits from our multi-index representation and APIs over baselines that use only an LLM, and (2) demonstrate that our approach is modular and can incorporate additional APIs.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Triples as the Key: Structuring Makes Decomposition and Verification Easier in LLM-based TableQA cites TAPEX: Table Pre-training via Learning a Neural SQL Executor
- RoT: Enhancing Table Reasoning with Iterative Row-Wise Traversals cites Triples as the Key: Structuring Makes Decomposition and Verification Easier in LLM-based TableQA
- PAL: Program-aided Language Models cites Neural Module Networks for Reasoning over Text
- ViperGPT: Visual Inference via Python Execution for Reasoning cites PAL: Program-aided Language Models
- TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Tasks cites PAL: Program-aided Language Models
- TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Tasks cites ViperGPT: Visual Inference via Python Execution for Reasoning
Cited by top-tier papers4
- TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic TasksZhiruo Wang, Graham Neubig, Daniel FriedICML 2024 · 47 citations
- RoT: Enhancing Table Reasoning with Iterative Row-Wise TraversalsXuanliang Zhang, Dingzirui Wang, Keyan Xu, Qingfu Zhu et al.EMNLP 2025 · 2 citations
- HeGTa: Leveraging Heterogeneous Graph-enhanced Large Language Models for Few-shot Complex Table UnderstandingRihui Jin, Yu Li, Guilin Qi, Nan Hu et al.AAAI 2025 · 1 citation
- Triples as the Key: Structuring Makes Decomposition and Verification Easier in LLM-based TableQAZhen Yang, Ziwei Du, Minghan Zhang, Wei Du et al.ICLR 2025
Builds on12
- DIN-SQL: Decomposed In-Context Learning of Text-to-SQL with Self-CorrectionMohammadreza Pourreza, Davood RafieiNeurIPS 2023 · 909 citations
- ViperGPT: Visual Inference via Python Execution for ReasoningDídac Surís, Sachit Menon, Carl VondrickICCV 2023 · 732 citations
- PAL: Program-aided Language ModelsLuyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon et al.ICML 2023 · 700 citations
- TAPEX: Table Pre-training via Learning a Neural SQL ExecutorQian Liu, Bei Chen, Jiaqi Guo, Morteza Ziyadi et al.ICLR 2022 · 347 citations
- Neural Module Networks for Reasoning over TextNitish Gupta, Kevin Lin, Dan Roth, Sameer Singh et al.ICLR 2020 · 134 citations
Related papers
- ReAcTable: Enhancing ReAct for Table Question AnsweringYunjia Zhang, Jordan Henkel, Avrilia Floratou, Joyce Cahoon et al.VLDB 2024 · 120 citations
- SMART: Semantic Header Flattening and Pseudo-Code-Style Reasoning for LLM-based Complex Table Question AnsweringYongshuo Zhang, Jixiong Chen, Kaihe Xu, Wei Wei et al.ACL Findings 2026
- LLM-Symbolic Integration for Robust Temporal Tabular ReasoningAtharv Kulkarni, Kushagra Dixit, Vivek Srikumar, Dan Roth et al.ACL Findings 2025
- Generation-Focused Table-Based Intermediate Pre-training for Free-Form Question AnsweringPeng Shi, Patrick Ng, Feng Nan, Henghui Zhu et al.AAAI 2022 · 16 citations
- TaREx: Reinforcement Learning for Code-Driven Table ReasoningFangyu Lei, Jinxiang Meng, Yiming Huang, Shizhu He et al.AAAI 2026
