{"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/learning-to-perturb-word-embeddings-for-out","title":"Learning to Perturb Word Embeddings for Out-of-distribution QA","arxiv_id":"2105.02692","date":"2021-05-06","proceeding":"ACL 2021 5","authors":["Seanie Lee","Minki Kang","Juho Lee","Sung Ju Hwang"],"abstract":"QA models based on pretrained language mod-els have achieved remarkable performance on various benchmark datasets.However, QA models do not generalize well to unseen data that falls outside the training distribution, due to distributional shifts.Data augmentation (DA) techniques which drop/replace words have shown to be effective in regularizing the model from overfitting to the training data.Yet, they may adversely affect the QA tasks since they incur semantic changes that may lead to wrong answers for the QA task. To tackle this problem, we propose a simple yet effective DA method based on a stochastic noise generator, which learns to perturb the word embedding of the input questions and context without changing their semantics. We validate the performance of the QA models trained with our word embedding perturbation on a single source dataset, on five different target domains.The results show that our method significantly outperforms the baselineDA methods. Notably, the model trained with ours outperforms the model trained with more than 240K artificially generated QA pairs.","url_abs":"https://arxiv.org/abs/2105.02692v3","url_pdf":"https://arxiv.org/pdf/2105.02692v3.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":"learning-to-perturb-word-embeddings-for-out","repo_url":"https://github.com/seanie12/SWEP","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"question-answering","task_name":"Question Answering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2105.02692","atlas_url":"https://app.syntology.ai/?focus=2105.02692","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.02692"}},"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/seanie12/SWEP","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":4,"ran_honours":2,"ran_violates":1,"unverified":3},"by_repo_kind":{"official":{"samples":10,"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":0,"samples":[{"code_sha256_prefix":"9df40357afea56cc","entry":"to_list","repo":"seanie12/SWEP","repo_kind":"official","path":"run_squad.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/run_squad.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9df40357afea56cc"}},{"code_sha256_prefix":"9026d9da5d085bd4","entry":"compute_exact","repo":"seanie12/SWEP","repo_kind":"official","path":"squad_metrics.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/squad_metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9026d9da5d085bd4"}},{"code_sha256_prefix":"bf75673211903e14","entry":"exact_match_score","repo":"seanie12/SWEP","repo_kind":"official","path":"mrqa_utils.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/mrqa_utils.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bf75673211903e14"}},{"code_sha256_prefix":"cdf4b8c0fec3da02","entry":"f1_score","repo":"seanie12/SWEP","repo_kind":"official","path":"mrqa_utils.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/mrqa_utils.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cdf4b8c0fec3da02"}},{"code_sha256_prefix":"aa6bc32d9c17a2f1","entry":"get_tokens","repo":"seanie12/SWEP","repo_kind":"official","path":"squad_metrics.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/squad_metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aa6bc32d9c17a2f1"}},{"code_sha256_prefix":"e7e75981cb464788","entry":"normalize_answer","repo":"seanie12/SWEP","repo_kind":"official","path":"mrqa_utils.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/mrqa_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e7e75981cb464788"}},{"code_sha256_prefix":"6a96435eba311b08","entry":"normalize_answer","repo":"seanie12/SWEP","repo_kind":"official","path":"squad_metrics.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/squad_metrics.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a96435eba311b08"}},{"code_sha256_prefix":"5fa242f804a151c9","entry":"convert_examples_to_features","repo":"seanie12/SWEP","repo_kind":"official","path":"squad_utils.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/squad_utils.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":"5fa242f804a151c9"}},{"code_sha256_prefix":"f4543e8ffa04b4d5","entry":"get_dataloader","repo":"seanie12/SWEP","repo_kind":"official","path":"run_squad.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/run_squad.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":"f4543e8ffa04b4d5"}},{"code_sha256_prefix":"3ed8b1210b9d20a6","entry":"process_batch","repo":"seanie12/SWEP","repo_kind":"official","path":"run_squad.py","file_url":"https://github.com/seanie12/SWEP/blob/HEAD/run_squad.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":"3ed8b1210b9d20a6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}