RC RANDOM CHAOS

LLMs write correct code, but it's twice as sloppy — and agents can't fix it

· via Hacker News

Original source

Measuring the sloppiness of code

Hacker News →

Modern LLMs reliably produce formally correct code, but correctness says nothing about quality. An engineer at Earendil, tasked with quantifying ‘code sloppiness,’ argues that AI agents pile on unnecessary abstractions, duplication, and runaway line counts — eroding human oversight in projects where millions of lines land each month. The industry’s evaluation methods are largely vibes-based: asking an LLM to rate code 1–10 is close to a random number generator, and pairwise A/B judging can flip simply by renaming the options. Human review is the gold standard but doesn’t scale to benchmarks or training loops.

The more promising signals come from the SlopCodeBench paper. ‘Verbosity’ captures duplicated and needlessly wordy lines (via handcrafted AST-Grep heuristics), while ‘erosion’ measures how much of a codebase’s mass sits in a few large, high-complexity functions (cyclomatic complexity above 10). Against established repositories, agent-generated code scored roughly twice as high on both — verbosity of 0.33 vs 0.15 and erosion of 0.68 vs 0.31 — a gap the author reproduced in his own vibe-coded projects. Simply tracking the change in lines of code also works surprisingly well, with the catch that optimizing for it destroys its usefulness.

The sharpest finding concerns whether agents can manage their own mess. SlopCodeBench evaluates iteratively — multiple rounds of instructions and tests with the model’s context wiped between checkpoints, mirroring how coding agents are actually used. Bad decisions compound across rounds, and under the strict metric where every test must pass at every checkpoint, even state-of-the-art models hit a 0% pass rate. The takeaway: quality evaluation still depends on human taste, and anyone shipping tens of thousands of AI-written lines a day should treat accumulating slop as a real liability rather than something the agents will sort out.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.