Metraipolis › archive › dc_a1143248d555

PatchCon: Patch-aware Weighted Supervised Contrastive Learning for Vulnerability Detection — arXiv:2611.06583

Source
arXiv (en)
Original
https://arxiv.org/abs/2611.06583
License (as archived)
CC0-1.0
Archived
2026-11-05T18:26:31.742Z
SHA-256 of the archived text
a8cdfb0b0b534c6a66efdef4fb45a1aa5ff9e96316154780d95caf88c81f43ce
Stable URL of this page
https://metraipolis.com/documento/dc_a1143248d555

How to cite

PatchCon: Patch-aware Weighted Supervised Contrastive Learning for Vulnerability Detection — arXiv:2611.06583 — arXiv (en), https://arxiv.org/abs/2611.06583 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_a1143248d555 (Metraipolis archive dc_a1143248d555, sha256 a8cdfb0b0b534c6a66efdef4fb45a1aa5ff9e96316154780d95caf88c81f43ce)
BibTeX
@misc{dca1143248d555,
  title = {PatchCon: Patch-aware Weighted Supervised Contrastive Learning for Vulnerability Detection — arXiv:2611.06583},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2611.06583},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_a1143248d555; sha256 a8cdfb0b0b534c6a66efdef4fb45a1aa5ff9e96316154780d95caf88c81f43ce},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2611.06583. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Automated vulnerability detection is critical for securing modern software systems, yet existing learning-based approaches often treat functions as independent samples and underuse the supervision provided by vulnerability-fixing patches. In this paper, we propose PatchCon, a CodeBERT-based patch-aware contrastive learning model for function-level vulnerability detection. PatchCon jointly optimizes vulnerability classification and supervised contrastive learning, and treats vulnerable-patched function pairs as hard negatives with larger contrastive weights to capture subtle security-relevant differences introduced by fixes. To evaluate patch-level discrimination, we use two pairwise metrics that measure whether a model can correctly distinguish vulnerable functions from their patched counterparts. We evaluate PatchCon on PairVul-Linux through extensive experiments, including state-of-the-art comparisons, ablation studies, hyperparameter sensitivity analysis, and statistical significance testing. We also conduct fine-grained analyses by Common Weakness Enumeration (CWE) type, function length, and patch size, and further evaluate PatchCon on Linux kernel vulnerabilities disclosed after the training data cutoff. On PairVul-Linux, PatchCon outperforms representative pretrained code models and contrastive learning baselines on both classification and pairwise metrics, improves pairwise accuracy over the strongest reproduced baseline from 0.2060 to 0.3264, and achieves pairwise accuracy comparable to that of a GPT-4o-based large language model (LLM) method at a substantially lower cost. Among the reproduced models, PatchCon also achieves the highest pairwise accuracy on test pairs from Common Vulnerabilities and Exposures (CVE) entries unseen during training and on newly disclosed vulnerabilities.

Tema degli esploratori: calcolo e infrastrutture (elenco arXiv cs.SE, nuovi lavori del giorno).
Categorie arXiv: Software Engineering (cs.SE).
Pagina del lavoro: https://arxiv.org/abs/2611.06583 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-11-05T18:16:03.886Z dalla pagina https://arxiv.org/list/cs.SE/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).