DocLang: a markup language for LLMs IBM Research introduced DocLang, a constrained XML sub-language designed to make document structure more interpretable for large language models, complementing its open-source Docling parser. Docling, IBM's most successful open-source project with 32 million downloads and 64,000 GitHub stars, converts unstructured data from formats like PDF, PPT, XLSX, and MP4 into DocLang's byte-identical representation, aiming to reduce token usage and lower latency and inferencing costs. Lead researcher Peter Staar said DocLang's one-to-one mapping between semantic tokens and LLM tokens minimizes the model's parsing effort. Introducing DocLang, a markup language for AI We spoke with Peter Staar, the lead researcher behind IBM’s popular document parser, Docling, about why generative AI needs its own document standard. AI is upending how we live and work, but the data that could really transform how businesses run is often locked away in outdated or proprietary formats. Docling, IBM’s open-source document parser, has helped to make this information more accessible, allowing enterprises to lift new insights from old charts, customer files, and annual reports. With 32 million downloads and 64,000 stars on GitHub, Docling is IBM’s most successful open-source project ever. It’s been integrated into everything from LangChain to Red Hat’s OpenShift, and even IBM’s own Granite family of LLMs https://www.ibm.com/granite . Now, the researchers behind Docling https://research.ibm.com/blog/docling-generative-AI are introducing its complement: DocLang https://github.com/doclang-project/doclang/blob/main/spec.md motivation , a sub-language of XML that has the potential to lower latency and inferencing costs by telling an AI model in fewer tokens where things like a headline ends and a chart caption begins. XML stands for Extensible Markup Language https://www.ibm.com/docs/en/i/7.5.0?topic=toolkit-xml-introduction , which was designed to store and move data across apps, databases, and web services. In the 1990s, front-end webpages moved to HTML because it was more forgiving of errors than XML, with its strict parsing rules. HTML also had fixed, ready-to-use visual tags making it easier to use. Though HTML became the markup language of the web, XML never really went away. Docling converts unstructured data from various formats PDF, PPT, XLSX, MP4 , into an internal representation that is serialized into DocLang, a constrained dialect of XML. DocLang’s flavor of XML was designed to be more interpretable for an LLM. We recently caught up with Peter Staar, the lead researcher behind Docling, to learn more about DocLang’s back story, its benefits, and what it will take for enterprises and others to adopt it. Why is something like DocLang needed? The document formats we use today were designed for different purposes. PDF tells a renderer where to put pixels. DOCX tells a word processor how to lay out a page. Neither were built for a machine that needs to understand the content. When you push these formats through an AI pipeline, reading order becomes ambiguous, tables collapse, figures lose their captions, and metadata disappears. All this happens before the model even sees the content, which caps its accuracy. How is DocLang different? Its only job is machine understanding. It's an open standard — think JSON for data, or HTML for the web — that natively encodes semantics, layout, bounding boxes, and reading order. Instead of trying to recover structure later, we define a representation from the start. We also take the position that a given piece of content should have exactly one encoding. Two systems that read a document correctly should produce byte-identical output. That property — one document, one representation — is something no previous standard guarantees, and it's what makes DocLang trainable and verifiable. Why did you choose XML as the basis for DocLang? We chose XML for its clean semantic-token link. Each semantic token has an explicit opening and closing form —