{"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/anah-analytical-annotation-of-hallucinations","title":"ANAH: Analytical Annotation of Hallucinations in Large Language Models","arxiv_id":"2405.20315","date":"2024-05-30","proceeding":null,"authors":["Ziwei Ji","Yuzhe Gu","Wenwei Zhang","Chengqi Lyu","Dahua Lin","Kai Chen"],"abstract":"Reducing the `$\\textit{hallucination}$' problem of Large Language Models (LLMs) is crucial for their wide applications. A comprehensive and fine-grained measurement of the hallucination is the first key step for the governance of this issue but is under-explored in the community. Thus, we present $\\textbf{ANAH}$, a bilingual dataset that offers $\\textbf{AN}$alytical $\\textbf{A}$nnotation of $\\textbf{H}$allucinations in LLMs within Generative Question Answering. Each answer sentence in our dataset undergoes rigorous annotation, involving the retrieval of a reference fragment, the judgment of the hallucination type, and the correction of hallucinated content. ANAH consists of ~12k sentence-level annotations for ~4.3k LLM responses covering over 700 topics, constructed by a human-in-the-loop pipeline. Thanks to the fine granularity of the hallucination annotations, we can quantitatively confirm that the hallucinations of LLMs progressively accumulate in the answer and use ANAH to train and evaluate hallucination annotators. We conduct extensive experiments on studying generative and discriminative annotators and show that, although current open-source LLMs have difficulties in fine-grained hallucination annotation, the generative annotator trained with ANAH can surpass all open-source LLMs and GPT-3.5, obtain performance competitive with GPT-4, and exhibits better generalization ability on unseen questions.","url_abs":"https://arxiv.org/abs/2405.20315v1","url_pdf":"https://arxiv.org/pdf/2405.20315v1.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":"anah-analytical-annotation-of-hallucinations","repo_url":"https://github.com/open-compass/anah","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"generative-question-answering","task_name":"Generative Question Answering"},{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"sentence","task_name":"Sentence"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.20315","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.20315"}},"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":"deterministic:regex_extraction","url":"https://github.com/open-compass/ANAH","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/open-compass/anah","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/InternLM/lmdeploy","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":9},"by_repo_kind":{"found_in_text":{"samples":9,"ran":9,"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":"2bf6c00c566b801c","entry":"check_vl_llm","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/archs.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/archs.py","link_basis":"first_harvest_node","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":"2bf6c00c566b801c"}},{"code_sha256_prefix":"77ce2711c2f8950d","entry":"compile_response_format","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/_guided_decoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/_guided_decoding.py","link_basis":"first_harvest_node","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":"77ce2711c2f8950d"}},{"code_sha256_prefix":"7004ae9213140ec9","entry":"get_text","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/model.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7004ae9213140ec9"}},{"code_sha256_prefix":"c8ad433b6fe18d53","entry":"to_json","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v32_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v32_encoding.py","link_basis":"first_harvest_node","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":"c8ad433b6fe18d53"}},{"code_sha256_prefix":"ee1294cf4de7d8c0","entry":"to_json","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v4_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v4_encoding.py","link_basis":"first_harvest_node","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":"ee1294cf4de7d8c0"}},{"code_sha256_prefix":"e9281cecc545ad6f","entry":"tool_calls_from_openai_format","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v32_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v32_encoding.py","link_basis":"first_harvest_node","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":"e9281cecc545ad6f"}},{"code_sha256_prefix":"8b8cee237b9dc9d0","entry":"tool_calls_from_openai_format","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v4_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v4_encoding.py","link_basis":"first_harvest_node","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":"8b8cee237b9dc9d0"}},{"code_sha256_prefix":"aa8d2113d1ab432e","entry":"tools_from_openai_format","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v32_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v32_encoding.py","link_basis":"first_harvest_node","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":"aa8d2113d1ab432e"}},{"code_sha256_prefix":"a2584d89f3a50342","entry":"tools_from_openai_format","repo":"InternLM/lmdeploy","repo_kind":"found_in_text","path":"lmdeploy/deepseek_v4_encoding.py","file_url":"https://github.com/InternLM/lmdeploy/blob/HEAD/lmdeploy/deepseek_v4_encoding.py","link_basis":"first_harvest_node","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":"a2584d89f3a50342"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}