Newer Models, Same Advantage
Newer Models, Same 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. 尽管出现了更新的架构,DharmaOCR 凭借领域专业化和针对性训练,在巴西葡萄牙语任务上依然超越了 Mistral OCR4 和 Unlimited-OCR。本文将展示相关证据及其背后的优势机制。
Three months ago, we published a paper on DharmaOCR and open-sourced one of the models. The objective was specific: optical character recognition engineered for Brazilian Portuguese. The training pipeline was built in two stages. The first was a supervised fine-tuning step, drawing on a broad collection of Portuguese-language files from different sources, formats, and levels of complexity. This stage aligned the model’s weights to the specific vocabulary, syntax, and document structures of Brazilian Portuguese — concentrating representational capacity on the target language rather than distributing it across a broader multilingual space. 三个月前,我们发布了关于 DharmaOCR 的论文并开源了其中一个模型。我们的目标非常明确:为巴西葡萄牙语量身定制光学字符识别(OCR)技术。训练流程分为两个阶段。第一阶段是监督微调,利用了来自不同来源、格式和复杂程度的广泛葡萄牙语文件。这一阶段将模型的权重与巴西葡萄牙语特定的词汇、语法和文档结构对齐,将表征能力集中在目标语言上,而不是将其分散到更广泛的多语言空间中。
The second stage applied Direct Preference Optimization: rather than training only on correct transcriptions, the model learned from comparative preference data between competing outputs, teaching it to consistently select the better extraction at inference time. This stage addressed a different problem: not accuracy, but stability. By suppressing the failure modes that cause generative models to produce repetitive or incoherent output, DPO reduced inference time and cost, and materially improved the reliability of what the model delivered in production. The combined result was a model that achieved the highest extraction quality score with the lowest degeneration rate on a Portuguese-focused benchmark. Both stages were necessary. The fine-tuning stage built domain competency; the DPO stage ensured that competency held under the conditions where models tend to fail. 第二阶段应用了直接偏好优化(DPO):模型不再仅仅通过正确的转录进行训练,而是从竞争输出之间的比较偏好数据中学习,从而教导模型在推理时始终选择更好的提取结果。这一阶段解决了一个不同的问题:不是准确性,而是稳定性。通过抑制导致生成模型产生重复或不连贯输出的失败模式,DPO 降低了推理时间和成本,并实质性地提高了模型在生产环境中的可靠性。综合结果是,该模型在以葡萄牙语为中心的基准测试中,以最低的退化率实现了最高的提取质量得分。这两个阶段缺一不可:微调阶段建立了领域能力,而 DPO 阶段确保了这种能力在模型容易出错的情况下依然稳固。
OCR models have been moving quickly. But the gaps that originally motivated DharmaOCR’s design (in extraction quality on complex documents and in model stability under production conditions) have not closed. They have, if anything, become more instructive as the field has changed. The proliferation of multimodal generative models made language model-based OCR widely accessible, and the wave of fine-tuned OCR variants that followed reflects how fast that adoption has moved. That proliferation has not, however, changed the fundamental character of the technology. Every OCR system built on a generative model is probabilistic. Transcription errors are an inherent variable of this probabilistic technology. What differentiates models is how many errors they make and of what kind. That is determined by two things: the structure of the model (its architecture and parameter count) and how those parameters were trained for the task. OCR 模型的发展日新月异。但最初促使 DharmaOCR 设计的那些差距(在复杂文档的提取质量和生产环境下的模型稳定性方面)并未缩小。随着该领域的变革,这些差距反而变得更具启发性。多模态生成模型的激增使得基于语言模型的 OCR 变得触手可及,随之而来的微调 OCR 变体浪潮反映了这种技术普及的速度。然而,这种激增并没有改变该技术的本质特征。每一个基于生成模型的 OCR 系统都是概率性的。转录错误是这种概率技术固有的变量。模型之间的区别在于它们产生错误的数量和类型。这由两件事决定:模型的结构(架构和参数量)以及这些参数如何针对任务进行训练。
Architecture and parameter count establish the ceiling on what a model can learn. Training determines how that capacity is allocated. This distinction is where specialization becomes a structural question rather than a design preference. When a model is trained on a restricted domain — a single language, a bounded document type, a specific task — All of its parameters are dedicated to that specific task. When a model is trained to cover a broader range of domains — a multilingual model handling N languages, for instance — those same parameters must be distributed across all of them. The distribution is not linear: the neuron superposition principle means individual parameters can encode multiple features simultaneously. But the division is real, and its consequences are real. A model covering more ground commits less to any given part of it. 架构和参数量决定了模型学习能力的上限。训练则决定了这种能力如何分配。这种区别使得“专业化”成为一个结构性问题,而非仅仅是设计偏好。当模型在受限领域(单一语言、特定文档类型或特定任务)进行训练时,其所有参数都致力于该特定任务。当模型被训练以覆盖更广泛的领域(例如处理 N 种语言的多语言模型)时,相同的参数必须分配给所有这些领域。这种分配不是线性的:神经元叠加原理意味着单个参数可以同时编码多个特征。但这种划分是真实的,其后果也是真实的。一个覆盖范围更广的模型,在任何特定部分投入的资源就越少。
DharmaOCR was trained to accept that constraint in reverse. The model is not designed to be the best option for other languages, and was never intended to be. In exchange, every parameter available to the network could be oriented toward the specific vocabulary, morphology, and orthographic patterns of Brazilian Portuguese — the most directed possible use of the model’s resources for that domain. That concentration is the structural basis of an inherent advantage over multilingual and broader-domain models. The advantage does not depend on having a larger architecture or a more sophisticated training procedure than competitors use — new architectures and new training techniques improve what any model can do. It depends on where those resources are directed: at one domain rather than spread across many. DharmaOCR 的训练逻辑恰恰相反,它接受了这种约束。该模型并非旨在成为其他语言的最佳选择,也从未打算这样做。作为交换,网络中可用的每一个参数都可以针对巴西葡萄牙语特定的词汇、形态和拼写模式进行优化——这是该领域模型资源最直接的利用方式。这种集中化是其相对于多语言和更广泛领域模型所具备的固有优势的结构基础。这种优势并不依赖于比竞争对手拥有更大的架构或更复杂的训练程序——新的架构和新的训练技术确实能提升任何模型的能力。其关键在于资源投向何处:是专注于一个领域,还是分散在多个领域。
Three months later, newer models have arrived. Whether the case for specialization holds when those models are newer and more capable is a different question. Three months after the DharmaOCR paper appeared, two new OCR models attracted significant attention from the research community: Mistral OCR4 and Unlimited-OCR. Both represent genuine technical advances — new training techniques, new datasets, and strong results across multiple languages on a range of benchmark evaluations. They are the kind of models that raise the competitive standard for what OCR systems are expected to deliver. 三个月后,更新的模型出现了。当这些模型更新、能力更强时,专业化的论点是否依然成立,则是另一个问题。在 DharmaOCR 论文发表三个月后,两款新的 OCR 模型引起了研究界的广泛关注:Mistral OCR4 和 Unlimited-OCR。两者都代表了真正的技术进步——采用了新的训练技术、新的数据集,并在多项基准测试中取得了跨语言的优异成绩。它们属于那种提高了 OCR 系统预期交付竞争标准的新型模型。
When we ran both against the DharmaOCR benchmark — an evaluation designed exclusively around Portuguese — the results were conclusive. DharmaOCR scored 0.925. Mistral OCR4 scored 0.798. Unlimited-OCR scored 0.7587. The difference is significant. Mistral OCR4 falls approximately 13 points below DharmaOCR; Unlimited-OCR falls more than 16 points below. Both were released after our model, both backed by substantial research resources. On a task where DharmaOCR’s fundamental design decision was to concentrate entirely on Portuguese, the specialization advantage is measurable and significant. The benchmark is the central finding. What follows illustrates why the gap takes the specific shape it does. 当我们用 DharmaOCR 的基准测试(专门针对葡萄牙语设计的评估)对两者进行测试时,结果是决定性的。DharmaOCR 得分为 0.925。Mistral OCR4 得分为 0.798。Unlimited-OCR 得分为 0.7587。差距是显著的。Mistral OCR4 比 DharmaOCR 低约 13 个百分点;Unlimited-OCR 低超过 16 个百分点。两者均在我们模型发布后推出,且都拥有雄厚的研究资源支持。在 DharmaOCR 将核心设计决策完全集中于葡萄牙语的任务上,这种专业化优势是可衡量且显著的。该基准测试是核心发现。下文将阐述为什么差距会呈现出这种特定的形态。