Lune

FSE2025Top-tier venue

One-for-All Does Not Work! Enhancing Vulnerability Detection by Mixture-of-Experts (MoE)

Xu Yang, Shaowei Wang, Jiayuan Zhou, Wenhan Zhu

Abstract

Deep Learning-based Vulnerability Detection (DLVD) techniques have garnered significant interest due to their ability to automatically learn vulnerability patterns from previously compromised code. Despite the notable accuracy demonstrated by pioneering tools, the broader application of DLVD methods in real-world scenarios is hindered by significant challenges. A primary issue is the “one-for-all” design, where a single model is trained to handle all types of vulnerabilities. This approach fails to capture the patterns of different vulnerability types, resulting in suboptimal performance, particularly for less common vulnerabilities that are often underrepresented in training datasets. To address these challenges, we propose MoEVD, which adopts the Mixture-of-Experts (MoE) framework for vulnerability detection. MoEVD decomposes vulnerability detection into two tasks, CWE type classification and CWE-specific vulnerability detection. By splitting the task, in vulnerability detection, MoEVD allows specific experts to handle distinct types of vulnerabilities instead of handling all vulnerabilities within one model. Our results show that MoEVD achieves an F1-score of 0.44, significantly outperforming all studied state-of-the-art (SOTA) baselines by at least 12.8%. MoEVD excels across almost all CWE types, improving recall over the best SOTA baseline by 9% to 77.8%. Notably, MoEVD does not sacrifice performance on long-tailed CWE types; instead, its MoE design enhances performance (F1-score) on these by at least 7.3%, addressing long-tailed issues effectively.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Towards Secure Logging: Characterizing and Benchmarking Logging Code Security Issues with LLMs cites Vulnerability detection with fine-grained interpretations
  • Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability Detection cites Towards Causal Deep Learning for Vulnerability Detection
  • Towards Causal Deep Learning for Vulnerability Detection cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Towards Causal Deep Learning for Vulnerability Detection cites GraphCodeBERT: Pre-training Code Representations with Data Flow
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability DetectionXin Peng, Bo Lin, Jing Wang, Xiaoling Li et al.FSE 2026 · 1 citation
  2. Towards Secure Logging: Characterizing and Benchmarking Logging Code Security Issues with LLMsHe Yang Yuan, Xin Wang, Kundi Yao, An Ran Chen et al.FSE 2026

Builds on10

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  2. GShard: Scaling Giant Models with Conditional Computation and Automatic ShardingDmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen et al.ICLR 2021 · 1,954 citations
  3. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
  4. Vulnerability detection with fine-grained interpretationsYi Li, Shaohua Wang, Tien N. NguyenFSE 2021 · 283 citations
  5. Towards Causal Deep Learning for Vulnerability DetectionMd Mahbubur Rahman, Ira Ceka, Chengzhi Mao, Saikat Chakraborty et al.ICSE 2024 · 22 citations

Related papers

  1. Rethinking Mixture-of-Experts for Vulnerability Detection: An Empirical Study and Improved DesignRongze Jiang, Chaofeng Sha, Xin PengISSTA 2026
  2. Leveraging Mixture-of-Experts Framework for Smart Contract Vulnerability Repair with Large Language ModelHang Yuan, Xizhi Hou, Lei Yu, Li Yang et al.ASE 2025 · 1 citation
  3. Applying Contrastive Learning to Code Vulnerability Type ClassificationChen Ji, Su Yang, Hongyu Sun, Yuqing ZhangEMNLP 2024 · 6 citations
  4. Toward Improved Deep Learning-based Vulnerability DetectionAdriana Sejfia, Satyaki Das, Saad Shafiq, Nenad MedvidovicICSE 2024 · 14 citations
  5. DeepVD: Toward Class-Separation Features for Neural Network Vulnerability DetectionWenbo Wang, Tien N. Nguyen, Shaohua Wang, Yi Li et al.ICSE 2023 · 32 citations
Dusk over the sea between two cliffs drawn in fine vertical lines