Function-Level Feedback Boosts Code Preference Optimization

Idris Nechnech, Sehwan Kim, Jimin Seo, Yeongoon Kim, Minhae Oh, Sangwoo Hong, Jungwoo Lee· August 26, 2026 View original

Key takeaways

  • Function-level execution feedback significantly improves code generation models.
  • STEP-KTODER combines process supervision with outcome-level feedback using unit tests.
  • Execution-based labels are superior to LLM-as-a-judge annotations for code correctness.
  • This approach leads to more robust and accurate code generation.

Who benefits

Software DevelopmentIT ServicesAI EngineeringEdTechCybersecurity

Summary

STEP-KTODER, a new framework, improves code preference optimization by applying function-level execution feedback to decomposed multi-function programs. It assigns binary correctness labels via unit tests, combining process supervision with outcome-level feedback, and outperforms outcome-only methods, demonstrating the necessity of execution-based labels.

Process supervision has proven effective in improving mathematical reasoning in LLMs by leveraging intermediate steps. However, applying this to code generation has been challenging due to the lack of a standardized definition for a "step" in code. Supervision could target lines, reasoning traces, or program states, making it unclear what to label and optimize. To address this, researchers introduce STEP-KTODER, a framework for code preference optimization. This framework defines "steps" as module-level functions within decomposed multi-function programs. It then assigns binary correctness labels to these functions using automatically generated unit tests. This approach effectively combines function-level process supervision with outcome-level feedback on the complete program. Evaluations on benchmarks like HumanEval(+), MBPP(+), BigCodeBench, and LiveCodeBench show that STEP-KTODER significantly improves performance over outcome-only KTO and DPO methods. Further analysis highlights the critical role of execution-based labels; LLM-as-a-judge annotations were found to systematically over-predict function failures, corrupting positive step labels and degrading downstream preference optimization. This underscores that actual code execution is essential for accurate feedback.

Why it matters

Developers and AI engineers can leverage function-level execution feedback to train more robust and accurate code generation models, moving beyond superficial textual correctness to ensure functional correctness, which is crucial for production-ready code.

How to implement this in your domain

  1. 1Adopt a modular approach to code generation, breaking down complex tasks into smaller, function-level components.
  2. 2Integrate automated unit test generation and execution into your code preference optimization pipelines.
  3. 3Prioritize execution-based feedback for training code generation models over LLM-as-a-judge annotations.
  4. 4Explore frameworks like STEP-KTODER to apply function-level process supervision to your code generation tasks.
  5. 5Develop robust evaluation metrics that assess functional correctness at both the module and program levels.

Original post by Idris Nechnech, Sehwan Kim, Jimin Seo, Yeongoon Kim, Minhae Oh, Sangwoo Hong, Jungwoo Lee

"arXiv:2608.23632v1 Announce Type: new 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 noti…"

View on X

Originally posted by Idris Nechnech, Sehwan Kim, Jimin Seo, Yeongoon Kim, Minhae Oh, Sangwoo Hong, Jungwoo Lee on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses