PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
February 9, 2026ACM Transactions on Software Engineering and Methodology2 citations

NLPerturbator: Studying the Robustness of Code LLMs to Natural Language Variations

View Full Paper
JCJunkai ChenLZLi ZhenhaoHXHu Xing

Key Points

  • The aim is to explore how code LLMs respond to variations in natural language descriptions in real-world scenarios.
  • Conducted a comprehensive literature review and online survey to categorize natural language perturbations.
  • Developed an automated framework, NLPerturbator, to apply perturbations to prompts.
  • Conducted experiments on seven code LLMs to assess performance with perturbed prompts.
  • Identified 18 categories of natural language perturbations.
  • Found that perturbed prompts significantly decreased code generation performance.
  • Emphasized the need for improved prompt construction to enhance LLM robustness.

Abstract

Large language models achieve promising results in code generation based on a given natural language description. They have been integrated into open-source projects and commercial products to facilitate daily coding activities. The natural language description in the prompt is crucial for LLMs to comprehend users’ requirements. Prior studies have uncovered that LLMs are sensitive to changes in the prompts, including slight changes that look inconspicuous. However, the natural language descriptions often vary in real-world scenarios (e.g., different formats, grammar, and wording). Prior studies on the robustness of LLMs were often based on random perturbations, and such perturbations may not actually happen. In this paper, we conduct a comprehensive study to investigate how code LLMs are robust to variations of natural language descriptions in real-world scenarios. We summarize 18 categories of perturbations of natural language and 3 combinations of co-occurred categories based on our literature review and online survey with practitioners. We propose an automated framework, NLPerturbator, which can perform perturbations of each category given a set of prompts. Through a series of experiments on code generation using sevencode LLMs, we find that the perturbed prompts can decrease the performance of code generation by a considerable margin. Our study highlights the importance of enhancing the robustness of LLMs to real-world variations in the prompts, as well as the essentiality of attentively constructing the prompts.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Chen et al. (2025) studied this question.

synapsesocial.com/papers/698979e9f0ec2af6756e7f2fhttps://doi.org/10.1145/3745764
Ask AI
Helpful
Bookmark
Share
View Full Paper