Papers › SaySelf: Teaching LLMs to Express Confidence with Self-Reflective Rationales

SaySelf: Teaching LLMs to Express Confidence with Self-Reflective Rationales

31 May 2024arXiv:2405.20974archive 2025-07-28

Tianyang Xu, Shujin Wu, Shizhe Diao, Xiaoze Liu, Xingyao Wang, Yangyi Chen, Jing Gao

Large language models (LLMs) often generate inaccurate or fabricated information and generally fail to indicate their confidence, which limits their broader applications. Previous work elicits confidence from LLMs by direct or self-consistency prompting, or constructing specific datasets for supervised finetuning. The prompting-based approaches have inferior performance, and the training-based approaches are limited to binary or inaccurate group-level confidence estimates. In this work, we present the advanced SaySelf, a training framework that teaches LLMs to express more accurate fine-grained confidence estimates. In addition, beyond the confidence scores, SaySelf initiates the process of directing LLMs to produce self-reflective rationales that clearly identify gaps in their parametric knowledge and explain their uncertainty. This is achieved by using an LLM to automatically summarize the uncertainties in specific knowledge via natural language. The summarization is based on the analysis of the inconsistency in multiple sampled reasoning chains, and the resulting data is utilized for supervised fine-tuning. Moreover, we utilize reinforcement learning with a meticulously crafted reward function to calibrate the confidence estimates, motivating LLMs to deliver accurate, high-confidence predictions and to penalize overconfidence in erroneous outputs. Experimental results in both in-distribution and out-of-distribution datasets demonstrate the effectiveness of SaySelf in reducing the confidence calibration error and maintaining the task performance. We show that the generated self-reflective rationales are reasonable and can further contribute to the calibration. The code is made public at https://github.com/xu1868/SaySelf.

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

Code

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

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

xu1868/sayself officialmentioned in papermentioned on GitHubpytorchMIT 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; 11 ran; 0 honoured the contract we drafted; 2 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.

11ran
2unverified

Licence: 0 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 xu1868/SaySelf. “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_reward xu1868/SaySelf/utils/utils.py official repository ran fingerprinted MIT (permissive) · 6c5c81d9c2c06116 · report
encode_with_json_format xu1868/SaySelf/evaluation/evaluate.py official repository ran MIT (permissive) · b9d2be719e848341 · report
encode_with_messages_format xu1868/SaySelf/training/finetune.py official repository ran MIT (permissive) · 0fe2c5386a8e7ffe · report
encode_with_messages_format xu1868/SaySelf/evaluation/evaluate.py official repository ran MIT (permissive) · 2ff0831de5949f6c · report
encode_with_messages_format xu1868/sayself/training/rlhf_train.py official repository ran MIT (permissive) · a6a6be18e0e76d28 · report
encode_with_qr_format xu1868/SaySelf/training/finetune.py official repository ran MIT (permissive) · 25e9ee7fc7b8741c · report
generate_summarized_reason xu1868/SaySelf/evaluation/evaluate_reason.py official repository ran MIT (permissive) · e3b0d7c3e623b451 · report
parse_response xu1868/SaySelf/utils/utils.py official repository ran fingerprinted MIT (permissive) · df9fb4e8e291c1f4 · report
parse_response_new xu1868/SaySelf/utils/utils.py official repository ran MIT (permissive) · 7f4e1be0da09e67d · report
parse_summarized_response xu1868/SaySelf/evaluation/evaluate_reason.py official repository ran fingerprinted MIT (permissive) · 351da31d97b7a2c7 · report
preprocess_dataset xu1868/SaySelf/evaluation/generate_reasons_for_evaluation.py official repository ran MIT (permissive) · a942e23bce929ae1 · report
encode_with_files_format xu1868/SaySelf/evaluation/evaluate.py official repository unverified MIT (permissive) · 6ea8e572530aeb5b · report
encode_with_prompt_completion_format xu1868/SaySelf/training/finetune.py official repository unverified MIT (permissive) · 119cad9954acc960 · report

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