Treffer: FNCD-CS: A neurocomputing-optimized hybrid neural network for cross-domain code search.
Weitere Informationen
Code search is pivotal for enhancing software development efficiency, yet existing deep learning models face critical limitations in cross-domain scenarios from a neural network perspective: single-modality feature extraction lacks dedicated neural modules to model code-specific syntactic dependencies, and information loss arises from gradient degradation during deep neural training—two inherent challenges of neural networks when processing structured code data. To address these issues, we propose FNCD-CS, a neurocomputing-optimized neural network architecture with a layered, synergistic design: (1) fastText initializes lexical embeddings by simulating morphological recognition in biological neural systems. It uses character n-gram splitting to resolve the out-of-vocabulary limitation of fixed-vocabulary embedding models; (2) a 2-head self-attention module constructs global syntactic dependency graphs, overcoming the local feature bias of traditional neural networks by simultaneously capturing token-level and structure-level relationships; (3) residual connections establish "short-circuit paths" for feature transmission, alleviating gradient vanishing-induced information loss and preserving 89.7 % of syntactic features in deep layers; (4) an LSTM-based domain adapter imitates synaptic plasticity via gated weight adjustment, aligning cross-domain syntactic feature spaces without retraining. Experimental results on Java (source domain) and three target domain datasets demonstrate that FNCD-CS outperforms four baseline models. It achieves 7.61 %-15.26 % higher H@1-H@3 accuracy over all baselines and a 21.90 % MRR improvement compared to the state-of-the-art cross-domain model AdaCS. This performance gain stems from the synergistic optimization of its neural modules: self-attention enhances syntactic feature discrimination, residual connections preserve feature integrity, and the LSTM adapter boosts cross-domain transferability. Notably, FNCD-CS maintains real-time inference efficiency at 50 queries per second—17.5 % faster than AdaCS—owing to optimized neural computation complexity with 234k parameters, 34.3 % fewer than AdaCS. Source code can be extracted from: https://share.weiyun.com/ngCifCi. [ABSTRACT FROM AUTHOR]