Papers › Knowledge Verification to Nip Hallucination in the Bud

Knowledge Verification to Nip Hallucination in the Bud

19 Jan 2024arXiv:2401.10768archive 2025-07-28

Fanqi Wan, Xinting Huang, Leyang Cui, Xiaojun Quan, Wei Bi, Shuming Shi

While large language models (LLMs) have demonstrated exceptional performance across various tasks following human alignment, they may still generate responses that sound plausible but contradict factual knowledge, a phenomenon known as hallucination. In this paper, we demonstrate the feasibility of mitigating hallucinations by verifying and minimizing the inconsistency between external knowledge present in the alignment data and the intrinsic knowledge embedded within foundation LLMs. Specifically, we propose a novel approach called Knowledge Consistent Alignment (KCA), which employs a well-aligned LLM to automatically formulate assessments based on external knowledge to evaluate the knowledge boundaries of foundation LLMs. To address knowledge inconsistencies in the alignment data, KCA implements several specific strategies to deal with these data instances. We demonstrate the superior efficacy of KCA in reducing hallucinations across six benchmarks, utilizing foundation LLMs of varying backbones and scales. This confirms the effectiveness of mitigating hallucinations by reducing knowledge inconsistency. Our code, model weights, and data are openly accessible at \url{https://github.com/fanqiwan/KCA}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2401.10768")

Code

Syntology Ran 13 of 22 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 12 ran with no contract checked.

By repository: official repository: 22 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

fanqiwan/kca officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

22 samples harvested; 13 ran; 0 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
12ran
9unverified

Licence: 0 of the 22 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from fanqiwan/KCA. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calculate_effectiveness_statistic fanqiwan/KCA/eval/gpt_judge/show_results.py official repository ran Apache-2.0 (permissive) · f9e2df54998117c3 · report
calculate_hallucination_classification_statistic fanqiwan/KCA/eval/gpt_judge/show_results.py official repository ran Apache-2.0 (permissive) · 48f1e29ec994c4e4 · report
compute_question_accuracy fanqiwan/KCA/examination/hallucination/get_metric.py official repository ran Apache-2.0 (permissive) · 4baef40c64107f17 · report
dispatch_openai_requests fanqiwan/KCA/eval/gpt_judge/gpt_judge.py official repository ran Apache-2.0 (permissive) · dc4bfb543add6e7d · report
encode_with_prompt_completion_format fanqiwan/KCA/examination/utils.py official repository ran Apache-2.0 (permissive) · 661419d69a095bfe · report
extract_question_id fanqiwan/KCA/examination/hallucination/get_metric.py official repository ran fingerprinted Apache-2.0 (permissive) · d82c972512c051c4 · report
get_completion fanqiwan/KCA/eval/gpt_judge/gpt_judge.py official repository ran Apache-2.0 (permissive) · cbcc22537dba8d33 · report
get_json_list fanqiwan/KCA/eval/gpt_judge/gpt_judge.py official repository ran Apache-2.0 (permissive) · 5d17b604c968b41d · report
get_next_word_predictions fanqiwan/KCA/examination/utils.py official repository ran Apache-2.0 (permissive) · b15d8b1317f1fd0d · report
parse_fact_enhance_classify_res fanqiwan/KCA/data_generation/post_process.py official repository ran fingerprinted Apache-2.0 (permissive) · 958758b5786a4316 · report
parse_fact_generation_res fanqiwan/KCA/data_generation/post_process.py official repository ran fingerprinted Apache-2.0 (permissive) · 63e1e400990ece36 · report
parse_test_generation_res fanqiwan/KCA/data_generation/post_process.py official repository ran fingerprinted Apache-2.0 (permissive) · 875f0b97337517e6 · report
read_jsonl fanqiwan/KCA/data_generation/inconsistency_processing.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 02171abe8492fcfd · report
compute_metrics fanqiwan/KCA/eval/gpt_judge/gen_summary.py official repository unverified Apache-2.0 (permissive) · 7f0044e5a93e33e2 · report
create_prompt_with_llama2_chat_format fanqiwan/KCA/examination/templates.py official repository unverified Apache-2.0 (permissive) · e51c9713fadad16f · report
create_prompt_with_tulu_chat_format fanqiwan/KCA/examination/templates.py official repository unverified Apache-2.0 (permissive) · 697d92a5d51eff3e · report
dispatch_openai_chat_requesets fanqiwan/KCA/examination/dispatch_openai_requests.py official repository unverified Apache-2.0 (permissive) · dcad9ac62979ca49 · report
dispatch_openai_prompt_requesets fanqiwan/KCA/examination/dispatch_openai_requests.py official repository unverified Apache-2.0 (permissive) · 71e4259026911444 · report
generate_completions fanqiwan/KCA/examination/utils.py official repository unverified Apache-2.0 (permissive) · 352416cd121404a7 · report
openai_encode_prompt fanqiwan/KCA/data_generation/per_instance_query.py official repository unverified Apache-2.0 (permissive) · 3a8f2cf897f0d356 · report
query_openai_batch fanqiwan/KCA/data_generation/per_instance_query.py official repository unverified Apache-2.0 (permissive) · e34ff3c5b1f3ba89 · report
request_openai_batch fanqiwan/KCA/data_generation/per_instance_query.py official repository unverified Apache-2.0 (permissive) · 5869d7c37c3993a8 · report

Tasks

HallucinationWorld Knowledge

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections