ProgramTab: Boosting Table Reasoning of LLMs via Programmatic Paradigm

TL;DR

ProgramTab leverages Python-guided code generation to enhance large table reasoning, outperforming baselines on WikiTQ and TabFact.

cs.CL 🔴 Advanced 2026-07-13 44 views
Pei Guo Enjie Liu Yunzhi Tan Mochi Gao Jianxin Zhang Ruichao Zhong Juntao Li Bo Hu Zang Li
table reasoning large language models programmatic paradigm information extraction SQL generation

Key Findings

Methodology

The framework integrates in-context learning with Python code to preprocess tabular data, including row and column extraction, data normalization, and type setting. It guides LLMs to generate SQL queries via chain-of-thought prompting, employing relevance-based row filtering to handle large or unstructured tables. This approach reduces input length constraints and enhances reasoning accuracy. Experiments on WikiTQ and TabFact demonstrate superior performance over all baselines, especially in handling lengthy and complex tables.

Key Results

  • Using GPT-4-mini as backbone, ProgramTab achieved 89.6% accuracy on WikiTQ, surpassing traditional SQL-based methods by nearly 10%. On TabFact, it reached 85.9%, outperforming non-programmatic prompting methods. The relevance-based row filtering and data normalization significantly reduced information loss, improving overall reasoning precision.
  • Across multiple LLMs, including Llama-3.1-70B-Instruct, ProgramTab outperformed other prompting approaches, especially in large table scenarios. Ablation studies confirmed that data preprocessing steps contributed approximately 8-10% performance gain, highlighting their importance.
  • The method generalizes well to Web and hierarchical tables, minimizing issues caused by structural inconsistencies and enabling robust reasoning in diverse real-world scenarios.

Significance

This work addresses core challenges in large-scale table reasoning, overcoming input length limits and structural irregularities. It advances LLM applications in complex, real-world data environments, facilitating automated data analysis, question answering, and knowledge extraction. The integration of programmatic data handling significantly enhances model robustness and interpretability, marking a substantial step forward in AI-driven data reasoning.

Technical Contribution

The proposed approach combines Python-based data preprocessing with SQL query generation, guided by chain-of-thought prompting. It introduces relevance-based row filtering and data normalization, reducing information loss and structural issues. This hybrid paradigm enables efficient reasoning over large or unstructured tables, broadening the applicability of LLMs. The framework is compatible with various models, demonstrating superior performance and robustness, thus pushing the frontier of table reasoning technology.

Novelty

This is the first systematic integration of Python code generation for data normalization with SQL-based reasoning in a unified framework. Unlike prior works that rely solely on direct SQL queries or raw text, ProgramTab employs code to handle data inconsistencies and large inputs, enabling more accurate and scalable reasoning. The combination of relevance filtering, code execution, and chain-of-thought prompting constitutes a novel paradigm in table reasoning.

Limitations

  • The approach depends heavily on the code generation accuracy of pre-trained models; complex or highly inconsistent tables may still cause errors or failures.
  • Processing very large tables with multiple filtering and normalization steps incurs significant computational overhead, affecting real-time deployment.
  • Current validation is limited to public datasets; real-world industrial data with higher complexity and noise may pose additional challenges.

Future Work

Future directions include integrating multimodal data, such as images or graphs, to enhance reasoning capabilities. Optimizing filtering and normalization algorithms to reduce computational costs is also a priority. Expanding application scenarios to domains like finance and healthcare will test the framework’s robustness and adaptability,推动其在实际工业环境中的部署。

AI Executive Summary

Tabular data plays a vital role in daily analysis and decision-making, yet large or unstructured tables pose significant challenges for existing language models. Traditional approaches often truncate data or rely solely on SQL queries, which struggle with Web tables lacking consistent structure. To address these issues, ProgramTab introduces一种结合Python代码预处理和SQL生成的程序化推理框架。该方法利用上下文学习引导LLMs生成数据清洗和筛选代码,先筛选出最相关的行列,再规范数据格式,最后生成SQL查询以提取关键信息。通过链式推理(CoT)策略,模型逐步解决复杂问题,显著提升推理准确率。在WikiTQ和TabFact两个公开数据集上的实验显示,ProgramTab在不同模型背后均优于现有最优方案,特别是在处理超长或结构不规范的表格时表现出色。这一创新方法突破了传统限制,为大规模表格推理提供了新思路。其核心在于结合代码预处理和SQL生成,有效缓解信息丢失和结构不一致的问题,推动自动化数据分析和问答技术的发展。尽管如此,模型在极端复杂或高维表格中的表现仍有待提升,未来将关注多模态融合和算法优化,以实现更广泛的工业应用。总体而言,ProgramTab为表格推理技术带来了革命性突破,具有深远的学术和产业价值。

Deep Dive

Abstract

Table-based reasoning with large language models (LLMs), which requires reasoning based on natural language questions and structured tabular data, has gained widespread attention. However, a series of issues still constrain the application of this task. The previous approaches suffered from significant performance degradation when faced with large tables due to the difficulty of long text modeling and the limitation of input length for LLMs. The text-to-SQL approach is used to efficiently extract key information from tables and generate smaller sub-tables. However, tabular data, especially web tables, often lack the necessary structure and consistency, making them unsuitable for performing mathematical logic operations using SQL queries. We propose the ProgramTab framework, which guides LLMs employing in-context learning to perform tabular data preprocessing with Python code, as well as the momentous contents extraction with row and column extraction and SQL generation. The experiment results on table reasoning datasets demonstrate that the ProgramTab framework effectively deals with table-based reasoning tasks and outperforms all LLM-based baselines.

cs.CL cs.AI