Lune

ASE2023Top-tier venue

On-the-fly Improving Performance of Deep Code Models via Input Denoising

Zhao Tian, Junjie Chen, Xiangyu Zhang

Abstract

Deep learning has been widely adopted to tackle various code-based tasks by building deep code models based on a large amount of code snippets. While these deep code models have achieved great success, even state-of-the-art models suffer from noise present in inputs leading to erroneous predictions. While it is possible to enhance models through retraining/fine-tuning, this is not a once-and-for-all approach and incurs significant overhead. In particular, these techniques cannot on-the-fly improve performance of (deployed) models. There are currently some techniques for input denoising in other domains (such as image processing), but since code input is discrete and must strictly abide by complex syntactic and semantic constraints, input denoising techniques in other fields are almost not applicable. In this work, we propose the first input denoising technique (i.e., CodeDenoise) for deep code models. Its key idea is to localize noisy identifiers in (likely) mispredicted inputs, and denoise such inputs by cleansing the located identifiers. It does not need to retrain or reconstruct the model, but only needs to cleanse inputs on-the-fly to improve performance. Our experiments on 18 deep code models (i.e., three pre-trained models with six code-based datasets) demonstrate the effectiveness and efficiency of CodeDenoise. For example, on average, CodeDenoise successfully denoises 21.91% of mispredicted inputs and improves the original models by 2.04% in terms of the model accuracy across all the subjects in an average of 0.48 second spent on each input, substantially outperforming the widely-used fine-tuning strategy.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

6 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Large Language Models for Equivalent Mutant Detection: How Far Are We? cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Large Language Models for Equivalent Mutant Detection: How Far Are We? cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Large Language Models for Equivalent Mutant Detection: How Far Are We? cites GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial Training cites GraphCodeBERT: Pre-training Code Representations with Data Flow
  • CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • CodeImprove: Program Adaptation for Deep Code Models cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • CodeImprove: Program Adaptation for Deep Code Models cites GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Selecting Initial Seeds for Better JVM Fuzzing cites CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
  • Selecting Initial Seeds for Better JVM Fuzzing cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Fixing Large Language Models' Specification Misunderstanding for Better Code Generation cites Large Language Models for Equivalent Mutant Detection: How Far Are We?
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Large Language Models for Equivalent Mutant Detection: How Far Are We?Zhao Tian, Honglin Shu, Dong Wang, Xuejie Cao et al.ISSTA 2024 · 12 citations
  2. Fixing Large Language Models' Specification Misunderstanding for Better Code GenerationZhao Tian, Junjie Chen, Xiangyu ZhangICSE 2025 · 6 citations
  3. Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial TrainingYangsen Wang, Yizhou Chen, Yifan Zhao, Zhihao Gong et al.ASE 2024 · 3 citations
  4. CodeImprove: Program Adaptation for Deep Code ModelsRavishka Rathnasuriya, Zijie Zhao, Wei YangICSE 2025 · 3 citations
  5. Selecting Initial Seeds for Better JVM FuzzingTianchang Gao, Junjie Chen, Dong Wang, Yile Guo et al.ICSE 2025 · 2 citations

Builds on32

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  2. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
  3. CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 citations
  4. DeepGini: prioritizing massive tests to enhance the robustness of deep neural networksYang Feng, Qingkai Shi, Xinyu Gao, Jun Wan et al.ISSTA 2020 · 206 citations
  5. Deep learning library testing via effective model generationZan Wang, Ming Yan, Junjie Chen, Shuang Liu et al.FSE 2020 · 165 citations

Related papers

  1. Code Difference Guided Adversarial Example Generation for Deep Code ModelsZhao Tian, Junjie Chen, Zhi JinASE 2023 · 27 citations
  2. Adversarial Robustness for CodePavol Bielik, Martin T. VechevICML 2020 · 101 citations
  3. On the Importance of Building High-quality Training Datasets for Neural Code SearchZhensu Sun, Li Li, Yan Liu, Xiaoning Du et al.ICSE 2022 · 67 citations
  4. CCT5: A Code-Change-Oriented Pre-trained ModelBo Lin, Shangwen Wang, Zhongxin Liu, Yepang Liu et al.FSE 2023 · 69 citations
  5. Has My Code Been Stolen for Model Training? A Naturalness Based Approach to Code Contamination DetectionHaris Ali Khan, Yanjie Jiang, Qasim Umer, Yuxia Zhang et al.FSE 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines