Document processing pipelines traditionally cascade optical character recognition (OCR) engines with downstream models for structured information extraction, leading to multi-stage error propagation. We fine-tune SmolDocling, a compact 256M-parameter vision-language model (VLM), to perform end-to-end key-value extraction directly from document images, jointly solving identification, localization, and association in a single pass without OCR preprocessing. We extend DocTags with specialized key, value, region, and link tags, enabling many-to-many relationships in a unified output sequence. To address data limitations, we design an augmentation pipeline combining synthetic form filling and graph-based crops that preserve complete key-value subgraphs. We further introduce a layout-aware evaluation framework extending text matching with spatial bounding box verification. On FUNSD, XFUND, and a large-scale private dataset, our model outperforms larger zero-shot VLM baselines under layout-aware evaluation, while being 27 times smaller than Qwen2.5-VL (7B) and over 5 times faster at inference. The model weights will be released publicly after publication.
Figures & tables
Figure 1: Key-value extraction examples: (a) visualization with keys (blue), values (green), and links (red arrows); (b) complex many-to-many relationships forming a directed graph.
Figure 2: DocTags representation: a document image (left) and its corresponding structured markup (right) encoding key-value content, bounding boxes, and links.
Figure 3: Model architecture [ 27 ] : a SigLIP vision encoder (93M) produces patch embeddings that are projected and combined with text embeddings, then fed to a SmolLM2 decoder (135M) to generate DocTags output.
Dataset
Samples
Annotations
Train
Val
Test
Entities
Links
DocLayNetV2
16,229
2,032
2,085
429,595
241,469
XFUND
1,043
175
175
69,974
51,146
FUNSD
149
25
25
8,362
5,621
Table 2: Dataset statistics. Entities and Links columns report totals for all splits.
Figure 4: Data augmentation pipeline used for training: (a) synthetic filling of empty form fields and (b) graph-based crop generation preserving complete key-value subgraphs.
Model
Input
FUNSD
XFUND
SER
RE
SER
RE
BERT base [ 10 ]
T
0.610
0.277
–
–
XLM-R base [ 9 ]
T
0.667
0.266
0.342
0.222
XLM-R large [ 9 ]
T
0.707
0.347
0.429
0.266
InfoXLM base [ 8 ]
T
0.685
0.292
0.373
0.235
InfoXLM large [ 8 ]
T
0.733
0.368
0.448
0.302
Table 3: Contextual OCR/text-layout baselines on FUNSD and XFUND. These models consume OCR text and/or layout as input and are not directly comparable under our layout-aware metric.
Model
Size
Loc.
FUNSD
XFUND
SER
RE
SER
RE
Llama-3.2 [ 11 ]
11B
×
0.389
0.186
–
–
GPT-4o [ 28 ]
–
×
0.554
0.274
–
–
Qwen2.5-VL [ 3 ]
7B
✓
0.273
0.144
0.285
0.123
Ours (SmolDocling)
256M
✓
0.514
0.275
0.412
0.206
Table 4: VLM comparison on FUNSD and XFUND. ✓ / × indicates layout-aware (bounding box) evaluation. All baselines are evaluated zero-shot.
Model
Size
DocLayNetV2
FUNSD
XFUND
SER
RE
SER
RE
SER
RE
Qwen2.5-VL [ 3 ]
7B
0.179
0.074
0.273
0.144
0.285
0.123
Ours (SmolDocling)
256M
0.485
0.321
0.514
0.275
0.412
0.206
Table 5: Layout-aware comparison with Qwen2.5-VL across all three datasets.
Variant
DLNv2
FUNSD
XFUND
SER
RE
SER
RE
SER
RE
DLNv2 crops + aug.
0.401
0.287
0.479
0.275
0.321
0.122
All crops
0.425
0.304
0.521
0.261
0.361
0.166
All crops + aug.
0.416
0.296
0.514
0.275
0.348
0.172
All crops + aug. + unfilled
0.485
0.321
0.523
0.239
0.376
0.171
All crops + aug. + synth. filled †
0.459
0.301
0.543
0.261
0.412
0.206
Table 6: Data pipeline ablation (layout-aware evaluation). DLNv2 = DocLayNetV2.
Config
DLNv2
FUNSD
XFUND
SER
RE
SER
RE
SER
RE
Link-in-key †
0.459
0.301
0.543
0.261
0.412
0.206
Spatial + link-in-key
0.504
0.282
0.557
0.251
0.441
0.194
Spatial + link-in-value
0.506
0.267
0.551
0.235
0.448
0.175
Spatial + link-in-value + wt. loss
0.509
0.269
0.510
0.197
0.444
0.178
Table 7: Model configuration ablation (layout-aware evaluation). DLNv2 = DocLayNetV2. All variants use all crops + aug. + synth. filled.
Figure 5: Predictions on FUNSD and XFUND test documents. The model correctly identifies keys (blue), values (green), bounding boxes, and linking relationships (yellow arrows) across English, Spanish, and Japanese forms.
Figure 6: Predictions on DocLayNetV2 test documents. The model generalizes across diverse document types: financial reports (a), structured forms (b), and report-style layouts (c).