Explainable AI for Pre-Trained Code Models: What Do They Learn? When They Do Not Work?

11/23/2022
by   Ahmad Haji Mohammadkhani, et al.
0

In recent years, there has been a wide interest in designing deep neural network-based models that automate downstream software engineering tasks, such as program 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 eXplainable AI (XAI) method (attention mechanism), we study state-of-the-art Transformer-based models (CodeBERT and GraphCodeBERT) on a set of software engineering downstream tasks: code document generation (CDG), code refinement (CR), and code translation (CT). We first evaluate the validity of the attention mechanism on each particular task. Then, 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. Finally, we show some of the common patterns when the model does not work as expected (perform poorly while the problem in hand is easy) and suggest recommendations that may alleviate the observed challenges.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/24/2022

Deep Learning Meets Software Engineering: A Survey on Pre-Trained Models of Source Code

Recent years have seen the successful application of deep learning to so...
research
08/25/2021

What do pre-trained code models know about code?

Pre-trained models of code built on the transformer architecture have pe...
research
06/21/2021

A Mocktail of Source Code Representations

Efficient representation of source code is essential for various softwar...
research
04/24/2023

Is ChatGPT the Ultimate Programming Assistant – How far is it?

The recent progress in generative AI techniques has significantly influe...
research
10/12/2019

Deep Transfer Learning for Source Code Modeling

In recent years, deep learning models have shown great potential in sour...
research
03/13/2023

xASTNN: Improved Code Representations for Industrial Practice

The application of deep learning techniques in software engineering beco...
research
03/31/2021

HAConvGNN: Hierarchical Attention Based Convolutional Graph Neural Network for Code Documentation Generation in Jupyter Notebooks

Many data scientists use Jupyter notebook to experiment code, visualize ...

Please sign up or login with your details

Forgot password? Click here to reset