Papers › UAlign: Leveraging Uncertainty Estimations for Factuality Alignment on Large Language Models

UAlign: Leveraging Uncertainty Estimations for Factuality Alignment on Large Language Models

16 Dec 2024arXiv:2412.11803archive 2025-07-28

Boyang Xue, Fei Mi, Qi Zhu, Hongru Wang, Rui Wang, Sheng Wang, Erxin Yu, Xuming Hu, Kam-Fai Wong

Despite demonstrating impressive capabilities, Large Language Models (LLMs) still often struggle to accurately express the factual knowledge they possess, especially in cases where the LLMs' knowledge boundaries are ambiguous. To improve LLMs' factual expressions, we propose the UAlign framework, which leverages Uncertainty estimations to represent knowledge boundaries, and then explicitly incorporates these representations as input features into prompts for LLMs to Align with factual knowledge. First, we prepare the dataset on knowledge question-answering (QA) samples by calculating two uncertainty estimations, including confidence score and semantic entropy, to represent the knowledge boundaries for LLMs. Subsequently, using the prepared dataset, we train a reward model that incorporates uncertainty estimations and then employ the Proximal Policy Optimization (PPO) algorithm for factuality alignment on LLMs. Experimental results indicate that, by integrating uncertainty representations in LLM alignment, the proposed UAlign can significantly enhance the LLMs' capacities to confidently answer known questions and refuse unknown questions on both in-domain and out-of-domain tasks, showing reliability improvements and good generalizability over various prompt- and training-based baselines.

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

Code

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

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

amourwaltz/ualign officialmentioned in papermentioned on GitHubpytorch 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

13 samples harvested; 1 ran; 0 honoured the contract we drafted; 12 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
12unverified

Licence: 13 of the 13 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 amourwaltz/ualign. “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.

jload amourwaltz/ualign/code/utils.py official repository ran · our draft was wrong no licence file found · pointer only · d07d04439cd1d44f · report
calculate_confidence amourwaltz/ualign/code/uncertainty.py official repository unverified no licence file found · pointer only · 88d00d042fe3cc57 · report
calculate_entropy amourwaltz/ualign/code/uncertainty.py official repository unverified no licence file found · pointer only · 23b0e66b13795f6e · report
calculate_probabilities amourwaltz/ualign/code/uncertainty.py official repository unverified no licence file found · pointer only · d995aae91bfab9fb · report
format_examplar amourwaltz/ualign/code/infer.py official repository unverified no licence file found · pointer only · 6d1515784df90ddb · report
make_supervised_data_module amourwaltz/ualign/code/train_sft.py official repository unverified no licence file found · pointer only · 91592110883e0f36 · report
output_split amourwaltz/ualign/code/infer.py official repository unverified no licence file found · pointer only · 67edb48169125783 · report
prep_sciq_dataset amourwaltz/ualign/code/prep.py official repository unverified no licence file found · pointer only · 8efdb337e4892760 · report
prep_triviaqa_dataset amourwaltz/ualign/code/prep.py official repository unverified no licence file found · pointer only · 00bac655587e2bf0 · report
prep_webqa_dataset amourwaltz/ualign/code/prep.py official repository unverified no licence file found · pointer only · b46ab02018bb18f6 · report
preprocess amourwaltz/ualign/code/train_sft.py official repository unverified no licence file found · pointer only · c855c225b6c71721 · report
read_json amourwaltz/ualign/code/utils.py official repository unverified no licence file found · pointer only · 8e230efd4b919022 · report
read_jsonl amourwaltz/ualign/code/utils.py official repository unverified no licence file found · pointer only · d5792c4c85064ef5 · report

Tasks

Question Answering

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGN

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