Random Perturbation Attack on LLMs for Code Generation
Large language models (LLMs) have shown impressive capabilities in coding tasks, including code understanding and generation. However, these models are also susceptible to input perturbations, such as case changes, whitespace or typo modifications, which can affect their performance. This study investigates the impact of different types of perturbations on code and natural language on the performance of LLM code generation tasks. In addition to evaluating individual perturbations, the research examines combined perturbation attacks, where multiple perturbations from different categories are applied together. While combined attacks showed only marginal overall improvement over individual ones, they demonstrated a synergistic effect in specific scenarios, exploiting complementary vulnerabilities in the models.
Authors
- Chi Zhang (ORCID: https://orcid.org/0009-0003-0012-1320)
- Ravi Mangal (ORCID: https://orcid.org/0000-0001-6267-6995)
- Qiupeng Peng (ORCID: https://orcid.org/0000-0002-5501-3947)
- Corina S. Păsăreanu (ORCID: https://orcid.org/0000-0002-5579-6961)
- Limin Jia (ORCID: https://orcid.org/0000-0002-8160-349X)
Institutions
- Carnegie Mellon University (US)
- Colorado State University (US)
Publication Details
- Published
- 2025-04-27
- DOI
- https://doi.org/10.1109/cain66642.2025.00052
- Primary Topic
- Security and Verification in Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00