AmbiHTMLBench: A New Benchmark for HTML Document Parsing

AmbiHTMLBench uses HTML as its output benchmark to systematically evaluate multimodal models' reconstruction of content, layout, and visual fidelity in visually rich documents.
The article introduces AmbiHTMLBench, a benchmark for visually rich document parsing that uses HTML rather than Markdown as the output representation. It contains 1,115 diverse pages and requires models to recover executable HTML while preserving content, organizational structure, and visual appearance. Evaluation uses a dual-track design: an objective protocol (aligning rendered blocks to measure table fidelity, text errors, and 2D layout consistency) and a reference-anchored protocol (LLM judgments aligned with human preferences). Tested on ten multimodal systems, the best objective score was 0.8092, but the subjective winner differed, showing automated metrics and human perception are complementary. A fine-tuned small-parameter expert model performed well, validating task-specific adaptation. The benchmark pushes document parsing evaluation from text extraction toward comprehensive consideration of structure, layout, and visual fidelity.
Traditional document parsing systems typically use Markdown as their output representation. While effective for linear text, Markdown cannot fully preserve fine-grained spatial structure, table geometry, visual hierarchy, or rendering semantics. To address this, researchers have proposed AmbiHTMLBench, an HTML-based benchmark for visually rich document parsing that systematically studies this setting.

Why HTML Instead of Markdown?
Markdown is concise and efficient for representing linear text, but its limitations become obvious when dealing with heterogeneous, layout-sensitive documents. Representations of such documents must remain editable, inspectable, and reusable, and HTML is better able to preserve spatial structure and visual semantics. AmbiHTMLBench was proposed precisely to systematically evaluate a model's ability, given a real document, to recover executable HTML that simultaneously preserves content, organization, and visual appearance.
Visually Rich Documents refer to documents that convey information not only through linear text but also through spatial layout, font styles, table structures, graphical elements, and page hierarchy. These are common in financial reports, academic papers, invoices, forms, and product manuals. The semantics of such documents reside not only in character sequences but also in the two-dimensional positional relationships between elements: whether a passage appears in a header or a footnote, how table cells are merged, and the font size of a heading all change its meaning. Traditional OCR or plain-text extraction loses these cues, degrading downstream tasks such as information extraction, question answering, and document re-ranking. HTML is well suited as a representation because it natively supports nested structures (e.g., <table>, <div>, <section>), cascading styles (CSS can encode fonts, spacing, and alignment), and executable rendering, thereby preserving both content and the visual semantics that a browser can reproduce.
Benchmark Composition and Evaluation Protocol
AmbiHTMLBench contains 1,115 diverse pages with structured annotations. Evaluation uses two complementary approaches:
- Objective protocol: aligns ground-truth and predicted rendered blocks, measuring table fidelity, page-level text errors, and two-dimensional layout consistency.
- Reference-anchored protocol: measures perceptual fidelity by aligning LLM judgments with human preferences.
This dual-track design reveals the complementary properties captured by automated decomposition and human perceptual fidelity.
The reference-anchored protocol is a strategy for evaluating generated outputs: rather than requiring the prediction to match the ground truth pixel by pixel, it uses the real document as a reference anchor and lets a judging model assess the perceptual quality of the predicted output within the reference context. In this benchmark specifically, the LLM judge is asked to compare the rendering of the predicted HTML against the real page in terms of visual fidelity, and its scores are calibrated by aligning with human preference annotations. The value of this protocol lies in capturing properties that traditional objective metrics struggle to quantify, such as the naturalness of reading order, the clarity of visual hierarchy, and the coherence of local styling. The objective protocol, by contrast, is based on rendered block alignment and computes deterministic metrics such as table structure matching, page-level text error rate, and two-dimensional layout overlap. Together, the two provide both reproducible quantitative signals and a reflection of how humans actually perceive document reconstruction quality.
Key Findings and Model Performance
Tested on ten major multimodal systems, the best objective score was 0.8092, yet the subjective winner was different. This shows that objective metrics and human perception are not always consistent and are complementary. The researchers also fine-tuned a small-parameter expert model and found that task-specific adaptation achieves strong performance on the document-to-HTML reconstruction task. These results position AmbiHTMLBench as a diagnostic testbed for building smarter, more logical document parsing systems.
Task-specific adaptation here refers to parameter-efficient fine-tuning for the specific task of "document-to-HTML reconstruction" beyond a general-purpose multimodal large model. The small-parameter expert model fine-tuned by the researchers typically uses low-rank adaptation (LoRA) or similar methods, updating only a small number of parameters so that the model retains the base model's general capabilities while focusing on learning the mapping between document layouts and HTML tags. This approach is particularly effective in document parsing because the task's output space is highly structured (tags, attributes, nesting levels), differing considerably from the open-ended output distribution of general visual question answering. Experiments show that a small model with task-specific adaptation can approach or even surpass larger general systems on objective metrics, indicating that data distribution and task alignment can improve document reconstruction fidelity more than simply increasing parameter count.
Implications for the Document Parsing Field
The emergence of AmbiHTMLBench marks a shift in document parsing evaluation from mere text extraction toward a comprehensive consideration of structure, layout, and visual fidelity. For document processing scenarios that require high-fidelity reconstruction, HTML representation offers richer possibilities. At the same time, the gap between objective and subjective evaluation revealed by the benchmark reminds researchers to balance automated metrics with human perception when optimizing models, driving the development of parsing systems that better meet real-world needs.
One-line Summary
AmbiHTMLBench uses HTML as its output benchmark to systematically evaluate multimodal models' ability to reconstruct the content, layout, and visual fidelity of visually rich documents.
Paragraph Summary
The article introduces AmbiHTMLBench, a benchmark for visually rich document parsing that uses HTML rather than Markdown as the output representation. The benchmark contains 1,115 diverse pages and requires models to recover executable HTML while preserving content, organizational structure, and visual appearance. Evaluation uses a dual-track design: an objective protocol (aligning rendered blocks to measure table fidelity, text errors, and two-dimensional layout consistency) and a reference-anchored protocol (LLM judgments aligned with human preferences). Tested on ten multimodal systems, the best objective score was 0.8092, but the subjective winner differed, showing that automated metrics and human perception are complementary. A fine-tuned small-parameter expert model performed well, validating the effectiveness of task-specific adaptation. The benchmark pushes document parsing evaluation from text extraction toward a comprehensive consideration of structure, layout, and visual fidelity.
Related articles

Dify Low-Code AI in Practice: RAG and Agents Made Easy
Based on a Bilibili Dify course, this article systematically covers Dify's five application types (Chat Assistant, Text Generation, Agent, Chat Flow, Workflow), Windows + Docker deployment, MySQL connection configuration, model integration strategies, and application publishing methods, helping beginners quickly build their own intelligent assistants.

WorkBuddy Hands-On: How Tencent's Strategic AI Workbench Lets Your Computer Do the Work
WorkBuddy is Tencent's strategic AI workbench that directly operates your computer to complete tasks like file conversion. Based on a Bilibili tutorial, this article analyzes its fundamental differences from assistants like Doubao, its four-layer product structure, the 28-knowledge-point learning path, and what to view critically beyond the demo.

LangChain 1.3 in Practice: From Beginner to Agent Development, Building Resume-Worthy Projects
In-depth analysis of a Bilibili tutorial based on LangChain 1.3: from beginner to Agent practical development, covering LangGraph, Deep Agents, RAG, MCP, Skill, and more. Build resume-worthy AI applications through eight industry SOP workflows and multiple projects, ideal for job interviews and engineering implementation.