arXiv:2610.08514cs.AIOct 2026

Manuscript Offprint

arXiv:2610.08514

How Much Evidence Should a Coding Agent's Self-Correction Carry? Adaptive Dirichlet Evidence for Self-Distillation

Yunbo Long, Guangya Hao, Yuhan Liu, Yiting Duan, Longyan Tan, Yunchen Long, Hao Wu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Execution feedback lets coding agents revise programs and learn from their own corrections. A correction’s learning weight should reflect both the transitions supported by its executions and the amount of evidence behind that support. We introduce Effective-Evidence Self-Distillation (EESD), which represents these quantities separately. Normalized execution relevance determines relative transition support and an effective pseudo-count mass; a Dirichlet posterior then produces an uncertainty-penalized weight for KL-anchored correction learning. Under a symmetric prior, changing mass preserves category ordering, and effective mass yields a supervised coefficient bounded by its matched fixed-mass counterpart. Across four model–domain history sweeps, increasing visible observations from one to eight reduces future-outcome NLL by 55.0–59.3%. At eight observations, effective mass achieves lower NLL than fixed mass in all four comparisons. In the primary matched DeepSeek/RunBugRun study, argmax predictions agree on all 3,000 examples, with the largest NLL gain under concentrated relevance. After one correction-learning round, DeepSeek/CodeARC all-tests Pass@1 increases from 15.0% to 20.4%, with a paired 95% source-bootstrap interval of [+2.8,+8.0][+2.8, +8.0] percentage points. The twelve-setting downstream evaluation establishes the model–domain scope of this update. These results show how separating evidence support from evidence mass changes probability estimation and correction learning in coding agents.

1 INTRODUCTION

Coding agents use language models to generate and revise programs from execution feedback, including compiler errors and unit-test outcomes. This supports self-correction in code generation and program repair. Self-Refine and Reflexion reuse model-generated feedback or reflection at inference time (Madaan et al., 2023; Shinn et al., 2023); Self-Debugging revises programs after observing execution behavior (Chen et al., 2024); and execution-guided repair, search, and verification systems use tests to select or refine candidate programs (Ni et al., 2023; Tang et al., 2024; Li et al., 2025b; a; Tao et al., 2026). These methods use feedback to improve the next candidate program.

Self-training also requires a decision about how strongly to learn from each trajectory. Correctness filtering, reward weighting, and confidence-aware training assess the quality of generated behavior (Jiang et al., 2025; Jang et al., 2025; Yang et al., 2025). Execution evidence supplies two further quantities: which before/after transitions the observations support and how much evidence supports those transitions. Representing both quantities makes the correction weight sensitive to evidence concentration even when relative support stays fixed.

Figure 1 illustrates the distinction through an off-by-one repair. Extending a Python range endpoint makes all four public executions pass, so relative support is r=(1,0,0,0)r = (1, 0, 0, 0) under either relevance pattern. Uniform relevance assigns comparable weight to every execution and gives E(p)=4E(p) = 4; concentrated relevance p=(0.97,0.01,0.01,0.01)p = (0.97, 0.01, 0.01, 0.01) gives E(p)≈1.062E(p) \approx 1.062. A fixed-mass control

Figure

Figure 1: Direction and strength in a coding agent's self-correction. (a) Fixing an off-by-one range error changes four public executions from fail to pass. (b) Aggregating execution relevance by transition gives r=(1,0,0,0)r = (1, 0, 0, 0): all support favors FIX. (c) The same transitions under uniform and concentrated relevance give E(p)=4.000E(p) = 4.000 and 1.062; at fixed prior and utility settings, they yield different supervised weights. The p bars index executions, whereas the r bars index transition categories. The relevance vectors define an analytical example at fixed transition support.

restores total mass to four in both cases. EESD instead lets relevance concentration change the supervised weight while retaining the same correction target. The analytical relevance vectors isolate the effect of concentration at fixed transition support.

The problem becomes more consequential when corrections are written back into model parameters. A mistaken inference-time correction affects one answer; an over-weighted training correction changes the policy that will generate future answers and future training data, a feedback pattern relevant to recursive self-improvement (RSI) and self-evolving agents (Yin et al., 2025; Ranaldi, 2026; Xiao et al., 2026; Li et al., 2026). We study the correction-to-update step within this feedback process: given a self-generated correction, how much should the next policy learn from its supporting execution evidence?

We introduce Effective-Evidence Self-Distillation (EESD), a posterior-based rule for weighting correction learning. Given nonnegative relevance scores sis_i, EESD normalizes them into pp. Relative support rr describes what transition categories the observations favor, while E(p)=(∑ipi2)−1E(p) = (\sum_i p_i^2)^{-1} describes how much pseudo-count mass that support contributes. A Dirichlet posterior produces an uncertainty-penalized correction utility; its positive part scales correction cross-entropy while a KL term anchors the student to the entering policy. The upstream correction generator and relevance estimator remain modular: the contribution is how their execution record is converted into a learning coefficient. Our contributions are:

  1. We formulate correction-level direction–strength separation: distinguishing relative execution support from the total evidence mass assigned to that support.

  2. We introduce an effective-evidence Dirichlet estimator (EED), which converts relevance concentration into adaptive Dirichlet pseudo-count mass, and connect its posterior utility to KL-anchored LoRA self-distillation. We characterize count recovery, ordering invariance, and the resulting control of the supervised coefficient.

  3. We evaluate the construction through visible-history scaling, a matched-mass mechanism study with fixed argmax, and one-round correction-based self-training followed by fresh code generation across multiple models and domains.