Papers › LayoutLMv2: Multi-modal Pre-training for Visually-Rich Document Understanding

LayoutLMv2: Multi-modal Pre-training for Visually-Rich Document Understanding

29 Dec 2020ACL 2021 5arXiv:2012.14740archive 2025-07-28

Yang Xu, Yiheng Xu, Tengchao Lv, Lei Cui, Furu Wei, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha Zhang, Wanxiang Che, Min Zhang, Lidong Zhou

Pre-training of text and layout has proved effective in a variety of visually-rich document understanding tasks due to its effective model architecture and the advantage of large-scale unlabeled scanned/digital-born documents. We propose LayoutLMv2 architecture with new pre-training tasks to model the interaction among text, layout, and image in a single multi-modal framework. Specifically, with a two-stream multi-modal Transformer encoder, LayoutLMv2 uses not only the existing masked visual-language modeling task but also the new text-image alignment and text-image matching tasks, which make it better capture the cross-modality interaction in the pre-training stage. Meanwhile, it also integrates a spatial-aware self-attention mechanism into the Transformer architecture so that the model can fully understand the relative positional relationship among different text blocks. Experiment results show that LayoutLMv2 outperforms LayoutLM by a large margin and achieves new state-of-the-art results on a wide variety of downstream visually-rich document understanding tasks, including FUNSD (0.7895 → 0.8420), CORD (0.9493 → 0.9601), SROIE (0.9524 → 0.9781), Kleister-NDA (0.8340 → 0.8520), RVL-CDIP (0.9443 → 0.9564), and DocVQA (0.7295 → 0.8672). We made our model and code publicly available at \url{https://aka.ms/layoutlmv2}.

PaperPDFConference PDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

microsoft/unilm officialmentioned in papermentioned on GitHubpytorch report
facebookresearch/data2vec_vision mentioned on GitHubpytorch report
huggingface/transformers mentioned on GitHubpytorch report
MS-P3/code3 mindspore report
PaddlePaddle/PaddleOCR paddleApache-2.0 report
pwc-1/Paper-9 mindspore report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

Document Image ClassificationDocument Layout AnalysisKey Information ExtractionKey-value Pair ExtractionLanguage ModelingLanguage ModellingRelation ExtractionSemantic entity labelingVisual Question AnsweringVisual Question Answering (VQA)document understanding

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Document Image Classification RVL-CDIP LayoutLMv2LARGE Accuracy 95.64% #6 of 31 Archive leaderboard report
Document Image Classification RVL-CDIP LayoutLMv2BASE Accuracy 95.25% #12 of 31 Archive leaderboard report
Document Image Classification RVL-CDIP LayoutLMv2BASE Parameters 200M #12 of 31 Archive leaderboard report
Key Information Extraction CORD LayoutLMv2LARGE F1 96.01 #8 of 9 Archive leaderboard report
Key Information Extraction CORD LayoutLMv2BASE F1 94.95 #9 of 9 Archive leaderboard report
Key Information Extraction Kleister NDA LayoutLMv2LARGE F1 85.2 #1 of 3 Archive leaderboard report
Key Information Extraction Kleister NDA LayoutLMv2BASE F1 83.3 #2 of 3 Archive leaderboard report
Key Information Extraction SROIE LayoutLMv2LARGE (Excluding OCR mismatch) F1 97.81 #1 of 5 Archive leaderboard report
Key Information Extraction SROIE LayoutLMv2LARGE F1 96.61 #3 of 5 Archive leaderboard report
Key Information Extraction SROIE LayoutLMv2BASE F1 96.25 #4 of 5 Archive leaderboard report
Key-value Pair Extraction RFUND-EN LayoutLMv2_base key-value pair F1 49.06 #12 of 13 Archive leaderboard report
Relation Extraction FUNSD LayoutLMv2 large F1 70.57 #8 of 9 Archive leaderboard report
Semantic entity labeling FUNSD LayoutLMv2LARGE F1 84.2 #12 of 15 Archive leaderboard report
Semantic entity labeling FUNSD LayoutLMv2BASE F1 82.76 #14 of 15 Archive leaderboard report
Visual Question Answering (VQA) DocVQA test LayoutLMv2LARGE ANLS 0.8672 #15 of 33 Archive leaderboard report
Visual Question Answering (VQA) DocVQA test LayoutLMv2BASE ANLS 0.7808 #25 of 33 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

1x1 ConvolutionAbsolute Position EncodingsAdamAttentionAverage PoolingBPEBatch NormalizationConvolutionDense ConnectionsDropoutFPNGlobal Average PoolingGrouped ConvolutionKaiming InitializationLabel SmoothingLayer NormalizationLayoutLMv2Linear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerReLUResNeXtResNeXt BlockResidual ConnectionSoftmaxTransformerWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections