arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.07573cs.LGcs.CR
收藏

用于CVE到CWE映射的多类与多标签BERT:分类法结构如何塑造错误

Multi-Class vs. Multi-Label BERT for CVE-to-CWE Mapping: How Taxonomy Structure Shapes the Errors

mindsquare AG(明思夸尔有限公司);Bochum University of Applied Sciences(波鸿应用科学大学)

Ana Schwengber Kelm, Christian Bockermann, Jörg Frochte

AI总结:

研究将CVE记录映射到CWE类别的文本分类任务,比较多类与多标签BERT建模,在三个嵌套标签空间评估三个编码器。多类训练宏F1更高,错误模式受分类法影响大,放宽层次结构评估可提升指标,CySecBERT总体结果最佳。

摘要:

将通用弱点枚举(CWE)类别分配给通用漏洞披露(CVE)记录在漏洞分析中仍然是一个重要但很大程度上依赖人工的步骤。我们将此任务作为文本分类问题进行研究,并比较两种建模选择:一种是为每个CVE预测单个CWE的多类表述,另一种是允许多个分配的多标签表述。在三个嵌套标签空间(83、47和25类)上评估了三个Transformer编码器(BERT Base、SecureBERT和CySecBERT)。多类训练在所有设置中都实现了更高的宏F1,尽管随着标签空间缩小,与多标签的差距从21个百分点缩小到2个百分点。多标签方面的事后阈值优化在25类设置上缩小了这一差距。混淆分析表明,主要的错误分类模式遵循CWE层次结构,并且在所有三个编码器中都是共享的(Pearson r>0.92),这表明错误结构更多地由分类法设计而非编码器选择驱动。一种放宽层次结构的评估,即容忍家族内的混淆,将宏F1从约81%提高到约90%,表明严格的指标低估了分支级分类器的质量。CySecBERT总体上取得了最强的结果,在多标签设置中取得了具有统计学意义的显著提升。

英文摘要:

Assigning Common Weakness Enumeration (CWE) categories to Common Vulnerabilities and Exposures (CVE) records remains an important but largely manual step in vulnerability analysis. We study this task as a text classification problem and compare two modelling choices: a \emph{multi-class} formulation that predicts a single CWE per CVE and a \emph{multi-label} formulation that allows multiple assignments. Three transformer encoders (BERT Base, SecureBERT, and CySecBERT) are evaluated on three nested label spaces (83, 47, and 25 classes). Multi-class training achieves higher macro-F1 across all settings, although the gap to multi-label narrows from 21 to 2 percentage points as the label space shrinks. Post-hoc threshold optimisation on the multi-label side closes this gap on the 25-class setting. Confusion analysis shows that the dominant misclassification patterns follow the CWE hierarchy and are shared across all three encoders (Pearson $r > 0.92$), which suggests that the error structure is driven more by taxonomy design than by encoder choice. A hierarchy-relaxed evaluation that forgives within-family confusions raises macro-F1 from ${\sim}$81\% to ${\sim}$90\%, indicating that strict metrics understate branch-level classifier quality. CySecBERT achieves the strongest results overall, with statistically significant gains concentrated in the multi-label setting.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑