B4: Towards Optimal Assessment of Plausible Code Solutions with Plausible Tests
Mouxiang Chen, Zhongxin Liu, He Tao, Yusu Hong, David Lo, Xin Xia,, Jianling Sun

TL;DR
This paper introduces B4, an approximate optimal strategy within a Bayesian framework for selecting the best code solutions using plausible tests, outperforming existing heuristics significantly.
Contribution
It formulates the code solution selection as an integer programming problem and proposes an efficient approximation method with theoretical guarantees.
Findings
B4 outperforms existing heuristics by up to 50%.
The approach achieves a 246% improvement over random selection.
Theoretical analysis confirms the approximation bounds.
Abstract
Selecting the best code solution from multiple generated ones is an essential task in code generation, which can be achieved by using some reliable validators (e.g., developer-written test cases) for assistance. Since reliable test cases are not always available and can be expensive to build in practice, researchers propose to automatically generate test cases to assess code solutions. However, when both code solutions and test cases are plausible and not reliable, selecting the best solution becomes challenging. Although some heuristic strategies have been proposed to tackle this problem, they lack a strong theoretical guarantee and it is still an open question whether an optimal selection strategy exists. Our work contributes in two ways. First, we show that within a Bayesian framework, the optimal selection strategy can be defined based on the posterior probability of the observed…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsProbabilistic and Robust Engineering Design
