← Latest papers
🤖 AI

Function-Level Execution Feedback for Code Preference Optimization

The paper introduces STEP-KTODER, a framework for code preference optimization that defines steps as module-level functions with binary correctness labels from unit tests, demonstrating that this execution-based process supervision significantly outperforms outcome-only methods while avoiding the label corruption caused by LLM-as-a-judge annotations.

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

Published 2026-08-26
📖 4 min read☕ Coffee break read

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

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

In the world of artificial intelligence, there is a growing divide between models that can simply produce an answer and those that understand the journey to get there. For years, researchers have trained computer programs to solve math problems by rewarding them not just for the final number, but for every logical step they take along the way. This approach, known as process supervision, has helped machines become much better at reasoning. However, when it comes to writing computer code, this method has remained elusive. Unlike a math problem, which naturally breaks down into a sequence of calculations, a piece of software is often a tangled web of instructions where it is difficult to say exactly which line is right and which is wrong. If a program fails to run, traditional training methods often treat the entire output as a failure, even if ninety percent of the code is perfect. This coarse feedback leaves the machine guessing which specific part of its work needs fixing.

A team of researchers at Seoul National University and Konkuk University has developed a new way to teach these models how to write better code by breaking the problem down into manageable, testable pieces. They call their method STEP-KTODER. Instead of judging a whole program as a single unit, they teach the model to view a program as a collection of independent functions, or small, self-contained tools that do one specific job. The researchers take a correct solution and break it into these separate functions. Then, they automatically generate a set of simple checks, similar to a quality control inspector testing a single part of a machine, to see if each function works correctly on its own. This allows them to give the model precise feedback: "This specific function is correct, but that one is broken," rather than just saying "The whole thing failed."

The researchers tested this approach on several standard challenges used to measure how well artificial intelligence can write code. They found that by using these fine-grained, execution-based checks, their models improved significantly more than models trained with older methods that only looked at the final result. In fact, on the most difficult coding challenges, their new method boosted performance by nearly twenty-seven percent compared to the previous best techniques. The study also revealed a critical insight about how we evaluate code: simply asking a powerful language model to guess whether a piece of code is correct is not enough. When the researchers tried to replace their automatic, execution-based checks with judgments from another AI, the results got worse. The judging AI tended to be overly critical, incorrectly flagging correct code as broken, which confused the training process. This proved that the only reliable way to teach a model the value of a correct step is to actually run the code and see if it works.

The core of this discovery lies in how the researchers handled the messy reality of coding, where a program might pass all its final tests even if one of its internal parts is flawed. In the past, such contradictions were often ignored or smoothed over. However, the team found that these conflicts are actually valuable. By preserving cases where the whole program works but a specific function fails, they provided the model with a nuanced lesson: a program can be successful overall while still containing errors that need to be fixed. This approach allows the model to learn to reinforce the parts of its code that are working well while specifically targeting the parts that are not, much like a mechanic who knows exactly which bolt to tighten rather than just replacing the entire engine.

This work suggests a practical path forward for making artificial intelligence more reliable in complex tasks. By moving away from judging the final product in isolation and focusing on the correctness of the individual components that make it up, researchers can guide these systems to learn more effectively. The study demonstrates that for code generation, the most effective supervision comes from the code itself running and being tested, rather than from a second opinion. This shift from outcome-based feedback to process-based feedback, grounded in actual execution, offers a clearer, more direct way for machines to learn the craft of programming.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →