Position, not importance: what a likelihood threshold actually defers on
This paper demonstrates that the Empower assistant-training method's likelihood-based stopping rule fails to distinguish between dangerous and benign code completions, instead deferring based on token position and local predictability, which results in either incomplete useful code or the generation of unsafe branches.
Original paper licensed under CC BY 4.0 (https://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 software development, artificial intelligence has evolved from a tool that simply answers questions into a partner that writes code alongside humans. These digital assistants, often called coding agents, watch what a programmer types and then suggest the next few lines of code to speed up the work. The central challenge for these systems is knowing when to stop. If the assistant writes too much, it might make a critical decision for the programmer, such as choosing a security setting or a database command, effectively taking the keyboard away before the human has a chance to review the choice. If it stops too soon, it offers little help at all. For a long time, researchers hoped that a computer could learn to recognize the exact moment a human needs to step in by measuring how "surprised" the computer is by its own predictions. The theory was that when a model becomes uncertain about what comes next, it is likely because a difficult or important decision is being made, and that is the perfect time to pause and ask for help.
A recent study set out to test this theory in the high-stakes environment of computer programming. The researchers built a specific test environment containing hundreds of short code snippets, some of which contained dangerous choices—like leaving a security door open or using a weak password method—and others that were just harmless, routine code. They applied a rule that told the computer to keep writing as long as it felt confident, stopping only when the cumulative confidence dropped below a certain line. The hope was that this rule would naturally pause before the dangerous choices, allowing the human to review them. However, the results revealed a startling disconnect. The computer did not stop because a choice was dangerous; it stopped because the text became hard to predict. In the world of code, the most dangerous choices are often the most common and predictable ones, while the truly surprising text is often just random noise. Consequently, the system frequently wrote out the dangerous code in full, while stopping abruptly in the middle of harmless, boring text.
The researchers, led by Shubhanandan T Y and colleagues at Dayananda Sagar University, constructed a detailed benchmark called CEDE-Bench to measure exactly how often this happens. The test included 112 specific scenarios where a programmer must choose between a safe path and a risky one, such as deciding whether to disable a security check or how to handle a password. They also included 12 harmless control items that contained no real decisions, just standard boilerplate code. When they ran the computer's stopping rule on these items, the results were stark. At the setting used in a previous user study, the system wrote out the dangerous branch in 33 percent of the cases. In some instances, it completed nearly an entire SQL database query that was vulnerable to hacking, writing eighteen out of nineteen tokens before stopping. This happened not because the computer failed to see the danger, but because the dangerous code was exactly what the computer expected to see based on its training data.
The study found that the system's behavior was driven almost entirely by where the decision appeared in the text, not by what the decision was. If a risky choice appeared within the first few words of a suggestion, the computer almost always wrote it down. If the same risky choice appeared later, after the computer had already used up its "budget" of confident words, it stopped before reaching it. The researchers discovered that the rule acts less like a judge weighing the importance of a decision and more like a simple token counter. It allows the computer to write a certain number of words based on how predictable the surrounding text is, and then it stops. Because the dangerous choices in code are often very predictable—like using a standard but insecure function—they fall within this early window and get written. Conversely, harmless text that contains random-looking strings, such as a fake API key, is unpredictable and causes the computer to stop early, even though there is no danger in continuing.
This finding challenges the idea that a computer can learn to defer to humans simply by measuring its own uncertainty. The study showed that the system's stopping point was statistically indistinguishable between dangerous items and harmless ones. It stopped in the middle of benign boilerplate code just as often as it stopped before dangerous code. The researchers concluded that the rule is blind to importance. It does not know that a specific line of code could delete a database or leak a password; it only knows how many words it has written and how surprising the next word feels. In fact, the system was more likely to stop on a harmless item containing a random-looking string than on a dangerous item that followed a common, predictable pattern. This means that tuning the sensitivity of the rule cannot fix the problem; making it stop earlier just means it stops writing useful code sooner, while making it stop later means it writes more dangerous code.
The implications of this discovery are significant for how we build and trust AI assistants. The study suggests that relying on a model's own confidence to decide when to hand control back to a human is a flawed strategy in programming. The system is not deferring to the human because the human's input is needed for a critical decision; it is deferring because the text has become mathematically difficult to predict. The researchers noted that in their tests, the system completed only about a third of the harmless boilerplate code before stopping, meaning it was frequently interrupting the programmer for no good reason. At the same time, it failed to pause for the most dangerous decisions, which were often the most routine and expected ones. This creates a situation where the assistant is either too intrusive or too risky, with no middle ground that satisfies both safety and usefulness.
Ultimately, the paper argues that the mechanism behind these AI assistants needs a fundamental rethink. The current approach, which assumes that uncertainty equals importance, does not hold up in the real world of software development. The researchers propose that instead of trying to teach the model to recognize importance through uncertainty, we should use simpler, more direct methods to catch dangerous patterns, such as static code checkers that look for known security flaws. These tools do not need to guess when to stop; they can simply flag specific risky patterns regardless of how confident the AI feels. The study serves as a clear warning that while AI assistants can be helpful, their ability to know when to stop is not a sign of wisdom or safety, but merely a reflection of how predictable the text happens to be. Until the technology can distinguish between a boring routine and a critical decision, relying on it to make those distinctions on its own remains a gamble.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.