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.
Bug localization is the task of automatically identifying the source files responsible for a reported defect. It is a critical step in software maintenance that accelerates defect resolution. Information retrieval (IR) methods are simple and effective at exploiting historical signals such as bug-fixing recency and frequency, but they struggle to bridge the lexical gap between natural-language bug reports and programming-language identifiers. Recent work increasingly leverages pre-trained language models (PLMs) for code to close this gap. However, current PLM-based approaches still rely on a single code encoder that ignores program structure and aggregates function-level signals into file-level representations via uniform pooling. We propose a dual-encoder bug localization (DuaLoc) framework that jointly addresses these limitations. DuaLoc combines two pre-trained language models: UniXcoder for the semantic understanding of source code and GraphCodeBERT for awareness of data-flow structure. Both encoders are fine-tuned with a contrastive objective that shapes the embedding space around the localization task. A bug-report-conditioned attention mechanism then aggregates function embeddings into query-dependent file representations. The resulting neural similarity scores are then fused with classical IR features in a learning-to-rank model. DuaLoc outperforms representative classical and PLM-based baselines across most evaluation settings on a widely used benchmark of six open-source Java projects.
Detecting vulnerabilities in source code remains a major challenge as modern software systems increasingly span multiple programming languages. This work presents a deep learning approach for multilingual vulnerability detection that emphasizes semantic transfer rather than architectural complexity. The proposed method combines contextualized embeddings from CodeBERT/GraphCodeBERT with a BiLSTM and attention mechanism to capture code semantics and adopts a cross-lingual transfer setting where models trained on one language (e.g., Python) are evaluated on another (e.g., Java). To improve robustness under data imbalance, SMOTE and stratified cross-validation are incorporated into the training process. Experiments on Juliet and CodeXGLUE show that the model achieves an F1-score of about 0.87 and a ROC-AUC of 0.85 in intra-language settings, while guided fine-tuning improves cross-language F1-score by an average of 0.18 and ROC-AUC by approximately 0.13 compared with the direct transfer baseline. These results suggest that stabilizing semantic representations during transfer is key to improving generalization while maintaining practical efficiency under moderate computational constraints.
Tuan Nguyen Kim, Nin Ho Le Viet, Chieu Ta Quang· Engineering, Technology &...· 0 citations
A transformer-based classification framework that fine-tunes CodeBERT on a balanced dataset of 25,000+ bug-report segments drawn from four Apache projects is proposed and CodeBERT is the best-performing transformer in this comparison.
Kanwal Naz, Imran Shafi, M. Z. Mehmood et al.· Computers· 0 citations
A refined training strategy is presented, leveraging an encoder-based approach, to address two key challenges in FL: (1) the accurate classification of lines of code according to their suspiciousness scores, and (2) the class imbalance inherent in this type of problem.
Jesus-Angel del-Hoyo-Gabaldon, Antonio Garcia-Cabot, Eva García-López et al.· Applied Sciences· 0 citations
The identification of vulnerabilities in software and their clones is crucial for secure software development, but achieving high accuracy whilst maintaining a scalable detection system is difficult. We introduce Amber, a semantic-aware framework that utilizes semantic embeddings, structural program features, and similarity metrics to construct a multi-channel representation, which is fed to a convolutional neural network (CNN) for vulnerability detection, and then further employed in a FAISS-based semantic similarity search for finding vulnerable code segments that can be reused in other large codebases. In addition to real-world data from open-source repository data sets, Amber is assessed on 12,303 vulnerable functions and 21,057 non-vulnerable functions from the SARD vulnerability database. Regarding accuracy, recall, and F1-score, Amber demonstrated superior performance over several leading baselines, including VulCNN, VulDeePecker, SySeVR, and Devign. In addition, Amber enables post-classification vulnerable clone detection, providing a deep understanding of vulnerabilities through hidden and subtle vulnerable clones. This work provides a scalable and explainable framework for development and security practitioners, helping to advance the automation of vulnerability and their clone detection and improve software security practices overall.
Gurpreet Singh, Dhavleesh Rattan· International journal of com...· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.