Execution-fingerprint selection for generated code candidates
Coding assistants that already sample multiple solutions should add a sandboxed execution stage before returning one answer. The concrete build is simple: generate a small set of diverse inputs, run each candidate with timeouts, record outputs, exception types, and timeouts as an execution fingerprint, then choose from the largest all-success behavior cluster.
Semantic Voting gives the clearest case for this as an adoption change. Across 18 HumanEval+ and MBPP+ configurations, execution-based selectors beat output-pattern majority voting by 19 to 52 percentage points, and sketch-based generated inputs were the best input source in its ablation. Sketch-and-Verify adds a useful candidate-generation rule for cheap model tiers: ask for distinct algorithmic sketches, fill each sketch several times, and verify the resulting candidates by execution. On 19 hard HumanEval+ problems for Gemini 3.1 Flash Lite, K=2,M=5 solved 11 problems, compared with 5 for flat N=10 sampling.
A practical first test is to run this selector on recent internal coding-assistant tasks where multiple candidates were already produced. Track pass rate, sandbox cost, and cases where no all-success cluster appears. DSDE can add a risk score when the top candidate’s behavior cluster is far from the alternatives, giving reviewers a reference-free signal before full validation.