TL;DR
TILT (Text-Image-Layout Transformer) is an end-to-end encoder-decoder model designed to understand documents by simultaneously processing text, spatial layout, and visual features. By moving away from traditional sequence labeling toward a generative framework, TILT achieves state-of-the-art results on challenging benchmarks like DocVQA and CORD, proving particularly robust against OCR errors and complex document structures.
What Problem Does This Paper Address?
Most Natural Language Processing (NLP) models are built for "plain text"—linear sequences of words. However, real-world documents like invoices, forms, and scientific papers convey meaning through their spatial layout and visual appearance (e.g., font size, bolding, or proximity to a table header).
Traditional approaches often treat this as a "sequence labeling" task, where the model tries to tag specific words in the document. This has three major flaws:
- Substring Dependency: They can only extract text exactly as it appears, failing if the answer requires normalization (e.g., changing "2.00 ITEMS" to "2.00") or if the OCR engine makes a typo.
- Reading Order Sensitivity: They rely on a pre-defined reading order, which is often garbled in complex multi-column layouts.
- Modality Gap: They often struggle to integrate visual context (like a logo or a checkbox) directly with the text.
Methods
TILT addresses these gaps by building on a pretrained encoder-decoder Transformer (specifically T5). The authors introduce three key architectural innovations:
- 2D Spatial Attention Bias: Instead of using absolute positional embeddings, TILT calculates relative horizontal and vertical distances between every pair of tokens. This information is injected directly into the self-attention mechanism as a bias term ($B$), allowing the model to "see" the spatial relationship between words regardless of their sequence order.
- Contextualized Image Embeddings: The model uses a U-Net backbone to process the entire document image. It then uses ROI (Region of Interest) pooling to extract visual features for each token's bounding box. Because the U-Net sees the whole page, these embeddings capture not just the look of a word, but its visual neighborhood.
- Encoder-Decoder Framework: By using a decoder to generate answers rather than a classifier to tag tokens, the model becomes independent of the input reading order and can generate "corrected" or normalized text that isn't a direct substring of the input.
To prevent overfitting, the authors also introduced specific Regularization Techniques:
- Case Augmentation: Randomly changing the casing of both document and target text.
- Spatial/Vision Augmentation: Randomly stretching, squeezing, or shearing the document image and bounding boxes during training.
Datasets
The authors evaluated TILT on four primary benchmarks:
- DocVQA: Visual question answering on industry documents.
- CORD: Information extraction from Indonesian receipts.
- SROIE: Key information extraction (company, date, address, total) from receipts.
- RVL-CDIP: Large-scale document image classification.
Crucially, the model underwent a multi-stage training process: unsupervised pretraining on a massive corpus of 1.1 million documents, followed by supervised pretraining on a diverse set of 21 tasks (including SQuAD and WikiTable Questions) to build a "general-purpose" reasoning foundation.
Key Insights and Ideas
- Generative is Better for Extraction: The shift to an encoder-decoder allows the model to handle "extractive" tasks more flexibly. For example, in DocVQA, TILT showed a massive improvement in "yes/no" questions (55.2 → 69.0) because it could simply generate the word "yes" rather than needing a specialized classification head.
- Relative Space Matters: The 2D relative attention bias proved to be the most significant modality in the ablation study. Knowing that "Total" is below a list of numbers is more useful than knowing its absolute X-Y coordinates.
- The "Case" for Augmentation: Surprisingly, removing "Case Augmentation" hurt performance more than removing vision or spatial augmentations. This suggests that models can easily overfit to the specific casing patterns (like all-caps headers) found in business documents.
- Visual Contextualization: Using a U-Net (Figure 5) to provide multi-scale visual features helps the model distinguish between similar-looking text that serves different functions based on its visual style or surrounding graphics.
Key Results
TILT achieved new state-of-the-art (SOTA) performance on two major benchmarks and highly competitive results on others:
| Dataset | Metric | TILT (Large) | Previous SOTA |
|---|---|---|---|
| DocVQA | ANLS | 87.05 | 86.72 (LayoutLMv2) |
| CORD | F1 | 96.33 | 96.06 (LAMBERT) |
| SROIE | F1 | 98.10 | 98.17 (LAMBERT) |
| RVL-CDIP | Accuracy | 95.52 | 95.64 (LayoutLMv2) |
The authors note that their SROIE results are essentially at the upper limit of the dataset due to inherent OCR mismatches in the test set.
Limitations and Future Work
- Decoding Overhead: Because TILT is an autoregressive encoder-decoder, generating long answers is computationally more expensive than simple sequence labeling. However, for most document tasks where answers are short, this overhead is negligible.
- Image-Rich Documents: The model performed slightly worse on the "image/photo" category of DocVQA. The authors attribute this to a lack of purely image-rich documents in their pretraining data.
- Parameter Count: The Large version of TILT is quite heavy (780M parameters). Future work could explore more efficient architectures or distillation to bring these capabilities to edge devices.
Summary updated