Assessing, Exploiting, and Mitigating Syntactic Robustness Failures in LLM-Based Code Generation
Not on the map. Why?
Abstract (arXiv)
Rapid advances in the field of Large Language Models (LLMs) have made LLM-based code generation an important area for investigation. An LLM-based code generator takes a prompt as input and produces code that implements the requirements specified in the prompt. Many software requirements include mathematical formulas that specify the expected behavior of the code to be generated. Given a code generation prompt that contains a mathematical formula, a reasonable expectation is that, if the formula is syntactically modified without changing its semantics, the generated code for the modified prompt should be semantically equivalent. We formalize this concept as syntactic robustness and investigate the syntactic robustness of LLMs as code generators. Our experimental assessment demonstrates that LLMs are not syntactically robust for code generation prompts with formulas, especially for the ones that require mathematical reasoning. We investigate attack strategies that can further deteriorate the syntactic robustness of LLMs. Finally, to mitigate syntactic robustness failures in LLMs, we propose a pre-processing step that uses reductions to transform formulas in prompts to a simplified form. Our experimental results demonstrate that the syntactic robustness of LLM-based code generation improves significantly using our approach, improving syntactic robustness of LLMs from 54.05% to 74.42%.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). First posted on arXiv 1 Apr 2024.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 2.
6 papers.
- 2024Web2Code: A Large-scale Webpage-to-Code Dataset and Evaluation Framework for Multimodal LLMscited by 73
- 2026Large Language Model Reasoning Failurescited by 20
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metricscited by 12
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoningcited by 7
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
- 2025Toward Automated and Trustworthy Scientific Analysis and Visualization with LLM-Generated Codecited by 0
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Large Language Model Reasoning Failures5 Feb 2026
- 2025Toward Automated and Trustworthy Scientific Analysis and Visualization with LLM-Generated Code26 Nov 2025
- 2025Robustness in Large Language Models: A Survey of Mitigation Strategies and Evaluation Metrics24 May 2025
- 2025Evaluating the Generalization Capabilities of Large Language Models on Code Reasoning7 Apr 2025
- 2024Web2Code: A Large-scale Webpage-to-Code Dataset and Evaluation Framework for Multimodal LLMs28 Jun 2024
Similar, not cited
Close in wording, no citation either way
- 2025Are Large Language Models Robust in Understanding Code Against Semantics-Preserving Mutations?
- 2026Poster: Rethinking Security in LLM Code Generation through Real-World Risk Scenarios
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
- 2026Enhancing Reliability in LLM-Based Secure Code Generation
- 2023L2CEval: Evaluating Language-to-Code Generation Capabilities of Large Language Models
- 2026An Empirical Evaluation of LLM-Generated Code Security Across Prompting Methods
- 2026How Robustly do LLMs Understand Execution Semantics?
- 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmap