Abstract
Large Language Models (LLMs) often struggle with requests related to information retrieval and data manipulation that frequently arise in real-world scenarios under multiple conditions. In this paper, we demonstrate that leveraging tabular structures in LLM interactions is more effective than utilizing other structures for handling prevalent requests that operate over factual data. Through comprehensive evaluations across various scenarios and request types, we show that providing tabular structures yields a 40.29% average performance gain along with better robustness and token efficiency. Through attention-value analysis, we discover that tables help LLMs better locate relevant information, explaining these improvements. Beyond tables and text, we evaluate whether (1) blending structuredness within text, such as providing templates or fixing the order of attributes, and (2) other representative structures, such as knowledge graphs and JSON are helpful. We observe that utilizing tables offers the best balance between efficiency and effectiveness. The method remains robust to task complexity and adapts to unstructured sources through text-to-table conversion. Overall, we highlight the untapped potential of tabular representations for future LLM applications.
Introduction
As Large Language Models (LLMs) are increasingly deployed as alternatives to search engines and data analysts, their ability to interact with factual data becomes paramount. These "factual data interactions" involve retrieving, aggregating, or manipulating structured information—tasks where LLMs often falter. When data is presented as natural language, models are susceptible to "snowball effects," where minor initial retrieval errors cascade into significant hallucinations. While semi-structured formats like JSON or Knowledge Graphs (KGs) have been proposed as solutions, they often introduce high token overhead and can degrade performance when data is sparse. This study investigates whether the two-dimensional layout of a table serves as the optimal structure for LLM data processing.
Methodology
The researchers established a rigorous evaluation framework comparing six distinct data formats:
- Natural Text: Standard prose.
- Order-fixed Text: Sentences with consistent attribute ordering.
- Template-based Text: Sentences following rigid grammatical structures.
- JSON: Standard semi-structured key-value pairs.
- Knowledge Graphs (KG): Triple-based relational data.
- Tables: Data formatted using the markdown-style
|delimiter.
These formats were tested across three interaction scenarios: Single-turn (data in input), Multi-turn (model organizes knowledge before answering), and Pre-instruction (model is explicitly told to convert text to an internal table). Evaluations spanned three domains: Soccer (FIFA 20), Movie (IMDb), and synthetic Personally Identifiable Information (PII).
Key Results and Efficiency
The primary finding is a 40.29% average relative performance improvement when using tabular formats over natural text. This gain is consistent across various LLM families, including GPT, Gemini, and Llama.
As shown in Figure 1, tables occupy a unique "sweet spot" in the design space, offering the highest F1-scores while requiring significantly fewer tokens than JSON or Knowledge Graphs. This efficiency allows for larger datasets to be included within the context window while simultaneously reducing inference latency and cost.
Resilience and Robustness
A critical challenge in data interaction is "sparsity"—scenarios where many data points are missing. While JSON and KGs are often touted for their flexibility, the study reveals they are surprisingly fragile in sparse environments.
Figure 6 illustrates that as sparsity increases, the performance of JSON and KG formats drops precipitously. In contrast, tables remain robust. The persistent schema provided by column headers acts as a reliable anchor, allowing the model to navigate the data structure even when specific cells are empty. Furthermore, tables significantly reduce output variance; LLMs provide more consistent answers when the underlying data is tabular compared to when it is presented as semantically identical text.
Mechanistic Insights: The Attention Advantage
To understand why tables work better, the authors performed a mechanistic attention-value analysis on Llama-3.1-70B. They discovered that LLMs assign 2.24x more attention weight to relevant data points when they are presented in a table versus text. The two-dimensional structure helps the model's attention mechanism "lock on" to the correct coordinates of information, effectively filtering out linguistic noise.
Conclusion
Tabular representations represent an underutilized but highly effective tool for enhancing LLM performance on factual data tasks. By providing a clear, token-efficient, and robust structure, tables help models focus their attention and resist the hallucinations common in text-based retrieval. Whether through direct input or internal "text-to-table" conversion, talking with tables is a superior strategy for data-centric LLM applications.
Reference: Oh, J., Heo, G., et al. (2024). Talking with Tables for Better LLM Factual Data Interactions. arXiv:2412.17189v4.
Summary updated