How it works (AI summary)
DocSEAM inserts two transformer layers (~235M parameters, zero-initialized at residual outputs) between a pretrained vision encoder and the LLM. For each page, it constructs a three-page triplet (previous, current, next), applies center-anchored masked self-attention that blocks direct previous-to-next interaction, modulates cross-page attention via four learned directional salience gates per token conditioned on content-frontier sinusoidal positional features, and outputs only the enriched center-page tokens. Training proceeds via Stage A supervised cross-page boundary alignment on 74k MP-DocStruct1M examples (with auxiliary gate losses while freezing the VLM) followed by Stage B LoRA fine-tuning of the LLM and patch merger with DocSEAM frozen.