Publication Type

Conference Proceeding Article

Version

acceptedVersion

Publication Date

11-2019

Abstract

Despite being adopted in software engineering tasks, deep neural networks are treated mostly as a black box due to the difficulty in interpreting how the networks infer the outputs from the inputs. To address this problem, we propose AutoFocus, an automated approach for rating and visualizing the importance of input elements based on their effects on the outputs of the networks. The approach is built on our hypotheses that (1) attention mechanisms incorporated into neural networks can generate discriminative scores for various input elements and (2) the discriminative scores reflect the effects of input elements on the outputs of the networks. This paper verifies the hypotheses by applying AutoFocus on the task of algorithm classification (i.e., given a program source code as input, determine the algorithm implemented by the program). AutoFocus identifies and perturbs code elements in a program systematically, and quantifies the effects of the perturbed elements on the network’s classification results. Based on evaluation on more than 1000 programs for 10 different sorting algorithms, we observe that the attention scores are highly correlated to the effects of the perturbed code elements. Such a correlation provides a strong basis for the uses of attention scores to interpret the relations between code elements and the algorithm classification results of a neural network, and we believe that visualizing code elements in an input program ranked according to their attention scores can facilitate faster program comprehension with reduced code.

Keywords

attention mechanisms, neural networks, algorithm classification, interpretability, code perturbation, programcomprehension

Discipline

Software Engineering

Research Areas

Software and Cyber-Physical Systems

Publication

2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE): San Diego, November 11-15: Proceedings

First Page

38

Last Page

41

ISBN

9781728125084

Identifier

10.1109/ASE.2019.00014

Publisher

IEEE

City or Country

Piscataway, NJ

Copyright Owner and License

Authors

Additional URL

https://doi.org/10.1109/ASE.2019.00014

Share

COinS