{"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/factool-factuality-detection-in-generative-ai","title":"FacTool: Factuality Detection in Generative AI -- A Tool Augmented Framework for Multi-Task and Multi-Domain Scenarios","arxiv_id":"2307.13528","date":"2023-07-25","proceeding":null,"authors":["I-Chun Chern","Steffi Chern","Shiqi Chen","Weizhe Yuan","Kehua Feng","Chunting Zhou","Junxian He","Graham Neubig","PengFei Liu"],"abstract":"The emergence of generative pre-trained models has facilitated the synthesis of high-quality text, but it has also posed challenges in identifying factual errors in the generated text. In particular: (1) A wider range of tasks now face an increasing risk of containing factual errors when handled by generative models. (2) Generated texts tend to be lengthy and lack a clearly defined granularity for individual facts. (3) There is a scarcity of explicit evidence available during the process of fact checking. With the above challenges in mind, in this paper, we propose FacTool, a task and domain agnostic framework for detecting factual errors of texts generated by large language models (e.g., ChatGPT). Experiments on four different tasks (knowledge-based QA, code generation, mathematical reasoning, and scientific literature review) show the efficacy of the proposed method. We release the code of FacTool associated with ChatGPT plugin interface at https://github.com/GAIR-NLP/factool .","url_abs":"https://arxiv.org/abs/2307.13528v2","url_pdf":"https://arxiv.org/pdf/2307.13528v2.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":"factool-factuality-detection-in-generative-ai","repo_url":"https://github.com/gair-nlp/factool","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"factool-factuality-detection-in-generative-ai","repo_url":"https://github.com/freedomintelligence/sdak","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"factool-factuality-detection-in-generative-ai","repo_url":"https://github.com/yuxiaw/openfactcheck","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"fact-checking","task_name":"Fact Checking"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.13528","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.13528"}},"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/freedomintelligence/sdak","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gair-nlp/factool","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yuxiaw/openfactcheck","reach":null}],"summary":{"ran_fixture":1,"ran":2,"ran_draft_wrong":1,"unverified":10},"by_repo_kind":{"listed":{"samples":14,"ran":4,"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":"5cfeaee89a75c5ff","entry":"apply_rotary_pos_emb","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/workers/modeling_chatglm.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/workers/modeling_chatglm.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5cfeaee89a75c5ff"}},{"code_sha256_prefix":"43c9688838aff8b2","entry":"gelu","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/modeling_chatglm_med.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/modeling_chatglm_med.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"43c9688838aff8b2"}},{"code_sha256_prefix":"c8f235d13277facd","entry":"gelu_impl","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/modeling_chatglm_med.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/modeling_chatglm_med.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c8f235d13277facd"}},{"code_sha256_prefix":"d7e378ee7899fbde","entry":"split_tensor_along_last_dim","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/workers/modeling_chatglm.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/workers/modeling_chatglm.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d7e378ee7899fbde"}},{"code_sha256_prefix":"873e7bc30cea086f","entry":"calculate_accuracy","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/score_test_backend.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/score_test_backend.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":"873e7bc30cea086f"}},{"code_sha256_prefix":"a24b83b6424555fd","entry":"calculate_class_accuracy","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/score_test_backend.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/score_test_backend.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":"a24b83b6424555fd"}},{"code_sha256_prefix":"128f2c3f0e4e57c0","entry":"calculate_class_type_accuracy","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/score_test_backend.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/score_test_backend.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":"128f2c3f0e4e57c0"}},{"code_sha256_prefix":"237019e36b9481d9","entry":"default_init","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/workers/modeling_chatglm.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/workers/modeling_chatglm.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":"237019e36b9481d9"}},{"code_sha256_prefix":"22856e4b99f1261c","entry":"follow_rate","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/evaluate.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/evaluate.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":"22856e4b99f1261c"}},{"code_sha256_prefix":"9eed5c0d506a76a0","entry":"get_fewshot_input_path","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/gen_ans_atom.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/gen_ans_atom.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":"9eed5c0d506a76a0"}},{"code_sha256_prefix":"7744c6b2a37fdc8c","entry":"load_tf_weights_in_chatglm_6b","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/modeling_chatglm_med.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/modeling_chatglm_med.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":"7744c6b2a37fdc8c"}},{"code_sha256_prefix":"5efad641568837aa","entry":"match_choice","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/utils_v2.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/utils_v2.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":"5efad641568837aa"}},{"code_sha256_prefix":"ec74acf5910b6ffd","entry":"parser_anaswr_one_cateory","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/evaluate.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/evaluate.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":"ec74acf5910b6ffd"}},{"code_sha256_prefix":"75a67db826a48255","entry":"read_prompt","repo":"freedomintelligence/sdak","repo_kind":"listed","path":"code/src/gpt4_eval.py","file_url":"https://github.com/freedomintelligence/sdak/blob/HEAD/code/src/gpt4_eval.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":"75a67db826a48255"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}