Lens: A Knowledge-Guided Foundation Model for Network Traffic

📄 arXiv: 2402.03646v5 📥 PDF

作者: Xiaochang Li, Chen Qian, Qineng Wang, Jiangtao Kong, Yuchen Wang, Ziyu Yao, Bo Ji, Long Cheng, Gang Zhou, Huajie Shao

分类: cs.LG, cs.NI

发布日期: 2024-02-06 (更新: 2026-01-14)


💡 一句话要点

提出Lens模型以解决网络流量分类与生成问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 网络流量分析 知识引导 Transformer模型 流量分类 流量生成 上下文感知微调 深度学习

📋 核心要点

  1. 现有方法在网络流量分析中忽视了网络知识,导致语义理解受限,且在微调时难以扩展到新类别。
  2. 本文提出Lens模型,通过知识引导的掩码跨度预测方法学习丰富的网络表示,并将分类任务重构为生成任务以应对分布转移。
  3. 实验结果显示,Lens在12个任务中有8个任务的分类准确率达到96.33%,并在流量生成中显著提高了准确率和F1值。

📝 摘要(中文)

网络流量是指通过互联网或连接计算机的任何系统发送和接收的数据量。分析网络流量对于安全和管理至关重要,但由于明文数据包头和加密负载的异质性,分析仍然具有挑战性。为捕捉流量的潜在语义,近期研究采用基于Transformer的预训练技术从大量流量数据中学习网络表示。然而,这些方法在数据驱动任务上进行预训练,但忽视了网络知识,限制了语义理解。为此,本文提出Lens,一个统一的知识引导基础模型,旨在同时进行网络流量分类和生成。通过知识引导的掩码跨度预测方法,Lens在预训练中学习知识丰富的表示,并通过上下文感知微调来适应分布转移。实验结果表明,Lens在分类和生成任务上均表现优异。

🔬 方法详解

问题定义:本文旨在解决网络流量分类和生成中的语义理解不足及新类别扩展困难的问题。现有方法主要依赖数据驱动的预训练,未能有效利用网络知识,导致性能受限。

核心思路:论文提出Lens模型,通过知识引导的掩码跨度预测方法,结合文本上下文,学习更丰富的网络表示。同时,将流量分类任务重构为生成任务,以适应分布转移的挑战。

技术框架:Lens模型包括预训练和微调两个主要阶段。在预训练阶段,采用知识引导的掩码跨度预测方法;在微调阶段,利用上下文感知微调策略来适应新类别。

关键创新:Lens的主要创新在于引入知识引导的掩码跨度预测方法,结合上下文信息,显著提升了网络流量的语义理解能力,与传统方法相比具有本质区别。

关键设计:在模型设计中,采用特定的损失函数来优化知识引导的表示学习,并在微调阶段调整网络结构以适应新类别的流量数据。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在实验中,Lens在12个任务中有8个任务的分类准确率达到96.33%,显著优于竞争基线。同时,在流量生成任务中,Lens在模糊测试中实现了高达30.46%和33.3%的准确率和F1值提升,展示了其强大的生成能力。

🎯 应用场景

Lens模型在网络安全、流量管理和网络模拟等领域具有广泛的应用潜力。通过提高网络流量的分类和生成能力,Lens能够帮助网络管理员更有效地监控和管理网络流量,从而增强网络安全性和效率。未来,Lens的开源将促进相关领域的研究与应用发展。

📄 摘要(原文)

Network traffic refers to the amount of data being sent and received over the Internet or any system that connects computers. Analyzing network traffic is vital for security and management, yet remains challenging due to the heterogeneity of plain-text packet headers and encrypted payloads. To capture the latent semantics of traffic, recent studies have adopted Transformer-based pretraining techniques to learn network representations from massive traffic data. However, these methods pre-train on data-driven tasks but overlook network knowledge, such as masking partial digits of the indivisible network port numbers for prediction, thereby limiting semantic understanding. In addition, they struggle to extend classification to new classes during fine-tuning due to the distribution shift. Motivated by these limitations, we propose \Lens, a unified knowledge-guided foundation model for both network traffic classification and generation. In pretraining, we propose a Knowledge-Guided Mask Span Prediction method with textual context for learning knowledge-enriched representations. For extending to new classes in finetuning, we reframe the traffic classification as a closed-ended generation task and introduce context-aware finetuning to adapt to the distribution shift. Evaluation results across various benchmark datasets demonstrate that the proposed Lens~achieves superior performance on both classification and generation tasks. For traffic classification, Lens~outperforms competitive baselines substantially on 8 out of 12 tasks with an average accuracy of \textbf{96.33\%} and extends to novel classes with significantly better performance. For traffic generation, Lens~generates better high-fidelity network traffic for network simulation, gaining up to \textbf{30.46\%} and \textbf{33.3\%} better accuracy and F1 in fuzzing tests. We will open-source the code upon publication.