DocSEAM Enriches Page Tokens with Local Cross-Page Context for Multi-Page Document Understanding
Summary:DocSEAM inserts a lightweight module between a pretrained vision encoder and the language model. For each page, it builds a triplet with its immediate neighbors, runs center-anchored masked self-attention with directional salience gates, and returns only the enriched center-page tokens. The approach enriches local cross-page evidence without increasing the visual-token budget presented to the language model. After supervised cross-page warm-up and multi-page fine-tuning with the module frozen,
The Boundary Problem in Multi-Page Documents
Multi-page document models commonly encode every page independently. Text, tables, and layout can be extracted correctly within each page, but relationships crossing a page boundary never enter the visual tokens. Typical failures include a table header on one page and its values on the next, a definition appearing several pages before the conclusion that depends on it, or a sentence split by a page break.
Even when the language model eventually receives the full document, it must reason over page representations that were formed in isolation. Page identifiers or textual prompts can expose ordering, but they cannot recreate visual evidence that the encoder never saw. DocSEAM addresses this problem by inserting local cross-page enrichment between the pretrained vision encoder and the language model.
Mechanism: Local Triplets with Center-Anchored Fusion
1. Constructing a local triplet
For each target page, DocSEAM forms a triplet consisting of the current page and its immediate predecessor and successor. Every page is enriched when acting as the center page, allowing the module to capture continuations such as table headers, split columns, and nearby narrative context without applying global attention across the entire document.
The treatment of the first page, last page, and missing pages remains unspecified. Whether the implementation uses one-sided context, padded neighbors, or masked empty neighbors could materially affect edge behavior and must be checked in the released code and ablations.
2. Center-anchored masked attention
The center page serves as the query anchor. Attention masks restrict information flow, while directional salience gates regulate the contribution of the previous and next pages. The intended effect is to suppress irrelevant neighboring content while retaining directionally meaningful evidence, such as a table header immediately before a continuation table.
The abstract does not establish whether these gates are scalar, channel-wise, or content-adaptive, nor does it provide the gating function. It would therefore be premature to interpret the mechanism as a fixed previous-page versus next-page weighting scheme. Whether the gates adapt to question type is an important question for both interpretability and generalization.
3. Returning only the enriched center tokens
After fusion, only the enriched tokens for the center page are returned. With P pages and approximately D visual tokens per page, the language model still receives roughly P×D visual tokens. The module therefore preserves the downstream input interface and avoids structural growth in context length, KV-cache usage, and positional-encoding range.
4. Staged training
The model first undergoes supervised cross-page warm-up, allowing DocSEAM to learn which neighboring evidence is useful. DocSEAM is then frozen during multi-page fine-tuning. Freezing can preserve a stable enrichment distribution, but it also prevents continued joint adaptation among the module, vision encoder, and language model. Comparisons between frozen and jointly trained variants are needed to establish which effect dominates.
Attention Complexity and System Cost
If all P pages are concatenated and globally self-attended over, the attention term scales as approximately O((PD)²). Under a simple equal-token-per-page implementation, DocSEAM restricts each page to a three-page window, reducing the main cross-page fusion term to approximately O(PD²). Its intermediate computation also does not need to cover the entire document.
This does not make the complete inference stack proportionally cheaper. The downstream language model may still attend globally over all P×D visual tokens, so DocSEAM primarily limits the newly introduced fusion cost rather than removing the language model's own long-context expense.
Three deployment metrics deserve particular attention:
- Peak memory: Materializing tokens and attention matrices for three pages at once can approach three times the single-page working set. Windowed batching, FlashAttention, and fused kernels can avoid storing full attention matrices.
- Inference latency: Neighbor representations that are recomputed rather than reused add visual-encoding and I/O overhead. Encoding and local fusion should be pipelined instead of saving every intermediate representation for a second pass.
- Streaming documents: A strictly online system cannot access the right-hand page until it arrives. Waiting for one page or applying a causal completion policy creates a direct trade-off between context quality and time to first answer.
Interpreting the Evaluation
The abstract reports that the 9B model achieves the best results among evaluated open-weight models with up to 10B parameters on five multi-page document VQA benchmarks. This is more informative than a comparison only against larger proprietary systems because parameter scale and weight availability are more tightly controlled. It does not establish universal leadership over every open-weight model.
The controlled repagination experiment is more diagnostic than a single VQA average. If a model can locate cross-page spans after page boundaries are deliberately moved, its gains are less likely to be artifacts of memorized fixed layouts. A convincing evaluation should nevertheless report ordinary QA metrics, cross-page span-localization scores, variance under different pagination offsets, and negative controls such as removing, swapping, or shuffling neighboring pages.
The collected abstract does not disclose absolute scores, baseline configurations, training data, OCR setup, rendering resolution, visual-token budget, or run-to-run variance. Several confounders therefore remain:
- OCR and layout-extraction errors may dominate some benchmarks and obscure the actual contribution of visual cross-page fusion.
- Comparisons are difficult to interpret if models use different page resolutions or visual-token budgets.
- Training data may overlap public test content, while language priors may contribute to VQA accuracy independently of visual grounding.
- Repagination means without variance cannot establish whether the robustness gain is statistically reliable.
Deployment Guidance
An integration with an existing vision-language model can follow this sequence:
- Continue producing a fixed-length token matrix for each page while retaining page indices, source order, and layout coordinates.
- Build left and right neighbor indices for every center page, then apply center-anchored masking and directional salience gating.
- Concatenate only the enriched center-page outputs so that the language model retains its original token budget and positional interface.
- Warm up the module with cross-page supervision, then fine-tune on the target document domain while comparing frozen and end-to-end training.
- Test fixed pagination, shifted boundaries, blank pages, missing pages, page-order corruption, and tables spanning multiple pages before deployment.
Acceptance criteria should include more than mean accuracy: time to first token, page-level throughput, peak memory, visual-token count, cross-page span F1, and variance under pagination changes. The architecture is most relevant for contracts, financial reports, technical manuals, and papers whose questions frequently depend on adjacent pages. For predominantly single-page workloads, an ablation must first show that the extra module delivers more value than its latency and maintenance burden.
Engineering Verdict
DocSEAM offers a restrained solution to page-boundary fragmentation. It expands no language-model context budget, requires no replacement vision encoder, and patches missing cross-page evidence with local attention. Its most important contribution is arguably the use of controlled repagination to test the mechanism rather than relying solely on aggregate benchmark scores.
At this stage, the method is best treated as a high-value replication target. Absolute metrics, full ablations, training data, code, memory measurements, and latency results are still required to determine whether the gains come from genuine cross-page evidence fusion or from additional parameters, supervision, and implementation advantages.
— END —Source: Hugging Face Daily Papers (2026-11-25)
Tags: #DocSEAM #Multi-page Document Understanding #Vision-Language Models #Cross-page Attention #Document VQA
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments