TokenGated-CodeBERT is proposed, a new methodology designed for scenarios with severe class imbalance that supports full end-to-end training, keeps the original CodeBERT encoder intact, requires no additional auxiliary optimization objectives, and features a lightweight architecture.
Abstract
Class imbalance poses a key challenge in defective code module detection, severely limiting the performance of deep learning models. To address this issue, we propose TokenGated-CodeBERT, a new methodology designed for scenarios with severe class imbalance. Constructed on the basis of vanilla CodeBERT, the model adopts a lightweight token gating module to raise the weights of defective minority tokens and lower the weights of non-defective majority tokens. It dynamically fuses token embeddings based on defect correlation, emphasizing fault-related tokens and eliminating noise to enhance minority defect detection in feature learning. We conduct extensive validation on the PROMISE dataset for cross-project and cross-version defect prediction tasks, with supplementary tests on the Defects4J dataset for fine-grained code snippet prediction to comprehensively examine the generalization performance of the newly designed structural module. Experimental results illustrate that our method achieves competitive Matthews Correlation Coefficient (MCC) performance against all baseline approaches, demonstrating its effectiveness in class-imbalanced scenarios. An ablation study confirms that our token-level gating mechanism is the key driver of this performance gain, as it more effectively captures defect-related signals distributed throughout the code sequence. Our framework supports full end-to-end training, keeps the original CodeBERT encoder intact, requires no additional auxiliary optimization objectives, and features a lightweight architecture.
One of the primary challenges in training deep neural networks is the requirement for a robust and diverse data source. To address this limitation, data augmentation techniques have emerged as a promising solution, enabling the expansion of training datasets without requiring additional data collection. This study inve...
Alı Nızam, Musa Aydin, Ertuğrul İslamoğlu et al.· Knowledge and Information Sy...· 0 citations
An innovative domain adaptive adversarial prediction method designed to tackle both contextual code semantic features and inter-domain distribution differences effectively and its potential for practical use in real-world software defect prediction tasks is introduced.
Qing Shen, Jing Xu, Mao-Nian Wu et al.· International Journal of Mac...· 0 citations
The results demonstrate that the proposed adaptive framework substantially improves minority-class vulnerability detection, achieving up to a 2.5-fold increase in F1-score and up to 83% improvement in MCC compared to the no-imbalance baseline.
Fatma Altınsoy· Süleyman Demirel Üniversites...· 0 citations
This thesis rebuilds Real-Vul through a controlled Code Property Graph pipeline, measure and remove a 37% content leak intrinsic to whole-codebase sampling, and train a relational graph neural network with a disciplined class-imbalance recipe: focal loss, class-aware undersampling, and fine-tuning of a GraphCodeBERT no...
This research proposes the first end-to-end multi-task architecture that jointly detects Python syntax errors and localizes their exact line position by adaptively fusing CodeBERT’s semantic embeddings with handcrafted syntactic features via a lightweight gating mechanism, without relying on Abstract Syntax Trees.
Rozali Ilham, Bahtiar Imran, Hasan Basri et al.· 0 citations
LWVIC4Code is proposed, a non-contrastive representation learning approach specifically designed for Type-IV clone detection that achieves competitive or superior performance without negative samples, benefits from layer-wise supervision, and generalizes effectively from Python to other languages, particularly Java and...
Luciano Marchezan, Kévin Delcourt, Eugene Syriani et al.· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.