Abstract
Processing structured tabular data, particularly large and lengthy tables, constitutes a fundamental yet challenging task for large language models (LLMs). However, existing long-context benchmarks like Needle-in-a-Haystack primarily focus on unstructured text, neglecting the challenge of diverse structured tables. Meanwhile, previous tabular benchmarks mainly consider downstream tasks that require high-level reasoning abilities, and overlook models' underlying fine-grained perception of individual table cells, which is crucial for practical and robust LLM-based table applications. To address this gap, we introduce NeedleInATable (NIAT), a new long-context tabular benchmark that treats each table cell as a "needle" and requires models to extract the target cell based on cell locations or lookup questions. Our comprehensive evaluation reveals a substantial performance gap between popular downstream tabular tasks and the simpler NIAT task, suggesting that models may rely on dataset-specific shortcuts rather than true structural understanding. Furthermore, we demonstrate that using synthesized NIAT training data can effectively improve performance on both NIAT and downstream tabular tasks.
Introduction
We are currently in the era of "long-context" LLMs, with models claiming to process hundreds of thousands of tokens. To test these capabilities, researchers typically employ the "Needle-in-a-Haystack" (NIAH) test—hiding a single fact in a long essay and asking the model to retrieve it. However, real-world data is frequently structured in tables, such as financial reports and medical records, which present unique spatial challenges that unstructured text does not.
The authors argue that existing table benchmarks skip a crucial foundational step: they ask models to perform high-level reasoning (e.g., "What is the total revenue?") without verifying if the model can even "see" the table correctly. If a model cannot reliably find the value in a specific row and column, its answer to a complex question is likely based on "shortcuts" or dataset-specific correlations rather than a genuine understanding of the data structure.
The NeedleInATable (NIAT) Benchmark
The researchers developed the NeedleInATable (NIAT) benchmark to treat every single cell in a table as a potential "needle." The benchmark evaluates models on two primary tasks:
- Cell Locating: "What is the value in the 3rd row and 4th column?" This tests if the model understands the 2D grid structure.
- Cell Lookup: "What was the attendance on August 20, 1960?" This tests if the model can use headers and keys to retrieve data.
NIAT contains 750 tables and up to 287,000 questions, covering three structures (flat, horizontal, and hierarchical) and three formats (Markdown, HTML, and Image). The tables were sourced from established datasets like WTQ (WikiTableQuestions), HiTab, and AIT-QA.
To address the weaknesses identified, the authors proposed a "Strong2Weak" data synthesis method. Using GPT-4o, they generated 12,000 training examples including detailed Chain-of-Thought (CoT) reasoning. These examples teach models how to systematically count rows and columns to find data, rather than relying on heuristic guessing.
Key Insights and Results
The Perception Gap
Evaluation results show a significant "Perception Gap": models are much better at Lookup (finding a value by a key like "August 20") than Locating (finding a value by coordinates). This suggests that LLMs rely heavily on keyword matching via attention mechanisms but lack a "human-like" grasp of 2D coordinates. Even powerful models like GPT-4o showed a massive gap, scoring ~68% on Cell Lookup but only ~26% on Cell Locating for text-based tables.
The "NIAT Boost"
One of the most significant findings is that foundational skills matter for complex reasoning. Fine-tuning models like Llama-3.1-8B and Qwen-2.5-7B on the synthesized NIAT data led to an average 14.55% accuracy increase across four major downstream tabular benchmarks (WTQ, TabFact, HiTab, and TABMWP). This validates that improving a model's basic perception of table structure directly enhances its ability to perform complex math and fact verification.
Reasoning Models and Visual Fragmentation
- Reasoning Models: DeepSeek-R1 showed the strongest innate ability to navigate tables, scoring 65.91% on Cell Locating—far higher than standard LLMs. This is likely due to its reinforcement learning-based reasoning chains.
- Visual Fragmentation: Multimodal LLMs perform poorly on table images because standard visual encoders chop images into fixed-size patches. If a patch boundary splits a table cell, the model's structural understanding often breaks.
- Lost-in-the-Middle: Similar to long-form text, LLMs suffer from a "lost-in-the-middle" effect in tables, performing well on the first and last few rows but struggling with data buried in the center.
Conclusion and Future Work
NeedleInATable reveals that long-context capabilities for unstructured text do not automatically translate to structured data. While teaching models basic cell-locating skills provides a significant performance boost, several frontiers remain. Future work is needed to address "multi-table" scenarios requiring joins across different structures, tables embedded within complex hybrid documents, and the scaling of these models to handle "Big Data" tables exceeding 120k tokens.
Summary updated