paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Traces of Memorisation in Large Language Models for Code

代码大语言模型中的记忆痕迹
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 3/10 · 该论文研究代码大语言模型的训练数据记忆与数据提取攻击,属于代码LLM安全与隐私方向;但它不涉及静态分析、形式化验证、Agentic程序分析、浮点程序分析或贝叶斯程序分析,与用户核心的PL与AI交叉方向匹配有限。引用 31 inbox
Ali Al-Kaswan, Maliheh Izadi, Arie van Deursen
crossref: 2026-09-12

AI 速览

一句话:该论文实证研究了代码大语言模型对训练数据的记忆与可提取性,并与自然语言模型比较。

论文关注代码大语言模型在大规模未清洗源代码上训练所导致的记忆与数据泄露风险。作者沿用自然语言记忆基准,并识别易受攻击样本以构建代码基准,随后对多种模型运行基准并实施数据提取攻击。结果显示,代码大语言模型与其自然语言对应模型一样容易受到数据提取攻击:在 CodeGen-Mono-16B 代码补全模型上,从被判定可能可提取的训练数据中成功提取了 47%。研究还发现,模型参数量越大记忆越多,预训练数据同样易受攻击;数据载体比普通代码或文档被记忆的比例更高,且不同模型架构记忆的样本不同。作者呼吁进一步研究并建立防护措施。

问题
代码大语言模型常在大规模未清洗源代码上训练,其记忆内容可能被数据提取攻击利用,造成数据泄露;论文探究代码模型的记忆程度并与自然语言模型比较。
方法
采用现有自然语言记忆基准,并基于易受攻击样本构建代码基准;对多种模型运行基准并实施数据提取攻击,分析参数规模、数据类别与模型架构对记忆的影响。
评估
在多种代码与自然语言模型上比较记忆率,并从 CodeGen-Mono-16B 代码补全模型中提取出 47% 的被判定可能可提取训练数据;还观察到参数量增长加剧记忆、数据载体更易被记忆以及不同架构记忆样本不同。
原文摘要(Abstract)

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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11437,
  title = {Traces of Memorisation in Large Language Models for Code},
  author = {Ali Al-Kaswan and Maliheh Izadi and Arie van Deursen},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639133}
}