{"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/disentqa-disentangling-parametric-and","title":"DisentQA: Disentangling Parametric and Contextual Knowledge with Counterfactual Question Answering","arxiv_id":"2211.05655","date":"2022-11-10","proceeding":null,"authors":["Ella Neeman","Roee Aharoni","Or Honovich","Leshem Choshen","Idan Szpektor","Omri Abend"],"abstract":"Question answering models commonly have access to two sources of \"knowledge\" during inference time: (1) parametric knowledge - the factual knowledge encoded in the model weights, and (2) contextual knowledge - external knowledge (e.g., a Wikipedia passage) given to the model to generate a grounded answer. Having these two sources of knowledge entangled together is a core issue for generative QA models as it is unclear whether the answer stems from the given non-parametric knowledge or not. This unclarity has implications on issues of trust, interpretability and factuality. In this work, we propose a new paradigm in which QA models are trained to disentangle the two sources of knowledge. Using counterfactual data augmentation, we introduce a model that predicts two answers for a given question: one based on given contextual knowledge and one based on parametric knowledge. Our experiments on the Natural Questions dataset show that this approach improves the performance of QA models by making them more robust to knowledge conflicts between the two knowledge sources, while generating useful disentangled answers.","url_abs":"https://arxiv.org/abs/2211.05655v1","url_pdf":"https://arxiv.org/pdf/2211.05655v1.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":"disentqa-disentangling-parametric-and","repo_url":"https://github.com/ellaneeman/disent_qa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"data-augmentation","task_name":"Data Augmentation"},{"task_slug":"natural-questions","task_name":"Natural Questions"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.05655","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.05655"}},"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/ellaneeman/disent_qa","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"ran":0,"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":"a0de6f5df583e698","entry":"generate_answer","repo":"ellaneeman/disent_qa","repo_kind":"official","path":"query_model.py","file_url":"https://github.com/ellaneeman/disent_qa/blob/HEAD/query_model.py","link_basis":"harvester_set","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":"a0de6f5df583e698"}},{"code_sha256_prefix":"f1d4e257c8e1ff65","entry":"get_data_for_fine_tuning","repo":"ellaneeman/disent_qa","repo_kind":"official","path":"run_nq_fine_tuning.py","file_url":"https://github.com/ellaneeman/disent_qa/blob/HEAD/run_nq_fine_tuning.py","link_basis":"harvester_set","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":"f1d4e257c8e1ff65"}},{"code_sha256_prefix":"a19a75e14c98f83a","entry":"json_to_pandas","repo":"ellaneeman/disent_qa","repo_kind":"official","path":"prepare_data.py","file_url":"https://github.com/ellaneeman/disent_qa/blob/HEAD/prepare_data.py","link_basis":"harvester_set","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":"a19a75e14c98f83a"}},{"code_sha256_prefix":"4aee7c93f0ffb3ad","entry":"save_split","repo":"ellaneeman/disent_qa","repo_kind":"official","path":"prepare_data.py","file_url":"https://github.com/ellaneeman/disent_qa/blob/HEAD/prepare_data.py","link_basis":"harvester_set","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":"4aee7c93f0ffb3ad"}},{"code_sha256_prefix":"0417db2d6a6d3158","entry":"split_by_fraction","repo":"ellaneeman/disent_qa","repo_kind":"official","path":"prepare_data.py","file_url":"https://github.com/ellaneeman/disent_qa/blob/HEAD/prepare_data.py","link_basis":"harvester_set","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":"0417db2d6a6d3158"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}