arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.02628cs.SEcs.AI
收藏

堆栈中的裂缝:LLM预训练数据集中的隐藏漏洞与许可风险

Cracks in The Stack: Hidden Vulnerabilities and Licensing Risks in LLM Pre-Training Datasets

Department of Electrical Engineering and Computer Science(电气工程与计算机科学系);University of Tennessee, Knoxville, USA(田纳西大学,基洛纳分校)

Mahmoud Jahanshahi, Audris Mockus

AI总结:

针对LLM预训练数据质量问题,提出利用开源项目版本历史自动识别含漏洞或修复的样本,在Stack v2中发现17%代码有更新版本,其中17%为修复,并揭示大量未修改blob和许可风险。

摘要:

创建代码建议系统的一个关键部分是在大量源代码和自然语言文本上预训练大型语言模型,这些数据通常来源或质量存疑。这可能促使LLM生成的代码中存在错误和漏洞。虽然已有在代码生成时或生成后识别错误的努力,但更可取的是在精心策划、高质量且合规的数据集上预训练或微调LLM。对海量训练数据的需求要求这种策划自动化,以尽量减少人工干预。我们提出一种自动化的源代码自动策划技术,利用开源软件项目的完整版本历史来提高训练数据的质量。该方法利用所有OSS项目的版本历史,识别在至少一个OSS项目中被修改或经历变更的训练数据样本,并找出包含错误或漏洞修复的子集。我们使用The Stack v2数据集评估此方法,发现数据集中17%的代码版本有更新版本,其中17%代表错误修复,包括2.36%针对已知CVE的修复。去重后的Stack v2版本仍包含易受6,947个已知CVE攻击的blob。此外,数据集中58%的blob在创建后从未被修改,表明它们可能代表使用极少或未使用的软件。错误识别的blob来源带来了额外挑战,因为它们导致包含非宽松许可代码,引发严重的合规问题。通过解决这些问题,新模型的训练可以避免延续有缺陷的代码模式或违反许可。我们期望我们的结果能激发自动化数据策划流程的改进,从而有潜力增强AI工具生成输出的可靠性。

英文摘要:

A critical part of creating code suggestion systems is the pre-training of Large Language Models on vast amounts of source code and natural language text, often of questionable origin or quality. This may contribute to the presence of bugs and vulnerabilities in code generated by LLMs. While efforts to identify bugs at or after code generation exist, it is preferable to pre-train or fine-tune LLMs on curated, high-quality, and compliant datasets. The need for vast amounts of training data necessitates that such curation be automated, minimizing human intervention. We propose an automated source code autocuration technique that leverages the complete version history of open-source software projects to improve the quality of training data. This approach leverages the version history of all OSS projects to identify training data samples that have been modified or have undergone changes in at least one OSS project, and pinpoint a subset of samples that include fixes for bugs or vulnerabilities. We evaluate this method using The Stack v2 dataset, and find that 17% of the code versions in the dataset have newer versions, with 17% of those representing bug fixes, including 2.36% addressing known CVEs. The deduplicated version of Stack v2 still includes blobs vulnerable to 6,947 known CVEs. Furthermore, 58% of the blobs in the dataset were never modified after creation, suggesting they likely represent software with minimal or no use. Misidentified blob origins present an additional challenge, as they lead to the inclusion of non-permissively licensed code, raising serious compliance concerns. By addressing these issues, the training of new models can avoid perpetuating buggy code patterns or license violations. We expect our results to inspire process improvements for automated data curation, with the potential to enhance the reliability of outputs generated by AI tools.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑