arXiv:2607.28100cs.NIcs.CL2026-07

用精简文本表示流量,让大模型轻松分析加密网络数据。

PCAP-LM: An LLM-Native Text Representation for TLS Bulk Traffic Analysis

  • 将原始流量转为语义摘要,用自创符号编码包方向、状态和时间间隔。
  • 压缩比达812倍,单次可装入大模型上下文,推理速度提升显著。
  • 适合网络安全人员做流量溯源,但对重传包检测有遗漏。

大语言模型(LLM)在网络安全分析中具备强大推理能力,但标准捕获格式及其文本化表示过于冗长,超出LLM上下文窗口两个数量级。本文提出PCAP-LM,一种面向流的、专为LLM设计的文本表示方法,作为有损知识提取步骤而非传统压缩工具:原始数据通过PacketGlyphs——一种新提出的ASCII字符集,编码包方向、TCP/TLS状态、对数尺度大小及包间延迟——转化为语义摘要。结合受限的PMI-BPE分词器与模式运行长度编码,重复行为被大幅压缩。@REFS侧索引保留了对原始包的无损回溯能力。在5G/4G TLS 1.3批量下载流量的同质数据集上,PMI-BPE词汇表完全饱和于159个词元,相比tshark -V实现812倍压缩,使整个捕获文件可放入单一LLM上下文窗口。在30个预留文件的取证问答任务中,前沿大模型使用PCAP-LM文档达到99.3%准确率,而同等词元预算下的tshark -V前缀仅得51.0%。有损设计引入已知盲区——尤其对TCP重传的漏检率达24%——扩展至异构混合协议环境需重新训练词表。

原文摘要 · Abstract (English)

Large language models (LLMs) offer powerful reasoning capabilities for network traffic analysis, but standard capture formats and their textual equivalents are prohibitively verbose, overflowing LLM context windows by two orders of magnitude. We present PCAP-LM, a flow-centric, LLM-native text representation that acts as a lossy knowledge extraction step rather than a standard compression tool: raw captures are transcoded into semantic summaries using PacketGlyphs - a novel ASCII alphabet coined in this paper that encodes packet direction, TCP/TLS state, log-scale size, and inter-packet delay. Combined with a constrained PMI-BPE tokenizer and motif run-length encoding, repetitive behavioural patterns are aggressively collapsed. A @REFS side-index preserves lossless drill-down into the original packets. Evaluated on a homogeneous corpus of 5G/4G TLS 1.3 bulk-download traffic, the BPE vocabulary fully saturates at 159 tokens, achieving an 812x size reduction over tshark -V and fitting entire captures within a single LLM context window. In a forensic question-answering evaluation over 30 held-out files, a frontier LLM achieves 99.3% accuracy from PCAP-LM documents versus 51.0% from a token-budget-matched tshark -V prefix. The lossy design introduces known blind spots - most notably a 24% false-negative rate for TCP retransmissions - and extending to heterogeneous mixed-protocol environments will require vocabulary retraining.

网络分析大模型流量压缩安全检测

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