Focus on What Matters: Fisher-Guided Adaptive Multimodal Fusion for Vulnerability Detection
Yun Bian, Yi Chen, HaiQuan Wang, ShiHao Li, Zhe Cui
TL;DR
This work tackles multimodal vulnerability detection by addressing redundancy and asymmetry between Natural Code Sequences (NCS) and Code Property Graphs (CPG). It introduces TaCCS-DFA, a Fisher-information-guided fusion framework that first aligns modalities and then restricts cross-modal interaction to a task-sensitive subspace via dynamic Fisher attention, augmented by an adaptive gating mechanism. Theoretical analysis shows a tighter robustness bound under isotropic noise, and empirical results on BigVul, Devign, and ReVeal demonstrate improved F1 scores and calibration across backbones, with strong performance under class imbalance. The approach offers practical benefits by reducing noise propagation and maintaining efficiency, suggesting a scalable path for robust, interpretable multimodal vulnerability detection in real-world pipelines.
Abstract
Software vulnerability detection is a critical task for securing software systems and can be formulated as a binary classification problem: given a code snippet, determine whether it contains a vulnerability. Existing multimodal approaches typically fuse Natural Code Sequence (NCS) representations from pretrained language models with Code Property Graph (CPG) representations from graph neural networks, often under the implicit assumption that adding a modality necessarily yields extra information. In practice, sequence and graph representations can be redundant, and fluctuations in the quality of the graph modality can dilute the discriminative signal of the dominant modality. To address this, we propose TaCCS-DFA, a framework that introduces Fisher information as a geometric measure of how sensitive feature directions are to the classification decision, enabling task-oriented complementary fusion. TaCCS-DFA online estimates a low-rank principal Fisher subspace and restricts cross-modal attention to task-sensitive directions, thereby retrieving structural features from CPG that complement the sequence modality; meanwhile, an adaptive gating mechanism dynamically adjusts the contribution of the graph modality for each sample to suppress noise propagation. Our analysis shows that, under an isotropic perturbation assumption, the proposed mechanism admits a tighter risk bound than conventional full-spectrum attention. Experiments on BigVul, Devign, and ReVeal show that TaCCS-DFA achieves strong performance across multiple backbones. With CodeT5 as the backbone, TaCCS-DFA reaches an F1 score of 87.80\% on the highly imbalanced BigVul dataset, improving over a strong baseline Vul-LMGNNs by 6.3 percentage points while maintaining low calibration error and computational overhead.
