DeepSeek-OCR turns text into images to reduce AI token use by seven to twenty times

12 Min Read
DeepSeek-OCR turns text into images to reduce AI token use by seven to twenty times

A smaller way to hold long documents

DeepSeek has released DeepSeek-OCR, a vision language system that converts long passages of text into images and recovers their contents when needed. The company reports reductions in token use of roughly seven to twenty times, depending on the settings and the type of document. At about ten times compression, reported decoding accuracy is around 97 percent.

Contents
  1. A smaller way to hold long documents
  2. Why tokens make long documents expensive
  3. How a page becomes a compact visual representation
  4. Inside DeepEncoder and its language model
  5. What the accuracy figures show
  6. Choosing a mode and processing at scale
  7. What this could change for AI products
  8. Where compression needs caution
  9. How developers can try the release
  10. Key Points

The release, available as of October 22, 2025, includes code and model weights for developers. Its target is a costly problem for artificial intelligence: reading and retaining large amounts of information without exhausting a model's memory or making responses too slow and expensive.

DeepSeek-OCR uses a vision encoder called DeepEncoder to turn pages, tables, charts and other layouts into compact sets of vision tokens. A language model called DeepSeek3B MoE A570M then decodes those tokens into text. The output can preserve document structure, including formatting and Markdown tables, or provide plain text.

Compression comes with a tradeoff. DeepSeek reports that decoding accuracy falls to about 60 percent around twenty times compression. Moderate settings offer a stronger balance between smaller inputs and faithful recovery, while aggressive settings leave more room for errors.

The system also targets document processing at scale. DeepSeek reports throughput of more than 200,000 pages a day on one Nvidia A100 GPU and roughly 33 million pages a day across a cluster of 20 similar servers. Those figures point to uses beyond reading individual PDFs, including digitizing document collections and producing training data.

Why tokens make long documents expensive

Language models process tokens, which are small pieces of language rather than whole pages or necessarily whole words. A short word may fit into one token. A longer word can be split into several, and punctuation also counts. A report that looks manageable to a person can therefore become thousands of tokens for a model.

Advertisement

The context window is the maximum number of tokens a model can consider at once. When a document exceeds that limit, a user may have to remove sections, split the material into smaller pieces or use a model designed for longer context, with higher costs.

Transformer models use attention mechanisms to connect information across their inputs. These mechanisms compare many pairs of tokens, so the work grows quickly as the input gets longer. More tokens also mean greater memory use and longer processing times, which can become expensive when a service handles many documents or conversations.

DeepSeek-OCR approaches that problem by representing a page through vision tokens instead of carrying all its text as ordinary language tokens. A vision encoder reads the page image and creates a compact representation that a decoder can turn back into structured text.

The proposed benefit is a cheaper memory layer for long sessions and large files. Earlier material could be retained in compact visual form, with details recovered when needed. That could expand the effective amount of context an AI system can use beyond what fits as text alone, although encoding and decoding add their own work.

How a page becomes a compact visual representation

DeepEncoder begins with images of document pages. Vision encoders divide images into patches, then represent those patches as tokens. DeepSeek's architecture adds a compression stage before passing the resulting features to the language model.

An example in the technical notes starts with an image measuring 1,024 by 1,024 pixels. That image initially produces 4,096 patch tokens, which the compression block reduces to 256 tokens. A dense page that would otherwise require 1,500 or more text tokens can then be represented by a much smaller visual input.

The two reductions describe different parts of the process. Compressing 4,096 image patch tokens to 256 shrinks the visual representation inside the encoder. Comparing those 256 vision tokens with the page's text token count shows the potential saving when the document enters the language processing system.

Advertisement

Page images also retain information that can be awkward to express as a simple stream of text. Columns, table cells, equations and diagrams have positions and relationships on the page. Keeping that layout available helps the decoder reconstruct structure alongside words and avoids some difficulties caused by splitting text into language tokens.

The cost is an extra conversion process and, at higher compression, a gradual loss of precision. The practical choice is how small to make the representation while preserving the details a particular task requires.

Inside DeepEncoder and its language model

DeepEncoder combines local perception with a broader understanding of a page. A Segment Anything Model backbone handles fine details such as regions and edges. A CLIP style module contributes a wider understanding of meaning and layout. A convolutional compressor between them reduces the number of vision tokens before the information reaches the language model.

Different resolution modes allow developers to adjust the token budget to the page. A simple slide can use relatively few tokens, while a crowded newspaper page or dense scientific figure may require more detail.

The decoder, DeepSeek3B MoE A570M, uses a Mixture of Experts architecture. It has a design of about three billion parameters, with approximately 570 million active for each token. Parameters are the numerical settings learned during training. Expert routing selects parts of the model for processing, reducing the computation needed compared with activating the full model for every token.

The system supports multilingual optical character recognition, or OCR, which turns text in images into machine readable text. It can also interpret diagrams, chemical structures and geometric figures. Its outputs include plain text, Markdown with preserved structure, and data extracted from tables and charts into formats that software can process.

Training used about 30 million PDF pages in close to 100 languages, alongside synthetic data for charts, formulas and figures. That mix supports a task broader than recognizing individual characters: recovering the relationships among words, numbers and visual elements across different kinds of documents.

What the accuracy figures show

DeepSeek reports around 97 percent decoding accuracy at compression ratios under ten times, with roughly the same headline figure near the ten times point. At around twenty times compression, accuracy falls to about 60 percent. The smaller representation saves tokens, but the recovered content becomes less reliable.

Advertisement

A focused benchmark also includes examples in which 100 vision tokens represent documents that would otherwise consume 700 to 800 text tokens, while precision stays around 97 percent. Those examples illustrate why the useful compression level depends on the document and the task, rather than a single setting that works equally well for every page.

On OmniDocBench, a document understanding benchmark, DeepSeek-OCR is reported to outperform well known OCR systems while using fewer tokens. Token requirements vary by document category. Slides and simple brochures may need around 64 vision tokens per page; magazines and newspapers with several columns and images can require several hundred.

Developers can choose whether to retain formatting or strip it from the output. Preserving the arrangement matters when the position of a number identifies its column or when a heading explains the text beneath it. Plain text can be enough for tasks focused on finding words or searching document contents.

Names, numbers and legal clauses require especially careful handling because even a small error can change their meaning. The reported accuracy levels make compression settings a practical decision about how much detail a workflow needs to recover, with more conservative settings for material requiring near perfect reproduction.

Choosing a mode and processing at scale

DeepSeek-OCR provides Tiny, Small, Base and Large presets, plus a dynamic mode for especially complex pages. Each preset balances image size against the number of tokens used. DeepSeek recommends starting with Small for typical pages and increasing the resolution when the content is dense or the layout is difficult.

Simple slides can therefore receive a smaller budget than scientific pages filled with formulas or documents containing complicated tables. Dynamic mode offers another option when a fixed preset is a poor fit for a page's complexity.

DeepSeek's operational claims put throughput at more than 200,000 pages per day on a single Nvidia A100 GPU. The team also gives a figure of roughly 33 million pages daily for a cluster of 20 similar servers. These are the company's reported processing figures; performance planning still requires measurements on the documents and equipment a team intends to use.

Advertisement

High throughput matters for digitization and training data generation. Processing hundreds of thousands of pages per GPU each day could help turn large document collections into searchable text or structured examples for language and vision models.

The release includes training and inference code, together with model weights, under a permissive license covering academic and commercial use. Access to both the implementation and the learned model settings lets developers experiment with the compression process and build document processing pipelines around it.

What this could change for AI products

Long conversations and chains of documents can push AI assistants against their context limits. A possible use for DeepSeek-OCR is to compress earlier conversation turns or document pages into images, keep their compact vision representations, and decode details when a later request needs them.

That approach could keep the active text context smaller while retaining access to facts, citations and layouts from earlier work. Tables and mathematical content are particularly relevant because their meaning can depend on arrangement as much as on the words and symbols themselves.

An assistant working with full length PDFs, contracts or spreadsheets could retain a compact representation and restore selected sections with their structure. Extracting rows from a table or recovering a figure caption would rely on reconstructing the relevant content rather than carrying every part of the original document as text throughout the session.

Enterprise search is another possible application. A system could index compact page representations and decode snippets when a user requests them. Finance, healthcare and science, where forms and charts are common, could use the same document processing capabilities to support digitization.

Training data generation carries its own quality concern. Small decoding mistakes can become incorrect labels when outputs are used to train another model. At the reported processing scale, checking accuracy is part of making the resulting data useful, especially where numbers, formulas or specialist documents are involved.

Where compression needs caution

Higher compression reduces fidelity. A workflow that tolerates minor transcription mistakes may accept a smaller token budget, while one handling exact names, amounts or contractual wording needs more conservative settings. Critical pages can be assigned lower compression, with aggressive compression reserved for material that does not require exact reproduction.

Advertisement

Reasoning adds another question. Models trained to reason over text receive different representations when information arrives through vision tokens. The decoder must reconstruct the text before reasoning over it, and that extra step may affect tasks involving several linked deductions. Teams need to test those tasks when important context sits in the visual layer and provide alternatives where precision is essential.

Encoding and decoding also take time. The expected savings become relevant as documents or conversations grow longer, so deployment tests should compare elapsed time, memory use and cost across several document types. Those measurements can guide when to compress content and when to pass the original text directly.

Storage and retrieval systems may also need changes when images or representations stored as tensors take the place of raw text. Compliance processes must account for those formats. Sensitive information still requires access controls, encryption and audit trails wherever the compressed content is kept.

Low resolution scans and messy handwriting remain challenging. Choosing modes dynamically and using human review are prudent options for critical work. The release points toward cheaper long context processing, while the accuracy and infrastructure requirements make testing on actual workloads essential to deployment decisions.

How developers can try the release

The Hugging Face model page provides model cards, quick start notes and downloads. The GitHub repository provides code and weights, along with scripts for batch processing and throughput guidance.

The reference setup lists Python 3.12.9 and CUDA 11.8. Its dependencies include PyTorch, Transformers, Tokenizers, Einops, Addict, Easydict and Flash Attention. An Nvidia GPU is recommended for speed.

A typical workflow converts a PDF into page images, sends each image through DeepEncoder at a chosen resolution, and uses the language model to decode the vision tokens. The output can be plain text for search or Markdown that retains tables and section headings.

Small mode is the recommended starting point for standard business documents. Dense scientific or legal pages may benefit from higher resolution or dynamic mode. Developers should monitor recovery accuracy as they increase compression and keep critical pages at conservative settings.

Key Points

  • DeepSeek-OCR represents document pages through compact vision tokens, then decodes them into text and structured output.
  • DeepSeek reports token reductions of roughly seven to twenty times, depending on settings and document complexity.
  • Reported decoding accuracy is around 97 percent near ten times compression and about 60 percent around twenty times.
  • DeepEncoder works with a Mixture of Experts decoder containing about three billion parameters, with roughly 570 million active per token.
  • Training used about 30 million PDF pages in close to 100 languages, plus synthetic material for charts, formulas and figures.
  • Reported throughput exceeds 200,000 pages daily on one Nvidia A100 GPU and reaches roughly 33 million pages daily across 20 similar servers.
  • Code and weights are available under a permissive license for academic and commercial use.
  • Potential uses include document digitization, training data generation and cheaper long context memory, with careful accuracy checks for critical material.
Share This Article

You May also Like