HAVE AI NEWS HAVE AI NEWS
tg subscribe
Research

"I'm 100% Sure": Why AI Self-Assessment Cannot Replace Unit Tests

By: HAVE AI NEWS desk Updated #Code Generation #LLM #Benchmarks #Python #Software Testing
"I'm 100% Sure": Why AI Self-Assessment Cannot Replace Unit Tests

An experiment evaluating the reliability of AI-generated code revealed that language models are fundamentally incapable of doubting their own solutions, even when producing blatant bugs.

The Blind Confidence of Algorithms

Attempting to delegate code validation to the neural network itself proved to be a flawed strategy. An experiment testing whether a language model could honestly admit uncertainty about its generated script using a special marker revealed a 100% tendency toward AI overconfidence: out of 179 Python problem solutions, not a single model chose an uncertain status even once, despite several programs containing gross errors.

Instead of manual code review or running automated tests, the hypothesis proposed a simple filter: if the model appends CONFIDENCE: SURE at the end of the response, the solution is accepted; if CONFIDENCE: UNSURE, it is sent for revision. In practice, however, such a filter would have let every bug slip into production, as the re-examination queue remained completely empty.

How the Testing Was Conducted

For the experiment, 20 practical problems based on the Python 3.9 standard library were prepared. Each prompt contained non-obvious edge cases (such as adjacent range merging rules, IPv4 character validation, or proper file size rounding). The solutions were evaluated against a hidden suite of 247 tests.

The prompt strictly specified that returning the SURE status was only permitted with complete confidence that the function would handle all edge cases and pass rigorous testing. Requests were sent via a third-party API gateway to three models (three generations per problem):

Model IDResponsesSuccessful TestsSUREUNSUREErroneous SURE
gpt-6.1-sol60606000
claude-haiku-5-560596001
glm-5.3-flash59565903
Total17917517904

The overall error rate was a modest 2.2%, but the core issue lies elsewhere: all 4 defective solutions received the highest confidence score from the models.

Errors the Neural Networks Never Doubted

The solutions failed not on exotic edge cases, but on quite trivial operations:

  • Index off-shift in date parsing. The glm-5.3-flash model wrote detailed comments about handling invalid formats, but then attempted to parse a YYYY-MM-DD string using slices that ignored hyphens: year = int(s[0:4]), month = int(s[4:6]), day = int(s[6:8]). Consequently, a standard date failed with a ValueError on the very first call.
  • Collapsing relative paths. Tasked with preserving the traversal ../../a, the same model pushed the first .. onto a stack, but on the second one simply called pop() without checking the stack's contents. The double directory traversal canceled itself out, turning into a. This bug occurred in two out of three runs.
  • Classic off-by-one. When formatting data sizes, the claude-haiku-5-5 model shifted the unit array index: given 1024 bytes, the function returned 1.0 MiB instead of 1.0 KiB, failing 11 out of 14 tests.

Limitations of the Experiment and Conclusions

Definitive conclusions regarding the superiority of specific architectures cannot be drawn from this sample: 20 tasks represent a modest dataset, and calls were routed through an aggregator with uncontrolled context (input token counts differed by an order of magnitude between models). Furthermore, results from deepseek-v4-flash were excluded due to frequent timeouts and truncated API responses.

Nevertheless, the main practical takeaway is clear: LLM self-reflection within a single prompt without a code execution environment does not work. Models tend to project false confidence even when making obvious syntactic and logical errors; therefore, external testing and running code in an isolated sandbox remain the only reliable means of validation.

Original byline: zach

Source: habr.com

Google introduces Gemini 4 Neon for fast, complex AI workflows
Models

Google introduces Gemini 4 Neon for fast, complex AI workflows

Gemini 4 Neon is Google’s new frontier-level model for software engineering, enterprise analysis, science, cybersecurity and long-running agent tasks. It offers a one-million-token context window, flexible reasoning levels and lower per-task costs, with access beginning across Google AI Studio, Gemini for business, Antigravity and the Gemini app.

Watermelon Breakthrough: Meta Unveils Muse Wonder Flagship AI Models
Models

Watermelon Breakthrough: Meta Unveils Muse Wonder Flagship AI Models

Meta Superintelligence Labs has introduced its closed Muse Wonder model family. The flagship Wonder Full outperformed OpenAI’s models and trails only Claude Opus 5.5.

Google Unveils Gemini 4 Argon: A Return to the Race for Advanced AI Models
Models

Google Unveils Gemini 4 Argon: A Return to the Race for Advanced AI Models

The new flagship Gemini 4 Argon neural network outperformed leading competitors in most tests, although access will be limited at launch.

Anthropic Unveils Claude Fable 5.2 and Mythos 5.2: Record Performance with a 20% Price Cut
Models

Anthropic Unveils Claude Fable 5.2 and Mythos 5.2: Record Performance with a 20% Price Cut

Anthropic has released its flagship Fable 5.2 and Mythos 5.2 models. They outperform Opus 5.5 in most benchmarks, cost less than their predecessors, and are capable of solving complex scientific problems in just a few hours.

Google Pulls Ahead: Gemini 4 Carbon Model Unveiled with Record-Breaking Performance
Models

Google Pulls Ahead: Gemini 4 Carbon Model Unveiled with Record-Breaking Performance

Google has announced Gemini 4 Carbon, a specialized AI model for coding and cybersecurity that has outperformed competitors in most industry benchmarks.

Slopsquatting Attack: How AI Hallucinations Opened a New Flaw in Software Security
Research

Slopsquatting Attack: How AI Hallucinations Opened a New Flaw in Software Security

Nearly 20% of libraries recommended to developers by modern LLMs are fabricated. Attackers have learned to hijack these phantom dependencies and inject malicious code into third-party projects.