Measuring Code Sloppiness in AI-Generated Software

ArticleSebastianResearch

Sebastian from Earendil examines quantitative approaches to measuring 'code slop' generated by language models. While LLMs deliver syntactically correct code, they frequently double verbosity and architectural erosion compared to human code, leading even advanced agents to fail during iterative development benchmarks.

Key points

  1. LLMs reliably produce formally correct code that passes unit tests, but often introduce unnecessary abstractions, duplication, and rapid line-of-code bloat.
  2. Using AI as an evaluation judge remains unreliable, as models frequently act like random number generators or alter preferences based on arbitrary label renaming.
  3. The SlopCodeBench paper proposes two objective metrics: Verbosity (AST-Grep flagged and clone lines divided by LOC) and Erosion (mass concentration in functions with cyclomatic complexity over 10).
  4. AI agent code averages roughly twice the verbosity (0.33 vs 0.15) and erosion (0.68 vs 0.31) of human-written benchmark repositories.
  5. In multi-round checkpoint benchmarks where context is erased between steps, cumulative bad decisions caused strict solve rates to drop to 0%, even for top models like GPT 5.6 sol xhigh.

Why it matters

Blindly relying on AI agents to manage expanding codebases introduces severe maintenance risks. Since agents themselves struggle to navigate accumulating slop across iterative tasks, engineering teams need quantitative quality benchmarks rather than purely vibe-based assessments.

Analysis

The article addresses a critical blind spot in typical AI coding benchmarks, which conventionally score isolated pass rates rather than long-term maintainability. By leveraging SlopCodeBench's definitions of verbosity and erosion, the author shows empirical evidence of code decay under agentic development. The 0% pass rate in multi-step tests with context resets proves that agents cannot reliably refactor or sustain their own generated code without human intervention.

Found in

Summary generated by AI (Gemini 3.8 Flash, 27 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • X post:Pi (@pidotdev) / Sebastian Baye

    Measuring Code Sloppiness: Why Functionally Correct AI Code Degrades Quality

    In an Earendil blog post, engineer Sebastian Baye explores methods to quantify 'code sloppiness' produced by LLMs. While models generate syntactically and functionally correct code that passes automated tests, empirical metrics demonstrate that agent-generated code has roughly twice the verbosity and structural erosion of human codebases.

    136bookmarks6.2kviews

    AI & LLMs· Research

  • Article:The Cognition Team

    Measuring Autonomous AI Engineer Productivity: Cognition's Framework for Devin

    Cognition has introduced an automated system to quantify the output of autonomous AI software engineers in terms of productive engineering hours. Because token consumption and diff sizes are poor proxies for actual value, a dedicated estimator agent inspects Devin session traces, removes unproductive runs, and benchmarks the result against the time a human developer would have required.

    AI & LLMs· Research

  • Repository:TinyFrontier/anti-slop-py

    anti-slop-py: Python Linter Blocking AI Agent Type Escapes

    anti-slop-py is a zero-dependency Python linter targeting low-evidence escape hatches generated by AI coding agents. It prevents patterns like excessive Any types, cast cascades, and unexplained type: ignore comments that agents use to satisfy type checkers without defining proper contracts.

    5starsPython

    AI & LLMs· Tool

  • Link:The Cognition Team

    FrontierCode: Benchmarking AI Code by Maintainer Mergeability

    Cognition has published FrontierCode, a benchmark and leaderboard evaluating whether pull requests generated by AI models would realistically be merged by open-source maintainers. Scoring relies on unit tests, verifiers, and maintainer-defined rubrics.

    AI & LLMs· Resource

  • X post:Tech with Mak

    Ponytail: Prompting AI Coding Agents to Write Less Code

    Ponytail is an open-source tool designed to teach AI coding agents to reuse existing code, standard libraries, and dependencies instead of writing new code from scratch. According to Tech with Mak, the tool reduces generated code by an average of 54 percent.

    1.9kbookmarks149.3kviews

    AI & LLMs· Tool

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.