Dharma Field Extractor: Any Document In, Structured Fields in JSON Out

2026年11月4日 17:50
站內 AI 整理稿

Back to Articles Dharma Field Extractor: Any Document In, Structured Fields in JSON Out Team Article Published November 4, 2026 Upvote 4 Gabriel Pimenta de Freitas Cardoso GabrielPimenta99 Follow Dharma-AI Paulo Henrique de Medeiros Araujo Paulo-DharmaAI Follow Dharma-AI Bruno Duarte brunoduarte01 Follow Dharma-AI Francisco de Almeida Rocha Alves falves9101 Follow Dharma-AI A 2-billion-parameter model that extracts exactly the fields you ask for, from any document type, outperforming every frontier LLM we tested, at a fraction of the cost.

In April, we released DharmaOCR-LITE, a model specialized for OCR across a wide range of documents, from contracts and court filings to invoices, IDs and forms.

The paper behind it made a narrow, well-measured case for domain specialization: a smaller model trained closer to its task beating general-purpose frontier APIs on that task.OCR gives you the text on a page, faithful to the original formatting.

That's exactly what you want when the job is the whole document, like a contract you'll read end to end or a manuscript you're digitizing.However, there's a different use case: you don't want the page, you want specific fields out of it, in a shape a system downstream can consume.

Every line item on an invoice, as a list.The patient name, exam type and date from a medical requisition, ready to schedule.The fields off an ID, mapped to the columns of an employee record.

Run that document through OCR and you get back everything printed on it, line by line, with no indication of which string is the exam type, which is the date or which number is the total.Someone still has to write the code that maps each value to the right field before it reaches the database.

A general-purpose LLM can do this work today, with careful prompting.At frontier API pricing and latency, on a task many businesses need to run at high volume, that quickly becomes the expensive way to solve a well-defined problem.So we built a model for it instead.

The Field Extractor takes a document image and either a request for everything it can find, or an exact schema to fill, and returns structured JSON: typed, field by field, nested where the document nests.

An invoice comes back with every line item as an ordered list, each with its own quantity and value, alongside the totals.An ID comes back as the fields you'll store, under the names your system already uses for them.The same checkpoint handles all of it, with no per-type fine-tuning.

You can try it yourself here.What the Model Does Say a batch of supplier invoices lands every morning, and you need four things off each one to push into your system: the supplier, the invoice number, the due date, the total.

Same story for medical requisitions going into a scheduler, or contracts feeding a compliance system, where what matters is the parties, the term, the penalties and the fine amounts.You don't need the page, you need certain fields.

With the Field Extractor there are two ways to ask for them: Open: no schema supplied.

The model reads the page and works out which parts of it are structured fields (a label followed by a value, a table with a header row over its columns) from context and layout, not from a fixed list of field names, and returns everything it finds as key-value pairs.

Schema-directed: you specify the exact shape wanted, field by field, with a type for each one (string, number, or boolean), under the key names your system already uses.Ask for "serviceprovider" and "clientcompany", and those are the exact keys that come back.

Ask for a table and it fills it row by row, column by column, matching each cell to the key it belongs under.Ask for a field that isn't on the document, and it returns null instead of inventing a value.The choice comes down to what you already know.

Send an open request when you don't know what the document holds.Send a schema when the output has to match a shape that already exists somewhere else.Either way, what comes back is JSON: the fields as keys, the values typed as requested, and null where the document didn't have what you asked for.

When you send a schema, the output follows it exactly, with the same keys and no extra fields, so it can go straight into the next system.How It Was Trained The base model is DharmaOCR-LITE v1.

1, a new 2-billion-parameter version optimized from the one in the paper and already specialized for OCR through supervised fine-tuning and DPO.On top of that checkpoint we trained a LoRA adapter on 43,384 training examples covering both request modes.

The data is organized into three streams: English multi-domain data: diverse documents collected from the public web, spanning many document types.Brazilian domain data: real Brazilian documents sourced internally, in Portuguese.

Multilingual data: a smaller share covering other European and Asian languages, for broader generalization beyond English and Portuguese.All three streams are annotated at the field level.

The mix is deliberately multi-domain: receipts, commercial invoices, forms, bank statements, ID documents and synthetic documents, rather than one filing type.

Where the Benchmark Draws the Line The full benchmark covers 546 documents across three request scenarios, for 1,638 total cases: extracting every field with no schema, a partial schema naming only real fields, and a schema that also includes deliberately nonexistent fields.

The score is field-level F1 (matched by path, including position inside a table), multiplied by the Levenshtein similarity on the values that matched and by the share of outputs that come back as valid JSON.We ran the same benchmark against four general-purpose frontier configurations.

Against general-purpose LLMs, the quality gap runs from 1.8 points (Claude Opus 5, the closest) to 9.3 points (GPT-5.6 Luna, the widest).Cost runs from roughly 6 times lower (GPT-5.6 Luna) to roughly 147 times lower (GPT-5.6 Sol).The two sides are priced differently.

The frontier figures come from measured average input and output tokens per page, reasoning tokens included, against each provider's published list pricing.

Every frontier model ran with reasoning set to low; Claude Opus 5 used adaptive effort, which can skip reasoning on simpler pages while staying at the low level.Ours isn't billed per token: the model runs self-hosted, so the figure is GPU time on a single L40S at $2.24 per hour.

This is not a sales price.Self-hosted cost depends on the hardware, the volume and the latency each deployment needs.The comparison is here to show that a sovereign SSLM, deployed on your own infrastructure, is a real alternative to frontier APIs.

A Test of Generalization SROIE and FUNSD are two public datasets in our benchmark, not used in training.Below is one example from each.

On a SROIE receipt, we asked for all 18 fields printed on it, with no phantom fields this time, and every one comes back correct: the multi-line, unlabeled billing address captured as a single field, the two blank fields (salesperson and ref) correctly returned as null, and every number on the receipt matching to the cent.

On a FUNSD photocopying variance form, a checklist of twelve boolean fields with one nested group of five sub-options, the model marks exactly the one box that's checked (poor quality original, with a handwritten "faded" note beside it) as true, and the other eleven as false, matching the form exactly.

It also reads the handwritten Bates ID off the page correctly, and returns null for the two fields left blank.Quality and Cost, at the Same Time A 2-billion-parameter model scored 0.834, above every frontier configuration we tested, from Claude Opus 5 at 0.816 to GPT-5.6 Luna at 0.

741, while running on a single L40S at a lower cost per extraction than every API in the comparison.Higher quality and lower cost, measured on the same benchmark, in the same run.This isn't the first time we've measured it.

Our OCR paper put the first DharmaOCR-LITE, a 3-billion-parameter model, above every commercial frontier API tested on Brazilian Portuguese; three months later, newer and better-resourced models arrived, and the gap held.Now a 2-billion-parameter model does it on field extraction.

Each result adds evidence for the thesis we started Dharma-AI with: on a bounded task, a small model trained close to that task beats a frontier model asked to do the same thing in general.In this benchmark, it also cost 6 to 147 times less to run.

Parameter count sets the ceiling; training decides how much of it a model reaches on your task.Your business doesn't need the biggest model available.It needs one trained for your problem.Try it on your own documents here.

To learn more about Dharma-AI and the specialized models we build, visit dharma-ai.com.Sources BID.Brazilian Identity Document Dataset.Soares, Neves Jr., Bezerra (2020), "BID Dataset: a challenge dataset for document processing tasks," Anais Estendidos XXXIII SIBGRAPI.github.

com/ricardobnjunior/Brazilian-Identity-Document-Dataset CORD.Park et al., NAVER CLOVA (2019).huggingface.co/datasets/naver-clova-ix/cord-v2 DocVQA.Mathew et al., WACV 2021 (ICDAR 2019).huggingface.co/datasets/lmms-lab/DocVQA WildReceipt.Sun et al., IJCAI 2021.huggingface.

co/datasets/Theivaprakasham/wildreceipt SROIE (ICDAR 2019).Held out from training, evaluation only.huggingface.co/datasets/darentang/sroie (mirror); upstream rrc.cvc.uab.es/?ch=13 FUNSD.Jaume et al.Held out from training, evaluation only.huggingface.co/datasets/nielsr/funsd (mirror); guillaumejaume.

github.io/FUNSD Zenodo Invoices (PT).Cruz & Castelli, NOVA IMS (2022).zenodo.org/records/6371710 lineitems.Sagarjha456, Hugging Face.huggingface.co/datasets/Sagarjha456/lineitems Katanaml Invoices (Donut).Kozłowski & Weichbroth (2021), Mendeley Data doi:10.17632/tnj49gpmtz.2.huggingface.

co/datasets/katanaml-org/invoices-donut-data-v1 HumynLabs Brazilian Bills and Invoices.huggingface.co/datasets/HumynLabs/BrazilianBillsandInvoicesDataset Tech4Humans BR-Doc Extraction.huggingface.co/datasets/tech4humans/br-doc-extraction Cardoso, Gabriel Pimenta de Freitas, et al.

"DharmaOCR: Specialized Small Language Models for Structured OCR that outperform Open-Source and Commercial Baselines." arXiv preprint arXiv:2604.14314 (2026).

Further Reading How Specializing the Vocabulary of SLMs Can Cut Inference Cost by 77% in Real Applications Same Cluster, 33 Points More Utilization: What Changed Was the Order GPU Management: Why Idle GPUs Are the New Grounded Aircraft Newer Models, Same Advantage Why Specialization Is Inevitable Specialization Beats Scale: A Strategic Variable Most AI Procurement Decisions Overlook Text Degeneration: A Production Failure Mode That Most Benchmarks Do Not Track Direct Preference Optimization Beyond Chatbots Explore Dharma AI on Hugging Face to try our interactive demos, download our open-source models, and discover how specialized AI systems outperform general-purpose models in real enterprise applications.

Models mentioned in this article 1 Datasets mentioned in this article 8 Spaces mentioned in this article 1 More from this author How Specializing the Vocabulary of SLMs Can Cut Inference Cost by 77% in Real Applications 38 October 21, 2026 Same Cluster, 33 Points More Utilization: What Changed Was the Order 20 August 17, 2026 Community EditPreview Upload images, audio, and videos by dragging in the text input, pasting, or clicking here.

Tap or paste here to upload images Comment · Sign up or log in to comment Upvote 4 Models mentioned in this article 1 Datasets mentioned in this article 8 Spaces mentioned in this article 1

Related

相關文章

雷峰網生成式AI

獨家 | 騰訊前高級研究員獲數千萬投資,錨定物理AI接觸智能

力合資本、合肥創新投等機構投資,Lux 系列視觸覺傳感器已實現規模化交付。作者丨董子博編輯丨張賢雷峰網·鯨犀獨家獲悉,觸覺智能企業“靈感機器人”新近完成數千萬元天使輪融資,投資方包括力合資本、合肥創新投等機構,治臻諮詢擔任財務顧問。雷峰網·鯨犀瞭解到,公司創始人、CEO 張雅展博士畢業於港科大機器人專業,曾是騰訊資深 AI 研究員,主導過大規模數據管線及 AI 模型研發,後於國家實驗室擔任研究員、博導,在觸覺感知與端到端精細操作模型的領域有多年研究,並在算法與硬件系統上均有落地經驗。相比於觸覺感知賽道的其他公司,靈感機器人入局更早,也有一套自己獨創的“稠密力場”技術路線——在解算力場的同時,從同一次成像中提取接觸區域的幾何形態,並形成包含受力、形變、滑移與姿態要素的原生多模態的觸覺數據,相較傳統“強調幾何重建”的方案,在信息密度和維度上均有很大的提升。在張雅展看來,讓觸覺真正參與操作,重點就是理解“交互力”——靈感機器人希望通過“稠密力場”路線,提升機器人的觸覺感知與力控能力,來整體性地提升任務的執行能力。除了獨特的技術選型,傳感器的小型化、感知密度與工程化,也是靈感機器人的重要攻關方向。2019 年,團隊就研發出了厚度 5mm 的超薄視觸覺傳感器,力場追蹤的分辨率達到了每平方 10 萬點以上。如今,公司發佈的 Lux 系列視觸覺傳感器已經在多個領域實現了規模化落地,其具備超高力場分辨率、原生多模態、多維力感知等特性,並且依靠更小的物距與體積,可以適配機械臂、夾爪、靈巧手等硬件。而在 Lux 之外,靈感機器人還正在電子皮膚、六維力與新型觸覺產品上探索,並準備向數採系統、數據管線和觸覺智能系統等業務進軍。據悉,公司本輪融資將被用於建設產線與優化量產能力,並進一步進行觸覺智能系統的研發。

2 小時前
雷峰網生成式AI

獨家丨預測引擎 Prophetlab 獲數千萬種子輪,常春藤資本等機構聯合投資

用 AI 通用地預測世界,或正成為資本關注的下一個大模型創業方向。作者丨董子博編輯丨張賢雷峰網·鯨犀獨家獲悉,AI 預測引擎公司 Prophetlab 已獲數千萬元天使輪融資,由常春藤資本等投資機構投資。成立不到四個月,Prophetlab 的早期項目,是利用 AI 大模型預測世界盃的賽果。產品成功預測了決賽結果和四強隊伍,不少模型下的預測結果準確率已經達到了 75% 左右。此外,公司研發的預測引擎 Prophet Engine 已登頂字節Seed發佈的知名預測榜單 FutureX 總榜榜首,並已獲得數百萬商業化訂單;即將發佈的 Investor’s Last Exam(ILE)也是嚴格時間凍結下,首個專注於商業的預測榜單。據悉,Prophetlab 稱得上是一家 AI Neo Lab,由一群國內外頂尖高校的 AI PhD 和 FinTech Master 組成。創始成員曾獲數理競賽理論金牌,有過十餘篇 NeurIPS、ICLR、ICML 的頂會一作,又在阿里千問、騰訊混元、小紅書 Dots 等項目中參與過千億量級模型的訓練。Prophetlab 創始人 Henry Jiang“小天才”們之外,Prophetlab 也在與上海交通大學嚴駿馳教授團隊開展長期產學研合作,把高校學術力量引入預測引擎技術的探索當中。預測引擎的賽道,國內今天仍是一片藍海;即使在世界範圍內,預測引擎更多也是扎進具體的場景,在垂直領域完成預測。而常春藤資本則對雷峰網·鯨犀表示,從 80 餘年前魯思·本尼迪克特的《菊與刀》,到後來詹姆斯·西蒙斯和他的大獎章基金,人類在不斷的嘗試中發現:萬事萬物皆可預測,人類都能夠在時序概率空間上,無窮地逼近複雜的真實事件。從足球到商業,Prophetlab 卻不想只成為一個領域的專家,而是要利用更強的智能,建造更通用的預測能力——或許,這才是他們獲得資本青睞最關鍵的原因。

2 小時前
智東西生成式AI

英偉達團隊下場!國產視頻模型開源,硅谷公司上門談授權

作者 | 江宇 編輯 | 漠影 硅谷AI公司,開始站在中國開源模型的肩膀上造模型了。 最近,出手的不僅有英偉達的技術團隊,還有美國AI視頻明星公司Pika。它們不約而同地選擇了同一個中國視頻模型——MiniMax H3。 英偉達相關技術團隊基於MiniMax開源的視頻模型H3,將低分辨率視頻再生成至2K、4K,推出視頻增強項目Open-H3-Regenerate-2K。幾乎同一時間,Pika發佈Pika H3 Flex,讓模型以更少的推理步驟生成視頻,並針對專業創作場景增強控制能力。

5 小時前

用自家大模型造自己的“芯”:Anthropic 組建 15 人芯片設計團隊,Claude 助陣讓研發提速

在實際的內部測試與應用中,Anthropic 的工程師團隊發現,與英偉達、超威半導體(AMD)等傳統大型芯片設計企業的常規工作流程和耗時估算相比,藉助 Claude 模型進行輔助設計,能夠顯著縮短芯片整體設計所需的週期。這一探索不僅展示了大模型在底層硬件研發中的輔助潛力,也為整個人工智能行業通過 AI 提升芯片研發效率提供了全新的實踐樣本。

9 小時前6400
智東西生成式AI

17秒驗明AI“真身”!Anthropic開源可證明推理系統,能抓模型調包

編譯 | 孫小雯 編輯 | 程茜 11月4日消息,今天凌晨,Anthropic開源大模型可證明推理系統FlashProve,詳細技術報告於11月2日發佈。服務商可通過該系統為模型回答生成密碼學證明,用戶無需獲取模型權重或自行運行大模型,就能在CPU上核驗輸出是否符合指定模型的計算結果。

9 小時前