LayoutLMv3 is a pre-trained multimodal Transformer for Document AI with unified text and image masking. The simple unified architecture and training objectives make LayoutLMv3 a general-purpose pre-trained model.
Runs On
What it takes to serve layoutlmv3-base (125M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.
| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
|---|---|---|---|---|---|
| 16-bit | 0.3 GB | 0.3 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 8-bit | 0.1 GB | 0.2 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
| 4-bit | 0.1 GB | 0.1 GB | 1x MI300X (192 GB) Vultr |
$1.85 | 1x H100 $1.99 · 1x MI325X $2.00 |
Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.
SAVRN's Notes on layoutlmv3-base
Forms, receipts and scanned pages are the workload here. This 125M parameter transformer from Microsoft reads text and page images together and fine-tunes for form understanding, document visual question answering, document image classification and layout analysis. Memory is not the constraint: 0.3 GB at 16-bit, 0.2 GB at 8-bit, 0.1 GB at 4-bit. The eleven files come to about 2.0 GB across safetensors, ONNX, PyTorch and TensorFlow formats; you only need one. One 192 GB MI300X at $1.85 per hour on-demand, the cheapest setup on our board, leaves nearly all of that memory free.
The constraint is the license. CC BY-NC-SA 4.0 rules out commercial use without separate permission, and any adaptation you fine-tune must carry the same license, so a production pipeline needs written permission first. Check the 514 token context against your page lengths, and note the April 2022 release, last updated April 2024.
Model Card
LayoutLMv3 is a pre-trained multimodal Transformer for Document AI with unified text and image masking. The simple unified architecture and training objectives make LayoutLMv3 a general-purpose pre-trained model. For example, LayoutLMv3 can be fine-tuned for both text-centric tasks, including form understanding, receipt understanding, and document visual question answering, and image-centric tasks such as document image classification and document layout analysis. Yupan Huang, Tengchao Lv, Lei Cui, Yutong Lu, Furu Wei, ACM Multimedia 2022. If you find LayoutLM useful in your research, please cite the following paper: The content of this project itself is licensed under the…
Excerpt from the card by Microsoft, licensed cc-by-nc-sa-4.0.
Configuration
- Context length (tokens)
- 514
- Layers
- 12
- Hidden size
- 768
- Feed-forward size
- 3,072
- Attention heads
- 12
- Vocabulary size
- 50,265
- Stored precision
- float32
- Model type
- layoutlmv3
Identity and Version
- Repository
- microsoft/layoutlmv3-base
- Publisher
- Microsoft
- Task
- Not stated by the source
- Modality
- Other
- Library
- transformers
- Parameters
- 125M parameters
- Languages
- en
- Revision
- cfbbbff0762e6aab37086fdd4739ad14fe7d5db4
- First published
- 2022-04-18
- Last updated
- 2024-04-10
Files and Weights
11 files, 2.0 GB in total. The weights are 4 files totalling 2.0 GB in bin, h5, onnx, safetensors.
Every file
| File | Type | Size | SHA-256 |
|---|---|---|---|
| model.onnx | Weights | 501.6 MB | e8d1f8e133bc |
| model.safetensors | Weights | 501.3 MB | 3c6bd09290e2 |
| pytorch_model.bin | Weights | 501.4 MB | 3b631333e3cb |
| tf_model.h5 | Weights | 501.6 MB | 0e8ef2140ebb |
| config.json | Configuration | 856 B | — |
| preprocessor_config.json | Configuration | 275 B | — |
| README.md | Documentation | 1.7 KB | — |
| .gitattributes | Repository | 1.3 KB | — |
| merges.txt | Tokenizer | 456.3 KB | — |
| tokenizer_config.json | Tokenizer | 1.1 KB | — |
| vocab.json | Tokenizer | 898.8 KB | — |
License and Download
- License
- cc-by-nc-sa-4.0
- Access
- Open weights, no gate
- Download size
- 2.0 GB
Released by Microsoft through its official repository on Hugging Face.
Built From
- Described by arXiv:2204.08387
Memory Requirements
| Precision | Weights in memory |
|---|---|
| As published | 2.0 GB |
| 16-bit | 0.3 GB |
| 8-bit | 0.1 GB |
| 4-bit | 0.1 GB |
Weights only, from the published parameter count; the key-value cache and runtime add to this.
Questions About layoutlmv3-base
How much GPU memory does layoutlmv3-base need?
About 0.3 GB at 16-bit and 0.1 GB at 4-bit: the weights (125M parameters) plus a working margin. A long context needs more.
What is the cheapest GPU to run layoutlmv3-base on?
At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.
Can I use layoutlmv3-base commercially?
Not without separate permission. layoutlmv3-base is released under Creative Commons Attribution-NonCommercial-ShareAlike 4.0. CC BY-NC-SA 4.0 permits non-commercial sharing and adapting with credit, and requires adaptations to use the same license. Commercial use needs separate permission.
What is layoutlmv3-base's context length?
514 tokens, from the maximum position embeddings in its published configuration.