Skip to main navigation Skip to search Skip to main content

UF-CDDFM: A unified framework for code defect detection using multi-modal inputs and few-shot learning

  • Xianglu Zhou
  • , Tianxiang Cui*
  • , Xiaoyan Zhu
  • , Jiayin Wang
  • , Xin Lai
  • *Corresponding author for this work

Research output: Journal PublicationArticlepeer-review

Abstract

Context: The detection of code defects is foundational to modern software development and maintenance, playing a critical role in ensuring software quality and security. However, as software systems grow in scale and complexity, the limitations of traditional static analysis and conventional machine learning techniques have become increasingly evident. These methods rely heavily on intricate, manual feature engineering and fail to capture dynamic runtime behavior, resulting in suboptimal accuracy and elevated error rates. Objective: To address these deficiencies, we propose UF-CDDFM, a unified framework for code defect detection that integrates multi-modal inputs, active learning, and state-of-the-art few-shot learning techniques. We aim to improve detection performance, reduce feature selection complexity and sample bias through active learning, and maintain practical efficiency in real-world development contexts. Methods: UF-CDDFM employs parallel encoding of source code, code annotations, and abstract syntax trees (ASTs) using large language models (LLMs) alongside multilayer perceptrons (MLPs) to derive robust, high-fidelity representations of code. To streamline feature selection and mitigate sample bias, an active learning component is introduced for automated identification of high-quality features. Addressing the pervasive challenge of data scarcity, we incorporate two complementary few-shot learning strategies-MAML for small-scale datasets and LEO for larger-scale settings to enhance overall generalization capability. Results: Empirical evaluations demonstrate that UF-CDDFM consistently outperforms existing methods, establishing new state-of-the-art detection rates: 72.04% for defect detection and 95.23% for clone detection. Crucially, these gains are achieved within resource-constrained computational environments, which highlights the practicality of the method. Conclusion: By fusing multi-modal code representations, active learning, and adaptive few-shot learning techniques, UF-CDDFM delivers significant improvements in detection accuracy and computational efficiency. This work offers a new paradigm for robust, scalable, and practical code defect and clone detection in modern software engineering.

Original languageEnglish
Article number107942
JournalInformation and Software Technology
Volume190
DOIs
Publication statusPublished - Feb 2026

Free Keywords

  • Active learning
  • Code defect detection
  • Few-shot learning
  • Large language models

ASJC Scopus subject areas

  • Software
  • Information Systems
  • Computer Science Applications

Fingerprint

Dive into the research topics of 'UF-CDDFM: A unified framework for code defect detection using multi-modal inputs and few-shot learning'. Together they form a unique fingerprint.

Cite this