{"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/alleviating-hallucinations-of-large-language","title":"Alleviating Hallucinations of Large Language Models through Induced Hallucinations","arxiv_id":"2312.15710","date":"2023-12-25","proceeding":null,"authors":["Yue Zhang","Leyang Cui","Wei Bi","Shuming Shi"],"abstract":"Despite their impressive capabilities, large language models (LLMs) have been observed to generate responses that include inaccurate or fabricated information, a phenomenon commonly known as ``hallucination''. In this work, we propose a simple \\textit{Induce-then-Contrast} Decoding (ICD) strategy to alleviate hallucinations. We first construct a factually weak LLM by inducing hallucinations from the original LLMs. Then, we penalize these induced hallucinations during decoding to enhance the factuality of the generated content. Concretely, we determine the final next-token predictions by amplifying the predictions from the original model and downplaying the induced untruthful predictions via contrastive decoding. Experimental results on both discrimination-based and generation-based hallucination evaluation benchmarks, such as TruthfulQA and \\textsc{FActScore}, demonstrate that our proposed ICD methods can effectively enhance the factuality of LLMs across various model sizes and families. For example, when equipped with ICD, Llama2-7B-Chat and Mistral-7B-Instruct achieve performance comparable to ChatGPT and GPT4 on TruthfulQA, respectively.","url_abs":"https://arxiv.org/abs/2312.15710v2","url_pdf":"https://arxiv.org/pdf/2312.15710v2.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":"alleviating-hallucinations-of-large-language","repo_url":"https://github.com/hiyouga/llama-factory","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"alleviating-hallucinations-of-large-language","repo_url":"https://github.com/hillzhang1999/icd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"hallucination-evaluation","task_name":"Hallucination Evaluation"},{"task_slug":"truthfulqa","task_name":"TruthfulQA"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2312.15710","atlas_url":"https://app.syntology.ai/?focus=2312.15710","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.15710"}},"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/hillzhang1999/icd","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hiyouga/llama-factory","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"unverified":9},"by_repo_kind":{"official":{"samples":13,"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":"db8a8ad434c0dd70","entry":"build_prompt","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/factscore_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/factscore_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"db8a8ad434c0dd70"}},{"code_sha256_prefix":"3d999b95009c7537","entry":"get_config_class_from_processor_class","repo":"hillzhang1999/icd","repo_kind":"official","path":"transformers/utils/create_dummy_models.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/transformers/utils/create_dummy_models.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3d999b95009c7537"}},{"code_sha256_prefix":"0c0b81b081919d8e","entry":"get_processor_types_from_config_class","repo":"hillzhang1999/icd","repo_kind":"official","path":"transformers/utils/create_dummy_models.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/transformers/utils/create_dummy_models.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0c0b81b081919d8e"}},{"code_sha256_prefix":"e9a7befa1d14a877","entry":"load_jsonl","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/factscore_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/factscore_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e9a7befa1d14a877"}},{"code_sha256_prefix":"d8198788b1eeae23","entry":"convert_dialog_halueval","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/utils/convert_dataset_for_training.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/utils/convert_dataset_for_training.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":"d8198788b1eeae23"}},{"code_sha256_prefix":"f4c68c4850723e81","entry":"download_url","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/factscore_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/factscore_eval.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":"f4c68c4850723e81"}},{"code_sha256_prefix":"158b8847881a64b3","entry":"format_best","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/truthfulqa_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/truthfulqa_eval.py","link_basis":"harvester_set","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":"158b8847881a64b3"}},{"code_sha256_prefix":"b176efb26f72e507","entry":"get_architectures_from_config_class","repo":"hillzhang1999/icd","repo_kind":"official","path":"transformers/utils/create_dummy_models.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/transformers/utils/create_dummy_models.py","link_basis":"harvester_set","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":"b176efb26f72e507"}},{"code_sha256_prefix":"85f010749bbdf0d3","entry":"get_bio_res_gpt","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/utils/generate_bio_hallucination.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/utils/generate_bio_hallucination.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":"85f010749bbdf0d3"}},{"code_sha256_prefix":"547b922a733a0af5","entry":"get_bio_res_hallu","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/utils/generate_bio_hallucination.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/utils/generate_bio_hallucination.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":"547b922a733a0af5"}},{"code_sha256_prefix":"2680f9029a02c8cc","entry":"get_template_and_fix_tokenizer","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/demo/template.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/demo/template.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":"2680f9029a02c8cc"}},{"code_sha256_prefix":"2a4c0ecd291e1795","entry":"load_csv","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/truthfulqa_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/truthfulqa_eval.py","link_basis":"harvester_set","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":"2a4c0ecd291e1795"}},{"code_sha256_prefix":"c852bd4d2face0a1","entry":"split_multi_answer","repo":"hillzhang1999/icd","repo_kind":"official","path":"src/benchmark_evaluation/truthfulqa_eval.py","file_url":"https://github.com/hillzhang1999/icd/blob/HEAD/src/benchmark_evaluation/truthfulqa_eval.py","link_basis":"harvester_set","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":"c852bd4d2face0a1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}