Evaluating and Enhancing Structural Understanding Capabilities of Large Language Models on Tables via Input Designs

Yuan Sui, Mengyu Zhou, Mingjie Zhou, Shi Han, Dongmei Zhang · OpenReview

Abstract

Large language models (LLMs) are becoming attractive as few-shot reasoners to solve NL-related tasks. However, there is still much to be learned about how well LLMs understand structured data, such as tables. While it is true that tables can be used as inputs to LLMs with serialization, there lack comprehensive studies examining whether LLMs can truly comprehend such data. In this paper we try to understand this by designing a benchmark to evaluate structural understanding capabilities (SUC) of LLMs. The benchmark we create includes seven tasks, each with their own unique challenges, e.g,, cell lookup, row retrieval and size detection. We run a series of evaluations on GPT-3 family models (e.g., text-davinci-003). We discover that the performance varied depending on a number of input choices, including table input format, content order, role prompting and partition marks. Drawing from the insights gained through the benchmark evaluations, we then propose self-augmentation for effective structural prompting, e.g., critical value / range identification using LLMs' internal knowledge. When combined with carefully chosen input choices, these structural prompting methods lead to promising improvements in LLM performance on a variety of tabular tasks, e.g., TabFact(+2.31%), HybridQA(+2.13%), SQA(+2.72%), Feverous(+0.84%), and ToTTo(+5.68%). We believe our benchmark and proposed prompting methods can serve as a simple yet generic selection for future research.

Introduction

While Large Language Models (LLMs) are masters of prose, their ability to "see" the grid-like structure of tables has remained a black box. We often feed tables into LLMs by "serializing" them—turning a 2D grid into a long string of text like a CSV or JSON file. While LLMs can perform tasks like Table Question Answering, it hasn't been clear if they actually understand the underlying structure or if they are just getting lucky with pattern matching. This paper systematically evaluates these choices to find out how to best "talk" to an LLM about structured data and addresses the gap in our understanding of an LLM's internal "structural intuition."

The SUC Benchmark

To probe this structural intuition, the researchers developed a suite of seven "Structural Understanding Capability" (SUC) tasks designed to test basic table literacy. These tasks move beyond simple reasoning to test the fundamental parsing abilities of the model.

The SUC Benchmark framework, detailing the stages and tasks used to evaluate structural understanding.

The benchmark includes:

  • Table Partition: Finding where the table starts and ends in a block of text.
  • Size Detection: Counting rows and columns (a task surprisingly difficult for current LLMs).
  • Cell/Row/Column Retrieval: Locating specific data points based on coordinates or headers.
  • Hierarchy/Merged Cell Detection: Identifying complex layouts where cells span multiple rows or columns.

Optimizing Input Design

Through systematic evaluation, the study identified several key factors that influence how well an LLM processes tabular data:

  1. HTML is the Language of Tables: Contrary to the popularity of CSV or Markdown, HTML emerged as the superior format. This is likely because LLMs are trained on massive amounts of web data where tables are defined by standard <table> tags.
  2. Context First, Table Second: Placing the user's question or instructions before the table leads to better performance. Giving the model a "goal" before it parses the data helps it filter relevant information.
  3. The "1-Shot" Power Jump: Moving from zero-shot (no examples) to one-shot (one example) caused a massive performance leap—sometimes over 30%. Structural understanding appears to be an "emergent" capability that requires a small nudge to activate.

Self-Augmented Prompting

Based on these findings, the authors proposed a model-agnostic, two-step prompting strategy called Self-Augmentation (SA). Instead of asking a question directly, the LLM is first asked to "self-reflect" on the table—identifying critical values, ranges, or format specifications.

The two-step Self-Augmentation prompting workflow for enhancing table reasoning.

This intermediate "knowledge" is then fed back into the prompt to help the model solve the final task. This method effectively uses the LLM's own internal knowledge to ground its reasoning in the table's specific structure.

Key Results

The Self-Augmentation technique yielded impressive gains across several well-known downstream tabular datasets compared to standard 1-shot baselines:

  • ToTTo (Table-to-Text): Saw the biggest jump, with a 5.68% improvement.
  • SQA (Question Answering): Improved by 2.72%.
  • TabFact (Fact Checking): Improved by 2.31%.

While GPT-4 is significantly better at structural tasks than GPT-3.5 (often by 20-30% in accuracy), it still benefits from the same input design optimizations, such as using HTML and Role Prompting.

Conclusion

This research demonstrates that LLMs possess a latent structural intuition that can be unlocked through careful input design. By using HTML serialization, placing context before data, and employing self-augmented reflection, we can significantly enhance the ability of LLMs to reason over complex, structured information. Future work will need to address token limits for massive tables and the potential impact of metadata on structural comprehension.

Summary updated

BibTeX
@inproceedings{sui2024evaluating,
  author = {Yuan Sui and Mengyu Zhou and Mingjie Zhou and Shi Han and Dongmei Zhang},
  title = {{Evaluating and Enhancing Structural Understanding Capabilities of Large Language Models on Tables via Input Designs}},
  booktitle = {WSDM},
  year = {2024},
  doi = {10.1145/3616855.3635752},
}
Figure