{"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/beyond-accuracy-evaluating-self-consistency","title":"Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain","arxiv_id":"2310.14053","date":"2023-10-21","proceeding":null,"authors":["Marcus J. Min","Yangruibo Ding","Luca Buratti","Saurabh Pujar","Gail Kaiser","Suman Jana","Baishakhi Ray"],"abstract":"Code Large Language Models (Code LLMs) are being increasingly employed in real-life applications, so evaluating them is critical. While the conventional accuracy evaluates the performance of Code LLMs on a set of individual tasks, their self-consistency across different tasks is overlooked. Intuitively, a trustworthy model should be self-consistent when generating natural language specifications for its own code and generating code for its own specifications. Failure to preserve self-consistency reveals a lack of understanding of the shared semantics underlying natural language and programming language, and therefore undermines the trustworthiness of a model. In this paper, we first formally define the self-consistency of Code LLMs and then design a framework, IdentityChain, which effectively and efficiently evaluates the self-consistency and conventional accuracy of a model at the same time. We study eleven Code LLMs and show that they fail to preserve self-consistency, which is indeed a distinct aspect from conventional accuracy. Furthermore, we show that IdentityChain can be used as a model debugging tool to expose weaknesses of Code LLMs by demonstrating three major weaknesses that we identify in current models using IdentityChain. Our code is available at https://github.com/marcusm117/IdentityChain.","url_abs":"https://arxiv.org/abs/2310.14053v3","url_pdf":"https://arxiv.org/pdf/2310.14053v3.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":"beyond-accuracy-evaluating-self-consistency","repo_url":"https://github.com/marcusm117/IdentityChain","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"code-generation","task_name":"Code Generation"},{"task_slug":"code-summarization-1","task_name":"Code Summarization"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.14053","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.14053"}},"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":"deterministic:regex_extraction","url":"https://github.com/marcusm117/IdentityChain","reach":null}],"summary":{"ran":3,"ran_violates":1,"ran_draft_wrong":6,"unverified":4},"by_repo_kind":{"official":{"samples":14,"ran":10,"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":"c521e50b415faff4","entry":"TimeoutException","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c521e50b415faff4"}},{"code_sha256_prefix":"f58e7b74cda16da7","entry":"WriteOnlyStringIO","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f58e7b74cda16da7"}},{"code_sha256_prefix":"fddc0d799c8cf0e4","entry":"calculate_EM","repo":"marcusm117/identitychain","repo_kind":"official","path":"scripts/analyze_results.py","file_url":"https://github.com/marcusm117/identitychain/blob/HEAD/scripts/analyze_results.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fddc0d799c8cf0e4"}},{"code_sha256_prefix":"7eab47e294a8f31c","entry":"generate_text","repo":"marcusm117/identitychain","repo_kind":"official","path":"examples/run_identity_chain_huggingface.py","file_url":"https://github.com/marcusm117/identitychain/blob/HEAD/examples/run_identity_chain_huggingface.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7eab47e294a8f31c"}},{"code_sha256_prefix":"5958df51781b9f30","entry":"post_processing_nl_to_pl","repo":"marcusm117/identitychain","repo_kind":"official","path":"examples/run_identity_chain_huggingface.py","file_url":"https://github.com/marcusm117/identitychain/blob/HEAD/examples/run_identity_chain_huggingface.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5958df51781b9f30"}},{"code_sha256_prefix":"4c6160654ff6a62c","entry":"post_processing_pl_to_nl","repo":"marcusm117/identitychain","repo_kind":"official","path":"examples/run_identity_chain_huggingface.py","file_url":"https://github.com/marcusm117/identitychain/blob/HEAD/examples/run_identity_chain_huggingface.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4c6160654ff6a62c"}},{"code_sha256_prefix":"30355c149429dbf6","entry":"summarize_test_results","repo":"marcusm117/identitychain","repo_kind":"official","path":"scripts/analyze_results.py","file_url":"https://github.com/marcusm117/identitychain/blob/HEAD/scripts/analyze_results.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"30355c149429dbf6"}},{"code_sha256_prefix":"2c19eab97c8fa563","entry":"swallow_io","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2c19eab97c8fa563"}},{"code_sha256_prefix":"1a67321b7467aae6","entry":"time_limit","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1a67321b7467aae6"}},{"code_sha256_prefix":"623e0f11ca79b156","entry":"unsafe_execute","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"623e0f11ca79b156"}},{"code_sha256_prefix":"2b8f674e1f3e4d91","entry":"IdentityChain","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2b8f674e1f3e4d91"}},{"code_sha256_prefix":"5624651b3e194800","entry":"IdentityChainError","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5624651b3e194800"}},{"code_sha256_prefix":"274aa878feec2278","entry":"redirect_stdin","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"274aa878feec2278"}},{"code_sha256_prefix":"e733482daf14e1e0","entry":"reliability_guard","repo":"marcusm117/IdentityChain","repo_kind":"official","path":"identitychain/identity_chain.py","file_url":"https://github.com/marcusm117/IdentityChain/blob/HEAD/identitychain/identity_chain.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e733482daf14e1e0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}