Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehension
Not on the map. Why?
Abstract (arXiv)
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).
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). First posted on arXiv 22 Jul 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 4; 2024: 2; 2025: 2; 2026: 1.
9 papers.
- 2023Exploiting Code Symmetries for Learning Program Semanticscited by 9
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2023When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detectioncited by 8
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lackingcited by 7
- 2025When Names Disappear: Revealing What LLMs Actually Understand About Codecited by 4
- 2024Causal Reasoning in Software Quality Assurance: A Systematic Reviewcited by 3
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Frameworkcited by 1
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Codecited by 0
- 2026On the Lexical Superstition of Large Language Models for Code Comprehension: Re-evaluation on Code of Low Lexical Qualitycited by 0
- 2026On the Lexical Superstition of Large Language Models for Code Comprehension: Re-evaluation on Code of Low Lexical Quality22 Sep 2026
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Framework20 Oct 2025
- 2025When Names Disappear: Revealing What LLMs Actually Understand About Code3 Oct 2025
- 2024Causal Reasoning in Software Quality Assurance: A Systematic Review30 Aug 2024
- 2024CodeArt: Better Code Models by Attention Regularization When Symbols Are Lacking19 Feb 2024
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023When Less is Enough: Positive and Unlabeled Learning Model for Vulnerability Detection21 Aug 2023
- 2023Exploiting Code Symmetries for Learning Program Semantics7 Aug 2023
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Code8 Mar 2023