The name DeepSeek-OCR suggests a specialized document scanning tool. That framing undersells it. The real claim of this model is a new approach to long-context memory: instead of expanding your context window, compress what's already in it. Text gets rendered to an image, the image gets compressed to visual tokens, and those tokens replace the original text in the context window. At 10× compression on benchmark tests, it's the kind of efficiency gain that changes the cost calculus for multi-turn agents, long documents, and persistent memory systems.

DeepSeek published the model as open-source simultaneously with an AlphaArena trading competition win — it arrived alongside a concrete performance demonstration, which made the compression numbers immediately legible. The underlying idea has a name: Contexts Optical Compression (上下文光学压缩).

What Contexts Optical Compression Is

What's New

Transformer attention is O(n²). The more tokens in your context, the more compute each token requires from every other token. This is well understood. The less discussed problem is that text tokens are themselves inefficient as a representation format: expressing a single paragraph requires hundreds of tokens, each one a discrete unit that must participate in attention computation. Sparse attention, RoPE position encoding extensions, RAG — these all work around the problem without addressing the root cause.

DeepSeek-OCR addresses it differently. The pipeline:

  1. Render a segment of text as a formatted image — the kind of rendering you'd get from exporting a document page to PDF, then to PNG.
  2. Run that image through a vision encoder that compresses it to a small set of visual tokens.
  3. Feed those visual tokens directly into the LLM's context window as memory — not as OCR output to be re-tokenized as text, but as the compressed representation itself.

The model learns to extract meaning from this compressed visual representation directly. The training task looks like OCR — predict the original text — but the learned operation is something closer to visual memory retrieval. What enters the model is a bundle of spatial, typographic, and semantic information packed into a fraction of the token budget.

The Architecture: DeepEncoder + DeepSeek-3B-MoE

Architecture

The system has two core components.

DeepEncoder handles compression. It's approximately 380M parameters and processes images at up to 1024×1024 resolution. Its internal structure runs in three stages:

Processing a 1024×1024 image produces 256 visual tokens. The encoder also supports six resolution modes that trade token budget against fidelity: Tiny (64 tokens), Small, Base, Large, Gundam, and Gundam-M (1,853 tokens). The selection lets you tune compression aggressively — 64 tokens for something that would otherwise occupy 1,000+ text tokens — or keep more resolution for dense technical content.

DeepSeek-3B-MoE handles decoding. Visual tokens from DeepEncoder enter this language model, which was trained to reconstruct the original meaning from compressed visual representations. Total parameters: 3B. Active per inference: 570M (MoE routing keeps the rest idle). The model learns not just character recognition but structural reconstruction — tables, formulas, code, geometric notation — from highly compressed visual input.

What the Numbers Show

Benchmarks

The Fox benchmark evaluates long-context compression by measuring how much original text information survives at different compression ratios. DeepSeek-OCR compresses 1,000+ text tokens to under 100 visual tokens while maintaining recognition accuracy above 90%. The 10× headline figure holds across text types, not just clean prose.

On OmniDocBench (structured document understanding, English edit distance), DeepSeek-OCR outperforms current state-of-the-art models on both axes: it's more accurate, and it uses fewer tokens to get there. Competing models need 5,000–6,000 tokens to represent a structured document. DeepSeek-OCR does it under 2,000.

The output types are notable. Standard OCR produces text. DeepSeek-OCR can reconstruct:

This isn't just character recognition at a lower token cost. It's full structural recovery of the kind that makes the output immediately usable in downstream pipelines.

Gradient Forgetting: Memory That Fades Without Disappearing

There's one design decision in DeepSeek-OCR that deserves separate attention: how it handles context that's temporally distant.

For older content — earlier in the conversation, further from the current task — the system progressively lowers image resolution before compression. Less recent context is stored at lower fidelity: fewer tokens, reduced spatial resolution, less recoverable detail. But it doesn't disappear. It remains in the context window as a blurry representation, retrievable at the category or topic level even when fine details are gone.

The paper frames this explicitly as an analog to human memory: what you just read is clear; what you read an hour ago is hazy but present; what you read last week might surface as a vague impression. The model is given the same property — a context gradient where recency maps to resolution.

This is described as an upper-context gradient forgetting strategy. In practice, it means a long conversation or document session can fit into a realistic context window without the binary choice between keeping everything (expensive) or dropping old content entirely (lossy). The degradation is continuous and controlled.

What It Means for Developers

Developer Take

The most direct application is multi-turn agent memory. Agents that accumulate conversation history or document context currently face an escalating token cost with each turn. Contexts Optical Compression converts that linear growth into a compression regime: old turns get stored as visual tokens at progressively lower resolution, freeing context budget for new input without dropping history entirely.

For document-heavy workloads — contract review, financial report analysis, scientific literature synthesis — the compression ratio is directly translatable to cost and throughput. A 10× reduction in tokens means either 10× more documents per dollar or 10× longer documents at the same cost.

The structured output capability (HTML tables, SMILES, Markdown, geometric notation) is relevant for any pipeline that processes technical documents. Current approaches require dedicated parsers or multiple models for different content types. DeepSeek-OCR recovers structured representations from a single visual compression pass.

On deployment: the DeepEncoder is 380M params and runs efficiently. The DeepSeek-3B-MoE decoder activates 570M params per call. The full system is small enough to run on a single GPU for typical document batch processing, and the open weights mean it can be integrated directly into inference pipelines without API dependency.

The resolution mode selection (64–1,853 tokens) gives you a meaningful engineering knob. For coarse context management — "what was discussed in the first hour of this conversation?" — Tiny mode at 64 tokens may be sufficient. For detailed technical document recovery, Gundam-M at 1,853 tokens keeps structure intact. The model lets you make that tradeoff explicitly rather than accepting a fixed compression ratio.

Bottom Line

DeepSeek-OCR is less a document scanner than an argument about memory representation. Text tokens are verbose; visual tokens can carry equivalent information at a fraction of the count. The 10× compression on Fox, the OmniDocBench results, and the ability to recover chemical formulas and table structure from compressed visual representations all point toward the same thing: visual tokens are a more efficient substrate for certain categories of stored context.

The gradient forgetting mechanism makes this practical at scale — not a blunt compression that discards old context, but a continuous fading that preserves retrievable structure at reduced fidelity. Combined with open weights, the 3B MoE decoder, and the structured output capabilities, DeepSeek-OCR is a deployable building block for the kind of long-context memory that agentic systems actually need.

Resources


DeepSeek-OCR weights are available at huggingface.co/deepseek-ai/DeepSeek-OCR. Open-source.