Abstract
Large language models (LLMs) are becoming attractive as few-shot reasoners to solve Natural Language (NL)-related tasks. However, the understanding of their capability to process structured data like tables remains an under-explored area. While tables can be serialized as input for LLMs, there is a lack of comprehensive studies on whether LLMs genuinely comprehend this data. In this paper, we try to understand this by designing a benchmark to evaluate the structural understanding capabilities of LLMs through seven distinct tasks, e.g., cell lookup, row retrieval and size detection. Specially, we perform a series of evaluations on the recent most advanced LLM models, GPT-3.5 and GPT-4 and observe that performance varied with different input choices, including table input format, content order, role prompting, and partition marks. Drawing from the insights gained through the benchmark evaluations, we propose self-augmentation for effective structural prompting, such as critical value / range identification using internal knowledge of LLMs. 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 that our open source benchmark and proposed prompting methods can serve as a simple yet generic selection for future research. The code and data for this paper are available at https://github.com/microsoft/TableProvider.
Introduction
Tables are a ubiquitous way of organizing data, but they pose a unique challenge for Large Language Models (LLMs). Because LLMs process information as a linear sequence of tokens, a 2D table must be "serialized"—flattened into text—before the model can read it. Despite the widespread use of LLMs for data analysis, the research community lacks a consensus on the optimal serialization format. Whether using CSV, Markdown, or HTML, it remains unclear if LLMs actually "comprehend" the grid structure or if they are simply performing sophisticated pattern matching. If a model cannot reliably determine the number of rows in a table or locate a specific cell by its coordinates, its reliability for complex financial analysis or fact-checking is questionable.
The SUC Benchmark
To address this gap, the authors introduced the Structural Understanding Capabilities (SUC) benchmark. This benchmark is designed to isolate structural understanding from general reasoning through seven "atomic" tasks.
The tasks are grouped into several stages:
- Partition & Parsing: These tasks involve detecting table boundaries and identifying the number of rows and columns (Table Size Detection).
- Search & Retrieval: These tasks test the model's ability to look up values based on coordinates (Cell Lookup & Reverse Lookup) or retrieve entire rows and columns.
- Format Understanding: This includes identifying complex hierarchical structures, such as merged cells or nested headers.
The benchmark utilizes 1,500 tables sampled from five major public datasets: TabFact, FEVEROUS, SQA, HybridQA, and ToTTo. This ensures a diverse range of table structures and contents.
Exploring Input Designs
The study systematically evaluated how various input choices affect LLM performance. Key variables included serialization formats (HTML, XML, JSON, Markdown, etc.) and prompting strategies like role-playing prompts and partition marks.
A significant finding was that HTML markup consistently outperformed simpler formats like CSV or Markdown. The researchers hypothesize that LLMs, having been trained on vast amounts of web data, possess an inherent "prior" for understanding table structures through standard tags like <table>, <tr>, and <td>. Furthermore, the order of information matters; placing instructions and external context before the table data generally leads to better generalization than placing them after.
Self-Augmented Prompting
Building on the insights from the SUC benchmark, the authors propose Self-Augmented Prompting (SA). Inspired by "Chain of Thought" techniques, SA is a two-stage process that encourages the LLM to build a mental map of the table before attempting a complex task.
Instead of asking the LLM to solve a task immediately, the model is first prompted to generate "intermediate structural knowledge." This might include identifying critical value ranges, describing the table format, or summarizing the table's schema. This self-generated context is then fed back into the model as part of the prompt for the final downstream task. This "self-explanation" mechanism helps the model ground its reasoning in the actual structure of the data.
Key Results and Insights
The empirical study yielded several concrete performance gains and observations:
- LLMs Struggle with Basics: Even advanced models like GPT-4 struggle with seemingly trivial tasks, such as exact table size detection. This suggests that LLMs do not "see" the grid as clearly as humans do.
- The 1-Shot Necessity: There is a significant performance drop (approx. 30%) when moving from a 1-shot to a 0-shot setting, indicating that LLMs rely heavily on examples to calibrate their understanding of a specific table format.
- Downstream Performance Boosts: When combined with optimal input designs, Self-Augmented Prompting led to significant improvements across all tested reasoning tasks: ToTTo (+5.68% BLEU-4), SQA (+2.72% accuracy), and TabFact (+2.31% accuracy).
Conclusion
While LLMs show promise in handling structured data, their structural understanding is not yet robust. The SUC benchmark provides a necessary tool for measuring these capabilities, and Self-Augmented Prompting offers a practical method for improving performance. Future work will need to address the challenges of processing very large tables that exceed token limits and exploring how these capabilities translate across different languages and more complex metadata.
Summary updated