← Latest papers
🤖 AI

Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code

This paper presents a systematic review of 114 studies to establish a unified taxonomy and causal framework linking training data quality issues to defective code generation in LLMs, while synthesizing mitigation techniques and outlining a paradigm shift toward proactive, data-centric governance for reliable code models.

Original authors: Kaifeng He, Xiaojun Zhang, Peiliang Cai, Mingwei Liu, Yanlin Wang, Chong Wang, Kaifeng Huang, Bihuan Chen, Xin Peng, Zibin Zheng

Published 2026-05-08
📖 5 min read🧠 Deep dive

Original authors: Kaifeng He, Xiaojun Zhang, Peiliang Cai, Mingwei Liu, Yanlin Wang, Chong Wang, Kaifeng Huang, Bihuan Chen, Xin Peng, Zibin Zheng

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 trying to teach a brilliant but very literal student how to write computer code. You give them a massive library of books (the training data) to study. The student reads everything, memorizes patterns, and then tries to write new code on their own.

This paper is a massive investigation into why that student sometimes writes code that is buggy, insecure, or just plain wrong. The authors, a team of researchers, looked at 114 different studies to answer a simple but crucial question: Is the student's bad writing their own fault, or is it because the books they were studying were full of mistakes?

Their conclusion is striking: It's mostly the books.

Here is the breakdown of their findings, explained through simple analogies:

1. The "Garbage In, Garbage Out" Reality

The paper argues that when an AI (Large Language Model) generates bad code, it's rarely because the AI is "thinking" poorly. Instead, it's because the AI is simply copying what it saw in its training data.

  • The Analogy: Imagine you are learning to cook by reading a cookbook. If the cookbook has a recipe that says, "Add a cup of salt to the soup," and you follow it, your soup will be inedible. You didn't make a mistake; the book did.
  • The Paper's Claim: The AI learns from a "cookbook" (training data) that contains millions of lines of code from the internet. If that internet code has security holes, outdated instructions, or typos, the AI will learn those mistakes as if they were the correct way to do things.

2. The Two Types of "Bad Books"

The researchers organized the problems in the training data into two main categories:

  • The "Bad Recipe" Problems (Code Attributes): These are specific mistakes inside the code snippets themselves.
    • Example: A recipe that uses a tool that was banned 10 years ago. The AI learns to use that banned tool because it saw it in the book.
    • Example: A recipe that forgets to wash the chicken, leading to a sick meal (a security vulnerability).
  • The "Bad Library" Problems (Non-Code Attributes): These are problems with the library as a whole, not just individual recipes.
    • Example: The library has 1,000 copies of the same boring recipe but only one copy of a complex, healthy dish. The AI becomes an expert at the boring dish but fails completely at the complex one.
    • Example: The library is filled with pages of random gibberish or ads (noise) that distract the student from learning real cooking.

3. How Mistakes Travel (The Pipeline)

The paper maps out exactly how a mistake in the "book" becomes a mistake in the "final dish." They found 18 different ways this happens, which they group into two paths:

  • Direct Copying (Direct Mappings): The AI sees a specific bad pattern and repeats it.
    • Analogy: The student sees a typo in the book and types the same typo in their essay.
    • Real-world result: The AI uses a deprecated (old) computer command that no longer works, causing the program to crash.
  • Distorted Learning (Indirect Mappings): The AI learns the wrong balance of things because the library was unbalanced.
    • Analogy: Because the library had 99% of recipes for "burning toast" and only 1% for "making bread," the AI thinks burning toast is the only way to cook. It doesn't know how to make good bread because it never saw enough examples.
    • Real-world result: The AI is great at writing simple Python code but terrible at writing code for other languages or complex tasks because the training data was unbalanced.

4. The Current Fix vs. The Better Fix

The paper points out that most companies are currently trying to fix this problem after the AI writes the code. They act like a food inspector who tastes the soup at the end and says, "This is too salty, throw it away."

  • The Problem: This is slow, expensive, and reactive. You keep throwing away bad soup.
  • The Paper's Recommendation: We need to become librarians and editors before the student starts studying.
    • Instead of just filtering bad soup at the end, we need to go into the library, remove the bad recipes, fix the typos, and ensure there is a good mix of different types of dishes.
    • The authors call this a shift from "reactive filtering" to "proactive data governance."

5. What's Still Hard?

Even with this new understanding, the paper admits there are big hurdles:

  • The "Leaky" Library: Sometimes the "books" the AI studies contain the answers to the tests it will take later. This makes the AI look smarter than it really is because it just memorized the answers.
  • The "Black Box" Library: We often don't know exactly which books were used to train the most popular AIs. Without knowing the source, it's hard to trace why a specific mistake happened.
  • The Moving Target: The world of software changes fast. A "good" recipe today might be a "bad" one tomorrow because technology updates. The library needs to be constantly updated, which is very difficult.

Summary

The paper concludes that to get reliable code from AI, we can't just blame the AI or try to fix its output after the fact. We have to fix the source material. If we want the AI to write perfect code, we must first ensure the "library" it learned from is clean, balanced, and up-to-date. The quality of the output is a direct reflection of the quality of the input.

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 →