arXiv:2603.20181cs.CRcs.AI2026-03

用文本指导代码分类,提升模型在网络安全任务中的泛化能力

Improving Generalization on Cybersecurity Tasks with Multi-Modal Contrastive Learning

  • 用文本描述引导代码特征学习,构建语义对齐的嵌入空间
  • 在真实与合成数据上均减少模型对表面模式的依赖
  • 适合关注模型鲁棒性与跨模态迁移的网络安全研究者

机器学习在网络安全中的应用长期受限于泛化能力:在受控环境下表现良好的模型在实际部署中性能下降。根本原因常是算法学习了表层模式(捷径)而非底层安全概念。本文探索对比多模态学习作为提升网络安全任务性能的第一步。目标是将数据丰富的模态(如文本)知识迁移到数据稀缺的模态(如恶意载荷)。以威胁分类为案例,提出两阶段多模态对比学习框架,利用文本漏洞描述指导载荷分类。首先,在漏洞描述上使用对比学习构建语义有意义的嵌入空间;随后,将载荷对齐至该空间,实现从文本到载荷的知识迁移。在大规模私有数据集和基于公开CVE描述与大模型生成载荷的合成基准上评估,该方法在两个基准上均有效降低基线模型的捷径学习现象。我们开源了合成基准和源代码。

原文摘要 · Abstract (English)

The use of ML in cybersecurity has long been impaired by generalization issues: Models that work well in controlled scenarios fail to maintain performance in production. The root cause often lies in ML algorithms learning superficial patterns (shortcuts) rather than underlying cybersecurity concepts. We investigate contrastive multi-modal learning as a first step towards improving ML performance in cybersecurity tasks. We aim at transferring knowledge from data-rich modalities, such as text, to data-scarce modalities, such as payloads. We set up a case study on threat classification and propose a two-stage multi-modal contrastive learning framework that uses textual vulnerability descriptions to guide payload classification. First, we construct a semantically meaningful embedding space using contrastive learning on descriptions. Then, we align payloads to this space, transferring knowledge from text to payloads. We evaluate the approach on a large-scale private dataset and a synthetic benchmark built from public CVE descriptions and LLM-generated payloads. The methodology appears to reduce shortcut learning over baselines on both benchmarks. We release our synthetic benchmark and source code as open source.

多模态学习网络安全对比学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。