Redundancy and Concept Analysis for Code-trained Language Models
Not on the map. Why?
Abstract (arXiv)
Code-trained language models have proven to be highly effective for various code intelligence tasks. However, they can be challenging to train and deploy for many software engineering applications due to computational bottlenecks and memory constraints. Implementing effective strategies to address these issues requires a better understanding of these 'black box' models. In this paper, we perform the first neuron-level analysis for source code models to identify textitimportant neurons within latent representations. We achieve this by eliminating neurons that are highly similar or irrelevant to the given task. This approach helps us understand which neurons and layers can be eliminated (redundancy analysis) and where important code properties are located within the network (concept analysis). Using redundancy analysis, we make observations relevant to knowledge transfer and model optimization applications. We find that over 95% of the neurons are redundant with respect to our code intelligence tasks and can be eliminated without significant loss in accuracy. We also discover several subsets of neurons that can make predictions with baseline accuracy. Through concept analysis, we explore the traceability and distribution of human-recognizable concepts within latent code representations which could be used to influence model predictions. We trace individual and subsets of important neurons to specific code properties and identify 'number' neurons, 'string' neurons, and higher-level 'text' neurons for token-level tasks and higher-level concepts important for sentence-level downstream tasks. This also helps us understand how decomposable and transferable task-related features are and can help devise better techniques for transfer learning, model compression, and the decomposition of deep neural networks into modules.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 44 of its 65 references that are in the map. First posted on arXiv 1 May 2023.
Builds on
44 of 65 references.
References · 44
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,665
- 2019Similarity of Neural Network Representations Revisitedcited by 1,695
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,046
- 2022Toy Models of Superpositioncited by 928
- 2019Attention is not Explanationcited by 916
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 831
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
32 more
- 2019Attention is not not Explanationcited by 629
- 2019Designing and Interpreting Probes with Control Taskscited by 608
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2018What Is One Grain of Sand in the Desert? Analyzing Individual Neurons in Deep NLP Modelscited by 124
- 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
- 2018Identifying and Controlling Important Neurons in Neural Machine Translationcited by 110
- 2020Analyzing Individual Neurons in Pre-trained Language Modelscited by 97
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 74
- 2019Visualizing and Understanding the Effectiveness of BERTcited by 67
- 2019Adversarial Examples for Models of Codecited by 61
- 2021On the Pitfalls of Analyzing Individual Neurons in Language Modelscited by 61
- 2022Discovering Latent Concepts Learned in BERTcited by 56
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 41
- 2023Explainable Automated Debugging via Large Language Model-driven Scientific Debuggingcited by 40
- 2021Neural Transfer Learning for Repairing Security Vulnerabilities in C Codecited by 36
- 2021What do pre-trained code models know about code?cited by 36
- 2018NeuroX: A Toolkit for Analyzing Individual Neurons in Neural Networkscited by 31
- 2023An Empirical Comparison of Pre-Trained Models of Source Codecited by 25
- 2021Counterfactual Explanations for Models of Codecited by 24
- 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
- 2021Understanding Neural Code Intelligence Through Program Simplificationcited by 20
- 2021Memorization and Generalization in Neural Code Intelligence Modelscited by 17
- 2020Probing Model Signal-Awareness via Prediction-Preserving Input Minimizationcited by 14
- 2018Studying the Difference Between Natural and Programming Language Corporacited by 13
- 2023KNOD: Domain Knowledge Distilled Tree Decoder for Automated Program Repaircited by 13
- 2020Towards Demystifying Dimensions of Source Code Embeddingscited by 9
- 2022Benchmarking Language Models for Code Syntax Understandingcited by 8
- 2019On the Feasibility of Transfer-learning Code Smells using Deep Learningcited by 7
- 2022Syntax-Guided Program Reduction for Understanding Neural Code Intelligence Modelscited by 7
- 2022Learning Program Semantics with Code Representations: An Empirical Studycited by 6
Built on by
Citing papers per year: 2023: 1.
1 paper.
- 2023Towards Understanding What Code Language Models Learnedcited by 3
- 2023Towards Understanding What Code Language Models Learned20 Jun 2023