Explainable AI for Pre-Trained Code Models: What Do They Learn? When
They Do Not Work?
- URL: http://arxiv.org/abs/2211.12821v2
- Date: Mon, 28 Aug 2023 19:42:34 GMT
- Title: Explainable AI for Pre-Trained Code Models: What Do They Learn? When
They Do Not Work?
- Authors: Ahmad Haji Mohammadkhani, Chakkrit Tantithamthavorn, Hadi Hemmati
- Abstract summary: We study two recent large language models (LLMs) for code on a set of software engineering downstream tasks.
We identify what CodeBERT and GraphCodeBERT learn (put the highest attention on, in terms of source code token types) on these tasks.
We show some of the common patterns when the model does not work as expected and suggest recommendations.
- Score: 4.573310303307945
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: In recent years, there has been a wide interest in designing deep neural
network-based models that automate downstream software engineering tasks on
source code, such as code document generation, code search, and program repair.
Although the main objective of these studies is to improve the effectiveness of
the downstream task, many studies only attempt to employ the next best neural
network model, without a proper in-depth analysis of why a particular solution
works or does not, on particular tasks or scenarios. In this paper, using an
example eXplainable AI (XAI) method (attention mechanism), we study two recent
large language models (LLMs) for code (CodeBERT and GraphCodeBERT) on a set of
software engineering downstream tasks: code document generation (CDG), code
refinement (CR), and code translation (CT). Through quantitative and
qualitative studies, we identify what CodeBERT and GraphCodeBERT learn (put the
highest attention on, in terms of source code token types), on these tasks. We
also show some of the common patterns when the model does not work as expected
(performs poorly even on easy problems) and suggest recommendations that may
alleviate the observed challenges.
Related papers
- INSPECT: Intrinsic and Systematic Probing Evaluation for Code
Transformers [7.255653248042546]
We use a framework to define 15 probing tasks that exercise surface, syntactic, structural and semantic characteristics of source code.
We probe 8 pre-trained source code models, as well as a natural language model (BERT) as our baseline.
We find that models that incorporate some structural information (such as GraphCodeBERT) have a better representation of source code characteristics.
arXiv Detail & Related papers (2023-12-08T15:21:54Z) - TaskMatrix.AI: Completing Tasks by Connecting Foundation Models with
Millions of APIs [71.7495056818522]
We introduce TaskMatrix.AI as a new AI ecosystem that connects foundation models with millions of APIs for task completion.
We will present our vision of how to build such an ecosystem, explain each key component, and use study cases to illustrate both the feasibility of this vision and the main challenges we need to address next.
arXiv Detail & Related papers (2023-03-29T03:30:38Z) - Greener yet Powerful: Taming Large Code Generation Models with
Quantization [47.734976584580224]
Large pretrained deep learning models have substantially pushed the boundary of code generation.
Despite their great power, the huge number of model parameters poses a significant threat to adapting them in a regular software development environment.
Model compression is a promising approach to address these challenges.
arXiv Detail & Related papers (2023-03-09T16:25:51Z) - Chatbots As Fluent Polyglots: Revisiting Breakthrough Code Snippets [0.0]
The research applies AI-driven code assistants to analyze a selection of influential computer code that has shaped modern technology.
The original contribution of this study was to examine half of the most significant code advances in the last 50 years.
arXiv Detail & Related papers (2023-01-05T23:17:17Z) - CodeRL: Mastering Code Generation through Pretrained Models and Deep
Reinforcement Learning [92.36705236706678]
"CodeRL" is a new framework for program synthesis tasks through pretrained LMs and deep reinforcement learning.
During inference, we introduce a new generation procedure with a critical sampling strategy.
For the model backbones, we extended the encoder-decoder architecture of CodeT5 with enhanced learning objectives.
arXiv Detail & Related papers (2022-07-05T02:42:15Z) - Enhancing Semantic Code Search with Multimodal Contrastive Learning and
Soft Data Augmentation [50.14232079160476]
We propose a new approach with multimodal contrastive learning and soft data augmentation for code search.
We conduct extensive experiments to evaluate the effectiveness of our approach on a large-scale dataset with six programming languages.
arXiv Detail & Related papers (2022-04-07T08:49:27Z) - What Makes Good Contrastive Learning on Small-Scale Wearable-based
Tasks? [59.51457877578138]
We study contrastive learning on the wearable-based activity recognition task.
This paper presents an open-source PyTorch library textttCL-HAR, which can serve as a practical tool for researchers.
arXiv Detail & Related papers (2022-02-12T06:10:15Z) - What do pre-trained code models know about code? [9.60966128833701]
We use diagnostic tasks called probes to investigate pre-trained code models.
BERT (pre-trained on English), CodeBERT and CodeBERTa (pre-trained on source code, and natural language documentation), and GraphCodeBERT (pre-trained on source code with dataflow) are investigated.
arXiv Detail & Related papers (2021-08-25T16:20:17Z) - Measuring Coding Challenge Competence With APPS [54.22600767666257]
We introduce APPS, a benchmark for code generation.
Our benchmark includes 10,000 problems, which range from having simple one-line solutions to being substantial algorithmic challenges.
Recent models such as GPT-Neo can pass approximately 15% of the test cases of introductory problems.
arXiv Detail & Related papers (2021-05-20T17:58:42Z) - InferCode: Self-Supervised Learning of Code Representations by
Predicting Subtrees [17.461451218469062]
This paper proposes InferCode to overcome the limitation by adapting the self-language learning mechanism to build source code model.
Subtrees in ASTs are treated with InferCode as the labels for training code representations without any human labeling effort or the overhead of expensive graph construction.
Compared to previous code learning techniques applied to the same downstream tasks, such as Code2Vec, Code2Seq, ASTNN, higher performance results are achieved using our pre-trained InferCode model.
arXiv Detail & Related papers (2020-12-13T10:33:41Z) - Neuroevolution of Neural Network Architectures Using CoDeepNEAT and
Keras [0.0]
A large portion of the work involved in a machine learning project is to define the best type of algorithm to solve a given problem.
Finding the optimal network topology and configurations for a given problem is a challenge that requires domain knowledge and testing efforts.
arXiv Detail & Related papers (2020-02-11T19:03:34Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.