NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DocTr: Document Transformer for Structured Information Extraction in Documents

Haofu Liao, Aruni RoyChowdhury, Weijian Li, Ankan Bansal, Yuting Zhang, Zhuowen Tu, Ravi Kumar Satzoda, R. Manmatha, Vijay Mahadevan · DOI

Introduction

Extracting structured data from visually rich documents (VRDs)—such as invoices, receipts, and forms—remains a significant challenge in the field of document AI. Unlike standard natural language processing, which operates on linear text sequences, VRD extraction requires a deep understanding of both linguistic content and spatial layout.

Existing approaches typically rely on two paradigms: IOB (Inside-Outside-Beginning) tagging and graph-based methods. IOB tagging is highly sensitive to the "reading order" generated by Optical Character Recognition (OCR) engines; if the text is serialized incorrectly (e.g., reading across columns), the sequence-based labels fail. Graph-based methods, while more flexible, often involve complex node-link predictions that are computationally expensive and difficult to decode.

DocTr (Document Transformer) addresses these limitations by reformulating structured information extraction (SIE) as a detection-based task, inspired by anchor-based object detection in computer vision.

Methodology

Anchor-Based Formulation

Instead of tagging every word in a sequence, DocTr identifies a single anchor word for each entity (typically the first word). The model then predicts a bounding box that encompasses the entire entity and establishes links between these anchors to represent semantic relationships (e.g., linking a "Total" label to its corresponding numerical value). This formulation significantly reduces the model's dependency on the specific order in which OCR tokens are serialized.

Architecture: Vision-Language Decoder

DocTr utilizes a vision-language encoder-decoder architecture. A key innovation is the Language-Conditioned Query (LCQ) mechanism. Unlike standard transformers that use generic, learned queries in the decoder, DocTr maps each query explicitly to a specific OCR token. This one-to-one correspondence simplifies the matching process between predicted entities and the underlying document text.

To maintain efficiency while processing high-resolution document images, the vision encoder utilizes a Deformable DETR-style architecture. This allows the model to focus on relevant spatial regions without the quadratic computational overhead associated with standard global self-attention.

Masked Detection Modeling (MDM)

The authors propose a novel pre-training task called Masked Detection Modeling (MDM). While traditional pre-training might only mask text tokens, MDM masks both the text and its associated bounding box. This forces the model to reconstruct the missing information using the surrounding visual and linguistic context, effectively teaching the model the spatial "grammar" of documents—such as the typical positioning of prices relative to product descriptions.

Experimental Results

DocTr was evaluated on several key benchmarks, including CORD (receipts), FUNSD (noisy forms), and the massive IIT-CDIP dataset for pre-training.

State-of-the-Art Performance

DocTr achieved superior results across multiple tasks:

  • Receipt Parsing (CORD): Reached an F1 score of 94.4, surpassing established models like LayoutLMv3 (92.2) and BROS (91.8).
  • Entity Linking (FUNSD): DocTr demonstrated a massive improvement in entity linking, achieving an F1 of 73.9. This represents a significant leap over previous graph-based state-of-the-art models like SPADE, which reached 41.7.

Robustness to Reading Order

A critical advantage of DocTr is its resilience to chaotic OCR outputs. In experiments where input text was shuffled, DocTr's performance dropped by only 0.6% when moving from perfect "oracle" ordering to a standard "raster scan" order. In contrast, traditional IOB and graph-based methods showed much steeper declines in accuracy under the same conditions.

Discussion and Insights

Ablation studies conducted by the authors highlight a clear division of labor within the model: the language encoder is primarily responsible for identifying which words serve as anchors, while the vision encoder is essential for the precise regression of bounding boxes.

Furthermore, the success of MDM suggests that spatial context is just as important as linguistic context in document understanding. By learning to predict where an entity should be located even when its text is hidden, the model develops a robust internal representation of document structures.

Limitations and Future Work

While DocTr represents a significant advancement, the authors note several areas for future exploration:

  • Text-Centric Design: The anchor-word approach is optimized for documents where text is the primary carrier of information. It may require adaptation for documents that rely heavily on non-textual symbols or logos.
  • Anchor Selection: The current heuristic of using the first word as an anchor could be refined. Future iterations might explore learned anchor selection to handle more complex entity structures.
  • Non-Textual Elements: Extending the framework to extract and link non-textual elements, such as checkboxes and signatures, remains an open area for research.

Conclusion

DocTr shifts the paradigm of structured information extraction from fragile sequence tagging to a robust, detection-based framework. By leveraging language-conditioned queries and a novel masked detection pre-training task, DocTr sets new benchmarks for accuracy and robustness in the automated processing of visually rich documents.

Summary updated

BibTeX
@misc{liao2023doctr,
  author = {Haofu Liao and Aruni RoyChowdhury and Weijian Li and Ankan Bansal and Yuting Zhang and Zhuowen Tu and Ravi Kumar Satzoda and R. Manmatha and Vijay Mahadevan},
  title = {{DocTr: Document Transformer for Structured Information Extraction in Documents}},
  year = {2023},
  eprint = {2307.07929},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.07929},
}
Figure