arXiv:2611.06449cs.AINov 2026

Manuscript Offprint

arXiv:2611.06449

AmbiHTMLBench: A Benchmark for HTML-based Visually Rich Document parsing

Boyu Niu, Yingjie Xiong, Shurui Li, Linhan Pang, Yuntong Zhang, Han Wang, Hao Wu, Kai Zuo, Xu Tang, Xuanhe Zhou, Fan Wu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Traditional document parsing systems use Markdown as their output representation, which is effective for linear text but does not fully preserve fine-grained spatial structure, table geometry, visual hierarchy, or rendering semantics. We show that HTML is advantageous for heterogeneous and layout-sensitive documents whose representations must remain editable, inspectable, and reusable, and introduce AmbiHTMLBench to systematically study this setting. In this benchmark, given a real-world document, a model must recover executable HTML that preserves its content, organization, and visual appearance. The benchmark contains 1,115 diverse pages with structured annotations and evaluates predictions in two different ways: The objective protocol aligns ground-truth and predicted rendered blocks and measures table fidelity, page-level text error, and a two-dimensional layout consistency; a complementary reference-anchored protocol measures perceived fidelity by aligning LLM judges with human preferences. Across ten primary multimodal systems, the best objective score is 0.8092, while the subjective winner is different, demonstrating that automatic decomposition and human-perceived fidelity capture complementary properties. We further fine-tune a small-parameter expert model and find that task-specific adaptation yields good performance on document-to-HTML reconstruction task. These results position AmbiHTMLBench as a diagnostic testbed for building smarter and more logical document parsing systems.

Figure

Figure 1 From document images to reusable HTML. Complete pages from realistic genres (top) are reconstructed as HTML and rendered in browser (middle), more cases are shown in appendix C. The bottom row lists potential uses of the generated content.

*Corresponding author.

1 Introduction

Figure

Figure 2 AmbiHTMLBench focuses on three level of fidelity in HTML based document parsing, with both objective and reference-anchored subjective protocols.

Motivation. Documents are not merely sequences of words: headings, tables, figures, typography, and spatial arrangement jointly determine how information is interpreted. Recent multimodal systems can extract and reason over document images [1–3], but document agents require a stronger capability. They must be able to store evidence, locate the source of an answer, modify a document, and reuse the same representation across retrieval, reasoning, and interaction tasks [4]. Understanding a page once is therefore insufficient; agents need a persistent and actionable representation of the page itself.

Existing representations expose only part of this information. Plain text or Markdown supports efficient reading but discards hierarchy, spatial relations, and visual emphasis. JSON-like schemas can encode selected semantics, yet are usually designed for one downstream task and rarely preserve presentation. Raster images retain appearance but provide neither editable semantic units nor stable machine-addressable references. These limitations force downstream agents to repeatedly infer structure from pixels, creating a gap between document perception and document interaction.

HTML provides a natural representation for closing this gap. Its Document Object Model (DOM) expresses hierarchical and addressable relationships among headings, paragraphs, tables, figures, and captions, allowing humans and agents to locate and manipulate individual elements [5, 6]. At the same time, HTML and CSS provide an executable rendering mechanism for alignment, spacing, typography, positioning, and table geometry. Semantic elements and their visual realization remain connected rather than being separated into an image and an unrelated text transcript. A faithful document-to-HTML system should thus produce an artifact that is simultaneously readable, editable, inspectable, and renderable.

We also obtain direct evidence for this interface property in two small pilots. On six field groups from a UKSwap form, HTML/CSS yields 62.03% pair-joint accuracy for field-to-slot binding, compared with 44.44% for geometry-matched non-HTML records. On PubTabNet tables, HTML-based evidence summaries make row, column, and value nodes explicitly addressable, enabling more reliable correction of an erroneous row assignment than linearized Markdown. These pilots are not part of the benchmark leaderboard; they motivate evaluating whether models can reconstruct the representation that agents can subsequently inspect and act upon.

Figure

Figure 3 Pilot evidence that HTML representations support spatial binding and table verification.

The missing capability. Despite progress in OCR and document parsing, existing benchmarks largely measure isolated components such as text, tables, formulas, and reading order [7–9]. Screenshot-to-code benchmarks study visual reconstruction, but primarily target webpages with relatively regular DOM-oriented layouts. Neither setting directly tests whether a multimodal model can recover a heterogeneous real-world document as complete, executable HTML. This task is difficult because fidelity has several interacting dimensions: a prediction may contain the correct words but destroy columns or table geometry; it may preserve layout while hallucinating or omitting content; or it may encode a valid DOM whose CSS fails to reproduce the visual hierarchy that guides human reading.

These failure modes also motivate complementary evaluation. Content fidelity should measure whether text, numbers, formulas, and table cells are preserved. Structural fidelity should measure whether blocks and their relationships are organized as in the source. Visual or perceived fidelity should account for the fact that humans may tolerate harmless line-break differences but strongly penalize lost emphasis, displaced media, or broken table structure. A single metric cannot reliably expose all of these cases, so a useful benchmark should report decomposed automatic signals together with a reference-anchored perceptual measure.

Our benchmark. We present AmbiHTMLBench, a benchmark of 1,115 diverse pages with expert annotations. We render each generated HTML page and align its semantic blocks with the ground truth to measure page-level text error, table fidelity, and two-dimensional layout consistency. We additionally use human-calibrated VLM judgments to estimate perceived fidelity under a separate subjective protocol. This design lets us ask not only whether a model obtains a high score, but also which reconstruction capability is responsible for success or failure.

Our contributions are threefold: (1) a diverse document-to-HTML benchmark covering heterogeneous page types, content, and layouts; (2) a reproducible multi-dimensional evaluation protocol that separates content, structure, rendering, and perceived fidelity; and (3) an empirical study of ten multimodal systems and task-specific fine-tuning. The objective and subjective leaderboards select different winners, and adaptation improves smaller models, showing that AmbiHTMLBench is useful both as a diagnostic evaluation and as a training target for agent-ready document representations.

References (22)