{"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/cer-confidence-enhanced-reasoning-in-llms","title":"CER: Confidence Enhanced Reasoning in LLMs","arxiv_id":"2502.14634","date":"2025-02-20","proceeding":null,"authors":["Ali Razghandi","Seyed Mohammad Hadi Hosseini","Mahdieh Soleymani Baghshah"],"abstract":"Ensuring the reliability of Large Language Models (LLMs) in complex reasoning tasks remains a formidable challenge, particularly in scenarios that demand precise mathematical calculations and knowledge-intensive open-domain generation. In this work, we introduce an uncertainty-aware framework designed to enhance the accuracy of LLM responses by systematically incorporating model confidence at critical decision points. We propose an approach that encourages multi-step reasoning in LLMs and quantify the confidence of intermediate answers such as numerical results in mathematical reasoning and proper nouns in open-domain generation. Then, the overall confidence of each reasoning chain is evaluated based on confidence of these critical intermediate steps. Finally, we aggregate the answer of generated response paths in a way that reflects the reliability of each generated content (as opposed to self-consistency in which each generated chain contributes equally to majority voting). We conducted extensive experiments in five datasets, three mathematical datasets and two open-domain datasets, using four LLMs. The results consistently validate the effectiveness of our novel confidence aggregation method, leading to an accuracy improvement of up to 7.4% and 5.8% over baseline approaches in math and open-domain generation tasks, respectively. Code is publicly available at https://github.com/ Aquasar11/CER.","url_abs":"https://arxiv.org/abs/2502.14634v1","url_pdf":"https://arxiv.org/pdf/2502.14634v1.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":"cer-confidence-enhanced-reasoning-in-llms","repo_url":"https://github.com/sharif-ml-lab/CER","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"math","task_name":"Math"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2502.14634","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.14634"}},"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/sharif-ml-lab/CER","reach":null}],"summary":{"ran_fixture":2,"ran_draft_wrong":7,"unverified":6},"by_repo_kind":{"official":{"samples":15,"ran":9,"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":15,"samples":[{"code_sha256_prefix":"aa1cedb61cbeeac0","entry":"_find_subsequence_indices","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"aa1cedb61cbeeac0"}},{"code_sha256_prefix":"73874e65d650cef0","entry":"aggregate_paths_based_on_scores","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"73874e65d650cef0"}},{"code_sha256_prefix":"dde79f1d781f0671","entry":"calculate_confidence_for_final_answer","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dde79f1d781f0671"}},{"code_sha256_prefix":"b29db381e43c4adb","entry":"extract_all_numerical_values","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b29db381e43c4adb"}},{"code_sha256_prefix":"8e25443514150f6f","entry":"extract_all_steps","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8e25443514150f6f"}},{"code_sha256_prefix":"89e7e36459462915","entry":"extract_final_answer","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"89e7e36459462915"}},{"code_sha256_prefix":"d20c7138d1b654ef","entry":"extract_last_numerical_value","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d20c7138d1b654ef"}},{"code_sha256_prefix":"76e07053dd45b75d","entry":"number_step_by_step_extraction","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"76e07053dd45b75d"}},{"code_sha256_prefix":"3fae2e5c8fbd21cf","entry":"postprocess_final_answer","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3fae2e5c8fbd21cf"}},{"code_sha256_prefix":"a448a32f720595c0","entry":"_handle_all_decoding","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a448a32f720595c0"}},{"code_sha256_prefix":"e82ebdf98178e2b1","entry":"_handle_last_decoding","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e82ebdf98178e2b1"}},{"code_sha256_prefix":"af9b934faa3771fc","entry":"_k_seperate_generation","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"af9b934faa3771fc"}},{"code_sha256_prefix":"6c17fb008603bd82","entry":"cer_decode","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6c17fb008603bd82"}},{"code_sha256_prefix":"970c62e19d1f0b90","entry":"extract_proper_nouns","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"970c62e19d1f0b90"}},{"code_sha256_prefix":"16897e2f9de270de","entry":"proper_noun_step_by_step_extraction","repo":"sharif-ml-lab/CER","repo_kind":"official","path":"src/decoding.py","file_url":"https://github.com/sharif-ml-lab/CER/blob/HEAD/src/decoding.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"16897e2f9de270de"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}