Adaptive Markup Language Generation for Contextually-Grounded Visual Document Understanding
Han Xiao, Yina Xie, Guanxin Tan, Yinghao Chen, Rui Hu, Ke Wang, Aojun Zhou, Hao Li, Hao Shao, Xudong Lu, Peng Gao, Yafei Wen, Xiaoxin Chen, Shuai Ren, Hongsheng Li
TL;DR
This work tackles visual document understanding by addressing the lack of contextual grounding in multimodal models. It introduces an adaptive markup language generation framework that translates documents into structured markup formats (plain text, Markdown, LaTeX, HTML, JSON, TikZ) to provide explicit context for reasoning, backed by DocMark-Pile (3.8M pretraining pairs) and DocMark-Instruct (624k CoT-style annotations). The approach uses a two-round, chain-of-thought-inspired pipeline where the model first outputs a markup-based context and then the final answer, enabling better disambiguation of complex layouts and content. Empirical results show substantial improvements over state-of-the-art MLLMs across a range of markup-generation and downstream document-understanding tasks, with detailed ablations confirming the value of the pretraining and CoT fine-tuning components; code and models are released for broader adoption.
Abstract
Visual Document Understanding has become essential with the increase of text-rich visual content. This field poses significant challenges due to the need for effective integration of visual perception and textual comprehension, particularly across diverse document types with complex layouts. Moreover, existing fine-tuning datasets for this domain often fall short in providing the detailed contextual information for robust understanding, leading to hallucinations and limited comprehension of spatial relationships among visual elements. To address these challenges, we propose an innovative pipeline that utilizes adaptive generation of markup languages, such as Markdown, JSON, HTML, and TiKZ, to build highly structured document representations and deliver contextually-grounded responses. We introduce two fine-grained structured datasets: DocMark-Pile, comprising approximately 3.8M pretraining data pairs for document parsing, and DocMark-Instruct, featuring 624k fine-tuning data annotations for grounded instruction following. Extensive experiments demonstrate that our proposed model significantly outperforms existing state-of-theart MLLMs across a range of visual document understanding benchmarks, facilitating advanced reasoning and comprehension capabilities in complex visual scenarios. Our code and models are released at https://github. com/Euphoria16/DocMark.
