微信扫码
添加专属顾问
我要投稿
字节跳动开源Dolphin模型,PDF解析效率大幅提升83%,能否破解AI数据治理难题? 核心内容: 1. PDF文档解析面临的复杂挑战:布局复杂、元素多样、领域结构差异 2. 传统文档解析路径的困局:集成式专家系统与端到端自回归模型的局限性 3. Dolphin模型创新的"结构化解构"方法,突破业界难题,提升数据治理效率
论文研究:想要提取PDF中的表格数据做分析,结果格式全乱
工作汇报:需要将扫描文档转成可编辑文本,OCR效果糟糕
数据处理:有大量PDF报告需要数字化,人工录入效率太低
预告:在AI数据治理的浪潮中,文档解析这个"基础工程"正成为制约智能升级的关键瓶颈。PDF文档中蕴藏着海量价值数据,却因布局复杂(多栏排版、混合内容)、元素多样(文本、公式、表格、图表)而难以被有效提取。更棘手的是,不同领域的文档有其独特的结构特征,使得通用模型难以应对。本文将深入解析字节跳动最新开源的Dolphin模型,看它能否通过创新的"结构化解构"方法,突破这一困扰业界的难题,为数据治理带来变化,先看理论再来实战体验。
在人工智能的宏大叙事中,我们往往被模型参数的规模、推理能力的提升所吸引,却忽略了一个更为根本的问题:数据质量决定智能上限。无论是训练下一代基础模型,还是构建企业级RAG系统,高质量、结构化的数据都是不可替代的基石。
然而,现实世界中约80%的有价值信息都被"囚禁"在非结构化文档中——PDF学术论文、企业报告、技术文档、医疗记录。这些"沉睡的数据资产"如同被锁在保险柜中的黄金,等待着被解放的钥匙。
文档解析表面上看似直观——将图像转换为可编辑文本。但深入分析后发现,这是一个涉及计算机视觉、自然语言处理、布局分析、结构理解的多维度挑战:
这些挑战使得文档解析成为AI应用落地的"最后一公里"难题。
当前主流的商业解决方案(如Mathpix、TextIn、MinerU)采用"多专家模型级联"的策略:
graph LR
A[原始文档] --> B[布局检测]
B --> C[元素分类]
C --> D[表格识别器]
C --> E[公式识别器]
C --> F[文本OCR]
D --> G[结果整合]
E --> G
F --> G
G --> H[最终输出]
优势:每个专家模型在特定任务上精度较高致命弱点:
以GPT-4V、Claude、Gemini为代表的通用视觉语言模型采用"一步到位"策略:
graph LR
A[文档图像] --> B[VLM模型]
B --> C[自回归生成]
C --> D[完整文档文本]
优势:架构简洁,能够利用大模型的泛化能力核心问题:
而Dophin的两者结合策略,取得了不错的进展,先看结果。
Dolphin模型以322M的轻量级参数量,在所有评测指标上都取得了最优性能,在简单文档(Plain Doc)上的编辑距离仅为0.0114-0.0131,在复杂文档(Complex Doc)上为0.1028,显著优于GPT-4、Claude等大型通用模型。
处理效率方面,Dolphin达到0.1729 FPS,比第二名Mathpix(0.0944 FPS)快近2倍,证明了其"先解析结构后解析内容"的并行处理架构在效率上的巨大优势。
相比动辄数千亿参数的通用VLM和复杂的集成式方案,Dolphin在保持轻量化的同时实现了专业文档解析的最佳效果,体现了针对性优化和架构创新的重要价值。
论文已被收录于ACL 2025
Dolphin的突破性创新在于引入了"分析-再解析"(Analyze-then-Parse)范式,这不仅是技术优化,更是AI系统处理复杂结构化信息的范式转变。
人类阅读文档的认知过程:首先快速浏览获得整体布局感知,然后聚焦于特定区域进行详细理解。Dolphin的模型就体现了这个"思想"。
# 伪代码示例
def stage1_layout_analysis(document_image):
visual_features = swin_transformer(document_image)
layout_prompt = "Parse the reading order of this document."
layout_sequence = mbart_decoder(visual_features, layout_prompt)
return structured_elements # [(type, bbox, reading_order), ...]
核心能力:
# 伪代码示例
def stage2_content_parsing(document_image, layout_elements):
results = []
for element in layout_elements:
cropped_region = crop_image(document_image, element.bbox)
task_prompt = get_prompt_by_type(element.type)
content = mbart_decoder(cropped_region, task_prompt)
results.append((element, content))
return parallel_process(results) # 并行处理
核心优势:
Dolphin的创新可以从信息论角度理解:
传统方法:信息处理是一个降维过程
Dolphin方法:信息处理是一个升维过程
Dolphin的一个关键设计是在两个阶段使用相同的编解码器架构(Swin Transformer + mBart),仅通过提示词差异化实现功能分化:
设计哲学:
Dolphin通过精心设计的提示词实现任务特化:
# 示例提示词设计
PROMPTS = {
"layout": "Parse the reading order of this document.",
"table": "Extract table structure and content in HTML format.",
"paragraph": "Extract text content preserving structure.",
"formula": "Convert mathematical formula to LaTeX format."
}
这种设计体现了"软件定义硬件"的思想:相同的神经网络"硬件"通过不同的"软件"(提示词)实现功能分化。
传统自回归方法的时间复杂度:**O(n·L)(n为元素数量,L为序列长度) Dolphin方法的时间复杂度:O(L + n)**(并行处理n个元素)
在包含16个元素的典型文档页面上,理论加速比可达8-16倍。
第一阶段(stage1)—文档布局解析:按照自然阅读顺序生成文档元素序列,即每个文档元素的类别及其坐标。这里的文档元素值得是标题、图表、表格、脚注等。
第二阶段—元素(stage2)内容解析:使用这些元素作为"锚点",配合特定提示词实现并行内容识别,从而完成整页文档的内容提取。
注意:整个stage1,stage2,都用了同一个模型架构Swin Transformer和Decoder,他们唯一的不同是"Prompt"不同。
图中展示了Dolphin的三阶段处理结果:
类别 | 方法 | 模型大小 | 简单文档-英文 | 简单文档-中文 | 复杂文档 | 平均ED | FPS |
---|---|---|---|---|---|---|---|
集成式方法 | |||||||
专业VLM | |||||||
通用VLM | |||||||
本文方法 | ?Dolphin | 322M | ?0.0114 | ?0.0131 | ?0.1028 | ?0.0575 | ?0.1729 |
表格说明:
数据集说明:
文本段落 | |||
公式识别 | |||
表格解析 | |||
可以看出:
Dolphin的消融实验揭示了AI系统设计的核心哲学:通过"任务解耦、知识注入、视觉聚焦"三位一体的策略,将复杂问题分解为简单子问题,让模型在清晰的约束条件下发挥最大效能。
这体现了优秀AI系统的设计原则:不是让模型变得更复杂来处理复杂任务,而是通过智能的任务分解和精准的信息引导,让模型在简化的子任务上达到最优表现。
这是Dolphin模型3000万样本训练数据的详细构成表,
展现了其独特的数据理念。
双粒度数据架构:Dolphin采用"页面级+元素级"的双层数据设计,页面级数据(5.7M)用于布局分析训练,元素级数据(24.57M)专门用于内容解析训练,完美匹配其两阶段解析架构。
大规模合成数据策略:通过HTML渲染、LaTeX Rainbow、Pandoc等工具链,将结构化源码(HTML/LaTeX/Markdown)渲染成图像并自动生成标注,其中公式数据占比高达76%(23M/30.27M),体现了对复杂元素解析能力的重点强化。
多层次精细标注:从字符级到段落级的层次化标注,结合多样化的数据源(学术论文、教育材料、商业文档)和丰富的视觉增强策略,确保模型在不同场景下的泛化能力和鲁棒性。
这种"结构化源码→渲染→自动标注"的数据生产模式,既保证了标注质量,又实现了大规模数据获取,是AI数据工程的典型范例。
数据理念:
"与其追求更多的数据,不如追求更好的数据多样性和更高的质量。"
作者没有用在线的demo,直接下载了模型和程序来执行识别,以防不一致。
下面通过几个实际案例,直观展示Dolphin的文档解析能力:
以LLaMA论文首页为测试案例,Dolphin展现了近乎完美的解析能力:
原始图像:
识别结果解析后的json和markdown:
[
{
"label": "title",
"bbox": [
271,
188,
1194,
221
],
"text": "LLaMA: Open and Efficient Foundation Language Models",
"reading_order": 0
},
{
"label": "author",
"bbox": [
313,
289,
1154,
317
],
"text": "Hugo Touvron; Thibaut Lavril; Gautier Izacard; Xavier Martinet",
"reading_order": 1
},
{
"label": "para",
"bbox": [
269,
317,
1201,
425
],
"text": "Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal\nEric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin\nEdouard Grave*Guillaume Lample*",
"reading_order": 2
},
{
"label": "para",
"bbox": [
685,
440,
795,
482
],
"text": "Meta AI",
"reading_order": 3
},
{
"label": "sec",
"bbox": [
376,
524,
502,
565
],
"text": "\\begin{abstract}",
"reading_order": 4
},
{
"label": "para",
"bbox": [
209,
586,
675,
946
],
"text": "We introduce LLaMA, a collection of founda-\ntion language models ranging from 7B to 65B\nparameters. We train our models on trillions\nof tokens, and show that it is possible to train\nstate-of-the-art models using publicly avail-\nable datasets exclusively, without resorting\nto proprietary and inaccessible datasets. In\nparticular, LLaMA-13B outperforms GPT-3\n(175B) on most benchmarks, and LLaMA-\n65B is competitive with the best models,\nChinchilla-70B and PaLM-540B. We release\nall our models to the research community $^1$ .",
"reading_order": 5
},
{
"label": "sec",
"bbox": [
167,
978,
376,
1006
],
"text": "1 Introduction",
"reading_order": 6
},
{
"label": "para",
"bbox": [
167,
1027,
718,
1498
],
"text": "Large Languages Models (LLMs) trained on mas-\nsive corpora of texts have shown their ability to per-\nform new tasks from textual instructions or from a\nfew examples ( Brown et al. , 2020 ) . These few-shot\nproperties first appeared when scaling models to a\nsufficient size ( Kaplan et al. , 2020 ) , resulting in a\nline of work that focuses on further scaling these\nmodels ( Chowdhery et al. , 2022 ; Rae et al. , 2021 ) .\nThese efforts are based on the assumption that\nmore parameters will lead to better performance.\nHowever, recent work from Hoffmann et al. ( 2022 )\nshows that, for a given compute budget, the best\nperformances are not achieved by the largest mod-\nels, but by smaller models trained on more data.",
"reading_order": 7
},
{
"label": "para",
"bbox": [
167,
1506,
717,
1844
],
"text": "The objective of the scaling laws from Hoff-\nmann et al. ( 2022 ) is to determine how to best\nscale the dataset and model sizes for a particular\ntraining compute budget. However, this objective\ndisregards the inference budget, which becomes\ncritical when serving a language model at scale.\nIn this context, given a target level of performance,\nthe preferred model is not the fastest to train but the\nfastest at inference, and although it may be cheaper\nto train a large model to reach a certain level of",
"reading_order": 8
},
{
"label": "para",
"bbox": [
753,
539,
1304,
734
],
"text": "performance, a smaller one trained longer will\nultimately be cheaper at inference. For instance,\nalthough Hoffmann et al. ( 2022 ) recommends\ntraining a 10B model on 200B tokens, we find\nthat the performance of a 7B model continues to\nimprove even after 1T tokens.",
"reading_order": 9
},
{
"label": "para",
"bbox": [
753,
769,
1305,
1236
],
"text": "The focus of this work is to train a series of\nlanguage models that achieve the best possible per-\nformance at various inference budgets, by training\non more tokens than what is typically used. The\nresulting models, called LLaMA , ranges from 7B\nto 65B parameters with competitive performance\ncompared to the best existing LLMs. For instance,\nLLaMA-13B outperforms GPT-3 on most bench-\nmarks, despite being 10 $\\times$ smaller. We believe that\nthis model will help democratize the access and\nstudy of LLMs, since it can be run on a single GPU.\nAt the higher-end of the scale, our 65B-parameter\nmodel is also competitive with the best large lan-\nguage models such as Chinchilla or PaLM-540B.",
"reading_order": 10
},
{
"label": "para",
"bbox": [
753,
1257,
1305,
1601
],
"text": "Unlike Chinchilla, PaLM, or GPT-3, we only\nuse publicly available data, making our work com-\npatible with open-sourcing, while most existing\nmodels rely on data which is either not publicly\navailable or undocumented (e.g. " Books – 2TB " or\n" Social media conversations " ). There exist some\nexceptions, notably OPT ( Zhang et al. , 2022 ) ,\nGPT-NeoX ( Black et al. , 2022 ) , BLOOM ( Scao\net al. , 2022 ) and GLM ( Zeng et al. , 2022 ) , but none\nthat are competitive with PaLM-62B or Chinchilla.",
"reading_order": 11
},
{
"label": "para",
"bbox": [
753,
1634,
1304,
1933
],
"text": "In the rest of this paper, we present an overview\nof the modifications we made to the transformer\narchitecture ( Vaswani et al. , 2017 ) , as well as our\ntraining method. We then report the performance of\nour models and compare with others LLMs on a set\nof standard benchmarks. Finally, we expose some\nof the biases and toxicity encoded in our models,\nusing some of the most recent benchmarks from\nthe responsible AI community.",
"reading_order": 12
},
{
"label": "fnote",
"bbox": [
167,
1844,
712,
1907
],
"text": "* Equal contribution. Correspondence: {htouvron\nthibautlav,gizacard,egrave,glample}@meta.com",
"reading_order": 13
},
{
"label": "fnote",
"bbox": [
209,
1907,
632,
1931
],
"text": "https://github.com/facebookresearch/llama",
"reading_order": 14
},
{
"label": "watermark",
"bbox": [
20,
649,
83,
1530
],
"text": "arXiv:2302.13971v1 [cs.CL] 27 Feb 2023",
"reading_order": 15
}
]
解析结果亮点:
精度评估:结构化元素识别准确率 >90%
技术难点:
解析表现:
dolphin识别的结果整体非常不错,而且后面红的单元格也没有乱,上次用smolDoling就翻车了(看来字节的开源,还是真实力,点赞)
Gemini-2.5 Pro的表现令人深思。在原图中,我们无意之间有个错误标记<10c_252>(本应为<loc_252>),但AI不仅完成了OCR识别,还"自作主张"地纠正了这个错误。 Gemini-2.5 Pro在测试中展现的"智能纠错"能力引发了深刻的思考:
伦理视角:当AI开始"理解"并"修正"人类意图时,这意味着什么
核心问题:我们需要的是绝对忠实的工具,还是具有判断力的伙伴
Dolphin vs Gemini-2.5 Pro对比:
*注:Gemini对原图中的标记错误"<10c_252>"主动纠正为"<loc_252>",体现了不同的AI哲学。
Dolphin的成功将推动数据治理领域的根本性变革:
传统范式:数据清洗 → 格式转换 → 结构化存储
新兴范式:智能解析 → 结构保持 → 语义增强
学术出版:
法律服务:
医疗健康:
金融服务:
Dolphin的开源将触发AI生态的连锁反应:
Dolphin触及了文档解析领域的根本矛盾:整体性与部分性的张力。
Dolphin的突破:实现了"结构化解构"——既保持整体的结构感知,又实现部分的独立处理。这是黑格尔式的"否定之否定":否定了纯粹分解,也否定了纯粹整合,在更高层次上统一了两者。
传统自回归是线性时间观,Dolphin的并行解析体现了空间化时间观——通过锚点将时间序列转化为空间并行处理。
Dolphin实现了系统论的理想状态:
总体来看,字节的Dolpin项目还是非常扎实,非常不错,比SmolDocling开源更具实用价值。建议大家上手实操。 在我们的测试中发现了一个有趣现象:
问题来了:AI应该做"忠实的工具"还是"智能的伙伴"
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费场景POC验证,效果验证后签署服务协议。零风险落地应用大模型,已交付160+中大型企业
2025-05-29
当Dify遇上可视化图表MCP(AntV),数据展示像呼吸一样简单
2025-05-29
DeepSeek R1新版震撼开源:性能直逼OpenAI o3,编程能力惊艳AI界
2025-05-29
对标 Manus 的开源通用 AI Agent:Suna by Kortix
2025-05-29
刚刚,DeepSeek开源新版R1,媲美OpenAI最高o3模型
2025-05-28
如何管理和调度Dify工作流?
2025-05-28
Seed Research|理解与生成统一模型 BAGEL 开源,All-in-One Model!
2025-05-28
AI驱动:用DeepWiki和ReadMex秒懂Github文档
2025-05-28
太顺手啦,这款开源框架让AI助手秒级接入应用,狂揽20.5K星!再见繁琐AI开发
2024-07-25
2025-01-01
2025-01-21
2024-05-06
2024-09-20
2024-07-20
2024-07-11
2024-06-12
2024-12-26
2024-08-13
2025-05-28
2025-05-28
2025-05-26
2025-05-25
2025-05-23
2025-05-17
2025-05-17
2025-05-17