{"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/on-subjective-uncertainty-quantification-and","title":"On Subjective Uncertainty Quantification and Calibration in Natural Language Generation","arxiv_id":"2406.05213","date":"2024-06-07","proceeding":null,"authors":["Ziyu Wang","Chris Holmes"],"abstract":"Applications of large language models often involve the generation of free-form responses, in which case uncertainty quantification becomes challenging. This is due to the need to identify task-specific uncertainties (e.g., about the semantics) which appears difficult to define in general cases. This work addresses these challenges from a perspective of Bayesian decision theory, starting from the assumption that our utility is characterized by a similarity measure that compares a generated response with a hypothetical true response. We discuss how this assumption enables principled quantification of the model's subjective uncertainty and its calibration. We further derive a measure for epistemic uncertainty, based on a missing data perspective and its characterization as an excess risk. The proposed methods can be applied to black-box language models. We illustrate the methods on question answering and machine translation tasks. Our experiments provide a principled evaluation of task-specific calibration, and demonstrate that epistemic uncertainty offers a promising deferral strategy for efficient data acquisition in in-context learning.","url_abs":"https://arxiv.org/abs/2406.05213v2","url_pdf":"https://arxiv.org/pdf/2406.05213v2.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":"on-subjective-uncertainty-quantification-and","repo_url":"https://github.com/meta-inf/suq-nlg","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"text-generation","task_name":"Text Generation"},{"task_slug":"uncertainty-quantification","task_name":"Uncertainty Quantification"}],"methods":[{"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":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt","method_name":"GPT"},{"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":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.05213","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.05213"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/meta-inf/suq-nlg","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":12,"unverified":2},"by_repo_kind":{"official":{"samples":14,"ran":12,"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":"915a9c0698bb76bc","entry":"add_completion_task","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/eval_dump.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/eval_dump.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"915a9c0698bb76bc"}},{"code_sha256_prefix":"b7c3d1da7e3610ab","entry":"align_arrays","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/plot-all.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/plot-all.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b7c3d1da7e3610ab"}},{"code_sha256_prefix":"2745a7b067527cea","entry":"clean_text","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/vu.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/vu.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2745a7b067527cea"}},{"code_sha256_prefix":"989948dc5ec7e193","entry":"download_batch_outputs","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/eval_parse.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/eval_parse.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"989948dc5ec7e193"}},{"code_sha256_prefix":"8b2a6e8218aec661","entry":"enque_sim_score_tasks","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/eval_dump.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/eval_dump.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8b2a6e8218aec661"}},{"code_sha256_prefix":"6afd679238dc532d","entry":"flatten_dict","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"generation/utils.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/generation/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6afd679238dc532d"}},{"code_sha256_prefix":"91089e2a35a95037","entry":"generate_gpt_eval_request","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/eval_dump.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/eval_dump.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"91089e2a35a95037"}},{"code_sha256_prefix":"c6f4b10896e5af07","entry":"load_data","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"mt/utils.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/mt/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c6f4b10896e5af07"}},{"code_sha256_prefix":"05b8a50b7eee68cf","entry":"mask_arrays","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/plot-all.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/plot-all.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"05b8a50b7eee68cf"}},{"code_sha256_prefix":"64c5dbf616aea642","entry":"online_outfile_path","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/eval_submit.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/eval_submit.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"64c5dbf616aea642"}},{"code_sha256_prefix":"6600bbf7a743f950","entry":"parse_float_between_0_and_1","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"generation/utils.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/generation/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6600bbf7a743f950"}},{"code_sha256_prefix":"71234fd59ed06c65","entry":"parser","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"exputils.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/exputils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"71234fd59ed06c65"}},{"code_sha256_prefix":"0d8b779c92feda0d","entry":"load","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"qa/plot-all.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/qa/plot-all.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0d8b779c92feda0d"}},{"code_sha256_prefix":"c6f235974b03ba76","entry":"preflight","repo":"meta-inf/suq-nlg","repo_kind":"official","path":"exputils.py","file_url":"https://github.com/meta-inf/suq-nlg/blob/HEAD/exputils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c6f235974b03ba76"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}