SevenTnewS

Domain specialization

A six-month-old OCR model still beats Mistral. The reason is hard to fix.

DharmaOCR scores 0.925 on a Portuguese benchmark versus 0.798 for Mistral OCR4 and 0.7587 for Unlimited-OCR. The gap comes from concentrated training allocation and a DPO-based approach that suppresses text degeneration in complex documents.

Emmanuel Fabrice Omgbwa Yasse AI-assisted

2026-07-16 · Last updated: 2026-07-17 · 4 min read

A six-month-old OCR model still beats Mistral. The reason is hard to fix.

Three months after publishing a paper on DharmaOCR, the authors are back with a follow-up. Newer models have arrived, running on newer architectures with substantial resources behind them. On the same Portuguese-focused benchmark, DharmaOCR still leads by about 13 to 16 percentage points over Mistral OCR4 and Unlimited-OCR. The lesson is simple but easy to miss: you cannot outspend the No Free Lunch theorem. See also Mistral's own benchmark audit.

This is not a claim that the model's architecture is better. It is a controlled demonstration of a structural dynamic that holds regardless of hardware generation. When a fixed pool of parameters concentrates on a single language rather than spreading across many, the model extracts more performance from that domain. The gap, measurable and consistent, is the empirical signature of that dynamic. The principle echoes what Anthropic found on the factory floor: narrow beats general.

How the pipeline works

DharmaOCR trains in two stages. The first is supervised fine-tuning on a broad collection of Portuguese-language documents: invoices, exams, handwritten notes, official forms. This stage orients the model's representational capacity toward the vocabulary, morphology, and orthographic patterns of Brazilian Portuguese. The second stage applies Direct Preference Optimization. This trains the model to prefer coherent full-text extractions over incomplete or repetitive ones, rather than optimizing for single-token accuracy. The result is a model that reads Portuguese well and stays stable when the input signal degrades.

In the original benchmark, extraction quality and degeneration rate were measured at the same time. DharmaOCR had the highest quality score in its class with the lowest rate of repetitive or incoherent output. The new comparison tests whether that position holds against models released after it, using the same evaluation protocol.

Graphique : Portuguese OCR Benchmark Scores
DharmaOCR leads by 13 to 16 percentage points over Mistral OCR4 and Unlimited-OCR on the Portuguese OCR benchmark.

Benchmark results

The headline numbers on the Portuguese benchmark:

ModelScore
DharmaOCR0.925
Mistral OCR40.798
Unlimited-OCR0.7587

The difference is not small. Mistral OCR4 falls roughly 13 points short. Unlimited-OCR falls more than 16. Both were released after DharmaOCR, both demonstrate strong multilingual capability, and both miss the linguistic signals that define the target domain.

What the errors reveal

Take an ENEM essay, Brazil's national high school examination, that contains the name of musician and poet Chico Buarque. Mistral OCR4 transcribed it as "Chico Barque." Unlimited-OCR rendered the same name as "chico bique." A quotation from the same essay, "O Brasil não exclui, assimila," turned into "a dose de chico bique, 'o Brasil no exclu, eliminila." These are not random corruptions. They happen precisely at the vocabulary and proper nouns that distinguish Brazilian Portuguese from the broader multilingual corpus. A model trained on enough Portuguese does not make these errors because its resources were specifically allocated to that lexical space.

The second failure mode is more damaging operationally: text degeneration. When a generative model that relies on next-token prediction hits a document of poor visual quality, small fonts, or degraded scans, it can lose its grounding and produce output with no relationship to the source. In the comparison, Mistral OCR4 produced entirely disconnected text on such inputs. The output is not just inaccurate. It is structurally unusable for downstream tasks like classification or information extraction.

DharmaOCR handles the same documents correctly because its DPO stage explicitly penalizes loss of coherence at the extraction level. The model learned to discriminate between complete, stable outputs and drifting ones. SFT alone does not provide that training signal. This mirrors the approach the M3 team used to stop their math verifier from cheating: the loss function encodes what the model should avoid, not just what it should hit.

The structural logic

The authors argue the advantage is not a permanent crown but a demonstration of principle. As architectures improve and training techniques advance, the absolute ceiling on performance rises for all models. What does not change is the allocation constraint. Finite parameters must go somewhere. A system that concentrates them on one domain will outperform a system that distributes them across many, regardless of how capable the generalist has become. This is the No Free Lunch theorem applied to OCR specialization. It is the same reason coding agent productivity is measured in human hours saved, not benchmark scores: the metric that matters is the one tied to the specific job.

Better tools do not undermine the case. They expand what specialization can achieve. The next iteration of DharmaOCR will adopt newer architectures and training methods, but always with the same focused objective. If Mistral wants to close the gap, it needs more than faster GPUs. It needs to decide whether it is building an OCR model for every document in the world or a great one for the documents a particular user actually has.

Get the tech essentials in 3 minutes every morning

One email, every weekday, with what actually matters in AI and tech.