SlopCodeBench: Benchmarking How Coding Agents Degrade Over Long-Horizon Iterative Tasks
The paper introduces SlopCodeBench, a benchmark demonstrating that current coding agents systematically fail at long-horizon iterative tasks by exhibiting steady degradation in code quality through increased verbosity and structural erosion, a problem that pass-rate benchmarks fail to capture.
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 hire a very talented, fast-talking architect to build a house.
The Old Way (Current Benchmarks):
You give the architect a blueprint for a small cottage. They build it perfectly. You walk through, check the doors and windows, and say, "Great job! 100% pass rate!" You hire them again for a bigger house, and they do it again.
The problem: The benchmarks only check if the house stands up right now. They don't ask: "If we need to add a second floor next year, will the foundation collapse? Will the walls be so messy with duct tape and glue that we can't drill a hole without the whole thing falling apart?"
The New Way (SlopCodeBench):
This paper introduces a new test called SlopCodeBench. Instead of building a house from scratch every time, the architect has to keep adding rooms to the same house they built yesterday, based on new, changing requests.
- The Request: "Okay, now add a kitchen." (They build it).
- The Twist: "Now, make the kitchen support a heavy stone oven, and also add a secret door."
- The Twist 2: "Now, we need to add a library, but the stone oven is blocking the way, so you have to move it."
The "Slop" Problem
The researchers found that as these AI coding agents keep working on the same project, the code starts to turn into "Slop."
Think of "Slop" like a messy kitchen counter where you keep piling up ingredients without cleaning up.
- Verbosity (The Clutter): The agents start writing way too much code. Instead of saying "Add salt," they write a 50-page essay on why salt is important, how to find it, and three different ways to pour it. It works, but it's bloated and hard to read.
- Structural Erosion (The Rot): This is the scary part. Imagine the house's main support beam. At first, it's a clean, strong steel beam. As the agent adds more rooms, they start nailing new things directly onto that one beam. They don't build new supports; they just pile more weight onto the old one. Eventually, that one beam is holding up the entire roof, the kitchen, and the library. It's a "God Function"—a single piece of code so huge and tangled that if you touch it to fix a small bug, the whole house might shake.
What They Discovered
The team tested 11 different AI models (like the smartest coding assistants available) on 20 different software projects.
- No One Won: Not a single AI could finish a project from start to finish without the code getting messy. The best one only solved about 17% of the final steps correctly.
- The "Slop" Grows: As the projects got longer, the code got messier.
- 80% of the time, the code became "eroded" (the messy, overloaded beams got worse).
- 90% of the time, the code became "verbose" (too much clutter).
- AI vs. Humans: The researchers compared the AI's messy code to real, maintained software written by humans (like the code behind popular apps).
- Human code stays relatively flat and clean over time.
- AI code gets worse with every single update. It's like a human who cleans their room every week, while the AI is a teenager who just keeps throwing more clothes on the floor without ever picking anything up.
The "Magic Prompt" Experiment
The researchers tried to fix this by giving the AI a strict set of rules in the beginning, like: "Be concise! Don't make one giant function! Plan before you write!"
- The Result: It helped a little at the very start. The first room was cleaner.
- The Reality: But as soon as the AI started adding the second and third rooms, it forgot the rules. The mess started piling up again at the exact same speed. The "magic prompt" couldn't stop the degradation; it just delayed the inevitable.
The Big Takeaway
Current tests for AI coders are like a driving test where you only drive in a straight line for 10 seconds. The AI passes because it doesn't hit anything.
But real software development is like driving across the country for a week. You have to navigate traffic, bad weather, and detours. This paper shows that while AI is great at driving in a straight line, it gets lost, crashes, and leaves a trail of wreckage when it has to keep driving and adapting for a long time.
In short: AI can write code that works today, but it's terrible at writing code that can be extended tomorrow. The code becomes a "sloppy" mess that is hard to fix, hard to read, and eventually, impossible to maintain.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.