{"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/logic-guided-data-augmentation-and","title":"Logic-Guided Data Augmentation and Regularization for Consistent Question Answering","arxiv_id":"2004.10157","date":"2020-04-21","proceeding":"ACL 2020 6","authors":["Akari Asai","Hannaneh Hajishirzi"],"abstract":"Many natural language questions require qualitative, quantitative or logical comparisons between two entities or events. This paper addresses the problem of improving the accuracy and consistency of responses to comparison questions by integrating logic rules and neural models. Our method leverages logical and linguistic knowledge to augment labeled training data and then uses a consistency-based regularizer to train the model. Improving the global consistency of predictions, our approach achieves large improvements over previous methods in a variety of question answering (QA) tasks including multiple-choice qualitative reasoning, cause-effect reasoning, and extractive machine reading comprehension. In particular, our method significantly improves the performance of RoBERTa-based models by 1-5% across datasets. We advance the state of the art by around 5-8% on WIQA and QuaRel and reduce consistency violations by 58% on HotpotQA. We further demonstrate that our approach can learn effectively from limited data.","url_abs":"https://arxiv.org/abs/2004.10157v2","url_pdf":"https://arxiv.org/pdf/2004.10157v2.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":"logic-guided-data-augmentation-and","repo_url":"https://github.com/AkariAsai/logic_guided_qa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"machine-reading-comprehension","task_name":"Machine Reading Comprehension"},{"task_slug":"multiple-choice","task_name":"Multiple-choice"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"reading-comprehension","task_name":"Reading Comprehension"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2004.10157","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2004.10157"}},"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/AkariAsai/logic_guided_qa","reach":null}],"summary":{"ran_draft_wrong":8,"unverified":10},"by_repo_kind":{"official":{"samples":18,"ran":8,"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":"51f66e8f1e74e6c8","entry":"add_negation","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"51f66e8f1e74e6c8"}},{"code_sha256_prefix":"f6c8f9aff2db5ca6","entry":"add_transitive_examples_one","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"f6c8f9aff2db5ca6"}},{"code_sha256_prefix":"497cb8886c3b4385","entry":"add_transitive_examples_two","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"497cb8886c3b4385"}},{"code_sha256_prefix":"a306ceb694d0ae50","entry":"extract_cause_effect","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"a306ceb694d0ae50"}},{"code_sha256_prefix":"1d14d98b6b0e76b3","entry":"flip_answer_label_as_choice","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"1d14d98b6b0e76b3"}},{"code_sha256_prefix":"902ccd6779092b1a","entry":"flip_label","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"902ccd6779092b1a"}},{"code_sha256_prefix":"9123e010fd4a0874","entry":"more_less_transforme","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"9123e010fd4a0874"}},{"code_sha256_prefix":"ceddf9a4afdfb9f8","entry":"replace_words","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"ceddf9a4afdfb9f8"}},{"code_sha256_prefix":"e250d92ff7a4e1c2","entry":"create_examples","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"e250d92ff7a4e1c2"}},{"code_sha256_prefix":"06b700e5d1ed3afe","entry":"create_symmetric_eight","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"06b700e5d1ed3afe"}},{"code_sha256_prefix":"264777adb796f474","entry":"create_symmetric_five","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"264777adb796f474"}},{"code_sha256_prefix":"5bc487d92545d2e4","entry":"create_symmetric_four","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"5bc487d92545d2e4"}},{"code_sha256_prefix":"fa8c05981e128568","entry":"create_symmetric_nine","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"fa8c05981e128568"}},{"code_sha256_prefix":"90447dfa80f4cafb","entry":"create_symmetric_one","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"90447dfa80f4cafb"}},{"code_sha256_prefix":"b1c84c791d839380","entry":"create_symmetric_seven","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"b1c84c791d839380"}},{"code_sha256_prefix":"11ef557fab1d6b7b","entry":"create_symmetric_six","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"11ef557fab1d6b7b"}},{"code_sha256_prefix":"f88f92a0c48c48a5","entry":"create_symmetric_three","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"f88f92a0c48c48a5"}},{"code_sha256_prefix":"551c47e3d79424f2","entry":"create_symmetric_two","repo":"AkariAsai/logic_guided_qa","repo_kind":"official","path":"wiqa_augmentation.py","file_url":"https://github.com/AkariAsai/logic_guided_qa/blob/HEAD/wiqa_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":"551c47e3d79424f2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}