arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.13459cs.CRcs.LG
收藏

代码模型中的投毒源代码检测

Poisoned Source Code Detection in Code Models

Technische Universität Clausthal(克劳斯塔尔工业大学)

Ehab Ghannoum, Mohammad Ghafari

AI总结:

针对源代码模型面临的训练数据投毒风险,提出混合深度学习模型 CodeGarrison(CG),利用代码嵌入检测投毒样本,在已知与未知攻击上均优于 ONION。

摘要:

深度学习模型已被广泛用于执行涉及源代码的各类任务。然而,其黑箱性质引发了对潜在风险的担忧。其中一种风险是投毒攻击,即攻击者故意用恶意样本污染训练集,以在特定场景下误导模型的预测。为保护源代码模型免受投毒攻击,我们提出了 CodeGarrison(CG),这是一种依赖代码嵌入来识别投毒代码样本的混合深度学习模型。我们针对检测由 DAMP、MHM、ALERT 以及一种名为 CodeFooler 的新型投毒技术生成的投毒样本,将 CG 与最先进的技术 ONION 进行了评估。结果表明,CG 以 93.5% 的准确率显著优于 ONION。我们还测试了 CG 对未知攻击的鲁棒性,在上述四种攻击中识别投毒样本的平均准确率达到 85.6%。

英文摘要:

Deep learning models have gained popularity for conducting various tasks involving source code. However, their black-box nature raises concerns about potential risks. One such risk is a poisoning attack, where an attacker intentionally contaminates the training set with malicious samples to mislead the model's predictions in specific scenarios. To protect source code models from poisoning attacks, we introduce CodeGarrison (CG), a hybrid deep-learning model that relies on code embeddings to identify poisoned code samples. We evaluated CG against the state-of-the-art technique ONION for detecting poisoned samples generated by DAMP, MHM, ALERT, as well as a novel poisoning technique named CodeFooler. Results showed that CG significantly outperformed ONION with an accuracy of 93.5%. We also tested CG's robustness against unknown attacks, achieving an average accuracy of 85.6% in identifying poisoned samples across the four attacks mentioned above.

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

↑