Papers › Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain

Beyond Accuracy: Evaluating Self-Consistency of Code Large Language Models with IdentityChain

21 Oct 2023arXiv:2310.14053archive 2025-07-28

Marcus J. Min, Yangruibo Ding, Luca Buratti, Saurabh Pujar, Gail Kaiser, Suman Jana, Baishakhi Ray

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.

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

Code

Syntology Ran 10 of 14 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · violated contract; 6 ran · our draft was wrong; 3 ran with no contract checked.

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

marcusm117/IdentityChain officialmentioned in papermentioned on GitHub 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

14 samples harvested; 10 ran; 0 honoured the contract we drafted; 4 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 · violated contract
6ran · our draft was wrong
3ran
4unverified

Licence: 0 of the 14 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 marcusm117/IdentityChain. “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.

TimeoutException marcusm117/IdentityChain/identitychain/identity_chain.py official repository ran · metamorphic tier: deterministic Apache-2.0 (permissive) · c521e50b415faff4 · report
WriteOnlyStringIO marcusm117/IdentityChain/identitychain/identity_chain.py official repository ran Apache-2.0 (permissive) · f58e7b74cda16da7 · report
calculate_EM marcusm117/identitychain/scripts/analyze_results.py official repository ran · violated contract fingerprinted Apache-2.0 (permissive) · fddc0d799c8cf0e4 · report
generate_text marcusm117/identitychain/examples/run_identity_chain_huggingface.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 7eab47e294a8f31c · report
post_processing_nl_to_pl marcusm117/identitychain/examples/run_identity_chain_huggingface.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 5958df51781b9f30 · report
post_processing_pl_to_nl marcusm117/identitychain/examples/run_identity_chain_huggingface.py official repository ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 4c6160654ff6a62c · report
summarize_test_results marcusm117/identitychain/scripts/analyze_results.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 30355c149429dbf6 · report
swallow_io marcusm117/IdentityChain/identitychain/identity_chain.py official repository ran Apache-2.0 (permissive) · 2c19eab97c8fa563 · report
time_limit marcusm117/IdentityChain/identitychain/identity_chain.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 1a67321b7467aae6 · report
unsafe_execute marcusm117/IdentityChain/identitychain/identity_chain.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 623e0f11ca79b156 · report
IdentityChain marcusm117/IdentityChain/identitychain/identity_chain.py official repository unverified Apache-2.0 (permissive) · 2b8f674e1f3e4d91 · report
IdentityChainError marcusm117/IdentityChain/identitychain/identity_chain.py official repository unverified Apache-2.0 (permissive) · 5624651b3e194800 · report
redirect_stdin marcusm117/IdentityChain/identitychain/identity_chain.py official repository unverified Apache-2.0 (permissive) · 274aa878feec2278 · report
reliability_guard marcusm117/IdentityChain/identitychain/identity_chain.py official repository unverified Apache-2.0 (permissive) · e733482daf14e1e0 · report

Tasks

Code GenerationCode Summarization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SET

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