arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.05130cs.CL
收藏

保持语义的对抗代码理解

Semantic-Preserving Adversarial Code Comprehension

Shanghai Jiao Tong University(上海交通大学)

Yiyang Li, Hongqiu Wu, Hai Zhao

摘要:

基于预训练语言模型(PrLM)在源代码理解任务中的巨大成功,当前的文献研究了进一步提高PrLM性能(泛化)的方法,或者它们对对抗攻击的鲁棒性。然而,他们不得不在这两个方面的权衡上妥协,没有一个人考虑以有效和实际的方式改善这两个方面。为了填补这一空白,我们提出了语义保持对抗代码嵌入(SPACE)来寻找最坏情况下的语义保持攻击,同时迫使模型在这些最坏情况下预测正确的标签。实验和分析表明,空间可以保持对最先进的攻击,同时提高性能的PrLM代码的鲁棒性。

英文摘要:

Based on the tremendous success of pre-trained language models (PrLMs) for source code comprehension tasks, current literature studies either ways to further improve the performance (generalization) of PrLMs, or their robustness against adversarial attacks. However, they have to compromise on the trade-off between the two aspects and none of them consider improving both sides in an effective and practical way. To fill this gap, we propose Semantic-Preserving Adversarial Code Embeddings (SPACE) to find the worst-case semantic-preserving attacks while forcing the model to predict the correct labels under these worst cases. Experiments and analysis demonstrate that SPACE can stay robust against state-of-the-art attacks while boosting the performance of PrLMs for code.

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

↑