Moving Beyond Binary Execution Feedback

Traditional methods for aligning code-generation models often rely on binary feedback—whether a generated script passes or fails a set of unit tests. This paper introduces a more granular approach: Function-Level Execution Feedback. Instead of treating an entire code block as a single success or failure, this method decomposes the code into individual functions and evaluates them independently. By isolating the execution success of specific functions, the model receives more precise signals during the preference optimization process, allowing it to learn which specific segments of code are problematic rather than discarding an entire generation due to a single localized error.

Enhancing Preference Optimization

By integrating this function-level feedback into the training pipeline, the researchers demonstrate that models can more effectively navigate the search space of potential solutions. The core argument is that binary feedback is too noisy; a model might generate a highly functional, complex algorithm that fails only because of a minor syntax error in a helper function. By providing feedback at the function level, the optimization process can reward the model for the correct logic in the primary function while penalizing only the specific sub-component that failed. This leads to more stable training dynamics and higher-quality code generation, as the model learns to prioritize functional correctness at a modular level, reducing the likelihood of cascading errors in larger codebases.