{
  "id": 10143083,
  "title": "AI models catch bad code, then cry wolf on the good code",
  "url": "https://urgent.news/2026/09/27/ai-models-catch-bad-code-then-cry-wolf-on-the-good-code",
  "topic": "ai",
  "section": "AI",
  "published": "2026-09-27T05:20:55.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/zkasuran/ai-models-catch-bad-code-then-cry-wolf-on-the-good-code-3e55"
  },
  "original_language": "en",
  "account": "I conducted a Kaggle benchmark called Blog vs Bytecode to explore how AI models handle data-science tutorials. Each pair featured a piece of code alongside a corresponding blog-style claim. Half of the claims were genuine, while the other half contained deliberate mistakes like improper scaler fitting, feature construction from the target variable, improper cross-validation on time-series data, quoting accuracy on highly imbalanced data, and threshold tuning on the test set.\n\nThe dataset was balanced at 15/13, meaning a model that simply flagged every example as problematic would achieve a 50% accuracy score. I tested various current models on Kaggle and observed that some models were excellent at identifying genuine flaws, but they also often flagged correct code as problematic. Conversely, other models tended to miss the flawed code.\n\nI discovered that the issue stemmed from the harness used to run the models on Kaggle. The harness was lying about half the models it ran for you, leaving empty responses which were counted as wrong. When I fixed the harness by having it return the actual model output instead, the performance of the models improved significantly. For instance, DeepSeek-R1's error rate dropped from 17% to 100% when the harness was fixed.\n\nWhile the strong models were near-perfect at flagging genuine flaws, they also tended to call sound code problematic. Small models, on the other hand, under-flagged flaws. Notably, models with reasoning capabilities scored better when reasoning was enabled, while those without reasoning saw a significant drop in performance. The benchmark, which includes all items, verdicts, and the grader, is publicly available on Kaggle for anyone to examine the models' outputs and identify any errors.",
  "summary": "I wanted to know one thing. When an AI model reads a data-science tutorial, does it check the code or believe the caption? So I built Blog vs Bytecode , a Kaggle benchmark of 28 short data-science snippets. Each pairs a piece of code with a blog-style claim about it. Half the claims are honest and the method is sound. The other half hide a real mistake: a scaler fit before the train/test split, a…",
  "key_points": [
    "AI models excel at identifying flawed code but often flag correct code as problematic",
    "Kaggle harness issue caused inaccurate model evaluations, improved after fixing",
    "Reasoning-capable models performed better when reasoning was enabled"
  ],
  "editors_take": "Fixing the flawed harness used to evaluate AI models on Kaggle significantly improved their performance, revealing that strong models can accurately flag flawed code but often incorrectly label good code as problematic.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}