# NetGPT: Generative Pretrained Transformer for Network Traffic

Source: [NetGPT: Generative Pretrained Transformer for Network Traffic](<https://www.sota2.com/research/paper/68fa7af91e209131cea86123>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-26T05:30:46.040Z

Authors: Xuying Meng, Chungang Lin, Yequan Wang, Yujun Zhang

Published: 2023-04-19T09:04:30.000Z

## Abstract

All data on the Internet are transferred by network traffic, thus accurately modeling network traffic can help improve network services quality and protect data privacy. Pretrained models for network traffic can utilize large-scale raw data to learn the essential characteristics of network traffic, and generate distinguishable results for input traffic without considering specific downstream tasks. Effective pretrained models can significantly optimize the training efficiency and effectiveness of downstream tasks, such as application classification, attack detection and traffic generation. Despite the great success of pretraining in natural language processing, there is no work in the network field. Considering the diverse demands and characteristics of network traffic and network tasks, it is non-trivial to build a pretrained model for network traffic and we face various challenges, especially the heterogeneous headers and payloads in the multi-pattern network traffic and the different dependencies for contexts of diverse downstream network tasks.   To tackle these challenges, in this paper, we make the first attempt to provide a generative pretrained model NetGPT for both traffic understanding and generation tasks. We propose the multi-pattern network traffic modeling to construct unified text inputs and support both traffic understanding and generation tasks. We further optimize the adaptation effect of the pretrained model to diversified tasks by shuffling header fields, segmenting packets in flows, and incorporating diverse task labels with prompts. With diverse traffic datasets from encrypted software, DNS, private industrial protocols and cryptocurrency mining, expensive experiments demonstrate the effectiveness of our NetGPT in a range of traffic understanding and generation tasks on traffic datasets, and outperform state-of-the-art baselines by a wide margin.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Service Classification on ISCXVPN NonVPN 2016](<https://www.sota2.com/research/sota/service-classification-on-iscxvpn-nonvpn-2016.md>): Service Classification; ISCXVPN NonVPN 2016; ACC: 66.18.

- [Service Classification on ISCXVPN 2016 (Mixed)](<https://www.sota2.com/research/sota/service-classification-on-iscxvpn-2016-mixed.md>): Service Classification; ISCXVPN 2016 (Mixed); Accuracy: 69.73.

- [Traffic Detection on ISCXTor NonTor 2016](<https://www.sota2.com/research/sota/traffic-detection-on-iscxtor-nontor-2016.md>): Traffic Detection; ISCXTor NonTor 2016; Accuracy: 96.55.

- [IoT/IoMT Attack Detection on CICIoMT 2024 (test)](<https://www.sota2.com/research/sota/iot-iomt-attack-detection-on-ciciomt-2024-test.md>): IoT/IoMT Attack Detection; CICIoMT 2024 (test); Accuracy: 89.58.

- [Traffic Detection on ISCX Tor 2016](<https://www.sota2.com/research/sota/traffic-detection-on-iscx-tor-2016.md>): Traffic Detection; ISCX Tor 2016; Accuracy: 85.06.

- [Network Traffic Analysis on CICIoMT2024 Proportion-shift](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciomt2024-proportion-shift.md>): Network Traffic Analysis; CICIoMT2024 Proportion-shift; Accuracy: 87.69.

- [Network Traffic Analysis on CICIoT2023 Time-shift](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciot2023-time-shift.md>): Network Traffic Analysis; CICIoT2023 Time-shift; Accuracy: 38.54.

- [Network Traffic Analysis on CICIoT2023 Proportion-shift](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciot2023-proportion-shift.md>): Network Traffic Analysis; CICIoT2023 Proportion-shift; Accuracy: 75.35.

- [Network Traffic Analysis on CICIoMT Time-shift 2024](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciomt-time-shift-2024.md>): Network Traffic Analysis; CICIoMT Time-shift 2024; Accuracy: 49.42.

- [Network Traffic Analysis on CICIoMT Compose-shift 2024](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciomt-compose-shift-2024.md>): Network Traffic Analysis; CICIoMT Compose-shift 2024; Accuracy: 71.16.

- [Network Traffic Analysis on CICIoT Compose-shift 2023](<https://www.sota2.com/research/sota/network-traffic-analysis-on-ciciot-compose-shift-2023.md>): Network Traffic Analysis; CICIoT Compose-shift 2023; Accuracy: 55.08.

- [IoT/IoMT Attack Detection on CICIoT 2023 (test)](<https://www.sota2.com/research/sota/iot-iomt-attack-detection-on-ciciot-2023-test.md>): IoT/IoMT Attack Detection; CICIoT 2023 (test); Mean F1 Score: 69.62.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2304.09513>)

[PDF](<https://arxiv.org/pdf/2304.09513.pdf>)
