# UDOP: Unifying Vision, Text, and Layout for Universal Document Processing

> Research note on UDOP, a universal document processing model that unifies vision, text, and layout modalities in a single framework.

- Authors: Hunter Heidenreich
- Published: 2022-12-05
- Updated: 2026-03-04
- Paper: UDOP paper <https://arxiv.org/abs/2212.02623>
- Paper: CVPR proceedings <https://openaccess.thecvf.com/content/CVPR2023/html/Tang_Unifying_Vision_Text_and_Layout_for_Universal_Document_Processing_CVPR_2023_paper.html>
- Code: microsoft/i-Code (UDOP) <https://github.com/microsoft/i-Code/tree/main/i-Code-Doc>
- Model: microsoft/udop-large <https://huggingface.co/microsoft/udop-large>
- Model: microsoft/udop-large-512 <https://huggingface.co/microsoft/udop-large-512>
- Model: microsoft/udop-large-512-300k <https://huggingface.co/microsoft/udop-large-512-300k>
- Source: Bevaya Labs, <https://labs.bevaya.ai/>

---


## What kind of paper is this?

-   This is a foundational model paper in the domain of Document AI.
-   It introduces a universal framework for multimodal document processing,
    unifying text, vision, and layout modalities.
-   It solves multiple tasks with a single model architecture using generative
    pretraining for tasks like document classification, layout analysis, and
    question answering.

## What is the motivation?

-   The motivation is to address the challenges of processing documents with
    multimodal content (text, images, layout) efficiently.
-   It aims to unify multiple tasks and modalities under a single model to
    improve document processing tasks across diverse domains.
-   The potential impact is significant, providing a foundation model for
    document AI that could revolutionize tasks like document understanding,
    classification, and customization.

## What is the novelty?

-   Relevant work includes vision-language models and document AI models like
    LayoutLM and TILT, which integrate vision and text but treat modalities
    separately or with limited fusion.
-   The contribution is a unified framework (Vision-Text-Layout Transformer)
    that effectively fuses vision, text, and layout modalities into a single
    representation for all tasks.
-   It introduces novel self-supervised and supervised pretraining objectives,
    showing superior performance on several document AI tasks.

## What experiments were performed?

-   **Theory**: The paper presents a novel architecture (VTL Transformer) and
    joint pretraining objectives, introducing layout-induced vision-text
    embeddings.
-   **Experiments**: It evaluates the model on several benchmarks like FUNSD,
    CORD, and DocVQA, achieving state-of-the-art results on 8 Document AI tasks.
-   It also demonstrates unique capabilities like high-quality document
    generation and editing, which have not been achieved in prior Document AI
    models.

## Dataset

-   **IIT-CDIP**: A large-scale dataset containing 11 million scanned documents
    with token-level OCR bounding boxes.
-   Supervised datasets used include: **FUNSD** (entity recognition), **CORD**
    (key information extraction), **RVL-CDIP** (document classification), and
    **DUE-benchmark**, which comprises 7 datasets such as **DocVQA**,
    **InfoVQA**, **KLC**, **PWC**, **DeepForm**, **WTQ**, and **TabFact**.

## Methodology Highlights

-   **Layout-Induced Vision-Text Embeddings**: Combines image patches with word
    tokens using bounding box information to enforce interaction between text
    and visual modalities. Image patches without text are concatenated to the
    sequence.
-   **Position Bias**: Applies 2D relative attention based on bounding boxes for
    text; no 1D sequence bias is used.
-   **Vision-Text-Layout (VTL) Transformer**: Unified model architecture with a
    text-layout decoder (producing tokens with discrete layout) and a vision
    decoder (masked autoencoder for pixel generation).
-   **Pretraining Objectives**:
    -   **Joint Text-Layout Reconstruction**: Mask part of the text and
        regenerate both the text content and layout.
    -   **Layout Modeling**: Predict the location of groups of text tokens.
    -   **Visual Text Recognition**: Predict text present at a given location.
    -   **Masked Image Reconstruction**: Reconstruct pixel values from text and
        layout with cross-attention to raw character embeddings.
-   **Supervised Objectives**: Include document classification, layout analysis,
    information extraction, question answering, and document NLI.

## Training Details

-   **Optimizer**: Adam, peak learning rate of 5e-5 with 1000 warmup steps,
    weight decay of 1e-2 (possibly AdamW).
-   **Batch Size**: 512.
-   **Epochs**: 3 epochs total, one for each resolution stage (224, 512, 1024).
-   **Curriculum Learning**: Training starts at 224 resolution and scales up to
    1024 resolution over epochs.

