Chandra-OCR-2 MTP v2: Faster text recognition without VRAM growth
2 min readupdated
A new Multi-Token Prediction speculative head for the datalab-to/chandra-ocr-2 model that accelerates text generation and document recognition. The model uses frozen base weights and adds 15 optimized MTP (speculative prediction) tensors, increasing performance in vLLM, SGLang, and llama.cpp. Built on public document, handwritten text, and LaTeX formula datasets, the solution requires no extra GPU memory while fully preserving original generation quality.
Key features
- Zero VRAM overhead: Architecture with no extra video memory costs compared to the base model.
- Token acceptance length growth: Average token length on trusted domains grew from 2.8984 to 2.9949 (at K=4).
- Frozen teacher: Base weights of
datalab-to/chandra-ocr-2remained completely unchanged (0.00% target distribution deviation). - Public data training: Training was conducted exclusively on open document and handwritten text datasets.
What you can do
- Accelerate vLLM inference: Deploy the model with speculative generation support for high-volume document processing.
- Integrate into SGLang: Set up a high-performance text and table recognition pipeline.
- Convert to GGUF: Run the optimized model locally using
llama.cppand the--mtpflag.
Example
hf download Scientist42/chandra-ocr-2-mtp-dpace-v2 --local-dir ./chandra2-mtp-v2
python3 ./chandra2-mtp-v2/repack_chandra2_mtp_v2.py \
--base-model datalab-to/chandra-ocr-2 \
--mtp-safetensors ./chandra2-mtp-v2/model-mtp-dpace-v2.safetensors \
--out-dir ./chandra-ocr-2-mtp-v2-repackedRead more
DetailsBenchmarks (E[tau] gain at K=4): handwriting_forms (+0.1397), en_papers (+0.1303), de_docs (+0.0895), math_latex (+0.0842), tables_html (+0.0387).
Hardware requirements: 0 B of additional VRAM relative to base chandra-ocr-2.
License: AI Pubs Open RAIL-M (Modified) by Datalab.










Comments