Yves Le Traon
Author directory2026
Natural Language Defects in Code Generation Prompts: Empirical Impact and Lightweight Detection
Amal Akli | Mike Papadakis | Maxime Cordy | Yves Le Traon
Findings of the Association for Computational Linguistics: EMNLP 2026
Amal Akli | Mike Papadakis | Maxime Cordy | Yves Le Traon
Findings of the Association for Computational Linguistics: EMNLP 2026
Large language models are widely used for code generation, yet they rely on an implicit assumption that the task descriptions are sufficiently detailed and well-formed. However, in practice, users may provide defective descriptions, which can have a strong effect on code correctness. To address this issue, we conduct a large-scale empirical analysis evaluating the robustness of 10 code LLMs across 3 benchmarks under three natural language defect types: Lexical Vagueness (LV), Under-Specification (US), and Syntax/Formatting (SF). Our results show that defect impact is not uniform: Under-Specification causes Pass@1 drops of up to 15.3% with no model immune, including state-of-the-art reasoning models; Lexical Vagueness produces moderate, benchmark-dependent degradation; and surface formatting noise has a negligible effect. Crucially, robustness is shaped more by the properties of the task description than by the size or architecture of the model, in contrast to prior perturbation studies reporting uniform degradation across models. Second, to address these defects before they reach the model, we develop SpecValidator, a lightweight LoRA-fine-tuned classifier based on a 1.5B code model, achieving F1 = 0.84 and MCC = 0.79, significantly outperforming few-shot GPT-5-mini (F1 = 0.43) and Claude-Sonnet-4 (F1 = 0.56), and demonstrating that strong code generation ability does not transfer to prompt meta-reasoning. Perhaps more importantly, our analysis indicates that SpecValidator can generalize to unseen issues and detect unknown Under-Specification defects in the original (real) descriptions of the benchmarks used.
2023
A Black-Box Attack on Code Models via Representation Nearest Neighbor Search
Jie Zhang | Wei Ma | Qiang Hu | Shangqing Liu | Xiaofei Xie | Yves Le Traon | Yang Liu
Findings of the Association for Computational Linguistics: EMNLP 2023
Jie Zhang | Wei Ma | Qiang Hu | Shangqing Liu | Xiaofei Xie | Yves Le Traon | Yang Liu
Findings of the Association for Computational Linguistics: EMNLP 2023
Existing methods for generating adversarial code examples face several challenges: limted availability of substitute variables, high verification costs for these substitutes, and the creation of adversarial samples with noticeable perturbations. To address these concerns, our proposed approach, RNNS, uses a search seed based on historical attacks to find potential adversarial substitutes. Rather than directly using the discrete substitutes, they are mapped to a continuous vector space using a pre-trained variable name encoder. Based on the vector representation, RNNS predicts and selects better substitutes for attacks. We evaluated the performance of RNNS across six coding tasks encompassing three programming languages: Java, Python, and C. We employed three pre-trained code models (CodeBERT, GraphCodeBERT, and CodeT5) that resulted in a cumulative of 18 victim models. The results demonstrate that RNNS outperforms baselines in terms of ASR and QT. Furthermore, the perturbation of adversarial examples introduced by RNNS is smaller compared to the baselines in terms of the number of replaced variables and the change in variable length. Lastly, our experiments indicate that RNNS is efficient in attacking defended models and can be employed for adversarial training.