Neural networks for source code processing have proven to be effective for solving multiple tasks, such as locating bugs or detecting vulnerabilities. In this paper, we propose an evolutionary approach for probing the behaviour of a deep neural source code classifier by generating instances that sample its input space. First, we apply a grammar-based genetic algorithm for evolving Python functions that minimise or maximise the probability of a function to be in a certain class, and we also produce programs that yield an output near to the classification threshold, namely for which the network does not express a clear classification preference. We then use such sets of evolved programs as initial popu-lations for an evolution strategy approach in which we apply, by following different policies, constrained small mutations to the individuals, so to both explore the decision boundary of the network and to identify the features that most contribute to a particular prediction. We furtherly point out how our approach can be effectively used for several tasks in the scope of the interpretable machine learning, such as for producing adversarial examples able to deceive a network, for identifying the most salient features, and further for characterising the abstract concepts learned by a neural model.
Saletta, M., Ferretti, C. (2022). A Grammar-based Evolutionary Approach for Assessing Deep Neural Source Code Classifiers. In 2022 IEEE Congress on Evolutionary Computation, CEC 2022 - Conference Proceedings (pp.1-8). 345 E 47TH ST, NEW YORK, NY 10017 USA : IEEE [10.1109/CEC55065.2022.9870317].
A Grammar-based Evolutionary Approach for Assessing Deep Neural Source Code Classifiers
Saletta, Martina;Ferretti, Claudio
2022
Abstract
Neural networks for source code processing have proven to be effective for solving multiple tasks, such as locating bugs or detecting vulnerabilities. In this paper, we propose an evolutionary approach for probing the behaviour of a deep neural source code classifier by generating instances that sample its input space. First, we apply a grammar-based genetic algorithm for evolving Python functions that minimise or maximise the probability of a function to be in a certain class, and we also produce programs that yield an output near to the classification threshold, namely for which the network does not express a clear classification preference. We then use such sets of evolved programs as initial popu-lations for an evolution strategy approach in which we apply, by following different policies, constrained small mutations to the individuals, so to both explore the decision boundary of the network and to identify the features that most contribute to a particular prediction. We furtherly point out how our approach can be effectively used for several tasks in the scope of the interpretable machine learning, such as for producing adversarial examples able to deceive a network, for identifying the most salient features, and further for characterising the abstract concepts learned by a neural model.File | Dimensione | Formato | |
---|---|---|---|
Saletta-2022-CEC2022-preprint.pdf
accesso aperto
Descrizione: Intervento a convegno
Tipologia di allegato:
Submitted Version (Pre-print)
Dimensione
541.92 kB
Formato
Adobe PDF
|
541.92 kB | Adobe PDF | Visualizza/Apri |
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.