NLPerturbator: Studying the Robustness of Code LLMs to Natural Language Variations
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) 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 uncover that LLMs are sensitive to the 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 are often based on random perturbations and such perturbations may not actually happen. In this paper, we conduct a comprehensive study to investigate how are code LLMs robust to variations of natural language description 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 an 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 six code LLMs, we find that the perturbed prompts can decrease the performance of code generation by a considerable margin (e.g., up to 21.2%, and 4.8% to 6.1% on average). 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.
Key facts. Cited by 19 papers in the map (data through 7 Oct 2026). Builds on 40 of its 68 references that are in the map. First posted on arXiv 28 Jun 2024.
Builds on
40 of 68 references.
References · 40
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2023StarCoder: may the source be with you!cited by 790
- 2023WizardCoder: Empowering Code Large Language Models with Evol-Instructcited by 728
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 342
- 2017Synthetic and Natural Noise Both Break Neural Machine Translationcited by 304
28 more
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2021Adversarial GLUE: A Multi-Task Benchmark for Robustness Evaluation of Language Modelscited by 227
- 2020IntelliCode Compose: Code Generation Using Transformercited by 225
- 2023PromptRobust: Towards Evaluating the Robustness of Large Language Models on Adversarial Promptscited by 218
- 2023On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspectivecited by 208
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2023CodeGen2: Lessons for Training LLMs on Programming and Natural Languagescited by 124
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 100
- 2016Latent Predictor Networks for Code Generationcited by 73
- 2023Can ChatGPT replace StackOverflow? A Study on Robustness and Reliability of Large Language Model Code Generationcited by 72
- 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 71
- 2023On the Robustness of Code Generation Techniques: An Empirical Study on GitHub Copilotcited by 64
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2024Reasoning Runtime Behavior of a Program with LLM: How Far Are We?cited by 44
- 2023On Robustness of Prompt-based Semantic Parsing with Large Pre-trained Language Model: An Empirical Study on Codexcited by 41
- 2022Fill in the Blank: Context-aware Automated Text Input Generation for Mobile GUI Testingcited by 36
- 2023In ChatGPT We Trust? Measuring and Characterizing the Reliability of ChatGPTcited by 35
- 2024SOEN-101: Code Generation by Emulating Software Process Models Using Large Language Model Agentscited by 34
- 2023Assessing Hidden Risks of LLMs: An Empirical Study on Robustness, Consistency, and Credibilitycited by 28
- 2023AceCoder: Utilizing Existing Code to Enhance Code Generationcited by 25
- 2023Competition-Level Problems are Effective LLM Evaluatorscited by 25
- 2021Adversarial Robustness of Deep Code Comment Generationcited by 22
- 2023Did We Miss Something Important? Studying and Exploring Variable-Aware Log Abstractioncited by 19
- 2023Exploring the Robustness of Large Language Models for Solving Programming Problemscited by 16
- 2021Studying Duplicate Logging Statements and Their Relationships with Code Clonescited by 5
- 2021On the Naming of Methods: A Survey of Professional Developerscited by 4
- 2023Are They All Good? Studying Practitioners' Expectations on the Readability of Log Messagescited by 4
- 2023AutoLog: A Log Sequence Synthesis Framework for Anomaly Detectioncited by 2
Built on by
Citing papers per year: 2025: 9; 2026: 10.
19 papers.
Sort:
By area:
- 2025CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoningcited by 14
- 2025Memorize or Generalize? Evaluating LLM Code Generation with Code Rewritingcited by 6
- 2025RobuNFR: Evaluating the Robustness of Large Language Models on Non-Functional Requirements Aware Code Generationcited by 5
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generationcited by 4
- 2026Evaluating Robustness of Large Language Models in Enterprise Applications: Benchmarks for Perturbation Consistency Across Formats and Languagescited by 4
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generationcited by 3
- 2026Defective Task Descriptions in LLM-Based Code Generation: Detection and Analysiscited by 2
- 2025A Representation Level Analysis of NMT Model Robustness to Grammatical Errorscited by 1
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variationscited by 1
- 2025LLM Assisted Coding with Metamorphic Specification Mutation Agentcited by 1
- 2026Using Small Language Models to Reverse-Engineer Machine Learning Pipelines Structurescited by 1
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMscited by 1
7 more
- 2026Detecting Differences Is Not Understanding Structure: Large Language Models Fail at Graph Isomorphismcited by 1
- 2025ML For Hardware Design Interpretability: Challenges and Opportunitiescited by 0
- 2026Characterizing Paraphrase-Induced Failures in Lean 4 Autoformalizationcited by 0
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvementscited by 0
- 2026Memorization Diagnostics for Code LLMs Should be Scale-Awarecited by 0
- 2026RealSWE: A Compositional Evaluation of Coding Agents under Realistic User Requestscited by 0
- 2026Noisy Test-Time Reinforcement Learning for Code LLMscited by 0
- 2026Noisy Test-Time Reinforcement Learning for Code LLMs26 Sep 2026
- 2026RealSWE: A Compositional Evaluation of Coding Agents under Realistic User Requests28 Aug 2026
- 2026Memorization Diagnostics for Code LLMs Should be Scale-Aware13 Aug 2026
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvements29 Jul 2026
- 2026Detecting Differences Is Not Understanding Structure: Large Language Models Fail at Graph Isomorphism8 Jun 2026
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMs28 May 2026
- 2026Defective Task Descriptions in LLM-Based Code Generation: Detection and Analysis27 Apr 2026
- 2026Characterizing Paraphrase-Induced Failures in Lean 4 Autoformalization25 Apr 2026
- 2026Evaluating Robustness of Large Language Models in Enterprise Applications: Benchmarks for Perturbation Consistency Across Formats and Languages9 Jan 2026
- 2026Using Small Language Models to Reverse-Engineer Machine Learning Pipelines Structures7 Jan 2026
- 2025LLM Assisted Coding with Metamorphic Specification Mutation Agent23 Nov 2025
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generation12 Oct 2025
7 more
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variations17 Sep 2025
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generation11 Jun 2025
- 2025A Representation Level Analysis of NMT Model Robustness to Grammatical Errors27 May 2025
- 2025CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoning19 Apr 2025
- 2025ML For Hardware Design Interpretability: Challenges and Opportunities11 Apr 2025
- 2025RobuNFR: Evaluating the Robustness of Large Language Models on Non-Functional Requirements Aware Code Generation28 Mar 2025
- 2025Memorize or Generalize? Evaluating LLM Code Generation with Code Rewriting4 Mar 2025
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generationcited by 3
- 2025LLM Assisted Coding with Metamorphic Specification Mutation Agentcited by 1
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvementscited by 0
- 2026RealSWE: A Compositional Evaluation of Coding Agents under Realistic User Requestscited by 0
- 2026RealSWE: A Compositional Evaluation of Coding Agents under Realistic User Requests28 Aug 2026
- 2026SWE-NFI: Studying and Benchmarking Coding Agents for Non-Functional Improvements29 Jul 2026
- 2025LLM Assisted Coding with Metamorphic Specification Mutation Agent23 Nov 2025
- 2025Understanding and Bridging the Planner-Coder Gap: A Systematic Study on the Robustness of Multi-Agent Systems for Code Generation12 Oct 2025
- 2025Memorize or Generalize? Evaluating LLM Code Generation with Code Rewritingcited by 6
- 2025RobuNFR: Evaluating the Robustness of Large Language Models on Non-Functional Requirements Aware Code Generationcited by 5
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generationcited by 4
- 2026Evaluating Robustness of Large Language Models in Enterprise Applications: Benchmarks for Perturbation Consistency Across Formats and Languagescited by 4
- 2026Defective Task Descriptions in LLM-Based Code Generation: Detection and Analysiscited by 2
- 2025A Representation Level Analysis of NMT Model Robustness to Grammatical Errorscited by 1
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variationscited by 1
- 2026Using Small Language Models to Reverse-Engineer Machine Learning Pipelines Structurescited by 1
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMscited by 1
- 2026Detecting Differences Is Not Understanding Structure: Large Language Models Fail at Graph Isomorphismcited by 1
- 2025ML For Hardware Design Interpretability: Challenges and Opportunitiescited by 0
- 2026Characterizing Paraphrase-Induced Failures in Lean 4 Autoformalizationcited by 0
12 most cited of 14 All 14 (JSON)
- 2026Noisy Test-Time Reinforcement Learning for Code LLMs26 Sep 2026
- 2026Memorization Diagnostics for Code LLMs Should be Scale-Aware13 Aug 2026
- 2026Detecting Differences Is Not Understanding Structure: Large Language Models Fail at Graph Isomorphism8 Jun 2026
- 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMs28 May 2026
- 2026Defective Task Descriptions in LLM-Based Code Generation: Detection and Analysis27 Apr 2026
- 2026Characterizing Paraphrase-Induced Failures in Lean 4 Autoformalization25 Apr 2026
- 2026Evaluating Robustness of Large Language Models in Enterprise Applications: Benchmarks for Perturbation Consistency Across Formats and Languages9 Jan 2026
- 2026Using Small Language Models to Reverse-Engineer Machine Learning Pipelines Structures7 Jan 2026
- 2025Prompt Stability in Code LLMs: Measuring Sensitivity across Emotion- and Personality-Driven Variations17 Sep 2025
- 2025Code Roulette: How Prompt Variability Affects LLM Code Generation11 Jun 2025
- 2025A Representation Level Analysis of NMT Model Robustness to Grammatical Errors27 May 2025
- 2025ML For Hardware Design Interpretability: Challenges and Opportunities11 Apr 2025
12 newest of 14 All 14 (JSON)