{"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/q-2-evaluating-factual-consistency-in","title":"$Q^{2}$: Evaluating Factual Consistency in Knowledge-Grounded Dialogues via Question Generation and Question Answering","arxiv_id":"2104.08202","date":"2021-04-16","proceeding":null,"authors":["Or Honovich","Leshem Choshen","Roee Aharoni","Ella Neeman","Idan Szpektor","Omri Abend"],"abstract":"Neural knowledge-grounded generative models for dialogue often produce content that is factually inconsistent with the knowledge they rely on, making them unreliable and limiting their applicability. Inspired by recent work on evaluating factual consistency in abstractive summarization, we propose an automatic evaluation metric for factual consistency in knowledge-grounded dialogue using automatic question generation and question answering. Our metric, denoted $Q^2$, compares answer spans using natural language inference (NLI), instead of token-based matching as done in previous work. To foster proper evaluation, we curate a novel dataset of dialogue system outputs for the Wizard-of-Wikipedia dataset, manually annotated for factual consistency. We perform a thorough meta-evaluation of $Q^2$ against other metrics using this dataset and two others, where it consistently shows higher correlation with human judgements.","url_abs":"https://arxiv.org/abs/2104.08202v2","url_pdf":"https://arxiv.org/pdf/2104.08202v2.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":"q-2-evaluating-factual-consistency-in","repo_url":"https://github.com/orhonovich/q-squared","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"abstractive-text-summarization","task_name":"Abstractive Text Summarization"},{"task_slug":"dialogue-evaluation","task_name":"Dialogue Evaluation"},{"task_slug":"natural-language-inference","task_name":"Natural Language Inference"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"question-generation","task_name":"Question Generation"},{"task_slug":"question-generation","task_name":"Question-Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2104.08202","atlas_url":"https://app.syntology.ai/?focus=2104.08202","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.08202"}},"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/orhonovich/q-squared","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":7},"by_repo_kind":{"listed":{"samples":7,"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":"be95edb39d85841d","entry":"bootstrap","repo":"orhonovich/q-squared","repo_kind":"listed","path":"system_level.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/system_level.py","link_basis":"first_harvest_node","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":"be95edb39d85841d"}},{"code_sha256_prefix":"96af2fcff56e897c","entry":"clean_text","repo":"orhonovich/q-squared","repo_kind":"listed","path":"pipeline/score.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/pipeline/score.py","link_basis":"first_harvest_node","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":"96af2fcff56e897c"}},{"code_sha256_prefix":"ce124c470165df33","entry":"compute_precision_recall_single_threshold","repo":"orhonovich/q-squared","repo_kind":"listed","path":"precision_recall.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/precision_recall.py","link_basis":"first_harvest_node","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":"ce124c470165df33"}},{"code_sha256_prefix":"32d8ebcf96ce0235","entry":"compute_precision_recall_various_thresholds","repo":"orhonovich/q-squared","repo_kind":"listed","path":"precision_recall.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/precision_recall.py","link_basis":"first_harvest_node","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":"32d8ebcf96ce0235"}},{"code_sha256_prefix":"e5df2ff8c5c66f6a","entry":"f1_score","repo":"orhonovich/q-squared","repo_kind":"listed","path":"pipeline/score.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/pipeline/score.py","link_basis":"first_harvest_node","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":"e5df2ff8c5c66f6a"}},{"code_sha256_prefix":"3d06bf3bb3f40703","entry":"get_metric_scores","repo":"orhonovich/q-squared","repo_kind":"listed","path":"precision_recall.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/precision_recall.py","link_basis":"first_harvest_node","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":"3d06bf3bb3f40703"}},{"code_sha256_prefix":"6f5e74888115a48d","entry":"merge_cross_annotations","repo":"orhonovich/q-squared","repo_kind":"listed","path":"system_level.py","file_url":"https://github.com/orhonovich/q-squared/blob/HEAD/system_level.py","link_basis":"first_harvest_node","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":"6f5e74888115a48d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}