Research Papers 论文研究 4h ago Updated 32m ago 更新于 32分钟前 46

Function-Level Execution Feedback for Code Preference Optimization 函数级执行反馈用于代码偏好优化

STEP-KTODER introduces function-level process supervision for code generation by defining steps as module-level functions in decomposed multi-function programs Binary correctness labels are assigned via automatically generated unit tests, combining function-level process supervision with outcome-level feedback on the full program The framework is a code-specific instantiation of stepwise KTO (Kahneman-Tversky Optimization), addressing the lack of a standard notion of "step" in code generation ST 提出STEP-KTODER框架,将代码生成中的"步骤"定义为模块级函数,解决过程监督在代码领域缺乏标准步骤定义的问题 通过自动生成的单元测试为函数级步骤分配二元正确性标签,实现函数级过程监督与完整程序结果级反馈的结合 在HumanEval(+)、MBPP(+)、BigCodeBench和LiveCodeBench上验证,STEP-KTODER优于仅依赖结果的KTO和DPO方法 发现基于执行的标签至关重要:LLM-as-a-judge会系统性高估函数失败,污染正样本标签并损害下游偏好优化效果

62
Hot 热度
72
Quality 质量
65
Impact 影响力

Analysis 深度分析

TL;DR

  • STEP-KTODER introduces function-level process supervision for code generation by defining steps as module-level functions in decomposed multi-function programs
  • Binary correctness labels are assigned via automatically generated unit tests, combining function-level process supervision with outcome-level feedback on the full program
  • The framework is a code-specific instantiation of stepwise KTO (Kahneman-Tversky Optimization), addressing the lack of a standard notion of "step" in code generation
  • STEP-KTODER outperforms outcome-only KTO and DPO baselines across HumanEval(+), MBPP(+), BigCodeBench, and LiveCodeBench benchmarks
  • LLM-as-a-judge annotations systematically over-predict function failures, corrupt positive step labels, and degrade downstream preference optimization, making execution-based labels essential

Why It Matters

This work addresses a critical gap in AI code generation by establishing a principled approach to process supervision in programming tasks, where intermediate steps lack the natural structure found in mathematical reasoning. For AI practitioners building code generation systems, it demonstrates that execution-based feedback significantly outperforms LLM-judged annotations, which introduces systematic biases that harm preference optimization.

Technical Details

  • STEP-KTODER Framework: Defines "steps" as module-level functions within decomposed multi-function programs, enabling granular process supervision that was previously absent in code generation
  • Automatic Unit Test Generation: Binary correctness labels for each function are assigned through automatically generated unit tests, providing objective and reliable execution-based feedback without human annotation
  • Hybrid Supervision Signal: Combines function-level process supervision (intermediate correctness) with outcome-level feedback (full program correctness), mirroring the dual signal used in stepwise KTO for mathematical reasoning
  • Benchmarks: Evaluated on HumanEval(+), MBPP(+), BigCodeBench, and LiveCodeBench, showing consistent improvements over outcome-only KTO and DPO
  • LLM-as-a-Judge Failure Analysis: Systematic evaluation reveals that LLM judges over-predict function failures, which corrupts positive step labels and degrades downstream preference optimization performance

Industry Insight

  • Execution-based evaluation should be the default for code preference optimization rather than LLM-as-a-judge approaches, which introduce systematic biases that actively harm model performance
  • The function-level decomposition strategy provides a reusable blueprint for applying process supervision to other structured generation tasks beyond code, such as technical documentation or multi-step workflows
  • As code generation models approach production readiness, the choice of preference optimization signal (execution vs. judgment) will become a decisive factor in closing the gap between benchmark performance and real-world reliability

TL;DR

  • 提出STEP-KTODER框架,将代码生成中的"步骤"定义为模块级函数,解决过程监督在代码领域缺乏标准步骤定义的问题
  • 通过自动生成的单元测试为函数级步骤分配二元正确性标签,实现函数级过程监督与完整程序结果级反馈的结合
  • 在HumanEval(+)、MBPP(+)、BigCodeBench和LiveCodeBench上验证,STEP-KTODER优于仅依赖结果的KTO和DPO方法
  • 发现基于执行的标签至关重要:LLM-as-a-judge会系统性高估函数失败,污染正样本标签并损害下游偏好优化效果

为什么值得看

本文首次系统性地解决了代码生成中过程监督缺乏标准步骤定义的核心难题,为代码偏好优化提供了可落地的技术路径。对AI从业者而言,研究结果揭示了执行验证相比LLM评判的显著优势,对构建更可靠的代码生成模型具有重要参考价值。

技术解析

  • STEP-KTODER框架:将多函数程序分解为模块级函数作为监督单元,定义"步骤"为函数级别,通过自动生成的单元测试为每个函数分配二元正确性标签(通过/失败)
  • 混合监督机制:结合函数级过程监督(step-level)与完整程序的结果级反馈(outcome-level),实现代码特定的逐步KTO(stepwise KTO)实例化
  • 基准测试:在HumanEval(+)、MBPP(+)、BigCodeBench和LiveCodeBench四个主流代码生成基准上进行评估,验证方法的有效性和泛化能力
  • 关键发现:执行-based标签优于LLM-as-a-judge,后者会系统性高估函数失败率,导致正样本标签被污染,最终损害偏好优化性能

行业启示

  • 代码生成领域需要建立标准化的过程监督机制,STEP-KTODER为复杂程序分解和函数级评估提供了可复用的框架范式
  • 执行验证(execution-based)比LLM评判更可靠,建议在代码生成模型的训练和评估中优先采用基于测试的验证方法
  • 多函数程序的分解策略为过程监督在代码领域的扩展应用提供了新思路,可推广至更复杂的软件工程任务

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Code Generation 代码生成 Research 科学研究 Fine-tuning 微调 LLM 大模型 Evaluation 评测