AI
New Benchmark Reveals AI Coding Agents Struggle With Code Quality Beyond Correctness
A comprehensive study finds that while AI agents excel at fixing bugs, they lag significantly when it comes to performance, readability, and other real-world code improvements developers make daily.
Coding agents powered by large language models have made significant strides in solving correctness-oriented programming tasks, but a new research study reveals critical gaps in their ability to handle the kind of code quality improvements that human developers perform routinely.
The Gap Between Correctness and Quality#
Researchers from the software engineering community have introduced SWE-NFI, a benchmark designed specifically to evaluate how well AI coding agents perform "non-functional improvements"—modifications that preserve existing behavior while enhancing aspects like performance, readability, and maintainability. The distinction matters because real-world software development involves far more than simply making code work correctly.
The benchmark encompasses 188 tasks drawn from actual merged pull requests in open-source Python projects. These tasks represent genuine scenarios where developers improved code quality without altering observable outputs. The researchers operationalized five key developer-focused improvement categories into 92 executable evaluation rules.
How Performance Falls Short#
When put to the test, the results proved sobering. Among eight commercial and open-source AI agent configurations evaluated, at most 70% of valid outputs successfully preserved the original code's essential properties. Even among solutions that passed functional preservation checks, performance on quality improvements was uneven.
For Logic Patterns—one of the five measured improvement aspects—all tested configurations achieved mean improvements ranging from 0.0 to 1.3, falling short of the 1.5 mean score set by human developers. This gap suggests AI agents currently lack the sophisticated judgment needed to recognize and implement the kinds of optimization patterns that experienced engineers routinely apply.
Why This Matters#
The findings underscore an important blind spot in how we currently benchmark coding AI. While existing evaluation frameworks focus heavily on whether code works correctly, they offer limited tools for assessing whether it works well. In practice, developers spend substantial effort on non-functional improvements—optimizing algorithms, refactoring for clarity, reducing technical debt—yet AI agents show inconsistent capability across these dimensions.
The SWE-NFI benchmark and its detailed findings provide a foundation for researchers to identify which code improvement areas need the most development and for practitioners to understand the real-world limitations of current tools.

