cs.AIAug 23, 2026

Function-Level Execution Feedback for Code Preference Optimization

Authors: Idris Nechnech, Sehwan Kim, Jimin Seo, Yeongoon Kim, Minhae Oh, Sangwoo Hong, Jungwoo Lee

Organizations: Department of Electrical and Computer Engineering, Seoul National University · Department of Computer Science and Engineering, Konkuk University

Abstract

Process supervision has improved mathematical reasoning, where intermediate steps are naturally expressed as chains of thought. In code generation, however, process supervision remains underexplored because there is no standard notion of a step. Supervision can target lines, reasoning traces, or program states, making it unclear what to label and optimize. We propose STEP-KTODER, a framework for code preference optimization that defines steps as module-level functions in decomposed multi-function programs and assigns binary correctness labels via automatically generated unit tests. Our method provides a code-specific instantiation of stepwise KTO, combining function-level process supervision with outcome-level feedback on the full program. We evaluate on HumanEval(+), MBPP(+), BigCodeBench, and LiveCodeBench, showing that STEP-KTODER improves over outcome-only KTO and DPO. Further analysis shows that execution-based labels are essential: LLM-as-a-judge annotations systematically over-predict function failures, corrupt positive step labels, and degrade downstream preference optimization. Code is available at: https://github.com/inechnech/STEP-KTODER.

Figures & tables

Appendix figures & tables15 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. StepCodeReasoner: Aligning Code Reasoning with Stepwise Execution Traces via Reinforcement Learning

    May 12, 2026Hao Wang, Rui Li, Lei Sha +1RL for Language Model ReasoningExecution-Guided Code Generation

  2. EffiPair: Improving the Efficiency of LLM-generated Code with Differential Execution Feedback

    Apr 6, 2026Samira Hajizadeh, Suman JanaInference-Time OptimizationCode Optimization

  3. COMPAS: Difficulty-Aware Joint Search for Optimizing Code Generation

    Aug 5, 2026Jingzhi Gong, Jie M. Zhang, Gunel Jahangirova +3Large Language Model-Guided OptimizationCode Generation