CREME: Robustness Enhancement of Code LLMs via Layer-Aware Model Editing
Shuhan Liu, Xing Hu, Kerui Huang, Xiaohu Yang, David Lo, Xin Xia

TL;DR
CREME is a novel method that enhances code LLM robustness by identifying sensitive layers and applying targeted parameter edits, significantly improving performance on perturbed prompts while preserving accuracy on clean inputs.
Contribution
CREME introduces a layer-aware model editing technique that improves LLM robustness to prompt perturbations by selectively updating parameters in sensitive layers.
Findings
CREME improves Pass@1 accuracy by 63% on perturbed prompts.
Robustness-sensitive layers are mainly in middle and deeper layers.
Locations of sensitive layers vary across different model architectures.
Abstract
Large language models (LLMs) have demonstrated impressive capabilities in code generation, where the natural language prompt plays a crucial role in conveying user intent to the model. However, prior studies have shown that LLMs are highly sensitive to prompt perturbations. Minor modifications in wording, syntax, or formatting can significantly reduce the functional correctness of generated code. As perturbations frequently occur in real-world scenarios, improving the robustness of LLMs to prompt perturbations is essential for ensuring reliable performance in practical code generation. In this paper, we introduce CREME (Code Robustness Enhancement via Model Editing), a novel approach that enhances LLM robustness through targeted parameter updates. CREME first identifies robustness-sensitive layers by comparing hidden states between an original prompt and its perturbed variant. Then, it…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Software Engineering Research · Natural Language Processing Techniques
