arrow
返回

CARL: Unsupervised Code-Based Adversarial Attacks for Programming Language Models via Reinforcement Learning

delete2024-12-28
delete0
delete
OA
AI
K
Kaichun Yao
H
Hao Wang
C
Chuan Qin
H
Hengshu Zhu
Y
Yanjun Wu
张立波 封面图
张立波 (Libo Zhang) *
DOI:10.1145/3688839delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Code based adversarial attacks play a crucial role in revealing vulnerabilities of software system. Recently, pretrained programming language models (PLMs) have demonstrated remarkable success in various significant software engineering tasks, progressively transforming the paradigm of software development. Despite their impressive capabilities, these powerful models are vulnerable to adversarial attacks. Therefore, it is necessary to carefully investigate the robustness and vulnerabilities of the PLMs by means of adversarial attacks. Adversarial attacks entail imperceptible input modifications that cause target models to make incorrect predictions. Existing approaches for attacking PLMs often employ either identifier renaming or the greedy algorithm, which may yield sub-optimal performance or lead to high inference times. In response to these limitations, we propose CARL, an unsupervised black-box attack model that leverages reinforcement learning to generate imperceptible adversarial examples. Specifically, CARL comprises a programming language encoder and a perturbation prediction layer. In order to achieve more effective and efficient attack, we cast the task as a sequence decision-making process, optimizing through policy gradient with a suite of reward functions. We conduct extensive experiments to validate the effectiveness of CARL on code summarization, code translation, and code refinement tasks, covering various programming languages and PLMs. The experimental results demonstrate that CARL surpasses state-of-the-art code attack models, achieving the highest attack success rate across multiple tasks and PLMs while maintaining high attack efficiency, imperceptibility, consistency, and fluency.
Keyword:
Code Adversarial Attacks
Programming Language Models
Reinforcement Learning

期刊

A
ACM Transactions on Software Engineering and Methodology
IF:
6.2
论文数:
1.2K
被引数:
3.4K

机构

U
university of chinese academy of sciences, cas
学者数:
4.1W
论文数: 3.8W
被引数: 75
I
institute of software, cas
学者数:
446
论文数: 388
被引数: 0
C
chinese academy of sciences
学者数:
56.7W
论文数: 45.0W
被引数: 704
学者 查看更多机构
引用论文

引用论文

The Importance of Muscle Relaxation in Dynamic Cardiomyoplasty
err1992-10-01
err0
PREAI
errCAROLINE M. LUCAS; FREDERIK H. VEEN; EMILE C. CHERIEX; VINCENT OMMEN; OLAF C. PENN; HEIN J. WELLENS
err分享
err收藏
err分享
err收藏
err分享
err收藏
err分享
err收藏
Do Multiple Venous Anastomoses Reduce Risk of Thrombosis in Free-Flap Transfer?
err2004-01-01
err0
PREAI
errAkihiro Ichinose; Hiroto Terashi; Minoru Nakahara; Isao Sugimoto; Kazunobu Hashikawa; Tadashi Nomura; Nobutaka Ogata; Satoshi Yokoo; Shinya Tahara
err分享
err收藏
err分享
err收藏
学者 查看更多内容