中文

DharmaOCR:用于结构化OCR的专用小语言模型,超越开源和商业基线

计算机视觉与模式识别 2026-04-17 v1 人工智能 计算与语言

摘要

本稿件介绍DharmaOCR Full和Lite,一对专用小语言模型(SSLM),用于结构化OCR,以联合优化transcription quality、generation stability和inference cost。它还介绍了DharmaOCR-Benchmark,覆盖打印、手写和legal/administrative文件,提出了统一的评估协议,该协议在显式跟踪text degeneration作为第一个基准指标(以及unit cost)的同时,衡量fidelity和structure。除了报告degeneration rate外,本稿件经验性地显示degeneration不仅仅是一种质量失败,因为它通过增加response time、降低throughput和inflate计算成本due to abnormally long generations来 materially恶化生产性能。 To the best of the author's knowledge, as a methodological contribution, this is the first application of Direct Preference Optimization(DPO) for OCR, explicitly using degenerate generations as rejected examples to penalize looping behavior. Combined with Supervised Fine-Tuning(SFT) for enforcing a strict JSON schema(header, margin, footer, and text), DPO consistently reduces degeneration rate across model families(up to 87.6% relative) while preserving or improving extraction quality. The resulting models, namely, DharmaOCR Full(7B)和DharmaOCR Lite(3B),在DharmaOCR-Benchmark上达到新的state-of-the-art,outperforming每个开源和商业基线模型在extraction quality方面的表现,达到0.925和0.911分,分别为0.40%和0.20%的degeneration rate。AWQ量化减少了最多22%的per-page cost with negligible quality loss,enabling a strong quality-cost trade-off in comparison to proprietary OCR APIs和开源替代方案。

关键词

引用

@article{arxiv.2604.14314,
  title  = {DharmaOCR: Specialized Small Language Models for Structured OCR that outperform Open-Source and Commercial Baselines},
  author = {Gabriel Pimenta de Freitas Cardoso and Caio Lucas da Silva Chacon and Jonas Felipe da Fonseca Oliveira and Paulo Henrique de Medeiros Araujo},
  journal= {arXiv preprint arXiv:2604.14314},
  year   = {2026}
}