Header Label Value Paragraph
drag to pan · scroll to zoom
Attention weight matrix a(i, j)

Document Layout Attention: Field Extraction (2D)

Intelligent Document Processing (IDP) systems like LayoutLMv3 read a form or invoice not as a flat string of OCR text but as tokens scattered across a 2D page, each carrying both semantic content and spatial position. This simulator renders a mock invoice as a flat 2D page of labelled blocks and computes a real self-attention layer over them, blending content similarity with a spatial-proximity bias exactly as a layout-aware transformer does, then draws the resulting label→value attention links as glowing arcs plus a live N×N attention-weight heatmap. Tune the spatial bias weight, softmax temperature, simulated OCR noise and link-confidence threshold, or shuffle the layout entirely, and watch live field-extraction accuracy, link count and attention entropy respond. Drag the page to pan and scroll to zoom.