Skip to main content
QUICK REVIEW

[论文解读] CoProtector: Protect Open-Source Code against Unauthorized Training Usage with Data Poisoning

Zhensu Sun, Xiaoning Du|arXiv (Cornell University)|Oct 25, 2021
Advanced Malware Detection Techniques被引用 10
一句话总结

CoProtector 是一种新颖的数据 poisoning 框架,可保护开源代码仓库免受大型语言模型(如 GitHub Copilot)的未经授权训练。它通过向代码中注入隐蔽的、语义反转的注释后门以及语法扰动,显著降低模型性能,同时支持可验证的水印检测,从而让代码所有者能够主张所有权并阻止滥用。

ABSTRACT

Github Copilot, trained on billions of lines of public code, has recently become the buzzword in the computer science research and practice community. Although it is designed to help developers implement safe and effective code with powerful intelligence, practitioners and researchers raise concerns about its ethical and security problems, e.g., should the copyleft licensed code be freely leveraged or insecure code be considered for training in the first place? These problems pose a significant impact on Copilot and other similar products that aim to learn knowledge from large-scale open-source code through deep learning models, which are inevitably on the rise with the fast development of artificial intelligence. To mitigate such impacts, we argue that there is a need to invent effective mechanisms for protecting open-source code from being exploited by deep learning models. Here, we design and implement a prototype, CoProtector, which utilizes data poisoning techniques to arm source code repositories for defending against such exploits. Our large-scale experiments empirically show that CoProtector is effective in achieving its purpose, significantly reducing the performance of Copilot-like deep learning models while being able to stably reveal the secretly embedded watermark backdoors.

研究动机与目标

  • 解决在开源代码(尤其是 copyleft 许可证下)上未经授权训练深度学习模型所引发的伦理与安全问题。
  • 为代码所有者提供一种实用机制,以主张其代码在 AI 训练中的使用控制权。
  • 设计一种既能有效降低模型性能,又能嵌入可检测水印以支持数字取证的保护系统。
  • 确保保护机制足够隐蔽,能够规避爬虫和防御机制的检测。
  • 在多种代码相关任务和模型架构上评估该方法,以证明其泛化能力和鲁棒性。

提出的方法

  • CoProtector 采用三种 poisoning 策略:注释语义反转、通过 AST 操作实现的语法变异,以及带有对抗性模式的注释注入。
  • 注释语义反转技术在保持语法正确性的同时改变注释的语义,使其与原始内容语义相反。
  • 语法变异通过修改抽象语法树(AST)引入细微但语法正确的更改,从而干扰模型学习。
  • 通过在训练数据中嵌入可验证的后门实现水印技术,使模型滥用可通过触发器激活被检测。
  • 该框架设计为兼容多种代码相关深度学习任务,包括代码生成和代码分类。
  • 引入了欺骗仓库机制,使开发人员能够在不影响主项目可用性的前提下部署污染实例。
Figure 1 . An illustration of training deep learning models with open-source code protected by CoProtector .
Figure 1 . An illustration of training deep learning models with open-source code protected by CoProtector .

实验结果

研究问题

  • RQ1数据 poisoning 技术能否有效降低在受保护仓库上训练的代码生成模型的性能?
  • RQ2在受污染数据上训练的模型中,嵌入的水印是否能被可靠检测?
  • RQ3这些 poisoning 技术在规避自动化工具和人工检查方面有多隐蔽?
  • RQ4CoProtector 在不同编程语言和代码相关任务上的泛化能力如何?
  • RQ5该保护机制能否在不损害原始代码仓库功能正确性或可用性的前提下部署?

主要发现

  • CoProtector 显著降低了类似 Copilot 的模型性能,代码生成准确率和流畅度均有明显下降。
  • 嵌入的水印在训练后的模型中可被成功检测,从而实现对未经授权训练的可验证数字取证。
  • 注释语义反转技术表现出更优的隐蔽性,在某些情况下甚至能逃过人工检查。
  • 这些 poisoning 技术在多种代码相关任务(包括代码补全和代码分类)中均造成显著性能下降。
  • 即使模型在干净数据上进行微调或重新训练,该方法仍保持有效,表明后门具有强韧性。
  • 该框架的有效性已在 Java 代码仓库上得到验证,但其在其他语言上的泛化能力仍是开放问题。
Figure 2 . Examples of poison instances generated by untargeted poisoning methods.
Figure 2 . Examples of poison instances generated by untargeted poisoning methods.

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。