No train, no pain: a training-free few-shot traffic classifier based on LLMs
Open Access
- 22 July 2026
- journal article
- research article
- Published by Springer Nature in Cybersecurity
- Vol. 9 (1) , 194
Abstract
Encrypted web traffic and evolving Internet technologies pose an increasing challenge to network traffic analysis. However, existing traffic classification methods, though effective, require large labeled datasets and complex training. This makes sustaining them prohibitively expensive and difficult in real-world scenarios. To narrow this gap, we propose a novel training-free few-shot network traffic classification framework based on large language models (LLMs). By integrating meta-learning with LLMs, it reduces reliance on labeled data, eliminates task-specific training, and improves performance. Specifically, we first apply an efficient feature extraction method to extract features from traffic flows. We then design meta-tasks that combine task descriptions with textualized features to produce natural language meta-task formulations. Building on these meta-tasks, the LLM performs reasoning to carry out traffic classification. Finally, to mitigate hallucination in the LLM outputs, we exploit the temporal characteristics of network traffic and aggregate predictions over samples within a defined time window. Extensive experiments on three widely-used encrypted traffic datasets demonstrate that our proposed framework outperforms the state-of-the-art methods, achieving an average absolute improvement in F1 score of 9.75, 9.82, and 12.06 percentage points on the three datasets, respectively.Keywords
Funding Information
- Key Technologies Research and Development Program (2023YFC2206402)
- the Strategic Priority Research Program of the Chinese Academy of Sciences (XDA0460100)
- Key Laboratory of Cyberspace Security, Ministry of Education of China (KLCS20240206)
- Key Laboratory of Network Assessment Technology, Chinese Academy of Sciences
- Beijing Key Laboratory of Network Security and Protection Technology
This publication has 37 references indexed in Scilit:
- Towards trustworthy LLMs: a review on debiasing and dehallucinating in large language modelsArtificial Intelligence Review, 2024
- Adversarial examples: A survey of attacks and defenses in deep learning-enabled cybersecurity systemsExpert Systems with Applications, 2023
- Detach and unite: A simple meta-transfer for few-shot learningKnowledge-Based Systems, 2023
- GAN augmentation to deal with imbalance in imaging-based intrusion detectionFuture Generation Computer Systems, 2021
- Multitask Learning for Network Traffic Classification2020
- A Network Intrusion Detection Method Based on Stacked Autoencoder and LSTM2020
- Semi-Supervised Encrypted Traffic Classification With Deep Convolutional Generative Adversarial NetworksIEEE Access, 2020
- Variational data generative model for intrusion detectionKnowledge and Information Systems, 2018
- LSTM for Anomaly-Based Network Intrusion Detection2018
- AppScanner: Automatic Fingerprinting of Smartphone Apps from Encrypted Network Traffic2016