Better Think with Tables: Leveraging Tables to Enhance Large Language Model Comprehension

Jio Oh, Geon Heo, Seungjun Oh, Jindong Wang, Xing Xie, Steven Euijong Whang · DOI

Introduction

Large Language Models (LLMs) have revolutionized natural language interaction, yet they frequently falter when tasked with precise data manipulation—such as filtering, counting, or updating records. In many real-world applications, LLMs serve as interfaces for structured data, but state-of-the-art models often achieve F1 scores below 70% on these tasks. This research investigates whether the format in which factual data is presented—natural text, semi-structured JSON, or tabular structures—significantly impacts model reasoning and efficiency.

Methodology

The study evaluates the impact of "structuredness" by comparing four primary data representations: natural text, order-fixed text, template-based text, and Markdown-style tables. These were tested against popular alternatives like JSON and Knowledge Graphs (KGs) across three interaction scenarios: single-turn Q&A, multi-turn (where the model first outputs a table), and "pre-instruction" (where the model is told to internally convert text to a table before answering).

Comparison of data formats and interaction scenarios, including the pre-instruction technique.

The evaluation utilized three datasets: Soccer player statistics, Movie metadata, and synthetic Personally Identifiable Information (PII). Models were tested on six request types, ranging from simple retrieval to complex summation and quantification.

Key Insights

The Attention Spotlight

Mechanistic attention-value analysis revealed that LLMs pay 2.24x more attention to relevant information when presented in a table compared to natural text. Tables act as a visual "anchor," allowing the model to focus on pertinent data while effectively ignoring irrelevant noise.

Resilience to Sparsity and Token Efficiency

A critical finding involves "sparse" data scenarios where information is missing. While missing keys in JSON or KGs often break the expected structure and degrade performance, tables remain robust. Empty cells in a table occupy a predictable place in the schema, maintaining structural integrity. Furthermore, tables are significantly more compact than JSON or descriptive text, allowing for higher information density within the model's context window.

Key Results

The research demonstrates that tabular structures yield a 40.29% average relative improvement in performance over natural text across all tested models and tasks.

F1-score vs. Number of Tokens for various data formats, highlighting the efficiency and accuracy of tables.

Key quantitative findings include:

  • Complexity Handling: On the "Revision" task—the most difficult task involving simultaneous retrieval and manipulation—performance increased by 11.96 percentage points.
  • Structurization Accuracy: LLMs proved highly capable of converting text to tables, achieving an average conversion accuracy of 98.6%.
  • Robustness: Tabular formats reduced output variance, making models less sensitive to minor phrasing changes in prompts.

Conclusion

Presenting factual data in a tabular format significantly enhances LLM comprehension, efficiency, and robustness. While two-dimensional tables may not suit every complex hierarchical relationship, they represent a superior "native language" for factual reasoning compared to plain text or JSON. Future LLM applications should consider hybrid approaches that leverage tables for data-heavy contexts to maximize performance and token economy.

Summary updated

BibTeX
@misc{oh2024better,
  author = {Jio Oh and Geon Heo and Seungjun Oh and Jindong Wang and Xing Xie and Steven Euijong Whang},
  title = {{Better Think with Tables: Leveraging Tables to Enhance Large Language Model Comprehension}},
  year = {2024},
  eprint = {2412.17189},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.17189},
}
Figure