{"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/dot-an-efficient-double-transformer-for-nlp","title":"DoT: An efficient Double Transformer for NLP tasks with tables","arxiv_id":"2106.00479","date":"2021-06-01","proceeding":"Findings (ACL) 2021 8","authors":["Syrine Krichene","Thomas Müller","Julian Martin Eisenschlos"],"abstract":"Transformer-based approaches have been successfully used to obtain state-of-the-art accuracy on natural language processing (NLP) tasks with semi-structured tables. These model architectures are typically deep, resulting in slow training and inference, especially for long inputs. To improve efficiency while maintaining a high accuracy, we propose a new architecture, DoT, a double transformer model, that decomposes the problem into two sub-tasks: A shallow pruning transformer that selects the top-K tokens, followed by a deep task-specific transformer that takes as input those K tokens. Additionally, we modify the task-specific attention to incorporate the pruning scores. The two transformers are jointly trained by optimizing the task-specific loss. We run experiments on three benchmarks, including entailment and question-answering. We show that for a small drop of accuracy, DoT improves training and inference time by at least 50%. We also show that the pruning transformer effectively selects relevant tokens enabling the end-to-end model to maintain similar accuracy as slower baseline models. Finally, we analyse the pruning and give some insight into its impact on the task model.","url_abs":"https://arxiv.org/abs/2106.00479v1","url_pdf":"https://arxiv.org/pdf/2106.00479v1.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":"dot-an-efficient-double-transformer-for-nlp","repo_url":"https://github.com/google-research/tapas","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"tf","reach":null}],"tasks":[{"task_slug":"question-answering","task_name":"Question Answering"}],"methods":[{"method_slug":"pruning","method_name":"Pruning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2106.00479","atlas_url":"https://app.syntology.ai/?focus=2106.00479","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.00479"}},"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":"deterministic:regex_extraction","url":"https://github.com/google-research/tapas","reach":null}],"summary":{"ran":1,"ran_draft_wrong":4,"unverified":4},"by_repo_kind":{"official":{"samples":9,"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":"d2b385866a52e38e","entry":"_BucketedTensor","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d2b385866a52e38e"}},{"code_sha256_prefix":"2a1bd049028d6725","entry":"_additive_mask","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2a1bd049028d6725"}},{"code_sha256_prefix":"03d02bc4f2462532","entry":"_compute_bucketed_attention_mask","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"03d02bc4f2462532"}},{"code_sha256_prefix":"d11811c587844793","entry":"_create_bucketed_tensor","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d11811c587844793"}},{"code_sha256_prefix":"892999c5d5451450","entry":"_dropout","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"892999c5d5451450"}},{"code_sha256_prefix":"89b5ac32bcd95fef","entry":"_attention_scores","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"89b5ac32bcd95fef"}},{"code_sha256_prefix":"53a77c65c41a166c","entry":"_bucketed_attention_layer","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"53a77c65c41a166c"}},{"code_sha256_prefix":"b54d98cfb82346cb","entry":"_dense_layer_3d","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b54d98cfb82346cb"}},{"code_sha256_prefix":"6eb350efd5477531","entry":"create_bucketed_attention_layer","repo":"google-research/tapas","repo_kind":"official","path":"tapas/utils/attention_utils.py","file_url":"https://github.com/google-research/tapas/blob/HEAD/tapas/utils/attention_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6eb350efd5477531"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}