[](https://huggingface.co/ErickvL)-
Despite newer architectures, DharmaOCR outperformed Mistral OCR4 and Unlimited-OCR on Brazilian Portuguese through domain specialization and targeted training. This article presents the evidence and the mechanism behind that advantage. Source
-
[
](#despite-newer-architectures-dharmaocr-outperformed-mistral-ocr4-and-unlimited-ocr-on-brazilian-portuguese-through-domain-specialization-and-targeted-training-this-article-presents-the-evidence-and-the-mechanism-behind-that-advantage)
Despite newer architectures, DharmaOCR outperformed Mistral OCR4 and Unlimited-OCR on Brazilian Portuguese through domain specialization and targeted training. This article presents the evidence and the mechanism behind that advantage.
Three months ago, we published a paper on DharmaOCR and open-sourced one of the models. The goal was clear: optical character recognition (OCR) built specifically for Brazilian Portuguese.
The training pipeline consists of two stages. The first stage is supervised fine-tuning, using a large volume of Portuguese documents from various sources, formats, and complexity levels. This stage aligns the model weights to the specific vocabulary, syntax, and document structures of Brazilian Portuguese—concentrating representation capacity on the target language rather than dispersing it across a broader multilingual space. The second stage applies Direct Preference Optimization (DPO): instead of learning only from correct transcriptions, the model learns from comparative preference data between candidate outputs, allowing it to consistently select better extraction results during inference. This stage addresses a different problem: not accuracy, but stability. By suppressing failure modes that cause generative models to output repetitive or incoherent content, DPO reduces inference time and cost, and significantly improves the reliability of the model’s deliverables in production environments.
The final combined effect is that the model achieved the highest extraction quality score and the lowest degradation rate on a Portuguese-focused benchmark. Both stages are indispensable. The fine-tuning stage establishes domain capability, while the DPO stage ensures this capability holds even under conditions where the model is most prone to failure.
OCR models are evolving rapidly. However, the gaps that originally prompted the creation of DharmaOCR—the gap in extraction quality on complex documents and the gap in model stability under production conditions—have not disappeared. Instead, as the field progresses, they have become even more revealing.
The popularity of multimodal generative models has made LLM-based OCR widely available; the subsequent wave of fine-tuned OCR variants reflects how quickly this adoption has occurred. However, this popularity does not change the fundamental properties of the technology. Any OCR system built on generative models is probabilistic. Transcription errors are an inherent variable in this probabilistic technology. The difference between models lies in how many errors they make and what types of errors they commit. This is determined by two things: the model structure (architecture and parameter size) and how these parameters are trained for the task.
Architecture and parameter size determine the upper limit of what a model can learn. The training method determines how these capabilities are allocated.
This distinction makes specialization a structural issue rather than a design preference. When a model is trained only on a limited domain—such as a single language, limited document types, or a specific task—all parameters are dedicated to that task. Conversely, when a model is trained to cover a broader domain—such as a multilingual model handling N languages—the same parameters must be distributed across all these domains. This allocation is not linear: the principle of superposition in neural networks means a single parameter can encode multiple features simultaneously. However, the allocation does exist, and its consequences are just as real. The wider the coverage of a model, the less investment it has in any single part.
DharmaOCR’s training objective is precisely to embrace this constraint in reverse. This model was not built to be the best choice for other languages, and it never was. In exchange, every available parameter in the network can be optimized toward the specific lexical, morphological, and orthographic patterns of Brazilian Portuguese—the most targeted use of model resources for this domain.
This centralization forms the foundation of its inherent advantage over multilingual models and broader-domain models. This advantage does not rely on a larger architecture or a more complex training pipeline than its competitors—new architectures and training techniques will enhance the capabilities of any model. It relies on where resources are directed: concentrated on a single domain rather than dispersed across multiple.
Three months later, newer models have emerged. Whether specialization still holds when these models are more modern and capable is another question.
Three months after the release of the DharmaOCR paper, two new OCR models have attracted widespread attention in the research community: Mistral OCR4 and Unlimited-OCR. Both represent genuine technical progress—new training techniques, new datasets, and strong performance across multiple languages and benchmarks. They are the kind of models that raise the bar for what OCR systems can deliver.
When we tested both on the DharmaOCR benchmark designed specifically for Portuguese, the results were very clear.
DharmaOCR scored 0.925. Mistral OCR4 scored 0.798. Unlimited-OCR scored 0.7587.
The gap is clear. Mistral OCR4 is about 13 percentage points lower than DharmaOCR; Unlimited-OCR is more than 16 percentage points lower. Both were released after our model and were backed by substantial research resources. On a task where DharmaOCR fundamentally focuses its attention entirely on Portuguese, the specialization advantage is measurable and significant.
The benchmark is the core finding. Next, we will explain why this gap takes this specific shape.
Processing non-trivial Portuguese documents reveals precisely where multilingual models are most prone to errors. ENEM essays (the Brazilian National High School Exam) combine handwritten text with vocabulary, proper nouns, and cultural references unique to Brazilian Portuguese. They are exactly the kind of documents where language-specific training pays off.
Figure 1: ENEM essay manuscript used for benchmark evaluation, and the outputs of each model. Misread parts are marked in red.
Mistral OCR4’s transcription of these documents turned the name of Chico Buarque (one of Brazil’s most widely known musicians) into…

