Skip to main content
QUICK REVIEW

[论文解读] Lens: A Knowledge-Guided Foundation Model for Network Traffic

Xiaochang Li, Qian Chen|arXiv (Cornell University)|Feb 6, 2024
Network Traffic and Congestion Control被引用 4
一句话总结

Lens 是一种用于网络流量的基础模型,采用 T5 编码器-解码器架构,通过一种新颖的多任务预训练目标,从大规模未标注流量数据中学习表征。该目标结合了掩码片段预测、数据包顺序预测和同源流量预测。Lens 在流量理解与生成任务中均达到最先进性能,相比先前方法,微调所需数据量减少了 50%–95%。

ABSTRACT

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 extbf{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 extbf{30.46\%} and extbf{33.3\%} better accuracy and F1 in fuzzing tests. We will open-source the code upon publication.

研究动机与目标

  • 为解决异构、加密且语义稀疏的网络流量数据分析挑战。
  • 开发一种统一的基础模型,同时在流量理解与生成任务中表现卓越,克服仅编码器或仅解码器架构的局限性。
  • 通过在未标注流量上进行有效预训练,降低下游任务对大规模标注数据的依赖。
  • 设计一种多任务预训练目标,以捕捉网络流量中的全局结构、序列顺序和关系模式。
  • 通过提示工程微调,实现在多样化网络流量任务上的强零样本和少样本泛化能力。

提出的方法

  • 将网络流量分词为十六进制序列,并评估多种分词方法,包括使用预定义词汇表的 WordPiece。
  • 采用 T5 架构作为主干模型,通过编码器-解码器注意力机制,联合学习理解与生成任务的表征。
  • 设计一种结合三项任务的多任务预训练目标:掩码片段预测(MSP)、数据包顺序预测(POP)和同源流量预测(HTP)。
  • 使用复合损失函数,联合优化 MSP(去噪)、POP(序列顺序建模)和 HTP(跨流关系学习)。
  • 在微调阶段应用特定任务的提示,仅使用少量标注数据,将 Lens 适配至下游任务。
  • 采用标准指标评估性能:理解任务使用准确率/F1,生成任务使用 JSD/TVD。

实验结果

研究问题

  • RQ1基于 T5 架构的基础模型能否有效从原始、未标注的网络流量数据中学习潜在表征?
  • RQ2结合 MSP、POP 和 HTP 的多任务预训练目标是否能同时提升流量理解与生成性能?
  • RQ3与现有预训练方法相比,Lens 在微调阶段对标注数据的需求减少程度如何?
  • RQ4该模型在多样化数据集和网络流量任务中(包括未预训练过的任务)的泛化能力如何?
  • RQ5各项预训练任务(MSP、POP、HTP)对最终模型性能的相对贡献是什么?

主要发现

  • 与基线模型相比,Lens 在数据包级理解任务中平均准确率提升 10.75%,在流级任务中提升 0.59%。
  • 在流量生成方面,Lens 相较于 NetShare,平均将 Jensen–Shannon 散度(JSD)降低 62%,将总变差距离(TVD)降低 77%。
  • Lens 在所有生成任务中均优于 NetShare,包括在未进行预训练的 CrossPlatform 数据集上。
  • 与 SOTA 方法(如 ET-BERT 和 YaTC)相比,Lens 微调所需标注数据量减少 50% 至 95%。
  • 消融实验表明,预训练和 MSP 对生成性能至关重要,当移除 MSP 时,JSD 上升 77%。
  • 同时包含三项预训练任务的完整模型性能最高,证实了 MSP、POP 和 HTP 的互补性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。