Function-Level Execution Feedback for Code Preference Optimization

📅 2026-08-23
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
本文提出STEP-KTODER框架,通过定义模块级函数为步骤并自动生成单元测试来优化代码偏好,解决了代码生成中过程监督不明确的问题。
📝 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.
Problem

Research questions and friction points this paper is trying to address.

process supervision
code generation
step definition
optimization
Innovation

Methods, ideas, or system contributions that make the work stand out.

function-level process supervision
code preference optimization
automatically generated unit tests
module-level functions
I
Idris Nechnech
Department of Electrical and Computer Engineering, Seoul National University
Sehwan Kim
Sehwan Kim
Ewha Womans University
J
Jimin Seo
Department of Electrical and Computer Engineering, Seoul National University
Y
Yeongoon Kim
Department of Electrical and Computer Engineering, Seoul National University
M
Minhae Oh
Department of Electrical and Computer Engineering, Seoul National University
S
Sangwoo Hong
Department of Computer Science and Engineering, Konkuk University
Jungwoo Lee
Jungwoo Lee
Professor, Department of Electrical and Computer Engineering, Seoul National University
Machine LearningDistributed ComputingInformation Theory