TL;DR
This paper introduces DODO, a novel diffusion model for Optical Character Recognition (OCR) that significantly speeds up text extraction from documents. By breaking down the generation process into smaller, manageable blocks, DODO overcomes the inherent limitations of standard diffusion models for the rigid, deterministic nature of OCR, achieving near state-of-the-art accuracy with up to 5x faster inference.
What Problem Does This Paper Address?
Modern Vision-Language Models (VLMs) have made great strides in document understanding and OCR. However, most rely on autoregressive decoding, which processes text token by token sequentially. This approach becomes a major bottleneck for long documents, leading to slow inference times. While diffusion models offer a promising alternative for parallel generation, existing methods struggle with OCR's strict requirement for an exact, immutable output sequence. Standard diffusion models can introduce structural instabilities (like incorrect token placement or length mismatches) that are easily corrected in flexible tasks like image captioning but are catastrophic for OCR, leading to fractured or hallucinated text.
Methods
The core innovation of DODO lies in its use of block discrete diffusion. Instead of trying to denoise the entire document sequence at once (global diffusion), DODO decomposes the task into a series of smaller, causally anchored blocks. This means the model processes the document in chunks, with each block attending to previously generated blocks. This "block-causal" approach ensures local alignment and allows for dynamic length adaptation without the need for a perfect global estimate.
Key techniques include:
- Block Discrete Diffusion: The generation process is partitioned into contiguous blocks of tokens. The model learns to generate each block conditioned on the preceding ones.
- Block-Causal Attention: This ensures that tokens within a block can attend to each other bidirectionally, but attention from previous blocks to the current one is masked. This allows for exact KV-caching, significantly improving efficiency.
- Bidirectional Attention Across Blocks: Unlike autoregressive models, DODO can leverage bidirectional attention across blocks, which helps improve accuracy by allowing for larger effective block sizes.
Datasets
The paper uses the olmOCR-mix-1025 dataset for training, which is a large-scale dataset of approximately 270,000 document-text pairs derived from PDFs, covering diverse document types.
For evaluation, they use:
- OmniDocBench: A comprehensive testbed for layout-sensitive transcription with 290 English documents across various types, including text, tables, and formulas.
- Fox-Page-EN: A dataset of 112 document pages focused on pure text transcription.
Key Insights and Ideas
- OCR's Determinism is a Double-Edged Sword: While OCR's highly deterministic nature (visual input strictly dictates output) makes it theoretically well-suited for parallel decoding, it also makes it extremely sensitive to errors that are benign in other tasks.
- Global Diffusion is Brittle for OCR: Standard masked diffusion models, with their fixed-length canvas and carry-over unmasking, introduce positional and length errors that are irrecoverable in the rigid OCR setting, leading to fractured outputs.
- Block Diffusion as a Structural Remedy: Decomposing the OCR task into blocks provides the necessary "structural safety rails" to harness the benefits of parallel decoding without sacrificing accuracy.
- KV-Caching is Crucial for Efficiency: The block-causal attention mechanism enables exact KV-caching, which is a key driver of DODO's significant speedup over autoregressive models.
- Bidirectional Attention Across Blocks Unlocks Scalability: The ability to use bidirectional attention across blocks, a feature unique to diffusion models, allows for larger block sizes and improved accuracy, pushing the usable block size to 256 tokens.
Key Results
- Accuracy: DODO achieves near state-of-the-art accuracy, with an NED of 0.069 on OmniDocBench, significantly outperforming previous diffusion-based VLMs and being competitive with specialized OCR models and autoregressive VLMs.
- Inference Speed: DODO achieves up to 5x faster inference compared to autoregressive baselines, reaching approximately 104 tokens/sec. This speedup is attributed to parallel decoding and efficient KV-caching.
- Block Size Impact: The paper demonstrates that increasing block size improves throughput and accuracy up to a point (B=256), after which performance degrades due to renewed synchronization issues.
- Document Length Advantage: DODO's advantage over autoregressive models grows with document length, showing a significant benefit for long documents.
Limitations and Future Work
- Static History with KV-Caching: The reliance on exact KV-caching enforces a static history. This limits accuracy at larger block sizes compared to a fully bidirectional variant.
- Future Work: The authors suggest exploring diffusion samplers specifically tailored for OCR and bridging the gap between static history and bidirectional variants to improve accuracy at larger block sizes.
Summary updated