TL;DR
This paper pulls back the curtain on how Large Language Models (LLMs) process and understand structured tabular data. By analyzing 16 different models, the authors reveal a consistent three-phase workflow: models scan tables broadly in early layers, pinpoint query-relevant cells in middle layers, and amplify this focused information in the deepest layers to generate an answer. Crucially, the study demonstrates that table understanding requires deeper layer processing than standard math reasoning, and that Mixture-of-Experts (MoE) models naturally delegate these tasks to specialized, middle-layer "table experts."
What Problem Does This Paper Address?
While LLMs have become remarkably good at table question answering (TQA) and fact verification, they are typically treated as black boxes. Existing research heavily favors performance-oriented engineering—such as tweaking prompt formats or applying supervised fine-tuning—without explaining how these models actually digest rows, columns, and hierarchical headers.
To bridge this gap, the authors shift the focus toward mechanistic interpretability. They tackle fundamental questions: Do LLMs look at the entire table throughout the network? How many layers are actually necessary to reach a stable prediction? Do Mixture-of-Experts (MoE) architectures naturally separate tabular reasoning from general text processing? Understanding these internal dynamics is critical for designing more efficient, specialized tabular models and robust inference-time interventions.
Methods
The authors establish a controlled prompt structure that segments inputs into three distinct parts: a System Prompt, the Table Content (serialized into text), and the User Question. They evaluate 16 LLMs across three categories (Instruct, Table-Specific Fine-tuned, and MoE models) using several diagnostic lenses:
- Attention Dynamics: They track Segment Attention Ratio (where the model looks), Table Attention Entropy (how focused the model's gaze is within the table), and Value-Weighted Contribution (the actual magnitude of information injected into the residual stream).
- Causal Attention Masking: To validate whether attention patterns are functional or merely decorative, they zero out attention to table tokens within specific layer blocks (Shallow, Shallow-Medium, Medium-Deep, Deep).
- LogitLens Analysis: Hidden states at every single layer are decoded directly into vocabulary distributions to measure prediction stability via KL divergence and top-5 token overlap with the final output.
- Expert Routing Analysis: For MoE models, they record the activation frequency and entropy of routing decisions across layers to identify domain-specific expert specialization.
Datasets
The empirical study utilizes 2,000 randomly selected evaluation samples across four established public benchmarks:
- WTQ (WikiTableQuestions): Question answering over flat table structures.
- TabFact: Table-based fact verification using flat tables.
- HiTab & AIT-QA: Complex question answering datasets featuring intricate, hierarchical table headers.
- GSM8K: A standard grade-school math dataset used strictly as a baseline to contrast tabular reasoning against unstructured text reasoning.
Key Insights and Ideas
-
The Three-Phase Attention Workflow: LLMs process tables using a highly structured, layer-dependent strategy. Early layers broadly scan the entire table structure (high entropy). Middle layers act as the critical reasoning hub, narrowing focus onto query-relevant cells (lowest entropy). Late layers then amplify this focused information to drive token generation.
Figure 1: The attention dynamics of Llama3.1-8B-Instruct and Qwen2.5-7B-Instruct on tabular tasks. Each input consists of three segments: system prompt, table content, and user question. Upper: A case study at selected layers—left sub-panels show step-wise attention ratio trend throughout generation steps; right sub-panels show cell-level attention heatmaps. Lower: Aggregated results—Layer-wise Segment Attn Ratio shows the proportion of attention allocated to each segment per layer; Table Attn Entropy measures the degree of focus towards table cells, with lower entropy indicating a more concentrated attention distribution on specific cells); Attn Contribution measures the influence of each segment on the final output. Notably, the entropy minimum at Layer 10 and Layer 14 for Llama3.1-8B-Instruct align with the concentrated attention on the answer cell “China” in the upper heatmap. -
Tables Demand Deeper Refinement: LogitLens analysis revealed that while the final answer content (top-k tokens) crystallizes at similar depths for both math and table tasks, table tasks require significantly more layers to stabilize and refine the overall output probability distribution. This implies that early-exit strategies might hurt tabular performance more than text tasks.
-
MoE Models Segregate Table Experts: In MoE architectures, specialized table experts naturally emerge in the middle layers. These experts show almost zero overlap with math-oriented experts, whereas early and late layers continue to share general-purpose routing.
Expert activation profiles and entropy across MoE architectures -
Format Agnosticism via Deep Convergence: While verbose HTML syntax (
<tr>,<td>) disperses attention and increases entropy in early layers compared to clean Markdown, t-SNE visualizations show that the internal representations of both formats converge in deeper layers. The model effectively strips away the syntactic wrapper to extract format-agnostic semantics.
Key Results
-
Causal Masking Penalties: Zeroing out table attention in early-to-middle layers (Shallow and Shallow-Medium) caused massive performance drops of 44–65 points, proving that the initial broad scanning phase is functionally essential. Interestingly, masking deep layers had almost no impact on Llama-family models, confirming their late layers primarily amplify rather than retrieve data.
Figure 2: Performance drop when masking table atten- tion in different layer ranges across 5 models (averaged over 3 benchmarks × 2 formats). Llama-family models show minimal impact from Deep masking, while Qwen- family models degrade uniformly across all ranges. -
Attention as an Error Predictor: In middle layers, the cells receiving the highest attention weights directly matched the model's final response in up to 53% of cases. Crucially, when models answered incorrectly, 52.8% (Llama) to 74.4% (Qwen) of the errors were directly associated with the middle layers misfocusing on the wrong cells.
- CoT and Fine-Tuning Synergy: Chain-of-Thought (CoT) prompting significantly increases the attention ratio allocated to table content in middle and late layers. When combined with reinforcement learning (RL) table-tuning, models achieved massive accuracy gains (e.g., Table-R1-7B jumped from 69.75% accuracy with direct answering to 82.30% with CoT).
Limitations and Future Work
- Model Scale Constraints: Due to compute limitations, the study only analyzed open-source models under 32B parameters. The scaling behavior of massive models like DeepSeek-V3 (671B) remains an open question.
- Multimodal Gap: The analysis is strictly confined to text-serialized tables (Markdown/HTML). Exploring how Multimodal LLMs (MLLMs) process visual table images internally is a critical next step.
- Task and Format Variety: The paper focuses primarily on TQA and fact verification. Future work should extend these interpretability methods to broader tasks like automated data analysis, and alternative serialization formats like CSV or JSON.
Summary updated