DeepSeek-OCR 2#

A document understanding model released by DeepSeek in 2026. Its core innovation is DeepEncoder V2, which uses cascaded causal reasoning to achieve 1D understanding of 2D images.


Core Innovation#

Visual Causal Flow#

Traditional vision encoders scan an image in a fixed order (top-left to bottom-right), while human reading follows semantically driven causal logic. DeepSeek-OCR 2 simulates this causal flow with DeepEncoder V2:

  • Visual tokens: bidirectional attention (preserves a global receptive field)
  • Causal flow queries: causal attention (learnable reordering tokens)
graph LR
    A[Image] --> B[Vision Tokenizer]
    B --> C[Visual Tokens]
    C --> D[DeepEncoder V2]
    D --> E[Causal Flow Queries]
    E --> F[DeepSeek-MoE Decoder]
    F --> G[Output]

Architecture#

ComponentDescription
Vision TokenizerSAM-base + conv layers (80M params), 16x token compression
DeepEncoder V2Based on Qwen2-0.5B, replacing the original CLIP
DecoderDeepSeek-MoE 3B (500M active)
Output token count256-1120 (on par with Gemini-1.5 Pro)

Technical Details#

Attention Mask#

┌─────────────────────┬─────────────────────┐
│  Bidirectional attn │  Causal attn        │
│  (visual tokens)    │  (causal queries)   │
│  all-ones matrix    │  lower-triangular   │
└─────────────────────┴─────────────────────┘
  • Among visual tokens: fully visible in both directions (ViT-like)
  • Causal flow queries: can only see preceding tokens (LLM-decoder-like)
  • Each query can attend to all visual tokens plus preceding queries

Cascaded Causal Reasoning#

  1. Encoder: semantically reorders visual tokens via causal flow queries
  2. Decoder: performs autoregressive reasoning over the reordered sequence

This design bridges the gap between “2D spatial structure” and “1D causal language modeling”.


Performance#

  • Significant improvement over DeepSeek-OCR on OmniDocBench v1.5
  • Much stronger visual reading-order logic
  • Retains high-ratio token compression efficiency