{"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/treemix-compositional-constituency-based-data","title":"TreeMix: Compositional Constituency-based Data Augmentation for Natural Language Understanding","arxiv_id":"2205.06153","date":"2022-05-12","proceeding":"NAACL 2022 7","authors":["Le Zhang","Zichao Yang","Diyi Yang"],"abstract":"Data augmentation is an effective approach to tackle over-fitting. Many previous works have proposed different data augmentations strategies for NLP, such as noise injection, word replacement, back-translation etc. Though effective, they missed one important characteristic of language--compositionality, meaning of a complex expression is built from its sub-parts. Motivated by this, we propose a compositional data augmentation approach for natural language understanding called TreeMix. Specifically, TreeMix leverages constituency parsing tree to decompose sentences into constituent sub-structures and the Mixup data augmentation technique to recombine them to generate new sentences. Compared with previous approaches, TreeMix introduces greater diversity to the samples generated and encourages models to learn compositionality of NLP data. Extensive experiments on text classification and SCAN demonstrate that TreeMix outperforms current state-of-the-art data augmentation methods.","url_abs":"https://arxiv.org/abs/2205.06153v2","url_pdf":"https://arxiv.org/pdf/2205.06153v2.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":"treemix-compositional-constituency-based-data","repo_url":"https://github.com/magiccircuit/treemix","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"constituency-parsing","task_name":"Constituency Parsing"},{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"natural-language-understanding","task_name":"Natural Language Understanding"},{"task_slug":"text-classification","task_name":"Text Classification"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"mixup","method_name":"Mixup"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2205.06153","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2205.06153"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/magiccircuit/treemix","reach":null}],"summary":{"ran_draft_wrong":3,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"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":"0ff7394e318b5d41","entry":"c2a","repo":"magiccircuit/treemix","repo_kind":"official","path":"Augmentation.py","file_url":"https://github.com/magiccircuit/treemix/blob/HEAD/Augmentation.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0ff7394e318b5d41"}},{"code_sha256_prefix":"5e2f74dcf9d332da","entry":"modify","repo":"magiccircuit/treemix","repo_kind":"official","path":"Augmentation.py","file_url":"https://github.com/magiccircuit/treemix/blob/HEAD/Augmentation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5e2f74dcf9d332da"}},{"code_sha256_prefix":"f097bb7bef545808","entry":"translate","repo":"magiccircuit/treemix","repo_kind":"official","path":"Augmentation.py","file_url":"https://github.com/magiccircuit/treemix/blob/HEAD/Augmentation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f097bb7bef545808"}},{"code_sha256_prefix":"af543a02e8ae5b2d","entry":"subtree_exchange_scan","repo":"magiccircuit/treemix","repo_kind":"official","path":"Augmentation.py","file_url":"https://github.com/magiccircuit/treemix/blob/HEAD/Augmentation.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":"af543a02e8ae5b2d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}