← Latest papers
💬 NLP

DevIntent: How Much Does LLM-Generated Code Violate Developer Intent?

This paper introduces the Intent Violation Rate (IVR) metric and a corresponding benchmark to reveal that while LLM-generated code frequently passes standard visible tests, it systematically violates developers' implicit intentions in over half of the cases, suggesting that current pass rates significantly overestimate the alignment between generated code and true developer intent.

Original authors: Susana Haing, Natan Vidra, Spurthi Setty

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

Original authors: Susana Haing, Natan Vidra, Spurthi Setty

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 super-talented, lightning-fast robot chef to cook dinner for your family. You tell it, "Make me a sandwich." The robot whirs to life, grabs the bread, slices the turkey, and plates a beautiful, perfect-looking sandwich. You take a bite, and it tastes exactly like a turkey sandwich. By every standard test you can think of—does it have bread? Yes. Does it have turkey? Yes. Is it edible? Yes. The robot has passed the test with flying colors.

But here's the twist: your family is vegetarian, and you forgot to mention that. The robot, being a literal-minded machine, didn't ask for clarification; it just assumed "sandwich" meant "sandwich with meat." It followed your instructions perfectly, but it completely missed your intent. In the world of computer science, specifically in the field of Artificial Intelligence (AI), this is a growing headache. We have powerful AI models that can write computer code, but they often act like that literal-minded chef. They can write code that passes all the official "tests" a programmer writes, yet the code does something slightly different from what the programmer actually wanted. This paper dives into that gap between "what the code does" and "what the human meant."

The researchers behind this study, working with models like Claude Sonnet 4.6 and OpenAI's GPT-4.1, decided to stop just checking if the code "works" and start checking if it "gets it." They created a new way to measure this, which they call the Intent Violation Rate (IVR). Think of IVR as a "mind-reading test" for AI. Instead of just asking, "Did the code run without crashing?" they ask, "Did the code do exactly what the human was thinking, even the parts the human forgot to say out loud?"

To test this, the team built a special playground of 49 tricky coding puzzles. They took clear, detailed instructions (the "Gold Prompt") and stripped away the important, unspoken details to create a vague, ambiguous version (the "Ambiguous Prompt"). They then asked the AI to solve the puzzle using only the vague version. The AI was given a basic checklist (the "Stated Test") to prove it solved the main problem, but the researchers also hid a secret checklist (the "Hidden Constraints") that captured the details the AI was supposed to guess. For example, if the vague prompt was "Sort these numbers," the AI might just list them. But the hidden constraint might be "Sort them from smallest to largest." If the AI listed them in random order, it would pass the basic test but fail the hidden one, violating the developer's intent.

The results were a bit of a shock. When the researchers looked at how often the AI passed the basic, visible tests, the numbers looked amazing: Claude Sonnet 4.6 passed 94.3% of the time, and GPT-4.1 passed 92.7% of the time. If you only looked at those numbers, you'd think the AI was a coding genius. But when they checked the secret "Intent Violation Rate," the picture changed dramatically.

Even though the code passed the visible tests, it violated the developer's hidden intent in 54.5% of the cases for Claude and 63.5% for GPT-4.1. That means in more than half of the problems, the AI wrote code that technically worked but was fundamentally wrong about what the human wanted. The researchers found that this wasn't just random noise or a few bad guesses. The AI's behavior was surprisingly consistent and "bimodal," meaning it tended to either get the hidden intent perfectly right or completely miss it, with very few "almost right" answers in between.

The study suggests that simply counting how many tests a piece of code passes is not enough to know if it's good. A high pass rate might give developers a false sense of security, making them think the code is ready to deploy when it's actually missing crucial, unspoken requirements. The authors note that while their findings are based on a specific set of 49 problems and two specific AI models, the pattern they found is systematic. They argue that we need new ways to measure code quality that look beyond the surface-level "pass/fail" results to ensure the AI is truly understanding the human's vision, not just gaming the test.

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 →