🤖 AI Summary
This study addresses the critical yet poorly understood issue of how training data quality influences logical errors and security vulnerabilities in code generated by large language models. Through a systematic literature review encompassing 114 studies, the work establishes the first unified taxonomy linking training data and generated code quality across nine dimensions and introduces a causal propagation framework that formally characterizes 18 typical mechanisms by which data defects propagate into generated code. Furthermore, it synthesizes detection and mitigation techniques spanning the entire lifecycle—data, model, and generation—and reveals a paradigm shift in quality assurance from reactive filtering toward proactive data governance and closed-loop repair. The paper provides foundational theory, methodological tools, and open-source resources to advance the development of reliable code-generating large language models.
📝 Abstract
Large language models (LLMs) frequently generate defective outputs in code generation tasks, ranging from logical bugs to security vulnerabilities. While these generation failures are often treated as model-level limitations, empirical evidence increasingly traces their root causes to imperfections within the training corpora. Yet, the specific mechanisms linking training data quality issues to generated code quality issues remain largely unmapped. This paper presents a systematic literature review of 114 primary studies to investigate how training data quality issues propagate into code generation. We establish a unified taxonomy that categorizes generated code quality issues across nine dimensions and training data quality issues into code and non-code attributes. Based on this taxonomy, we formalize a causal framework detailing 18 typical propagation mapping mechanisms. Furthermore, we synthesize state-of-the-art detection and mitigation techniques across the data, model, and generation lifecycles. The reviewed literature reveals a clear methodological shift: quality assurance is transitioning from reactive, heuristic-based post-generation filtering toward proactive, data-centric governance and closed-loop repair. Finally, we identify open challenges and outline research directions for developing reliable LLMs for code through integrated data curation and continuous evaluation. Our repository is available at https://github.com/SYSUSELab/From-Data-to-Code.