ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation

Yiru Dong, Richong Zhang, Fanshuang Kong, Si ChenarXiv 2026 · DOI

TL;DR

Self-correction pipelines for Large Language Model (LLM) code generation often fail because they rely on buggy, automatically generated reference tests that mislead the model. ExeCRE solves this by treating multiple generated reference codes like noisy annotators in a crowdsourcing task, using the statistical Dawid-Skene model to infer code reliability from execution consistency patterns. This approach dramatically reduces misleading feedback and significantly boosts code generation accuracy across various LLM scales.

What Problem Does This Paper Address?

LLMs are highly capable at simple coding tasks but frequently stumble on complex algorithmic problems. To mitigate this, state-of-the-art systems use self-correction, where an LLM iteratively refines its code based on execution feedback (e.g., running the code against tests generated by a simpler "reference" script).

However, these reference scripts are often riddled with subtle bugs or miss edge cases. When a correct solution fails an unreliable test, the LLM receives "misleading feedback," causing it to break perfectly good code or reinforce bad code. Current methods either blindly trust these reference tests or rely on expensive LLM-as-a-judge prompts, leaving verification signals highly unstable.

Self-correction pipelines with and without ExeCRE

Methods

ExeCRE (Execution-Consistency guided code Reliability Estimation) introduces a statistical framework to evaluate reference code reliability without needing ground-truth labels. The process operates in four main stages:

  1. Schema-Driven Input Generation: Instead of querying an LLM for every single test case, ExeCRE prompts the LLM once to extract a structured JSON schema defining input types, ranges, and variable dependencies. A rule-based generator then rapidly samples hundreds of diverse, valid inputs.
  2. Consistency Projection: ExeCRE generates multiple candidate reference codes and runs them on all sampled inputs. It then maps the raw execution outputs into a binary consistency matrix, indicating whether a specific code candidate agrees with the majority vote for a given input.
  3. Dawid-Skene Latent Estimation: Borrowing a classic algorithm from crowdsourcing (the Dawid-Skene Expectation-Maximization model), ExeCRE treats the inputs as items and the reference codes as noisy annotators. It iteratively estimates the latent "true" consistency state of each input and the specific error rate of each code candidate.
  4. Reliability Selection: Each candidate receives a final reliability score. If a candidate exceeds a threshold (e.g., 0.95), it is trusted to generate verification tests for the self-correction loop. If no candidate passes, the system falls back to basic public tests, preventing bad feedback from derailing the correction process.
Figure 2: Overview of ExeCRE. Given a problem, ExeCRE constructs execution inputs and collects execution outputs from multiple candidate codes. It then projects raw outputs into a binary consistency matrix and applies Dawid–Skene EM to estimate the latent reliability of each candidate. The estimated reliability scores are finally used to select reliable code or trigger fallback when no candidate exceeds the threshold.

Datasets

  • LiveCodeBench (v6): Used as the primary benchmark, focusing on 182 competitive programming problems released between January and May 2025 to ensure a "cutoff-clean" evaluation free from training data contamination for most models.
  • GSM8K: A dataset of 1,319 grade-school math word problems, used for an applicability study to test ExeCRE in a Program-of-Thought (PoT) mathematical reasoning setting.

Key Insights and Ideas

  • Crowdsourcing Code Correctness: The core "aha moment" is framing code execution as a crowdsourcing problem. Even if multiple LLM-generated reference codes are buggy, their patterns of disagreement across hundreds of inputs reveal which ones are systematically flawed and which ones are robust.
  • Binary Projection Simplifies the Space: Instead of trying to model the infinite space of raw execution outputs (strings, matrices, integers), collapsing the data into a binary "agrees/disagrees with majority" matrix makes latent error-rate estimation mathematically tractable via Dawid-Skene.
  • Robustness to Shared LLM Biases: Standard voting fails when multiple incorrect codes share the same bug. Because Dawid-Skene models code-specific error tendencies conditionally, it can successfully identify the correct minority code even when a cluster of bad codes consistently agree on a specific wrong answer.

Key Results

  • Performance Boost: ExeCRE achieved the highest Pass@1 accuracy across all evaluated models on LiveCodeBench. For instance, under GPT-5.2, it pushed overall Pass@1 to 72.8% (compared to a 62.7% base and 69.9% for TextGrad).
  • Drastic Reduction in Misleading Feedback: On GPT-5.2, the average number of times a correct initial solution was subjected to misleading feedback dropped from 113.2 (with TextGrad) to just 14.0 with ExeCRE.
  • Iterative Stability: Unlike baselines that often degrade or saturate early due to bad test signals, ExeCRE maintains a steady, upward trajectory across self-correction iterations.
  • Math Reasoning Generalization: In the GSM8K Program-of-Thought study, ExeCRE improved Qwen2.5-Coder-32B accuracy from 90.28% to 92.96% by acting as a reliability gate for when to trust code-based answers versus falling back to direct text answers.

Limitations and Future Work

  • Computational Overhead: Running 10 candidate codes across 300 inputs takes time (~26 seconds per problem), though the authors note this can be mitigated with parallel execution and batched API calls.
  • Repository-Level Tasks: The current input generation relies on isolated function-call or stdin/stdout schemas. Extending ExeCRE to complex, stateful repository-level software engineering tasks remains future work.
  • Shared Bug Limits: While robust, if a vast majority of generated codes share the exact same bug that the generated inputs fail to differentiate, ExeCRE can still occasionally adopt an incorrect reference code.

Summary updated

BibTeX
@misc{dong2026execre,
  author = {Yiru Dong and Richong Zhang and Fanshuang Kong and Si Chen},
  title = {{ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation}},
  year = {2026},
  eprint = {2608.04439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.04439},
}
Figure