Papers › Improving Factuality in Large Language Models via Decoding-Time Hallucinatory and...

Improving Factuality in Large Language Models via Decoding-Time Hallucinatory and Truthful Comparators

22 Aug 2024arXiv:2408.12325archive 2025-07-28

Dingkang Yang, Dongling Xiao, Jinjie Wei, Mingcheng Li, Zhaoyu Chen, Ke Li, Lihua Zhang

Despite their remarkable capabilities, Large Language Models (LLMs) are prone to generate responses that contradict verifiable facts, i.e., unfaithful hallucination content. Existing efforts generally focus on optimizing model parameters or editing semantic representations, which compromise the internal factual knowledge of target LLMs. In addition, hallucinations typically exhibit multifaceted patterns in downstream tasks, limiting the model's holistic performance across tasks. In this paper, we propose a Comparator-driven Decoding-Time (CDT) framework to alleviate the response hallucination. Firstly, we construct hallucinatory and truthful comparators with multi-task fine-tuning samples. In this case, we present an instruction prototype-guided mixture of experts strategy to enhance the ability of the corresponding comparators to capture different hallucination or truthfulness patterns in distinct task instructions. CDT constrains next-token predictions to factuality-robust distributions by contrasting the logit differences between the target LLMs and these comparators. Systematic experiments on multiple downstream tasks show that our framework can significantly improve the model performance and response factuality.

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="2408.12325")

Code

Syntology Ran 7 of 11 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 7 ran with no contract checked.

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

ydk122024/cdt officialmentioned in papermentioned on GitHubjaxMIT 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

11 samples harvested; 7 ran; 0 honoured the contract we drafted; 4 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.

7ran
4unverified

Licence: 0 of the 11 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 ydk122024/cdt. “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.

build_prompt ydk122024/cdt/src/benchmark_evaluation/alpaca_eval.py official repository ran MIT (permissive) · b13ae15599bf9354 · report
build_prompt ydk122024/cdt/src/benchmark_evaluation/knight_eval.py official repository ran MIT (permissive) · a3be7b801f8fda87 · report
build_prompt ydk122024/cdt/src/benchmark_evaluation/xsum_eval.py official repository ran MIT (permissive) · d80c60be83bb2afa · report
build_prompt_gen ydk122024/cdt/src/benchmark_evaluation/alpaca_eval.py official repository ran MIT (permissive) · f2d73dda9e665c06 · report
build_prompt_gen ydk122024/cdt/src/benchmark_evaluation/knight_eval.py official repository ran MIT (permissive) · 27d49354a7eee2e1 · report
build_prompt_no_yes ydk122024/cdt/src/benchmark_evaluation/alpaca_eval.py official repository ran MIT (permissive) · 6439303c87d1473a · report
load_jsonl ydk122024/cdt/src/benchmark_evaluation/knight_eval.py official repository ran MIT (permissive) · b6224b7268dbdb06 · report
format_best ydk122024/cdt/src/benchmark_evaluation/truthfulqa_eval.py official repository unverified MIT (permissive) · 158b8847881a64b3 · report
is_torch_tpu_available ydk122024/cdt/src/peft/import_utils.py official repository unverified MIT (permissive) · a3daaf3e5bdfc709 · report
load_csv ydk122024/cdt/src/benchmark_evaluation/truthfulqa_eval.py official repository unverified MIT (permissive) · 2a4c0ecd291e1795 · report
split_multi_answer ydk122024/cdt/src/benchmark_evaluation/truthfulqa_eval.py official repository unverified MIT (permissive) · c852bd4d2face0a1 · report

Tasks

HallucinationMixture-of-Experts

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Focus

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