MARGIN: Margin-Aware Regularized Geometry for Imbalanced Vulnerability Detection
Not on the map. Why?
Abstract (arXiv)
Software vulnerability detection is critical for ensuring software security and reliability. Despite recent advances in deep learning, real-world vulnerability datasets suffer from two severe challenges: frequency imbalance and difficulty imbalance. We reinterpret these challenges from an embedding geometry perspective, observing that such imbalances induce geometric distortions in hyperspherical representation space. To address this issue, we propose MARGIN, a metric-based framework that learns discriminative vulnerability representations through adaptive margin metric learning and hyperspherical prototype modeling. MARGIN dynamically adjusts geometric regularization according to the distribution structure estimated by the von Mises-Fisher concentration, aligning the probability mass of embedding distributions with their corresponding Voronoi cells, thereby reducing geometric distortion and yielding more stable decision boundaries. Extensive experiments on public vulnerability datasets show that MARGIN consistently outperforms strong baselines, achieving notable improvements in classification and detection, especially on challenging, imbalanced datasets. Further analysis demonstrates that MARGIN produces more structured embedding geometries, improving robustness, interpretability, and generalization.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 23 of its 38 references that are in the map. First posted on arXiv 11 May 2026.
Builds on
23 of 38 references.
References · 23
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2019Class-Balanced Loss Based on Effective Number of Samplescited by 1,245
- 2018CosFace: Large Margin Cosine Loss for Deep Face Recognitioncited by 971
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 719
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
- 2017L2-constrained Softmax Loss for Discriminative Face Verificationcited by 96
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
11 more
- 2019Hyperspherical Prototype Networkscited by 86
- 2023Deep Neural Collapse Is Provably Optimal for the Deep Unconstrained Features Modelcited by 43
- 2023Loss Functions and Metrics in Deep Learningcited by 42
- 2024ReposVul: A Repository-Level High-Quality Vulnerability Datasetcited by 36
- 2024MegaVul: A C/C++ Vulnerability Dataset with Comprehensive Code Representationcited by 27
- 2024Guiding Neural Collapse: Optimising Towards the Nearest Simplex Equiangular Tight Framecited by 14
- 2022KappaFace: Adaptive Additive Angular Margin Loss for Deep Face Recognitioncited by 11
- 2024Data Quality Issues in Vulnerability Detection Datasetscited by 5
- 2025One-for-All Does Not Work! Enhancing Vulnerability Detection by Mixture-of-Experts (MoE)cited by 4
- 2023LIVABLE: Exploring Long-Tailed Classification of Software Vulnerability Typescited by 3
- 2026An Empirical Study of the Imbalance Issue in Software Vulnerability Detectioncited by 1
Built on by
Not cited yet.