Rethinking Tabular Data Understanding with Large Language Models

Tianyang Liu, Fei Wang, Muhao Chen

Introduction

While Large Language Models (LLMs) excel at processing unstructured text, they often struggle with the structural nuances of tabular data. Standard approaches typically linearize tables into text, which can obscure relational information and lead to reasoning errors. This paper introduces NORM, a table structure normalization method, and Mix Self-Consistency (Mix-SC), a mechanism that aggregates textual and symbolic reasoning pathways. These innovations achieve a new state-of-the-art (SOTA) accuracy of 73.6% on the WikiTableQuestions benchmark.

The Challenge of Tabular Reasoning

Tables are ubiquitous, yet LLMs struggle to "see" them reliably. The authors identify three primary challenges:

  1. Structural Sensitivity: LLMs are fragile when table layouts change (e.g., transposing rows and columns), even if the underlying data remains identical.
  2. Reasoning Trade-offs: There is a conflict between textual reasoning (Chain-of-Thought) and symbolic reasoning (writing code like Python/Pandas). Each has distinct failure modes.
  3. Localization Errors: Models often fail to pinpoint specific data points within complex grids.
Figure 1: LLMs often fail at symbolic reasoning due to structural misunderstandings, such as misidentifying column headers, leading to execution errors like KeyErrors.

Methodology

The researchers propose a multi-pronged approach to improve tabular understanding:

Table Structure Normalization (NORM)

NORM is a two-stage strategy. First, it detects if a table is "column-oriented" and transposes it into a standard "row-oriented" format. Second, it strategically reorders rows to enhance readability and logical flow for the model.

Figure 2: An example of a Wikipedia table used in benchmarks, illustrating the complex headers and data types LLMs must process.

Reasoning Pathways

  • Direct Prompting (DP): A textual reasoning approach using Chain-of-Thought (CoT) for step-by-step natural language reasoning.
  • Python Shell Agent (PyAgent): A symbolic reasoning approach where the LLM acts as a programmer, writing and executing Pandas code to manipulate a dataframe.
  • Mix Self-Consistency (Mix-SC): Instead of picking one reasoning method, the authors generate multiple outputs from both DP and PyAgent. They then use a majority voting mechanism across these diverse pathways to find the most reliable answer.
  • Self-Evaluation: A prompt-based method where the LLM chooses between DP and PyAgent outputs based on the nature of the question (e.g., favoring code for complex math).

Key Insights and Results

The study reveals that symbolic reasoning is surprisingly fragile; transposing a table caused a 77.7% drop in performance for the Python-based agent. In contrast, textual reasoning (DP) proved much more robust to structural changes, likely because LLMs are better at grasping semantic connections in text regardless of layout.

By combining 5 textual paths and 5 symbolic paths, Mix-SC outperformed using 10 paths of either method alone. This "diversity of thought" allowed the model to overcome the inherent weaknesses of any single reasoning style. The proposed method achieved a 73.6% accuracy on the WikiTableQuestions (WTQ) test set, significantly outperforming previous SOTA models like DATER (65.9%) and BINDER (64.6%).

Limitations

Despite these gains, challenges remain. Accuracy declines as table size increases (the "lost in the middle" phenomenon), and the NORM reordering stage can inadvertently change the correct answer for order-sensitive questions (e.g., "What is the last entry?"). Future work will focus on scaling these methods for extremely large tables that exceed current context windows.

Summary updated

BibTeX
@inproceedings{liu2024rethinking,
  author = {Tianyang Liu and Fei Wang and Muhao Chen},
  title = {{Rethinking Tabular Data Understanding with Large Language Models}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.26},
}
Figure