Research · Document AI

DocLayout-VL: Hierarchical, Open-Set, Promptable Document Layout Segmentation

Layout tools still draw flat rectangles from a fixed list of labels. DocLayout-VL treats a page as a tree of masks: a language model writes the tree, attention follows it, and a segmenter draws every region, in whatever vocabulary the prompt asks for.

Document AILayout analysisSegmentation

What a layout model is for

Before any system can read a document, it has to divide the page into regions and say what each region is. This post is about a model that does that job for any page, in any vocabulary, as a tree of pixel masks you can ask for in words.

Here is the concrete question. You are building the first stage of a document pipeline. It will feed a reconstruction system, a question-answering model, a redaction tool and a retrieval index. What should that first stage output, so that every later stage gets what it needs?

The usual answer is a layout detector. It draws a rectangle around each region and gives it one of a few labels, such as text, title, figure or table. That answer has served the field well on scientific papers. It breaks on real documents. A seal is round. A pie wedge is a wedge. An insurance policy has a "premium breakdown", not a "text block". A newspaper is a masthead and a grid of articles, each with its own headline and captions, not a flat list of boxes.

DocLayout-VL (ECCV 2026) answers the question differently. It treats layout as promptable, open-set, hierarchical segmentation. A vision-language model writes the layout tree. Each node of the tree carries a special [LAY] token. A small module refines those tokens along the tree, and a segmentation model turns each one into a mask. The prompt decides the vocabulary and which regions to return.

A short way to say it is "Segment Anything for documents". SAM takes a prompt and returns the mask of the thing you asked for. DocLayout-VL takes a prompt and returns the masks of the regions you asked for, with names, and with the way they nest. The section SAM for documents says which parts of that comparison hold and which do not.

The route is the one the thesis talk takes. First, why today's layout tools fall short. Second, what a layout model would need. Third, the SAM comparison. Then the model, why attention should follow the tree, the losses, the data and the three-stage curriculum, the benchmark and the results, and last the question people kept asking: does architecture or scale of data matter more?

This is the fifth and last post in a series on grounded document intelligence. The hub post, Building Grounded Document Intelligence, sets out the thesis. REPLICA builds a text form of the page that loses nothing. M3Grounder and DoCoG join a vision-language model (VLM) with SAM so that a model grounds its answers with masks instead of typed coordinates. DocLayout-VL applies the same recipe to the page itself. It also closes the loop: it replaces the ensemble of layout detectors in REPLICA's first stage.

How layout analysis is done today

Document layout analysis (DLA) finds the structural regions of a page. For most of its history it has been framed as object detection. The model sees a page image and predicts a set of boxes. Each box gets one label from a fixed list.

The datasets define that list. PubLayNet, built from medical papers, has 5 classes: text, title, list, table and figure. DocBank has 13. DocLayNet has 11 classes across 6 document types. M6Doc raised the count to 74 classes. D4LA has 27. IndicDLP covers 12 Indian languages with 42 classes. Every one of these datasets annotates rectangles, and almost all of them annotate a flat list.

The models follow the data. Some are general object detectors trained on pages: Faster R-CNN, DETR-style detectors and the YOLO family. DocLayout-YOLO pushed this line far by pretraining on 300K synthetic pages. Others add document pretraining. DiT pretrains a vision transformer on document images. LayoutLMv3 jointly pretrains on text and image. VGT adds a grid of text features. All of them end with a detection head that outputs boxes from a closed set of classes.

Two other lines of work matter here. The first adds hierarchy. DocParser parses a rendered document into a tree of entities and relations. HRDoc reconstructs the hierarchy of a document at the line level. Detect-Order-Construct builds a tree in three steps: detect, order, construct. Graph-based Document Structure Analysis (GraphDoc) and UniHDSA predict relations between detected regions. These methods produce structure, but they still start from boxes and closed taxonomies, and many build the tree with post-hoc heuristics.

The second line uses general vision-language models. A VLM can read any prompt and produce any label. When asked for regions, it writes box coordinates as text, one number at a time. When Language Must Point covers why typed coordinates are brittle. Page parsers such as Dolphin build on this: they first predict layout elements as a sequence and then parse each one.

So the field has open vocabulary in one place (VLMs), hierarchy in another (structure parsers) and precise localization in a third (detectors). None of them has all three, and none of them returns masks.

Where closed-set boxes fall short

It is easiest to see the problem on one page. Figure 1 runs a classic detector on a government circular: a header with an emblem and a Hindi title, two sections, a table, and a footer with a round seal and a signature. Step through it.

Figure 1 · Four ways a closed-set box detector falls short

Figure 1. A detector with a fixed label set draws one rectangle per region. Its boxes cannot follow a round seal or a pie wedge, its labels cannot say "seal" or "Hindi title", its output is a flat list with no record of which caption belongs to which figure, and it returns the same output whatever you ask for.

The four failures are independent. Fixing one does not fix the others.

  1. Shape. A box is the wrong shape for seals, curved text, wedges, icons and rotated labels. A circle fills only π/4, about 79%, of its bounding box. The other 21% belongs to whatever sits behind it. Boxes of neighbouring irregular regions also overlap, so one pixel can belong to two regions.
  2. Vocabulary. A fixed label set cannot keep up with real domains. A banking app has status bars and quick-action icons. An exam paper has multiple-choice questions. An insurance policy has a premium breakdown and an authorization signature. A detector trained on five classes calls the seal, the emblem and the signature all "figure".
  3. Structure. A page is a tree, not a list. A newspaper is a masthead and a grid of articles; each article has a headline, a body and images with captions. A flat list throws that away. Which caption belongs to which photo? Which header opens which section? The output does not say.
  4. Control. The output is the same for every request. If you need only the Hindi text, only the personal details on a passport, or the figure to the left of a table, you have to filter the boxes after the fact, and the labels usually do not carry the information you need to filter on.

General VLMs fix the vocabulary and the control problems, because they read prompts. They do not fix the other two. On the paper's open-set flat benchmark, small open VLMs reach a reasonable Open mIoU of 50 to 64, but very low instance scores: Qwen3-VL-8B gets 24.3 Open RQ and 5.8 Open AP. On the hierarchical benchmark, Gemini 3 Pro scores 6.9 Open mIoU.

So each family of tools gets part of the way. A detector has the geometry of a box. A VLM has the words. A structure parser has the tree. A better layout model has to have all of them at once.

The task in one formulation

The four failures suggest four requirements. A layout model needs masks, so a region can have any shape. It needs open-set labels, so the prompt names the classes. It needs the page as a tree, so every region is kept together with how it nests. And it needs to be promptable, so you can ask for any region in words. All in one model.

DocLayout-VL states these as four tasks of one formulation. Given a document image d and a prompt P, the model returns three things:

fθ(d, P) → ( T̂, M̂, X̂ ),   T̂ = ( V̂, Ê ),   M̂ = { M̂i }i=1…N,   M̂i ∈ {0,1}H×W T̂ is the layout tree: nodes V̂ are regions with open-set labels, edges Ê are parent–child links. M̂i is the pixel mask of node i. X̂ is an optional explanation in text.

One property of this formulation is easy to miss. Standard closed-set detection is a special case of it. If the prompt lists PubLayNet's five classes and asks for a flat layout, the model is doing PubLayNet's task. That is why the paper can evaluate DocLayout-VL zero-shot on ten classic benchmarks.

The four requirements also point at a design. Open-set labels and prompts need a language model. A tree of variable size and depth needs a generator that can write structure. Masks of any shape need a segmenter. That is the recipe of the earlier papers in this series: a VLM decides what to ground and at what granularity, and SAM decides where. In the thesis talk, the slide that lists the four requirements ends with "all in one model. Sound familiar?" It should. A promptable model that returns masks is what SAM does for photographs. The next section takes that comparison seriously.

SAM for documents

Start with what SAM, the Segment Anything Model, does for photographs. It is a promptable segmentation model. You give it a prompt, such as a click on an object, and it returns the mask of that object. It does not say what the object is. It is class-free. The talk's slide on SAM lists three properties: promptable, class-free and 1B masks of training data.

Now picture the same interface on a page. You write "parse this page" and get back a mask for every region. You write "mask all personally identifiable information of the passport holder" and get back only those regions. The slide in the talk draws it as one click on the left and one prompt on the right: SAM returns that one object; the document model returns every region, and the tree that holds them.

Some of SAM's properties carry over and some do not. Table 1 sorts them.

Table 1 · What carries over from SAM to documents
PropertySAM on natural imagesDocLayout-VL on pagesCarries over?
InterfacePromptable: a prompt picks what to segment. A click is the standard example.Promptable: a request in words picks what to return, from "parse this page" to "find the figure to the left of a table".Yes. The prompt changes from a click to language.
OutputA mask for the prompted objectA mask for every region the prompt selects, one per [LAY] tokenYes. Masks, not boxes.
NamesClass-free: the mask carries no labelOpen-set: each region carries a label from the vocabulary the prompt definesNo. A page needs to say "premium breakdown", so names are added.
RelationsNone: the objects in a photo are a pileA tree: every region has a parent, children and siblingsNo. This is the new part.
RecipeA promptable task, one model and a data engineThe same three: promptable layout, one model, and a data engine that reconstructs pages firstYes.
Training masks1B masks (the talk's SAM slide)80M masks on 2.5M pagesDifferent scale and domain.

How to read this table: the first and last rows are what makes the comparison fair. The middle rows are where documents ask for more. Names and relations are the two things a page needs that a photograph does not.

The analogy breaks in one place, and that place is the point of the paper. The objects in a photo are a pile. A dog and a bench do not contain each other. The regions of a page do. A headline belongs to an article, the article to a grid, the grid to the page. Segmenting every region is not enough. The model has to keep how they nest.

There is also a literal side to the name. SAM is a part of the model. DocLayout-VL uses SAM's image encoder, prompt encoder and mask decoder to draw each mask. The change is what drives them. A click would be the prompt for SAM alone. Here the prompt is the hidden state of a [LAY] token, written by a language model that has read the page and your request. The language model supplies the words and the tree. SAM supplies the pixels.

The page as a tree

How does a language model write a tree? As text, with tags. DocLayout-VL's VLM generates a serialized layout string. Every region is followed by a [LAY] token. A leaf region appears as label [LAY]. A region with children appears as an opening tag, its children, a closing tag and a [LAY]:

<header> emblem [LAY] title [LAY] hindi-title [LAY] </header> [LAY]

The string is then parsed into a tree. Each [LAY] is one node, and the tree is one-to-one with the masks: one token, one region, one mask. Figure 2 shows the model writing the layout of the circular, one branch at a time. Watch the masks appear as each [LAY] is written.

Figure 2 · From a page to a tree of masks

Select a node in the tree or a [LAY] token in the output to see its mask.

Figure 2. The language model writes the layout as tagged text. Leaves end in [LAY]; a parent's [LAY] follows its closing tag, so a parent is grounded after its children. The parsed tree (right) has one node per [LAY], and each node has its own mask on the page (left). The root has no [LAY]: top-level regions are siblings.

Three details of this format are deliberate.

First, a parent's [LAY] comes after its closing tag. By the time the model grounds "header", it has already written everything inside the header. Its hidden state can summarise its children.

Second, the root has no [LAY]. The paper's figures show <document> and </document> without a token. The top-level regions (header, body, footer) are therefore siblings. This matters for HGC below.

Third, labels are free text. The tag is whatever word the prompt or the page calls for: "teaser-strip", "media-unit", "premium-breakdown". Nothing in the architecture fixes a class list.

A natural worry is that a model writing trees as text will write broken trees: unclosed tags or invalid nesting. The paper measured this. The malformed-tree rate drops with training data: 0.41% at 25% of the data, 0.03% at 50%, and 0.01% at 100%.

Asking for regions in words

Because a language model writes the output, the prompt can change everything about it: the vocabulary, the granularity and which regions appear at all. Figure 3 is an interactive version of this. Pick a prompt and the model's output and masks change. The drawn page is a stand-in; the second tab shows real outputs from the paper and the talk.

Figure 3 · One page, many requests

View

Figure 3. The prompt sets the vocabulary (generic or domain classes), the granularity (a whole table, one row, one wedge of a chart) and the selection (only the Hindi text, only what identifies the officer). Spatial prompts come back with an explanation. Real examples: passport PII redaction, a spatial question on a scientific page, Hindi-only text on a bilingual cover, numbered questions, circular seals and rotated labels.

The prompts fall into a few kinds.

All of this is the same model with the same weights. There is no task-specific head and no fine-tuning per prompt type. The instruction-tuning stage, described below, teaches the model to be asked.

The model

The architecture is the same recipe as M3Grounder and DoCoG, with one change. A VLM writes special tokens. Their hidden states become prompts for SAM. What is new is that the [LAY] hidden states first go through HGC, the Hierarchical Grounding Contextualizer, which attends along the tree. Then they reach the segmenter.

DocLayout-VL has three parts, and each does one job.

Who does what in DocLayout-VL

Vision-language model
reads the page and the prompt, writes the layout tree, and emits one [LAY] token per region
HGC
refines each [LAY] state using only its parent, children and siblings in the tree
Segmentation module
SAM's image encoder, prompt encoder and mask decoder: turns each refined token into a mask

The backbone is a standard VLM. The paper uses Qwen3-VL (4B and 8B) for the main results and also tests InternVL3.5-8B. The VLM reads the image and the prompt and generates the layout string autoregressively. When the prompt asks for it, it also writes an explanation.

After generation, the string is parsed into the tree T̂. Only the final hidden states of the [LAY] tokens are kept. Call the state of the i-th token h̃i. The Hierarchical Grounding Contextualizer (HGC) turns these into structure-aware embeddings hi. The next section explains why that step exists.

The segmentation module is SAM-based. It has its own vision encoder, separate from the VLM's, which turns the page into dense features z = Fenc(d). Its prompt encoder turns each hi into a prompt pi. Its mask decoder combines the two:

M̂i = Fdec( z, pi ),   pi = PromptEnc( hi ),   hi = HGC( h̃1…N ; T̂ )i One mask per [LAY] token. The image features z are computed once per page and shared by every mask.

The whole model is trained end to end. The mask losses flow back through the mask decoder, the prompt encoder and HGC into the language model. So the language model learns to put into each [LAY] state exactly what the segmenter needs to draw that region. Figure 4 follows one forward pass.

Figure 4 · One forward pass through DocLayout-VL

Figure 4. The VLM writes the tagged layout and [LAY] tokens. Their hidden states go through HGC, which attends along the parsed tree. SAM's prompt encoder turns each refined state into a prompt, and the mask decoder draws one mask per node from SAM's own image features. Gradients from the mask losses reach the language model.

Inference cost is modest for a model of this size. On one H100, DocLayout-VL runs at 602 ms per sample with 24.08 GB of memory, or 1.66 samples per second.

The pattern is the one the hub post calls a smart highlighter. The VLM never types a coordinate. It says what each region is and how regions nest. SAM, which is very good at turning a prompt into a precise mask, does the marking. The new piece is what sits between them.

Why HGC: attention that follows the tree

Start with the intuition. In a feature article, a headline should stay with its article. On a restaurant menu, an item should stay with its menu section. So each [LAY] token attends only to its parent, its children and its siblings. Regions of different branches never merge.

Why not send each h̃i straight to SAM, as M3Grounder does? Because the raw states do not know enough about each other, and what they do know is not organised by the tree.

Two problems with raw token states

The first problem is causality. The VLM is a causal decoder. When it writes the [LAY] for the first caption, it cannot see anything written after it: not the next section, not the footer. So each state has seen only the part of the page layout that came before it in the string.

The second problem is look-alikes. A page has many regions that look the same: section headers, captions, table rows, headlines. Picture the circular. Its two sections each have a header and a figure with a caption. A newspaper page has dozens of headlines, photos and captions. If every layout token can attend to every other one, a caption is as free to pull towards the photo in the next article as towards its own. Two branches can blur into one region.

The tree as an attention mask

HGC is a lightweight multi-layer transformer that runs over the [LAY] states after generation. Its self-attention is bidirectional, so the first token can see the last. That fixes the causality problem. Its attention is also masked by the tree, which fixes the look-alike problem. The paper calls this Hierarchical Contextual Attention.

The rule is short. Each node attends only to its structural neighbourhood: its parent, its children and its siblings. In a standard masked attention layer that is one extra term:

A = softmax( Q K⊤ / √dk + BT̂ ),   (BT̂)ij = 0 if j ∈ {i} ∪ parent(i) ∪ children(i) ∪ siblings(i), else −∞ The mask B is built from the tree the language model has just written. It changes from page to page.

This is the same mechanism as a causal mask in a language model; only the pattern differs. Attention from First Principles derives how an additive −∞ mask removes a position from the softmax. Figure 5 builds the mask for the circular. Select any node to see its neighbourhood, and switch between full and tree attention.

Figure 5 · The HGC attention mask follows the tree

Pattern

Select a node in the tree or a row of the matrix.

Real examples
Figure 5. Rows and columns are the 23 [LAY] tokens, listed parent first as in the paper's figure (the model itself writes a parent's [LAY] after its children). A filled cell means the row token may attend to the column token. Under tree attention each token sees itself, its parent, its children and its siblings, so the mask is block-structured and branches stay apart. The real examples, from the paper and talk, show the tree, its attention mask and the segmented page.

Look at what the mask does to the two captions. Under full attention, caption B can attend to caption A, to the pie chart in the other section and to every row of the table. Under tree attention, caption B sees only section B (its parent) and its siblings: the section header, the photo and the table. It cannot be pulled towards caption A, because caption A is not in its neighbourhood.

Three properties follow from the rule.

HGC is the third version of a pattern in this series. In M3Grounder, grounding tokens are projected to SAM independently. In DoCoG, the Grounding Interaction Module lets the pointers of one reasoning chain attend to each other in both directions, so that a label and its pie wedge agree. In DocLayout-VL, HGC lets pointers in a tree agree, and it knows the structure to respect because the language model has just written it. Not at all, along a chain, along a tree: that is the only part of the recipe that changes.

Structure-aware losses

HGC shapes the inputs to the segmenter. The losses shape its outputs. The training objective has four terms:

Ltotal = 1 · Llm + 2 · Lseg + 0.5 · Lbg + 0.5 · Lstruct,   Lstruct = 1 · Lcontain + 1 · Loverlap Llm: cross-entropy on the tagged layout text. Lseg: Dice plus binary cross-entropy on each mask. Lbg and Lstruct are new; the weights are the paper's.

In plain words, Lstruct says the masks must respect the tree. Containment penalises a child's mask that falls outside its parent. Overlap penalises two siblings that claim the same pixels. Lbg says masks stay off the background: every predicted pixel outside the page's ground-truth foreground, such as whitespace, is penalised. The talk's one-line summary is that these are M3Grounder's two priors, now on a tree.

Why add anything to Dice and cross-entropy? Because those losses score each mask on its own. A pixel wrongly added to a mask costs the same wherever it lands: in empty margin, in a sibling region, or outside the parent. But those errors are not equally bad for a layout. A child that spills outside its parent breaks the tree. Two siblings that claim the same pixels break the partition of the page. The new losses charge for exactly these errors.

Containment, overlap and background

All three new terms have the same shape: the fraction of a predicted mask that lies where it should not. Training uses teacher forcing, so each predicted mask M̂v is paired with ground-truth masks for its node, its parent and its siblings.

Lcontain = (1/|E|) ∑(u,v)∈E ∑m M̂v(m)·[1 − Mu(m)] / ( ∑m M̂v(m) + ε ) For each parent–child edge (u, v): the share of the predicted child that falls outside the ground-truth parent.
Loverlap = (1/|S|) ∑(v,w)∈S ∑m M̂v(m)·Mw(m) / ( ∑m M̂v(m) + ε ) For each pair of siblings (v, w): the share of the predicted v that lands on the ground-truth w.
Lbg = (1/|V|) ∑v∈V ∑m M̂v(m)·[1 − Mfg(m)] / ( ∑m M̂v(m) + ε ),   Mfg = ⋃v Mv For each node: the share of its prediction outside the union of all ground-truth masks on the page.

Two choices in these formulas are worth reading slowly. Each penalty is divided by the predicted mask's own area, so it is a fraction between 0 and 1. A small region that spills is penalised as much as a large one that spills by the same share. And the constraint is the ground-truth parent and sibling, not the predicted ones. The target does not move while the model learns.

Figure 6 lets you spill a predicted mask in three directions by the same number of pixels. Dice treats the three cases the same. The structure terms do not.

Figure 6 · Where a mask spills decides what it costs

Spill

Figure 6. Ground truth: a parent region containing two siblings, A and B, on a page with margin. The predicted mask for A grows by the same area in each direction. Dice loss is identical in all three cases. Overlap fires only when A lands on B; containment and background fire only when A leaves the parent. Bars show each term before weighting.

These losses are not new ideas so much as old ideas moved to a tree. M3Grounder used two document priors. A bleed loss kept masks off icons and graphics around the text. A hierarchy loss kept the phrase inside the line and the line inside the block. DocLayout-VL carries both over. Bleed becomes background. Enclosure becomes containment, generalised from three fixed levels to any parent–child edge, plus a new non-overlap term for siblings.

The data: HOPLay-Docs-80M

A foundation model needs data at a scale no one annotates by hand. The paper builds HOPLay-Docs-80M (HOPLay: hierarchical, open-set, promptable layout). It has 2.5M pages from 12 domains and 58 document types, with 80M pixel masks, 400K open-set labels and 5M promptable annotations. The paper's dataset table lists 40 languages and a mix of real and synthetic pages.

It comes in three aligned splits, one per curriculum stage:

The pages come from existing datasets (forms, receipts, slides, industry documents, web PDFs) plus scraped documents: invoices, receipts, theses, circulars, notifications, exam papers, slides and UI screenshots. They include curved text, dense graphics and multi-column layouts. Figure 7 follows a page through the data engine.

Figure 7 · The data engine behind HOPLay-Docs-80M

Figure 7. Pages are reconstructed first. When a judge accepts the reconstruction, boxes and labels come straight out of it. Hard pages fall back to detector proposals that a reasoning VLM relabels and groups. SAM 3 turns boxes into masks, a VLM writes instruction data around them, and several checks filter the result.

The five stages, with the models the paper names:

  1. Open-set hierarchical reconstruction. Qwen3-VL-235B-Instruct writes the page as structured HTML with context-aware labels, so the hierarchy exists by construction. The HTML is rendered and aligned to the original image. A VLM judge checks fidelity. If it passes, boxes and labels are read straight from the reconstruction.
  2. Semantic relabelling and grouping. For hard pages, flat detectors (Surya, Hi-SAM and DocLayout-YOLO) propose regions. The regions are indexed with Set-of-Mark overlays on visual pages and with OCR anchors on text-heavy pages. Qwen3-VL-235B-Thinking assigns open-set labels and groups the regions into a hierarchy.
  3. Mask generation. SAM 3 turns each box into a mask. Boundary refinement, overlap resolution and hierarchy consistency checks follow.
  4. Instruction data. Flat layouts are indexed with Set-of-Mark, hierarchical ones with Graph-of-Mark. Taxonomy-driven prompts produce varied question–answer pairs with explanations, plus deterministic geometric questions. Every answer refers to regions inline with <LAY>, so the supervision stays grounded. Qwen3-VL-235B-Instruct writes the QA.
  5. Verification. A VLM judge checks reconstruction and hierarchy. Embedding similarity catches labels that do not match the region's text. An LLM judge scores QA pairs. Masks get geometric checks. OCR-based checks removed 3% of synthetic masks.

Stage 1 is the idea behind REPLICA: rebuild the page as HTML first, check the render against the source, and read the labels off the reconstruction. Nobody draws a box. The hub post calls this the data engine that runs through all three grounding papers.

A three-stage curriculum

The three splits are not mixed. The model learns them in order, and what is trained changes at each stage. Figure 8 shows the schedule.

Figure 8 · Learn to see regions, then structure, then requests

Figure 8. Stage 1 learns open-set flat grounding with dense HGC attention. Stage 2 switches HGC to tree attention and learns nesting. Stage 3 instruction-tunes on prompts with SAM's image and prompt encoders frozen. Orange parts are trained, grey parts are frozen, as stated in the paper. The last step compares the curriculum with one joint fine-tuning pass.
  1. Flat layouts (FlatLay-Docs-25M): learn to see regions. Every region is a sibling, so HGC applies dense attention. The VLM's vision encoder is frozen. The language model, HGC and all of SAM (image encoder, prompt encoder, mask decoder) are trained.
  2. Hierarchies (HierLay-Docs-40M): learn structure. HGC switches to tree-constrained sparse attention. The same parts stay trainable.
  3. Instructions (PromptLay-Docs-15M): learn to be asked. The task is now to select regions, not to learn new segmentation concepts. So SAM's image encoder and prompt encoder are frozen, and only the mask decoder and the language model are trained.

The order follows a simple logic. Flat data is the easiest way to learn what a region is and how to draw it. Trees need regions first. Prompts need both, because a prompt selects among regions the model can already find and nest.

The rest of the setup is conventional: AdamW with learning rate 2×10−6, 3% warmup and cosine decay; gradients clipped at 1.0; mixed precision for the VLM, with HGC and the mask decoder in FP32 for stability. Training runs on 64 H100 GPUs with DeepSpeed ZeRO-3 and an effective batch size of 128.

Measuring layout understanding

Existing layout benchmarks score closed-set boxes. None of them can score an open-set label, a tree, a curved mask or a prompt. So the paper builds HOPLay-Docs-Bench: 5,000 manually curated documents with 51,241 annotated regions, 5,277 open-set labels and 47,613 prompt-conditioned annotations. Every sample is checked by hand.

It has four tracks, each with its own metrics:

The Overall Score is the mean of four track scores. The flat track contributes the mean of its three metrics. The hierarchical track does the same. The curved track contributes Open mIoU. The prompt track contributes the mean of cumulative IoU and G-Eval.

OS = ¼ · [ (Om + OR + OA)/3flat + (Om + mST + mhF)/3hier + Omcurved + (cI + GE)/2prompt ] For DocLayout-VL-8B: ¼ · [74.9 + 75.9 + 87.9 + 78.7] ≈ 79.4.

The paper addresses two threats to validity. The first is leakage. Perceptual-hash deduplication (Hamming distance at most 4) between the benchmark and the training set found 0.07% near-duplicates, all removed, and no exact matches. The ten external benchmarks have 0.0% overlap, so every result on them is zero-shot.

The second is the judge. G-Eval and label embeddings use Gemini 3 Pro and a Gemini embedding model, and Gemini 3 Pro is also a baseline. So the paper re-ran the prompt track with Claude Sonnet 4.6 and GPT-5.2 as judges. The ranking of all 17 models stayed stable (Spearman ρ = 0.97 and 0.96, Kendall τ = 0.91 and 0.89). DocLayout-VL-8B ranks first under all three judges, with G-Eval scores of 87.2, 85.9 and 86.4. Measuring What a VLM Can Do discusses judge-based metrics more generally.

Results

The baselines cover every family from the comparison above: hierarchical pipelines (Dolphin, DocParser), small and large open VLMs, thinking VLMs, closed VLMs (Claude Sonnet 4.6, Gemini 3 Pro, GPT-5.2), and InternVL3.5-8B and Qwen3-VL-8B fine-tuned with box supervision on the same curriculum. That last group is the most important control. It has the same data and the same backbone. Only the architecture differs. Figure 9 has every number; pick a track.

Figure 9 · HOPLay-Docs-Bench and zero-shot closed-set results

Figure 9. Scores from Tables 2 and 3 of the paper (0–100, higher is better). Grey bars are baselines, the dark grey bar is Qwen3-VL-8B fine-tuned with boxes on the same data, and blue bars are DocLayout-VL. Closed-set scores are mAP@50:95; traditional detectors are trained on each dataset, DocLayout-VL is zero-shot. Models without a reported score on a dataset are left out.

Open-set, hierarchical, curved and promptable

DocLayout-VL-8B reaches an Overall Score of 79.4. The 4B model reaches 71.8. The best zero-shot model, Gemini 3 Pro, reaches 37.2. Qwen3-VL-8B fine-tuned with boxes on the same data reaches 45.8.

Classic closed-set benchmarks, zero-shot

Because closed-set detection is a special case of the task, DocLayout-VL can be run on ten classic benchmarks by prompting with their label sets. It never trained on any of them. The traditional detectors it is compared with were trained on each dataset.

The pattern depends on the benchmark. On simple, saturated benchmarks, the per-dataset detectors stay slightly ahead: DocLayout-YOLO gets 96.9 on PubLayNet against 96.5, and 97.5 on TableBank against 97.3. On label-rich and shifted benchmarks, DocLayout-VL is well ahead: 76.9 on M6Doc against 70 for RoDLA, 77.5 on IndicDLP against 55.0 for the best detector, 81.2 on PRImA-LAD against 70.3, and 79.6 on D4LA against 70.9. On OmniDocBench it gets 67.8, against 47.4 for DocLayout-YOLO and 64.2 for Gemini 3 Pro.

Architecture, data and order

One question came up again and again when this work was presented: what matters more, architecture or scale of data? The short answer from the talk is both, but architecture wins. The rest of this section shows why. A second question follows: which parts of the architecture matter? The paper answers both with one controlled experiment: the same Qwen3-VL-8B backbone, trained at 25%, 50% and 100% of the data, with one component added at a time. Figure 10 plots it.

Figure 10 · Architecture versus data scale

Figure 10. Table 5 of the paper, hierarchical track Open mIoU. "VLM only" writes boxes as text after fine-tuning on the same data. Each line adds one component. The dashed line is the full model trained with one joint pass instead of the three-stage curriculum. Hover a point for its value.

Data does real work. For the same Qwen3-VL-8B backbone, the Overall Score goes from 31.6 zero-shot, to 45.8 after fine-tuning with boxes on the same data, to 79.4 for the full model. Data brings the backbone into the task. The architecture closes the rest. The talk shows the same two steps, data and then model, for M3Grounder and DoCoG.

Three patterns stand out, and the paper names them.

  1. At every data scale, adding HGC helps the tree more than doubling the data. VLM+SAM gains 5.5 points of hierarchical Open mIoU from 25% to 50% data. Adding HGC at 25% gains 12.2. HGC at 25% of the data (59.8) beats VLM+SAM at 100% (58.3).
  2. The full model uses data better. From 25% to 100% data, the box-only VLM gains 4.1 points on the tree, VLM+SAM gains 10.7, and the full model gains 14.0.
  3. The curriculum helps at every scale. Joint training is below the full curriculum at 25%, 50% and 100%.

The component ablations tell the same story from another angle. Removing both SAM and HGC (the box-writing VLM) collapses the hierarchical track to 32.5 and the curved track to 39.7. Removing HGC alone costs 19.2 points on the tree. Removing the structure losses costs 5.2. The backbone matters too: with InternVL3.5-8B instead of Qwen3-VL-8B, flat Open mIoU drops from 86.7 to 82.4, hierarchical from 77.5 to 71.3, and G-Eval from 87.2 to 76.5.

How the approaches compare

The table puts the families from this post side by side, along the aspects the post introduced: region shape, vocabulary, structure, control, how regions are located, and how regions relate to each other.

Document layout approaches compared
ApproachRegion shapeLabel setStructurePrompt controlHow regions are locatedRelations between regionsEvidence in this post
Closed-set detectors
DocLayout-YOLO, DiT, LayoutLMv3, VGT
BoxesFixed per dataset (5 to 74 classes)Flat listNoneDetection head regresses boxesNone; detections are independentStrong on their home datasets; drop on shifted, label-rich sets (IndicDLP 55.0)
Hierarchical structure parsers
DocParser, HRDoc, Detect-Order-Construct, GraphDoc, UniHDSA
BoxesFixedTree or graphNoneDetector, then relation predictionParent–child or graph relations between detected boxes, often with post-hoc tree heuristicsDocParser 4.3 overall on HOPLay-Docs-Bench
VLM page parsers
Dolphin, Chandra
BoxesFixed element typesElement sequenceTask promptsLayout elements written as a sequence, then parsedReading orderDolphin 6.6 and Chandra 20.1 overall
General VLMs, zero-shot
Gemini 3 Pro, GPT-5.2, Qwen3-VL
Boxes typed as textOpenCan write nesting; weak treesYesCoordinates as tokensImplicit, through a causal decoderBest: Gemini 3 Pro 37.2 overall, 6.9 hierarchical Open mIoU
VLM fine-tuned with boxes
Qwen3-VL-8B-ft on the same data
Boxes typed as textOpenTree as textYesCoordinates as tokensImplicit, through a causal decoder45.8 overall, 32.5 hierarchical Open mIoU
Reasoning segmentation (VLM + SAM)
LISA, GLaMM, PixelLM
MasksOpenNoneYesA segmentation token's state prompts a mask decoderNone between mask tokensBuilt for natural images; the paper notes they struggle on text-dense documents
M3GrounderMasks at phrase, line and block levelNot a layout labeller; grounds answersThree fixed nested levels per citationQuestions[GROUND] token → three heads → SAMNone between tokens; a hierarchy loss nests the three levelsDoes not generalise well to layout, per the paper
DocLayout-VLMasksOpen; set by the promptFull tree of any depthYes, including spatial and selection prompts[LAY] state → HGC → SAM prompt encoder → mask decoderParent, child and sibling attention (HGC); containment and overlap losses79.4 overall; zero-shot on ten closed-set benchmarks

How to read this table: read down the "Region shape" and "Label set" columns first. Every row above the last three uses boxes, and only the VLM rows are open-set. Then read "Relations between regions". Only the last row models relations between grounding tokens explicitly, and that column lines up with the hierarchical scores.

Closing the loop with REPLICA

Now look at what DocLayout-VL produces: a hierarchical, open-set tree of masks for any page. That is the job REPLICA's first stage was doing.

REPLICA's Segment stage works in four steps. A tool decides whether the page is digital or scanned. For scanned pages, an ensemble of off-the-shelf detectors (DocLayout-YOLO, IndicDLP-YOLO and Hi-SAM) proposes regions, fused by IoU. A labelling agent uses Set-of-Mark prompting to fix mislabelled and mis-segmented regions. A grouping agent builds the layout tree: it binds captions to figures and nests lists. The hub post calls this the weakest link in REPLICA, because every later stage inherits its mistakes.

DocLayout-VL does all of that in one model: it proposes regions, labels them with open-set names and nests them into a tree. And it was trained on data from REPLICA's own approach: reconstruct the page first, check it, read the labels off the result. Figure 11 shows the loop.

Figure 11 · DocLayout-VL feeds back into REPLICA

Figure 11. REPLICA's reconstructions are labelled by construction and become training data. DocLayout-VL, trained on that data, takes over REPLICA's Segment stage, where a detector ensemble and two agents used to sit. Better segmentation gives better reconstructions, which give better data.

The swap is supported by the closed-set results above. Two members of the old ensemble are layout detectors that DocLayout-VL beats zero-shot on label-rich data: DocLayout-YOLO (for example 47.4 against 67.8 on OmniDocBench) and IndicDLP-YOLO (55.0 against 77.5 on IndicDLP). The replacement also removes hand-built steps: no IoU fusion, no separate labelling pass, no separate grouping pass.

This is the last arrow in the hub post's first figure. The system that made the data is improved by a model trained on that data. That is what makes the work a loop rather than a list of papers.

Limitations and open problems

The paper names four limitations. Each points to an open problem.

Two further questions follow from the design. HGC's mask trusts the predicted tree; how errors in the tree propagate into the masks is not broken out. And HGC refines tokens only after the whole tree is written. Whether grounding could feed back into generation, so that a poorly grounded node changes the tree, is open.

This is the last post in the series. The hub post, Building Grounded Document Intelligence, puts REPLICA, M3Grounder, DoCoG and DocLayout-VL together as one loop.

Key insights and nuances

References

Grouped by topic. Every entry links to its primary source.

The paper

This series

Segmentation and grounding