{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/docformer-end-to-end-transformer-for-document","title":"DocFormer: End-to-End Transformer for Document Understanding","arxiv_id":"2106.11539","date":"2021-06-22","proceeding":"ICCV 2021 10","authors":["Srikar Appalaraju","Bhavan Jasani","Bhargava Urala Kota","Yusheng Xie","R. Manmatha"],"abstract":"We present DocFormer -- a multi-modal transformer based architecture for the task of Visual Document Understanding (VDU). VDU is a challenging problem which aims to understand documents in their varied formats (forms, receipts etc.) and layouts. In addition, DocFormer is pre-trained in an unsupervised fashion using carefully designed tasks which encourage multi-modal interaction. DocFormer uses text, vision and spatial features and combines them using a novel multi-modal self-attention layer. DocFormer also shares learned spatial embeddings across modalities which makes it easy for the model to correlate text to visual tokens and vice versa. DocFormer is evaluated on 4 different datasets each with strong baselines. DocFormer achieves state-of-the-art results on all of them, sometimes beating models 4x its size (in no. of parameters).","url_abs":"https://arxiv.org/abs/2106.11539v2","url_pdf":"https://arxiv.org/pdf/2106.11539v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"docformer-end-to-end-transformer-for-document","repo_url":"https://github.com/shabie/docformer","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"document-image-classification","task_name":"Document Image Classification"},{"task_slug":"document-understanding","task_name":"document understanding"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/document-image-classification-on-rvl-cdip","task":"Document Image Classification","dataset":"RVL-CDIP","model":"DocFormerBASE","rank_in_archive_order":3,"of":31,"metrics":{"Accuracy":"96.17%","Parameters":"183M"},"uses_additional_data":false},{"leaderboard":"/sota/document-image-classification-on-rvl-cdip","task":"Document Image Classification","dataset":"RVL-CDIP","model":"DocFormer large","rank_in_archive_order":8,"of":31,"metrics":{"Accuracy":"95.50%","Parameters":"536M"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2106.11539","atlas_url":"https://app.syntology.ai/?focus=2106.11539","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.11539"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/shabie/docformer","reach":null}],"summary":{"ran":5,"unverified":5},"by_repo_kind":{"listed":{"samples":10,"ran":5,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"08d9b843959a11da","entry":"MultiModalAttentionLayer","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"08d9b843959a11da"}},{"code_sha256_prefix":"95c11b9646ef2995","entry":"PositionalEncoding","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"95c11b9646ef2995"}},{"code_sha256_prefix":"9d44110b605b91c8","entry":"PreNormAttn","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d44110b605b91c8"}},{"code_sha256_prefix":"2485d54f61db9f8d","entry":"RelativePosition","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2485d54f61db9f8d"}},{"code_sha256_prefix":"3c51327ee452d265","entry":"ResNetFeatureExtractor","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3c51327ee452d265"}},{"code_sha256_prefix":"b7af5dd1c0383ff1","entry":"DocFormer","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b7af5dd1c0383ff1"}},{"code_sha256_prefix":"4006b85007037117","entry":"DocFormerEmbeddings","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4006b85007037117"}},{"code_sha256_prefix":"682dbc1c67b2b9df","entry":"DocFormerEncoder","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"682dbc1c67b2b9df"}},{"code_sha256_prefix":"714cd85a4f672596","entry":"ExtractFeatures","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"714cd85a4f672596"}},{"code_sha256_prefix":"330baaddd559fac9","entry":"LanguageFeatureExtractor","repo":"shabie/docformer","repo_kind":"listed","path":"src/docformer/modeling.py","file_url":"https://github.com/shabie/docformer/blob/HEAD/src/docformer/modeling.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"330baaddd559fac9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}