When Exact Inference Changes Code Selection: A Decision-Theoretic Analysis of B4
Yanliang Cai
Abstract
When generated programs are ranked using generated tests, a more exact posterior computation need not improve the selected program. We characterize this distinction in the published B4 code--test model. Identical execution signatures reduce exact candidate marginalization to N summands and nonempty joint maximum a posteriori (MAP) inference to two weights per group. A prior--budget condition guarantees that B4's whole-group rule already attains MAP; a sharp finite correction bound certifies when candidate marginals must select the same group. All 2,421 default-setting comparisons on 807 development matrices select the same candidates. A prospectively specified validation on 1,345 execution snapshots from a separate public archive also finds no changes in 4,035 default-setting comparisons. Across 80 literature-derived priors, this new archive yields 85 changed top sets in 107,600 comparisons; only six coincide with failure of whole-group MAP. Under finite-test proxy labels, four changes increase and five decrease expected success. These descriptive changes span seven snapshots; per-prior mean differences range from -0.074 to +0.045 percentage points. The results do not recommend a tuned prior or a new performance method. Exact enumeration and independent high-precision checks support the formulas and decision diagnostics. A supplementary fixed-test analysis separates asymptotic failure from observational ambiguity. The contribution is a model-specific account of when an inference intervention can change a software-testing decision, and when its effect must be sought in the priors or evidence instead.
Create a lesson
Related papers
Which Archived Results Survive a Rule Change? A Case Study in Revalidating Decisions
Shared title terminology · Zengjian Liu, Tommy He, ELE Zhao et al.
Beyond Plain MCP: Do Decision Models and Code Mode Make Tool Use Cheaper and Faster?
Shared title terminology · Abhishek Rai
Rasoi: Visual Diffs for Evaluating Structural Changes Made by Coding Agents
Shared title terminology · Riya Sahni, Aryan Kaul, Anushka Bhatnagar et al.
Inference Validation for Regulated AI: A Governed Decision Pipeline for LLM Serving
Shared title terminology · Dev Akre, Roman Bobalo, Manoj Dobbali
Hybrid Source Code Change Impact Analysis
Shared title terminology · Katharina Stengg, Christian Macho, Martin Pinzger
Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses
Shared title terminology · Saurabh Chopra