Introduction
Large Language Models (LLMs) have demonstrated remarkable capabilities in natural language processing, yet they often struggle with structured data. While humans perceive tables as two-dimensional entities with inherent hierarchical relationships, standard LLM architectures typically process them as one-dimensional text sequences. This paper introduces TAMO (Table as a Modality), a framework that treats tabular structure as a distinct modality, providing LLMs with a "structural eye" to better navigate and understand complex data.
The Serialization Trap
The prevailing method for feeding tables into LLMs is serialization—converting a 2D table into a CSV or Markdown string. However, this approach leads to what researchers call the "serialization trap." Tables possess a property known as permutation invariance: swapping rows or columns does not change the underlying information. When tables are serialized, this structural context is often lost. LLMs become sensitive to the order of data, and their performance in cell localization or relational reasoning drops significantly when the structure is perturbed.
As shown in Figure 1, traditional text-based serialization can lead to incorrect answers even for simple queries like "What is the value in the column Role of sample row 3?" because the model loses track of the 2D coordinates within the 1D string. TAMO addresses this by introducing structural embeddings that provide the model with a global relational map.
TAMO: A Multimodal Approach
To overcome these limitations, TAMO integrates a dedicated table encoder with mainstream LLMs. The core of this framework is a hypergraph-enhanced tabular encoder.
Hypergraph Modeling
Unlike standard graphs that model pairwise relationships, TAMO uses a hypergraph where individual cells are nodes and structural components (rows, columns, headers) are hyperedges. This architecture naturally captures the high-order hierarchical relationships inherent in tables, making the model inherently robust to permutations.
Architecture and Alignment
The encoder utilizes a HyperTrans backbone—a hypergraph-aware transformer—to propagate information between cells and their structural containers. A lightweight "Alignment Projector" then maps these structural embeddings into the same semantic space as the LLM’s text tokens. The final input to the LLM is a hybrid stream:
- Structural Embeddings: Providing global relational context (the "where").
- Serialized Text: Providing fine-grained semantic content (the "what").
This modular design allows TAMO to be "plug-and-play," compatible with frozen LLMs via prompt tuning or integrated into fine-tuning workflows like LoRA.
Experimental Results
The researchers evaluated TAMO across five major benchmarks, including a new diagnostic benchmark, StructQA, designed to test structural understanding through tasks like cell location and row/column lookup under shuffling conditions.
Key Findings
- Massive Performance Gains: TAMO achieved an average relative performance gain of 42.65% over text-only baselines in frozen LLM settings.
- State-of-the-Art Results: TAMO + Llama-2-7B achieved SOTA results on HiTab, WikiSQL, and FeTaQA, outperforming even specialized models designed for those datasets.
- Robustness to Shuffling: As illustrated in Figure 2, while standard models like GPT-3.5 and Llama-2 see accuracy drops when tables are permuted, TAMO maintains high performance, demonstrating true permutation invariance.
- Efficiency over Scale: A 7B-parameter model equipped with TAMO can outperform much larger models like GPT-4 on structure-centric tasks, suggesting that architectural inductive bias is a powerful alternative to raw scaling.
Conclusion
TAMO represents a significant step toward making LLMs truly "table-aware." By treating tabular structure as a first-class modality rather than a text-processing byproduct, the framework enables models to grasp the structural semantics of data. This approach not only improves accuracy on complex reasoning tasks but also ensures robustness against data perturbations, paving the way for more reliable data-driven AI applications.
Summary updated