Commit2Vec: Learning Distributed Representations of Code Changes

11/18/2019
by   Rocío Cabrera Lozoya, et al.
0

Deep learning methods, which have found successful applications in fields like image classification and natural language processing, have recently been applied to source code analysis too, due to the enormous amount of freely available source code (e.g., from open-source software repositories). In this work, we elaborate upon a state-of-the-art approach to the representation of source code that uses information about its syntactic structure, and we adapt it to represent source changes (i.e., commits). We use this representation to classify security-relevant commits. Because our method uses transfer learning (that is, we train a network on a "pretext task" for which abundant labeled data is available, and then we use such network for the target task of commit classification, for which fewer labeled instances are available), we studied the impact of pre-training the network using two different pretext tasks versus a randomly initialized model. Our results indicate that representations that leverage the structural information obtained through code syntax outperform token-based representations. Furthermore, the performance metrics obtained when pre-training on a loosely related pretext task with a very large dataset (>10^6 samples) were surpassed when pretraining on a smaller dataset (>10^4 samples) but for a pretext task that is more closely related to the target task.

READ FULL TEXT
research
11/18/2019

patch2vec: Distributed Representation of Code Changes

Deep learning methods, which have found successful applications in field...
research
05/23/2022

AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representations

In software development, it is common for programmers to copy-paste code...
research
05/04/2022

CODE-MVP: Learning to Represent Source Code from Multiple Views with Contrastive Pre-Training

Recent years have witnessed increasing interest in code representation l...
research
05/16/2022

The use of deep learning in interventional radiotherapy (brachytherapy): a review with a focus on open source and open data

Deep learning advanced to one of the most important technologies in almo...
research
02/16/2018

Instance-based Inductive Deep Transfer Learning by Cross-Dataset Querying with Locality Sensitive Hashing

Supervised learning models are typically trained on a single dataset and...
research
03/09/2021

Finding Inlined Functions in Optimized Binaries

Much software, whether beneficent or malevolent, is distributed only as ...
research
06/01/2021

On using distributed representations of source code for the detection of C security vulnerabilities

This paper presents an evaluation of the code representation model Code2...

Please sign up or login with your details

Forgot password? Click here to reset