揭示代码大模型生成缺陷与训练数据质量的因果关系
Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code

- 构建九维代码质量与数据属性分类体系
- 梳理18种训练数据问题向生成缺陷的传播机制
- 推动从事后过滤转向数据驱动的闭环治理
大型语言模型在代码生成任务中常产生逻辑错误和安全漏洞。尽管这些生成失败常被视为模型自身局限,但实证研究越来越多地将根源指向训练语料的不完善。然而,训练数据质量问题如何影响生成代码质量的机制仍不清晰。本文对114篇原始研究进行系统综述,建立统一分类体系,将生成代码质量问题分为九个维度,训练数据质量缺陷分为代码与非代码属性。基于此,提出18种典型传播机制的因果框架,并整合数据、模型、生成全生命周期的质量检测与缓解技术。研究表明,质量保障正从被动的启发式后处理转向主动的数据中心化治理与闭环修复。最后,识别出开放挑战,提出通过数据集持续优化与评估实现可靠代码大模型的研究方向。相关资源见https://github.com/SYSUSELab/From-Data-to-Code。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。