{"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/enhancing-uncertainty-based-hallucination","title":"Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus","arxiv_id":"2311.13230","date":"2023-11-22","proceeding":null,"authors":["Tianhang Zhang","Lin Qiu","Qipeng Guo","Cheng Deng","Yue Zhang","Zheng Zhang","Chenghu Zhou","Xinbing Wang","Luoyi Fu"],"abstract":"Large Language Models (LLMs) have gained significant popularity for their impressive performance across diverse fields. However, LLMs are prone to hallucinate untruthful or nonsensical outputs that fail to meet user expectations in many real-world applications. Existing works for detecting hallucinations in LLMs either rely on external knowledge for reference retrieval or require sampling multiple responses from the LLM for consistency verification, making these methods costly and inefficient. In this paper, we propose a novel reference-free, uncertainty-based method for detecting hallucinations in LLMs. Our approach imitates human focus in factuality checking from three aspects: 1) focus on the most informative and important keywords in the given text; 2) focus on the unreliable tokens in historical context which may lead to a cascade of hallucinations; and 3) focus on the token properties such as token type and token frequency. Experimental results on relevant datasets demonstrate the effectiveness of our proposed method, which achieves state-of-the-art performance across all the evaluation metrics and eliminates the need for additional information.","url_abs":"https://arxiv.org/abs/2311.13230v1","url_pdf":"https://arxiv.org/pdf/2311.13230v1.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":"enhancing-uncertainty-based-hallucination","repo_url":"https://github.com/zthang/focus","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"enhancing-uncertainty-based-hallucination","repo_url":"https://github.com/iinemo/lm-polygraph","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.13230","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.13230"}},"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/iinemo/lm-polygraph","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zthang/focus","reach":{"status":"ok"}}],"summary":{"ran_fixture":2,"ran":7,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":11,"ran":10,"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":11,"samples":[{"code_sha256_prefix":"30d7eec482ebf6b1","entry":"repeat_kv","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_llama2.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_llama2.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":2,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"30d7eec482ebf6b1"}},{"code_sha256_prefix":"9b4dff79d5e6102c","entry":"apply_rotary_pos_emb","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gpt_neox.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gpt_neox.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9b4dff79d5e6102c"}},{"code_sha256_prefix":"4397f33726a2999e","entry":"attention_mask_func","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gpt_neox.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gpt_neox.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4397f33726a2999e"}},{"code_sha256_prefix":"a1d797b4db2912e4","entry":"calcu_auc_pr","repo":"zthang/focus","repo_kind":"official","path":"run_wikibiogpt3.py","file_url":"https://github.com/zthang/focus/blob/HEAD/run_wikibiogpt3.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a1d797b4db2912e4"}},{"code_sha256_prefix":"c2217cd556fe5607","entry":"create_sinusoidal_positions","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gptj.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gptj.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c2217cd556fe5607"}},{"code_sha256_prefix":"6ef9ea8bea823588","entry":"dropout_add","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_RW.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_RW.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6ef9ea8bea823588"}},{"code_sha256_prefix":"22d927bdb866159f","entry":"get_embed_positions","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gptj.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gptj.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"22d927bdb866159f"}},{"code_sha256_prefix":"2e3bec9f0c9b1973","entry":"rotate_every_two","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gptj.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gptj.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2e3bec9f0c9b1973"}},{"code_sha256_prefix":"b99eea6376d1e212","entry":"rotate_half","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_gpt_neox.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_gpt_neox.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b99eea6376d1e212"}},{"code_sha256_prefix":"2502f906145be7f6","entry":"rotate_half","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_RW.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_RW.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2502f906145be7f6"}},{"code_sha256_prefix":"b4acc4f0962c97ca","entry":"build_alibi_tensor","repo":"zthang/focus","repo_kind":"official","path":"models/modeling_RW.py","file_url":"https://github.com/zthang/focus/blob/HEAD/models/modeling_RW.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b4acc4f0962c97ca"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}