On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformations
Not on the map. Why?
Abstract (arXiv)
With the prevalence of publicly available source code repositories to train deep neural network models, neural program models can do well in source code analysis tasks such as predicting method names in given programs that cannot be easily done by traditional program analysis techniques. Although such neural program models have been tested on various existing datasets, the extent to which they generalize to unforeseen source code is largely unknown. Since it is very challenging to test neural program models on all unforeseen programs, in this paper, we propose to evaluate the generalizability of neural program models with respect to semantic-preserving transformations: a generalizable neural program model should perform equally well on programs that are of the same semantics but of different lexical appearances and syntactical structures. We compare the results of various neural program models for the method name prediction task on programs before and after automated semantic-preserving transformations. We use three Java datasets of different sizes and three state-of-the-art neural network models for code, namely code2vec, code2seq, and GGNN, to build nine such neural program models for evaluation. Our results show that even with small semantically preserving changes to the programs, these neural program models often fail to generalize their performance. Our results also suggest that neural program models based on data and control dependencies in programs generalize better than neural program models based only on abstract syntax trees. On the positive side, we observe that as the size of the training dataset grows and diversifies the generalizability of correct predictions produced by the neural program models can be improved too. Our results on the generalizability of neural program models provide insights to measure their limitations and provide a stepping stone for their improvement.
Key facts. Cited by 41 papers in the map (data through 7 Oct 2026). First posted on arXiv 31 Jul 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 7; 2022: 6; 2023: 9; 2024: 6; 2025: 10; 2026: 3.
41 papers.
Sort:
By area:
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Modelscited by 28
- 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 20
- 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inferencecited by 14
- 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 13
- 2022An Exploratory Study on Code Attention in BERTcited by 12
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2022HierarchyNet: Learning to Summarize Source Code with Heterogeneous Representationscited by 9
- 2023Exploiting Code Symmetries for Learning Program Semanticscited by 9
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
29 more
- 2024Are Latent Vulnerabilities Hidden Gems for Software Vulnerability Prediction? An Empirical Studycited by 9
- 2022Fix Bugs with Transformer through a Neural-Symbolic Edit Grammarcited by 8
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Codecited by 8
- 2022Syntax-Guided Program Reduction for Understanding Neural Code Intelligence Modelscited by 7
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testingcited by 5
- 2021Code2Snapshot: Using Code Snapshots for Learning Representations of Source Codecited by 4
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistantscited by 4
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
- 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Modelscited by 4
- 2025Evaluate-and-Purify: Fortifying Code Language Models Against Adversarial Attacks Using LLM-as-a-Judgecited by 4
- 2021Self-Supervised Learning to Prove Equivalence Between Straight-Line Programs via Rewrite Rulescited by 3
- 2024Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Studycited by 3
- 2023Study of Distractors in Neural Models of Codecited by 2
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2026Evaluating LLM-Based Test Generation Under Software Evolutioncited by 2
- 2021WheaCha: A Method for Explaining the Predictions of Models of Codecited by 1
- 2021Is a Single Model Enough? MuCoS: A Multi-Model Ensemble Learning for Semantic Code Searchcited by 1
- 2021Energy-bounded Learning for Robust Models of Codecited by 1
- 2023Redundancy and Concept Analysis for Code-trained Language Modelscited by 1
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomycited by 1
- 2022Extracting Label-specific Key Input Features for Neural Code Intelligence Modelscited by 0
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Codecited by 0
- 2024CatCode: A Comprehensive Evaluation Framework for LLMs On the Mixture of Code and Textcited by 0
- 2025A Match Made in Heaven? AI-driven Matching of Vulnerabilities and Security Unit Testscited by 0
- 2025An Initial Exploration of Fine-tuning Small Language Models for Smart Contract Reentrancy Vulnerability Detectioncited by 0
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Codecited by 0
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?cited by 0
- 2026Operational Robustness of LLMs on Code Generationcited by 0
- 2026Invariant Pretraining for Robust Code Representationscited by 0
- 2026Invariant Pretraining for Robust Code Representations15 Aug 2026
- 2026Evaluating LLM-Based Test Generation Under Software Evolution24 Mar 2026
- 2026Operational Robustness of LLMs on Code Generation21 Feb 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025An Initial Exploration of Fine-tuning Small Language Models for Smart Contract Reentrancy Vulnerability Detection25 May 2025
- 2025Evaluate-and-Purify: Fortifying Code Language Models Against Adversarial Attacks Using LLM-as-a-Judge28 Apr 2025
- 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Models6 Apr 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants18 Mar 2025
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference22 Feb 2025
29 more
- 2025A Match Made in Heaven? AI-driven Matching of Vulnerabilities and Security Unit Tests5 Feb 2025
- 2024What can Large Language Models Capture about Code Functional Equivalence?20 Aug 2024
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomy5 May 2024
- 2024CatCode: A Comprehensive Evaluation Framework for LLMs On the Mixture of Code and Text4 Mar 2024
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testing19 Feb 2024
- 2024Are Latent Vulnerabilities Hidden Gems for Software Vulnerability Prediction? An Empirical Study20 Jan 2024
- 2024Uncertainty Awareness of Large Language Models Under Code Distribution Shifts: A Benchmark Study12 Jan 2024
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Code13 Nov 2023
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Models28 Aug 2023
- 2023Exploiting Code Symmetries for Learning Program Semantics7 Aug 2023
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection28 Jun 2023
- 2023Redundancy and Concept Analysis for Code-trained Language Models1 May 2023
- 2023A Study of Variable-Role-based Feature Enrichment in Neural Models of Code8 Mar 2023
- 2023Study of Distractors in Neural Models of Code3 Mar 2023
- 2023Toward a Theory of Causation for Interpreting Neural Code Models7 Feb 2023
- 2022HierarchyNet: Learning to Summarize Source Code with Heterogeneous Representations31 May 2022
- 2022Syntax-Guided Program Reduction for Understanding Neural Code Intelligence Models28 May 2022
- 2022Fix Bugs with Transformer through a Neural-Symbolic Edit Grammar13 Apr 2022
- 2022An Exploratory Study on Code Attention in BERT5 Apr 2022
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar 2022
- 2022Extracting Label-specific Key Input Features for Neural Code Intelligence Models14 Feb 2022
- 2021Energy-bounded Learning for Robust Models of Code20 Dec 2021
- 2021Code2Snapshot: Using Code Snapshots for Learning Representations of Source Code1 Nov 2021
- 2021Self-Supervised Learning to Prove Equivalence Between Straight-Line Programs via Rewrite Rules22 Sep 2021
- 2021Is a Single Model Enough? MuCoS: A Multi-Model Ensemble Learning for Semantic Code Search10 Jul 2021
- 2021Memorization and Generalization in Neural Code Intelligence Models16 Jun 2021
- 2021Understanding Neural Code Intelligence Through Program Simplification7 Jun 2021
- 2021WheaCha: A Method for Explaining the Predictions of Models of Code9 Feb 2021
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2022ReACC: A Retrieval-Augmented Code Completion Framework15 Mar 2022
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 20
- 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
- 2024What can Large Language Models Capture about Code Functional Equivalence?cited by 13
- 2022An Exploratory Study on Code Attention in BERTcited by 12
- 2023Toward a Theory of Causation for Interpreting Neural Code Modelscited by 12
- 2022HierarchyNet: Learning to Summarize Source Code with Heterogeneous Representationscited by 9
- 2023Exploiting Code Symmetries for Learning Program Semanticscited by 9
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2024Are Latent Vulnerabilities Hidden Gems for Software Vulnerability Prediction? An Empirical Studycited by 9
- 2022Fix Bugs with Transformer through a Neural-Symbolic Edit Grammarcited by 8
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Codecited by 8
12 most cited of 37 All 37 (JSON)
- 2026Invariant Pretraining for Robust Code Representations15 Aug 2026
- 2026Evaluating LLM-Based Test Generation Under Software Evolution24 Mar 2026
- 2026Operational Robustness of LLMs on Code Generation21 Feb 2026
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025An Initial Exploration of Fine-tuning Small Language Models for Smart Contract Reentrancy Vulnerability Detection25 May 2025
- 2025Evaluate-and-Purify: Fortifying Code Language Models Against Adversarial Attacks Using LLM-as-a-Judge28 Apr 2025
- 2025Assessing the Impact of Code Changes on the Fault Localizability of Large Language Models6 Apr 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Grounding27 Mar 2025
- 2025XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants18 Mar 2025
- 2025A Match Made in Heaven? AI-driven Matching of Vulnerabilities and Security Unit Tests5 Feb 2025
- 2024What can Large Language Models Capture about Code Functional Equivalence?20 Aug 2024
12 newest of 37 All 37 (JSON)