arXiv:2611.03319cs.CRNov 2026

Manuscript Offprint

arXiv:2611.03319

TrafficInstruct: A Multi-Task Network Traffic Dataset and Benchmark for Instruction Tuning

Zhengdao Li, Hui Wen, Zixuan Wan, Weifeng Zhang, Yan Wu, Benlong Wu, Nenghai Yu, Weiming Zhang, Kejiang Chen

Zhengdao Li, Hui Wen, Zixuan Wan, Weifeng Zhang, Yan Wu, Benlong Wu, Nenghai Yu, Weiming Zhang, and Kejiang Chen ∗^{*}

Abstract—Instruction tuning for multi-task network traffic analysis requires data resources with clearly defined collection sources, supervision targets, and evaluation conditions. We introduce TrafficInstruct, a newly collected dataset comprising raw packet captures and 55,000 structured supervised fine-tuning records across ten tasks: malware traffic detection, botnet detection, malicious DNS-over-HTTPS detection, Web attack detection, advanced persistent threat detection, encrypted VPN detection, Tor behavior detection, encrypted application/service classification, website fingerprinting, and application classification under concept drift. An automated workflow captures traffic from controlled software executions, attack experiments, and application activities. Task-specific labels are supported by evidence from the corresponding collection scenarios, including process or socket attribution, activity records, and execution outcomes. Filtering, sanitization, and task-specific transformations produce instructions, traffic observations, and structured answers. Task-specific input preparation converts traffic observations into model prompts for baseline evaluation. We verified the collection source of every sample and partitioned the dataset by complete collection sessions, assigning all samples from the same session to one partition. The benchmark specifies allowed inputs, deterministic label mappings, fixed training, validation, and test partitions, and task-wise scoring rules.

We evaluate majority-class, random-forest, and ET-BERT baselines, an unadapted 27B language model, and independently trained task-specific LoRA adapters on a shared frozen base. Each adapter is selected using its task's validation set and evaluated on the corresponding test set. Task-specific adaptation improves classification performance, supporting the dataset's use for instruction tuning across diverse traffic-analysis tasks.

Index Terms—Network traffic analysis, multi-task benchmark, instruction tuning, parameter-efficient fine-tuning, encrypted traffic classification.

I. INTRODUCTION

NETWORK traffic analysis supports security monitoring and the identification of communication behaviors. Its tasks require different judgments, from recognizing threats to identifying applications and services in encrypted communications. These judgments draw on related network observations, such as protocols, packet lengths, directions, and timing, but have different label semantics and observation requirements. Instruction tuning provides a way to express such tasks through natural-language instructions and structured prediction targets [1]. Using this approach across multiple

tasks requires training resources that connect each instruction to an appropriate traffic representation and a clearly defined target. The usefulness of these resources depends on how traffic is collected, how labels are assigned, and how training and evaluation samples are organized.

Existing research has advanced both traffic-model adaptation and benchmark design. NetBench organizes seven public datasets into classification and generation tasks, with standardized preprocessing and PCAP-level partitioning before flow and packet extraction to reduce leakage between related observations [2]. TrafficLLM combines traffic-domain tokenization, instruction and traffic tuning, and extensible parameter-efficient adaptation across diverse analysis tasks [1]. These studies provide foundations for studying traffic representations and comparing models across tasks. They also motivate complementary resources whose collection conditions, attribution evidence, and task definitions can be examined together. Combining datasets broadens task coverage, while their original collection and labeling conditions remain relevant to interpreting results. A common instruction format alone does not establish equivalent label evidence or evaluation conditions. Researchers therefore need to know which observations a model may access, what evidence supports each target, and how derived samples relate to their collection sources.

We introduce TrafficInstruct, a newly collected network traffic dataset for supervised instruction tuning across ten parallel tasks: malware traffic detection, botnet detection, malicious DNS-over-HTTPS (DoH) detection, Web attack detection, advanced persistent threat (APT) detection, encrypted VPN detection, Tor behavior detection, encrypted application/service classification, website fingerprinting, and application classification under concept drift. The complete resource contains 55,000 serialized SFT records. Traffic is produced through controlled software executions, attack experiments, and application activities, with an automated workflow coordinating execution, capture, and quality checks. Labels draw on evidence appropriate to each collection scenario, including process or socket attribution, activity records, and execution outcomes. Task-specific filtering and sanitization convert the captured observations into instructions, traffic inputs, and structured targets. Task-specific input preparation converts traffic observations into model prompts, with the experimental input conditions described in Section V-A. The dataset provides task-specific traffic representations, structured answers, and fixed training, validation, and test partitions. We verified the collection source of every sample and kept all samples from the same complete collection session in one

The authors are with the School of Cyberspace Security, University of Science and Technology of China, Hefei, China (e-mail: zhengdaoli@mail.ustc.edu.cn; harry0597@mail.ustc.edu.cn; zixuanwan@mail.ustc.edu.cn; wf_zhang@mail.ustc.edu.cn; wuy4n@mail.ustc.edu.cn; dizzylong@mail.ustc.edu.cn; ynh@ustc.edu.cn; zhangwm@ustc.edu.cn; chenkj@ustc.edu.cn).

∗^{*}Corresponding author: Kejiang Chen.

Figure

Fig. 1. Conceptual overview of instruction-conditioned traffic classification, inspired by the task-specific adaptation approach of TrafficLLM [1]. Instructions define the task, traffic observations provide its input, and the corresponding adapter specializes a frozen language-model base. Snowflake and flame symbols denote frozen and trainable components. The task panels, token notation, NLP block, and output categories are schematic; our benchmark supplies the task identity and uses independently trained task-specific adapters, with separate adapters for the plaintext and encrypted Web views.

partition.

To support comparison across all ten tasks, our benchmark design specifies allowed inputs, deterministic label projections, fixed training/validation/test partitions, and task-wise scoring rules. Inspired by TrafficLLM's task-specific parameter-efficient adaptation approach [1], we organize the language-model baseline around a shared frozen base and independently trained task-specific PEFT modules. Figure 1 presents the conceptual workflow: a natural-language instruction specifies the classification task and answer format, while the serialized traffic provides the observation to be classified. Together, they form the input to the shared base with the adapter corresponding to the known task. Each adapter is trained on its own task's training split and selected using that task's validation split; at inference, it generates a structured prediction in the task's label space. The task-identification panel therefore represents supplied task context, while the token examples and output categories illustrate the information flow. Our baseline adopts the task-specific adaptation principle rather than reproducing TrafficLLM's tokenizer or dual-stage training pipeline; the figure's NLP block is schematic and is not a separately trained module in our experiments. Majority-class and random-forest classifiers, together with a fine-tuned ET-BERT baseline, provide complementary comparisons across the same task scope.

We evaluate classification performance across all ten tasks, compare task-specific adaptation with statistical, ET-BERT, and unadapted language-model baselines, and analyze differences between coarse and fine-grained predictions. Together, the dataset and empirical evaluation provide a basis for studying how instruction models learn different traffic-analysis tasks from newly collected observations.

Our contributions are threefold:

  • A newly collected multi-task instruction resource. We bring together ten traffic-analysis tasks with task-specific structured targets and existing data splits, including task-specific traffic views and observation granularities.

  • An explicit construction and evaluation methodology. We describe controlled collection, label evidence, filtering, and sanitization, verify sample sources, and partition samples by complete collection sessions to prevent same-

session leakage across training, validation, and test sets.

  • A task-wise empirical baseline evaluation. We report accuracy and Macro-F1 for statistical baselines, ET-BERT, and a 27B language model with and without task-specific LoRA, and analyze performance differences across tasks and label levels.

References (28)