Going Full-TILT Boogie on Document Understanding with Text-Image-Layout Transformer

Rafał Powalski, Łukasz Borchmann, Dawid Jurkiewicz, Tomasz Dwojak, Michał Pietruszka, Gabriela PałkaarXiv 2021

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:

  1. 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.
  2. Reading Order Sensitivity: They rely on a pre-defined reading order, which is often garbled in complex multi-column layouts.
  3. 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.
Comparison of TILT architecture vs. Vanilla Transformer and T5

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.
The U-Net backbone used for visual features

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

Abstract

We address the challenging problem of Natural Language Comprehension beyond plain-text documents by introducing the TILT neural network architecture which simultaneously learns layout information, visual features, and textual semantics. Contrary to previous approaches, we rely on a decoder capable of unifying a variety of problems involving natural language. The layout is represented as an attention bias and complemented with contextualized visual information, while the core of our model is a pretrained encoder-decoder Transformer. Our novel approach achieves state-of-the-art results in extracting information from documents and answering questions which demand layout understanding (DocVQA, CORD, SROIE). At the same time, we simplify the process by employing an end-to-end model.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
DocVQATILT-LargeANLS87.05+0.33 vs baselinesplit: test · fine-tuned
Source quote
L279: TILT-Large │ 96.33 │ 98.10 │ 87.05 │ 73.80 │ 95.52
CORDTILT-LargeF196.33+0.27 vs baselinesplit: test · fine-tuned
Source quote
L279: TILT-Large │ 96.33 │ 98.10 │ 87.05 │ 73.80 │ 95.52
WikiOpsTILT-LargeAccuracy73.80+14.3 vs baselinesplit: test · fine-tuned
Source quote
L279: TILT-Large │ 96.33 │ 98.10 │ 87.05 │ 73.80 │ 95.52
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
DocVQALayoutLMv2 baselineANLS86.72split: test
Source quote
L274: LayoutLMv2~\cite{xu2020layoutlmv2} │ 96.01 │ 97.81 │ 86.72 │ --- │ 95.64
CORDLAMBERT baselineF196.06split: test
Source quote
L275: LAMBERT \cite{garncarek2020lambert} │ 96.06 │ 98.17 │ --- │ --- │ ---
WikiOpsNeOp baselineAccuracy59.50split: test
Source quote
L276: NeOp \cite{Cho2018AdversarialTA} │ --- │ --- │ --- │ 59.50 │ ---
BibTeX
@misc{powalski2021going,
  author = {Rafał Powalski and Łukasz Borchmann and Dawid Jurkiewicz and Tomasz Dwojak and Michał Pietruszka and Gabriela Pałka},
  title = {{Going Full-TILT Boogie on Document Understanding with Text-Image-Layout Transformer}},
  year = {2021},
  eprint = {2102.09550},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2102.09550},
}

Loading related content...

Figure