← Latest papers
💻 computer science

Defective Task Descriptions in LLM-Based Code Generation: Detection and Analysis

This paper introduces SpecValidator, a lightweight, finetuned classifier that effectively detects defective task descriptions (such as lexical vagueness, under-specification, and syntax errors) to improve LLM-based code generation, outperforming larger models and revealing that defect robustness depends more on description quality and type than model capacity.

Original authors: Amal Akli, Mike Papadakis, Maxime Cordy, Yves Le Traon

Published 2026-04-28
📖 5 min read🧠 Deep dive

Original authors: Amal Akli, Mike Papadakis, Maxime Cordy, Yves Le Traon

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 are hiring a brilliant but literal-minded chef (the AI) to cook a specific dish based on a recipe you wrote (the task description). If your recipe says, "Add some spice," the chef might guess wrong. If it says, "Add 2 grams of salt," the chef knows exactly what to do.

This paper, "Defective Task Descriptions in LLM-Based Code Generation," investigates what happens when the "recipes" (prompts) given to AI coding assistants are vague, incomplete, or messy. The researchers found that even the smartest AI chefs can fail spectacularly if the instructions aren't perfect, and they built a tool to spot these bad instructions before the cooking starts.

Here is a breakdown of their findings using simple analogies:

1. The Problem: Garbage In, Garbage Out

The researchers discovered that AI coding tools are incredibly sensitive to how a task is described. They identified three main ways a "recipe" can go wrong:

  • Lexical Vagueness (The "Use Your Best Judgment" Problem): This is like telling the chef to "add a little bit of sugar" instead of "add 10 grams." The AI has to guess the amount. The study found this causes a moderate drop in performance. It's annoying, but the AI can often still figure it out, especially if the recipe is short and informal.
  • Under-Specification (The "Missing Ingredient" Problem): This is the worst offender. It's like telling the chef to "bake a cake" but forgetting to say what kind of cake, how long to bake it, or what temperature. The AI is left guessing critical details. The study found this causes massive failures (up to a 15% drop in success rate). Even the most advanced AI models couldn't handle this; they just guessed wrong.
  • Syntax and Formatting (The "Typo" Problem): This is like writing "bake at 350 degrees" but accidentally typing "bake at 350 degreess" or messing up the capitalization. Surprisingly, the AI is very good at ignoring these. It's like a human chef who can read a messy, handwritten note and still bake the cake perfectly. Typos barely affected the results.

2. The Surprise: Bigger Isn't Always Better

You might think a super-smart, massive AI chef (a large model) would be better at handling vague instructions than a smaller one. The researchers tested this and found it doesn't matter.

Whether the AI was a small, resource-friendly model or a massive, state-of-the-art reasoning model, they all failed equally when the instructions were incomplete. The size of the AI's brain didn't help; the clarity of the instructions was the only thing that mattered.

However, there was one exception: LiveCodeBench. This is a benchmark where the "recipes" are very detailed, including specific examples of inputs and outputs (like showing the chef a picture of the finished cake alongside the instructions). Because the context was so rich, these AI chefs were much more resilient to bad instructions. It proved that structure and examples save the day.

3. The Solution: The "Quality Inspector" (SpecValidator)

Since the AI chefs can't fix bad recipes themselves, the researchers built a tool called SpecValidator. Think of this as a Quality Inspector who looks at the recipe before the chef starts cooking.

  • How it works: It's a small, lightweight AI trained specifically to spot the three types of bad instructions (Vague, Missing Info, or Typos).
  • How good is it? It is surprisingly effective. It caught defects with an accuracy score (F1) of 0.804.
  • The Comparison: The researchers tested this small inspector against the "giants" (GPT-5-mini and Claude Sonnet 4). The giants, despite being huge and powerful, performed poorly at spotting these defects (scoring around 0.46–0.51). The small, specialized inspector beat them by a wide margin.

4. The "Real World" Test

The most interesting part of the study was testing SpecValidator on the original benchmarks (the "clean" recipes) that were supposed to be perfect.

The inspector found that 18% of the "perfect" recipes were actually defective.

  • When the researchers manually checked the ones flagged as "Under-Specified" (missing info), they confirmed that 73% of them were indeed missing critical details.
  • When they tried to use these "clean" but actually broken recipes with the AI chefs, the chefs failed almost every time.

This suggests that many of the standard tests we use to measure AI coding ability might be flawed because the instructions themselves are secretly broken.

Summary

  • Bad instructions kill performance: Missing details (Under-Specification) are the most dangerous, causing AI to fail even when it's a top-tier model.
  • Size doesn't save you: A bigger AI brain doesn't make up for a vague recipe.
  • Typos don't matter: AI is surprisingly good at ignoring small formatting errors.
  • Context is king: Benchmarks that provide clear examples (like LiveCodeBench) are much more robust.
  • We need a filter: A small, specialized tool (SpecValidator) is better at spotting bad instructions than the giant AI models themselves.
  • The benchmarks might be broken: Even the "gold standard" tests used to evaluate AI contain hidden defects that cause the AI to fail, which we didn't know until this tool found them.

The paper concludes that to get reliable code from AI, we need to treat the description of the task as a critical part of the process, not just an afterthought. We need to check the recipe before we let the chef cook.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →