Metraipolis › archive › dc_0f62a731dbbd
Embedding Drift in Code Vulnerability Models Under Intended Behaviour-Preserving Transformations — arXiv:2609.21203
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2609.21203
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-10T02:04:09.352Z
- SHA-256 of the archived text
00ec2107f0031c726a12936566a95e3b9cb9bd4605123cfab1075e1ff6ce33cd- Stable URL of this page
https://metraipolis.com/documento/dc_0f62a731dbbd
How to cite
Embedding Drift in Code Vulnerability Models Under Intended Behaviour-Preserving Transformations — arXiv:2609.21203 — arXiv (en), https://arxiv.org/abs/2609.21203 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_0f62a731dbbd (Metraipolis archive dc_0f62a731dbbd, sha256 00ec2107f0031c726a12936566a95e3b9cb9bd4605123cfab1075e1ff6ce33cd)
BibTeX
@misc{dc0f62a731dbbd,
title = {Embedding Drift in Code Vulnerability Models Under Intended Behaviour-Preserving Transformations — arXiv:2609.21203},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2609.21203},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_0f62a731dbbd; sha256 00ec2107f0031c726a12936566a95e3b9cb9bd4605123cfab1075e1ff6ce33cd},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.21203. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Code edits that preserve program behaviour can shift frozen code embeddings across classifier decision boundaries, causing correctly detected vulnerabilities to be predicted as benign. Such instability is problematic because semantically neutral changes, including comment removal, insertion of unreachable code, variable renaming, and loop rewriting, should not alter a model's security judgment. We investigate this issue using 15,000 C/C++ functions organized as 7,500 vulnerable-patched pairs from the Big-Vul dataset. Four mutation tracks are applied to both vulnerable and benign samples: comment removal, unreachable code insertion, variable renaming, loop rewriting, and a combined setting that applies all transformations. Using frozen microsoft/codebert-base embeddings with six downstream classifiers, we evaluate the robustness of vulnerability predictions and introduce a train-only defence that projects clean and mutated representations closer together while preserving vulnerability-class information. Under combined mutations, the baseline Vulnerable Flip Rate (VFR) ranges from 35.55% to 42.15%. The proposed defence reduces the mean common-set VFR from 22.60% to 11.32% and improves mean mutated accuracy from 55.33% to 57.10%. For Logistic Regression, VFR decreases by 17.29 percentage points, although benign-to-vulnerable flips increase by 11.95 percentage points. These results indicate that the defence improves robustness to semantics-preserving code transformations but introduces a false-positive trade-off and does not fully eliminate prediction instability. Tema degli esploratori: calcolo e infrastrutture (retro-catalogo arXiv: annunci del 2026-09-21 in cs.SE). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2609.21203 — 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-10-10T01:43:39.830Z dalla pagina https://arxiv.org/catchup/cs.SE/2026-09-21?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).