Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehension
Shuzheng Gao, Cuiyun Gao, Chaozheng Wang, Jun Sun, David Lo, Yue Yu
摘要
Previous studies have demonstrated that neural code comprehension models are vulnerable to identifier naming. By renaming as few as one identifier in the source code, the models would output completely irrelevant results, indicating that identifiers can be misleading for model prediction. However, identifiers are not completely detrimental to code comprehension, since the semantics of identifier names can be related to the program semantics. Well exploiting the two opposite impacts of identifiers is essential for enhancing the robustness and accuracy of neural code comprehension, and still remains under-explored. In this work, we propose to model the impact of identifiers from a novel causal perspective, and propose a counterfactual reasoning-based framework named CREAM. CREAM explicitly captures the misleading information of identifiers through multi-task learning in the training stage, and reduces the misleading impact by counterfactual inference in the inference stage. We evaluate CREAM on three popular neural code comprehension tasks, including function naming, defect detection and code classification. Experiment results show that CREAM not only significantly outperforms baselines in terms of robustness (e.g., +37.9% on the function naming task at F1 score), but also achieve improved results on the original datasets (e.g., +0.5% on the function naming task at F1 score).
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper7
- Generative Type Inference for PythonYun Peng, Chaozheng Wang, Wenxuan Wang, Cuiyun Gao 等ASE 2023 · 被引用 29 次
- When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability DetectionXin-Cheng Wen, Xinchen Wang, Cuiyun Gao, Shaohua Wang 等ASE 2023 · 被引用 20 次
- CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code ReasoningMan Ho Lam, Chaozheng Wang, Jen-Tse Huang, Michael R. LyuNeurIPS 2025 · 被引用 16 次
- Exploiting Code Symmetries for Learning Program SemanticsKexin Pei, Weichen Li, Qirui Jin, Shuyang Liu 等ICML 2024 · 被引用 15 次
- Mutual Learning-Based Framework for Enhancing Robustness of Code Models via Adversarial TrainingYangsen Wang, Yizhou Chen, Yifan Zhao, Zhihao Gong 等ASE 2024 · 被引用 3 次
它引用的顶会 Paper32
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 被引用 1,644 次
- 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 次
- Long-tail learning via logit adjustmentAditya Krishna Menon, Sadeep Jayasumana, Ankit Singh Rawat, Himanshu Jain 等ICLR 2021 · 被引用 937 次
- Causal Intervention for Leveraging Popularity Bias in RecommendationYang Zhang, Fuli Feng, Xiangnan He, Tianxin Wei 等SIGIR 2021 · 被引用 431 次
- Vulnerability detection with fine-grained interpretationsYi Li, Shaohua Wang, Tien N. NguyenFSE 2021 · 被引用 283 次
相关 Paper
- Graph Neural Networks for Vulnerability Detection: A Counterfactual ExplanationZhaoyang Chu, Yao Wan, Qian Li, Yang Wu 等ISSTA 2024 · 被引用 19 次
- A Causal Learning Framework for Enhancing Robustness of Source Code ModelsJunyao Ye, Zhen Li, Xi Tang, Deqing Zou 等FSE 2025
- Robin: A Novel Method to Produce Robust Interpreters for Deep Learning-Based Code ClassifiersZhen Li, Ruqian Zhang, Deqing Zou, Ning Wang 等ASE 2023 · 被引用 4 次
- Multi-task Learning based Pre-trained Language Model for Code CompletionFang Liu, Ge Li, Yunfei Zhao, Zhi JinASE 2020 · 被引用 162 次
- Neural Causal Models for Counterfactual Identification and EstimationKevin Muyuan Xia, Yushu Pan, Elias BareinboimICLR 2023 · 被引用 3 次
