paper-with-me

Papers

Towards Learning (Dis)-Similarity of Source Code from Program Contrasts

2021-10-08 · ACL 2022 5 · Yangruibo Ding, Luca Buratti, Saurabh Pujar, Alessandro Morari, Baishakhi Ray, Saikat Chakraborty

Understanding the functional (dis)-similarity of source code is significant for code modeling tasks such as software vulnerability and code clone detection. We present DISCO(DIS-similarity of COde), a novel self-supervised model focusing on identifying (dis)similar functionalities of source code. Different from existing works, our approach does not require a huge amount of randomly collected datasets. Rather, we design structure-guided code transformation algorithms to generate synthetic code clones and inject real-world security bugs, augmenting the collected datasets in a targeted way. We propose to pre-train the Transformer model with such automatically generated program contrasts to better identify similar code in the wild and differentiate vulnerable programs from benign ones. To better capture the structural features of source code, we propose a new cloze objective to encode the local tree-based context (e.g., parents or sibling nodes). We pre-train our model with a much smaller dataset, the size of which is only 5% of the state-of-the-art models' training datasets, to illustrate the effectiveness of our data augmentation and the pre-training approach. The evaluation shows that, even with much less data, DISCO can still outperform the state-of-the-art models in vulnerability and code clone detection tasks.

📄 PDF Abstract BibTeX arXiv:2110.03868

Code (0)

등록된 구현이 없습니다.

Tasks

Clone DetectionContrastive LearningData AugmentationLanguage Modelling

Methods 이 논문이 사용한 방법론

Multi-Head Attention 설명 없음
Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Residual Connection 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone Detection

2023-11-13 · Yangkai Du, Tengfei Ma, Lingfei Wu, Xuhong Zhang 외

Code Clone Detection, which aims to retrieve functionally similar programs from large code bases, has been attracting increasing attention. Modern software often involves a diverse range of programming languages. However…

Clone DetectionContrastive Learning

Exploring General Intelligence of Program Analysis for Multiple Tasks

2021-09-29 · Yixin Guo, Pengcheng Li, Yingwei Luo, Xiaolin Wang 외

Artificial intelligence are gaining more attractions for program analysis and semantic understanding. Nowadays, the prevalent program embedding techniques usually target at one single task, for example detection of binar…

A systematic literature review on source code similarity measurement and clone detection: techniques, applications, and challenges

2023-06-28 · Morteza Zakeri-Nasrabadi, Saeed Parsa, Mohammad Ramezani, Chanchal Roy 외

Measuring and evaluating source code similarity is a fundamental software engineering activity that embraces a broad range of applications, including but not limited to code recommendation, duplicate code, plagiarism, ma…

ArticlesClone DetectionSystematic Literature Review

A Comprehensive Survey of AI-Driven Advancements and Techniques in Automated Program Repair and Code Generation

2024-11-12 · Avinash Anand, Akshit Gupta, Nishchay Yadav, Shaurya Bajaj

Bug fixing and code generation have been core research topics in software development for many years. The recent explosive growth in Large Language Models has completely transformed these spaces, putting in reach incredi…

Bug fixingCode GenerationProgram RepairSurvey

Code Clone Detection based on Event Embedding and Event Dependency

2021-11-28 · Cheng Huang, Hui Zhou, Chunyang Ye, Bingzhuo Li

The code clone detection method based on semantic similarity has important value in software engineering tasks (e.g., software evolution, software reuse). Traditional code clone detection technologies pay more attention …

Clone DetectionSemantic SimilaritySemantic Textual Similarity