{"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/coda-constrained-generation-based-data","title":"CoDa: Constrained Generation based Data Augmentation for Low-Resource NLP","arxiv_id":"2404.00415","date":"2024-03-30","proceeding":null,"authors":["Chandra Kiran Reddy Evuru","Sreyan Ghosh","Sonal Kumar","Ramaneswaran S","Utkarsh Tyagi","Dinesh Manocha"],"abstract":"We present CoDa (Constrained Generation based Data Augmentation), a controllable, effective, and training-free data augmentation technique for low-resource (data-scarce) NLP. Our approach is based on prompting off-the-shelf instruction-following Large Language Models (LLMs) for generating text that satisfies a set of constraints. Precisely, we extract a set of simple constraints from every instance in the low-resource dataset and verbalize them to prompt an LLM to generate novel and diverse training instances. Our findings reveal that synthetic data that follows simple constraints in the downstream dataset act as highly effective augmentations, and CoDa can achieve this without intricate decoding-time constrained generation techniques or fine-tuning with complex algorithms that eventually make the model biased toward the small number of training instances. Additionally, CoDa is the first framework that provides users explicit control over the augmentation generation process, thereby also allowing easy adaptation to several domains. We demonstrate the effectiveness of CoDa across 11 datasets spanning 3 tasks and 3 low-resource settings. CoDa outperforms all our baselines, qualitatively and quantitatively, with improvements of 0.12%-7.19%. Code is available here: https://github.com/Sreyan88/CoDa","url_abs":"https://arxiv.org/abs/2404.00415v1","url_pdf":"https://arxiv.org/pdf/2404.00415v1.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":"coda-constrained-generation-based-data","repo_url":"https://github.com/sreyan88/coda","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"instruction-following","task_name":"Instruction Following"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.00415","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.00415"}},"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/sreyan88/coda","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":8,"ran":7,"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":8,"samples":[{"code_sha256_prefix":"fa2a03a0ea1ff2c2","entry":"clean_pipeline","repo":"sreyan88/coda","repo_kind":"official","path":"Lexical-Constraints/lexical_constraints_exemplars.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/Lexical-Constraints/lexical_constraints_exemplars.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fa2a03a0ea1ff2c2"}},{"code_sha256_prefix":"043d088c5500f82f","entry":"get_conll_str","repo":"sreyan88/coda","repo_kind":"official","path":"json_to_conll.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/json_to_conll.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"043d088c5500f82f"}},{"code_sha256_prefix":"3fc7cd41ab920cbd","entry":"get_phrase_idx_in_text","repo":"sreyan88/coda","repo_kind":"official","path":"json_to_conll.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/json_to_conll.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3fc7cd41ab920cbd"}},{"code_sha256_prefix":"72d1dd3a64b7cb1e","entry":"is_matching","repo":"sreyan88/coda","repo_kind":"official","path":"json_to_conll.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/json_to_conll.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"72d1dd3a64b7cb1e"}},{"code_sha256_prefix":"77f69af078e09830","entry":"mean_pooling","repo":"sreyan88/coda","repo_kind":"official","path":"Lexical-Constraints/lexical_constraints_exemplars.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/Lexical-Constraints/lexical_constraints_exemplars.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"77f69af078e09830"}},{"code_sha256_prefix":"7b35ac76fbfe10ad","entry":"proposal_score","repo":"sreyan88/coda","repo_kind":"official","path":"Lexical-Substitution/scores.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/Lexical-Substitution/scores.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7b35ac76fbfe10ad"}},{"code_sha256_prefix":"1ae9f9a3449338bb","entry":"remove_special_characters","repo":"sreyan88/coda","repo_kind":"official","path":"Lexical-Constraints/lexical_constraints_exemplars.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/Lexical-Constraints/lexical_constraints_exemplars.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1ae9f9a3449338bb"}},{"code_sha256_prefix":"4b037fa925077c99","entry":"similarity_score","repo":"sreyan88/coda","repo_kind":"official","path":"Lexical-Substitution/scores.py","file_url":"https://github.com/sreyan88/coda/blob/HEAD/Lexical-Substitution/scores.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4b037fa925077c99"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}