Semantic-Preserving Adversarial Code Comprehension

Yiyang Li, Hongqiu Wu, Hai Zhao
9/12/2022
cs.CL

Official code: EricLee8/SPACE (12 stars, Python, last commit 2022-10-23).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

EricLee8/SPACEOfficial100%

The official codes for our paper at COLING 2022: Semantic-Preserving Adversarial Code Comprehension

120Python, ShellSep 8, 20224 years ago

Similar Papers

Cite this paper

@article{li2022semanticpreserving,
  title  = {Semantic-Preserving Adversarial Code Comprehension},
  author = {Yiyang Li and Hongqiu Wu and Hai Zhao},
  year   = {2022},
  eprint = {2209.05130},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2209.05130}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2209.05130.svg)](https://codeofpaper.com/paper/2209.05130)

Discussion