一句话:该论文实证研究了代码大语言模型对训练数据的记忆与可提取性,并与自然语言模型比较。
论文关注代码大语言模型在大规模未清洗源代码上训练所导致的记忆与数据泄露风险。作者沿用自然语言记忆基准,并识别易受攻击样本以构建代码基准,随后对多种模型运行基准并实施数据提取攻击。结果显示,代码大语言模型与其自然语言对应模型一样容易受到数据提取攻击:在 CodeGen-Mono-16B 代码补全模型上,从被判定可能可提取的训练数据中成功提取了 47%。研究还发现,模型参数量越大记忆越多,预训练数据同样易受攻击;数据载体比普通代码或文档被记忆的比例更高,且不同模型架构记忆的样本不同。作者呼吁进一步研究并建立防护措施。
Large language models have gained significant popularity because of their ability to generate human-like text and potential applications in various fields, such as Software Engineering. Large language models for code are commonly trained on large unsanitised corpora of source code scraped from the internet. The content of these datasets is memorised and can be extracted by attackers with data extraction attacks. In this work, we explore memorisation in large language models for code and compare the rate of memorisation with large language models trained on natural language. We adopt an existing benchmark for natural language and construct a benchmark for code by identifying samples that are vulnerable to attack. We run both benchmarks against a variety of models, and perform a data extraction attack. We find that large language models for code are vulnerable to data extraction attacks, like their natural language counterparts. From the training data that was identified to be potentially extractable we were able to extract 47% from a CodeGen-Mono-16B code completion model. We also observe that models memorise more, as their parameter count grows, and that their pre-training data are also vulnerable to attack. We also find that data carriers are memorised at a higher rate than regular code or documentation and that different model architectures memorise different samples. Data leakage has severe outcomes, so we urge the research community to further investigate the extent of this phenomenon using a wider range of models and extraction techniques in order to build safeguards to mitigate this issue.