--- title: DocSEAM emoji: 📄 colorFrom: blue colorTo: indigo sdk: gradio sdk_version: 6.32.0 app_file: app.py short_description: Multi-page document VQA with cross-page encoding python_version: "3.12" startup_duration_timeout: 1h --- # DocSEAM: Bidirectional Cross-Page Encoding for Multi-Page Document Understanding Demo of **[mossbee/DocSEAM](https://huggingface.co/mossbee/DocSEAM)** — a multi-page document understanding model built on Qwen3.5-9B that enriches each page's visual features with context from its **neighboring pages** (center-anchored masked self-attention over page triplets + directional salience gates), while preserving the visual token count. Upload one or more document pages in reading order, ask a question, and optionally render the **cross-page salience heatmap** showing which regions each page sends to / reads from its neighbors. - **Paper**: [DocSEAM: Bidirectional Cross-Page Encoding for Multi-Page Document Understanding](https://arxiv.org/abs/2611.34420) - **Project page**: https://mossbee.github.io/projects/DocSEAM/ - **Code**: https://github.com/mossbee/DocSEAM ## How to use 1. Upload page images **in reading order** (the first file is treated as page 1). DocSEAM handles any number of pages, including a single page; boundary pages fall back to themselves for the missing neighbor. 2. Type a question. By default the pages are placed at the start of the prompt; if you need finer control, include the literal `` placeholder in the question once per page to interleave text between pages (e.g. `Page 4:\n\n...`). 3. Toggle **Show cross-page salience heatmap** to visualize the directional gates of the center page's triplet, averaged over DocSEAM layers. ## Example assets The bundled example pages are pages 4–6 of [*Attention Is All You Need* (arXiv:1706.03762)](https://arxiv.org/abs/1706.03762), the sample shipped with the [DocSEAM repository](https://github.com/mossbee/DocSEAM), and the example questions are taken verbatim from the repository's `examples/attention/` JSONL files. ## License DocSEAM is released under the [S-Lab License 1.0](https://huggingface.co/mossbee/DocSEAM/blob/main/LICENSE) (non-commercial use). The Qwen3.5-9B backbone's Apache-2.0 license is retained.