[论文解读] KiloGrams: Very Large N-Grams for Malware Classification
本文提出 KiloGrams,一种高效提取最大频率 n-gram 的方法,即使在 n 极大(≥1024)时亦能实现,克服了以往在计算效率和过拟合方面的顾虑。尽管 n-gram 尺寸巨大,该方法仍能生成具有预测性且可解释的特征,用于恶意软件分类,当与梯度提升树结合使用时,在 EMBER 数据集上的性能可媲美专业人工设计的特征。
N-grams have been a common tool for information retrieval and machine learning applications for decades. In nearly all previous works, only a few values of n are tested, with n>6 being exceedingly rare. Larger values of n are not tested due to computational burden or the fear of overfitting. In this work, we present a method to find the top-k most frequent n-grams that is 60× faster for small n, and can tackle large n≥1024. Despite the unprecedented size of n considered, we show how these features still have predictive ability for malware classification tasks. More important, large n-grams provide benefits in producing features that are interpretable by malware analysis, and can be used to create general purpose signatures compatible with industry standard tools like Yara. Furthermore, the counts of common n-grams in a file may be added as features to publicly available human-engineered features that rival efficacy of professionally-developed features when used to train gradient-boosted decision tree models on the EMBER dataset.
研究动机与目标
- 解决历史上因计算不可行性和过拟合风险而将 n-gram 分析限制在小 n 值(n≤6)的问题。
- 开发一种可扩展的方法,即使在 n 极大(≥1024)时也能高效识别最频繁的 top-k n-gram。
- 证明尽管 n-gram 尺寸庞大,大 n-gram 仍保有恶意软件分类的预测能力。
- 生成与恶意软件分析实践一致、可解释的特征,并支持与行业工具(如 Yara)集成。
- 证明 n-gram 计数可增强公开的人工设计特征,使其性能与专业开发的特征相当。
提出的方法
- 提出一种新算法,通过优化频率计数和剪枝策略,实现小 n 情况下 60 倍的速度提升。
- 通过利用高效的数据结构和流式处理技术,将方法扩展至 n≥1024,以管理内存和计算开销。
- 从二进制文件中提取最频繁的 n-gram,将其视为字节序列。
- 将提取的 n-gram 用作机器学习模型中的二值化或基于计数的特征。
- 通过从频繁 n-gram 生成 Yara 兼容签名,支持与现有恶意软件分析工作流的集成。
- 将 n-gram 特征与标准人工设计特征(如 EMBER 中的特征)结合,并训练梯度提升决策树以评估性能。
实验结果
研究问题
- RQ1是否能够以可接受的计算成本,大规模高效地提取 n≥1024 的 n-gram?
- RQ2尽管 n-gram 尺寸庞大且存在过拟合风险,大 n-gram 是否仍保有恶意软件分类的预测能力?
- RQ3大 n-gram 是否能生成可解释且适用于现实世界恶意软件分析工作流的特征?
- RQ4当 n-gram 特征与人工设计特征结合时,是否能实现与专业开发特征相当的恶意软件检测性能?
- RQ5提取的 n-gram 是否可用于生成通用的、与 Yara 兼容的签名?
主要发现
- 所提方法在小 n 情况下实现 60 倍的 top-k n-gram 提取速度提升,支持可扩展处理。
- 该方法成功在 n=1024 及以上时提取 top-k n-gram,此前因计算限制而不可行。
- 大 n-gram(n≥1024)仍对恶意软件分类具有预测能力,证明其在小 n 之外仍具实用性。
- n-gram 特征具有可解释性,可生成用于实际部署的 Yara 兼容签名。
- 当与公开的人工设计特征结合时,n-gram 特征在 EMBER 数据集上的性能可媲美专业开发的特征。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。