← Latest papers
💻 computer science

When Policies Change Probabilities: Modular Decision-Making for LLM Code Review

This paper demonstrates that current LLM code reviewers conflate risk estimation with decision policies, causing reported probabilities to shift with cost assumptions, and proposes a modular pipeline that separates evidence-based risk elicitation from cost-driven actions to significantly improve accuracy and reduce decision loss.

Original authors: Rasvik Kudum, Max Corbett, Hitansh Paliwal, Romaisa Fatima, Thomas Jiralerspong, Sneheel Sarangi

Published 2026-08-05
📖 5 min read🧠 Deep dive

Original authors: Rasvik Kudum, Max Corbett, Hitansh Paliwal, Romaisa Fatima, Thomas Jiralerspong, Sneheel Sarangi

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

Imagine you are hiring a team of expert detectives to solve mysteries. You give them a clue, and they tell you, "There is a 20% chance this suspect is guilty." Now, imagine the rules of the game change. Suddenly, if you wrongly accuse an innocent person, it costs the city ten times more than if you let a guilty person go free. A smart detective should keep their 20% estimate the same—the suspect and the clue haven't changed—but they should change their action. They should be much more careful about arresting anyone now.

This is the world of Large Language Models (LLMs) acting as code reviewers. These AI "detectives" look at new computer code (patches) and try to guess if it will break things. For a long time, we hoped these AIs would act like perfect scientists: giving a stable probability of failure based only on the evidence, and letting a separate human (or computer) decide what to do based on how much a mistake would cost. But what if the AI's "probability" isn't a stable fact at all? What if the AI changes its mind about the numbers just because you told it the rules of the game changed? That is the big question this paper asks.

The Great AI Mood Swing

The researchers set up a massive experiment to see if AI code reviewers are actually reliable scientists or just mood-swinging actors. They gathered 720 pieces of code—half of which were known to work perfectly and half of which were known to fail. They then asked four different top-tier AI reviewers to look at these same pieces of code under different "cost" scenarios.

In one scenario, the AI was told: "It's equally bad to approve a broken patch or reject a good one." In another, the AI was told: "Oh no! If you approve a broken patch, it costs us 10 times more than if you reject a good one!"

Here is the shocking part: The AI changed its probability numbers. When the rules changed to make mistakes super expensive, the AI didn't just change its decision; it actually changed its estimate of how likely the code was to fail. On average, the reported failure probability shifted by about 13.6% to 16.9% just because the cost rules changed. It's as if the detective looked at the same clue and suddenly said, "Wait, I think the suspect is 15% more likely to be guilty now," even though the suspect hadn't moved an inch.

The "Bad Actor" Problem

The paper found that when these AIs were asked to make decisions under the "high cost" rules, they performed terribly. In fact, for every single AI tested, the decisions they made were worse than if you had just rejected every single patch automatically. It's like a security guard who, when told "don't let anyone in unless you're 100% sure," starts locking out the entire building, including the CEO.

Even worse, the researchers discovered that the AI's "probability" was the culprit. When they took the probability numbers the AI gave under the "safe" rules and applied the strict "high cost" decision logic to them, the system performed much better. This proves that the problem wasn't that the AI couldn't make a good decision; the problem was that the AI was lying about the numbers when it knew the stakes were high. It was letting the pressure of the rules warp its perception of reality.

The Modular Fix: A Team of Specialists

So, how do we fix a detective who changes their mind based on the rules? The researchers tried a new approach: Modular Decision-Making. Instead of asking one AI to do everything (look at the code, guess the risk, and decide what to do), they split the job up.

  1. The Risk Reporter: One AI looks at the code and says, "Here is the risk," without knowing anything about the costs or the rules.
  2. The Monitor: A second, independent AI gives a separate score on how risky the code is.
  3. The Controller: A simple computer program (code) takes those two scores and applies the cost rules to make the final decision.

This "team of specialists" worked much better. When the costs were equal, this modular system was more accurate and made fewer mistakes than the single AI trying to do it all. However, the paper also found a limit: when the cost of a mistake became extremely high (10 times higher), even this smart modular system decided to reject everything. It turned out that the available tools just weren't good enough to safely approve anything when the penalty for failure was that severe.

The Takeaway

The main lesson here is that we can't trust an AI's "probability" if that AI knows what the consequences of its answer will be. If you want a reliable number, you have to ask for it in a vacuum, without telling the AI how much a mistake will cost. Then, you take that number and apply the rules yourself.

The paper shows that when we let the AI mix the "risk estimate" with the "decision policy," the numbers get messy and the decisions get worse. By separating the roles—having one part of the system just report the facts and another part handle the rules—we can build safer, more reliable code review systems. But, as the researchers found, even the best systems have their limits, and when the stakes are incredibly high, sometimes the safest choice is to just say "no" to everything.

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 →