Manuscript Offprint
arXiv:2611.07452Understanding Self-Supervised Representation Learning for Encrypted Traffic
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Zongxi Liu, Shuai Mao, Jie Chuai, and Hongyang Du
Abstract—Self-supervised learning (SSL) has been adopted for encrypted traffic classification to learn representations from unlabeled traces and reduce reliance on manual feature engineering. However, recent studies show that data leakage can inflate reported performance and that pretrained models can underperform shallow classifiers once leakage is controlled. These findings raise fundamental questions about what information SSL can learn from encrypted traffic and how different pretraining mechanisms exploit this information. In this paper, we systematically investigate these questions by examining the sources of learnable information, the effectiveness of contextual pretraining, alternative self-supervision mechanisms, and the limits of representation learning. We first find that visible protocol fields retain contextual dependencies that are strongest between adjacent bytes, while payload interventions establish the classification value of retained plaintext structure. Guided by these insights, we investigate byte-level contextual learning through ByteBERT and TrafficDCNet, showing that aligning prediction granularity with local dependencies produces more discriminative representations than existing contextual pretraining approaches. We further examine cross-view contrastive learning through AlignTraffic and find that complementary supervision improves representation quality beyond contextual prediction alone. Across four public classification tasks, AlignTraffic outperforms shallow learning by 5.97 to 30.70 percentage points in Macro-F1, with additional evaluations on industrial traffic and geographic transfer demonstrating its effectiveness in broader settings. Finally, evaluations on Tor traffic and individual packets reveal limitations when application information is concealed or unevenly distributed. These findings provide a systematic understanding of how observable information and self-supervision mechanisms shape the effectiveness and scope of representation learning for encrypted traffic.
Index Terms—Encrypted traffic classification, self-supervised learning, representation learning, contrastive learning.
I. INTRODUCTION
Traffic classification is an important task in network measurement and security analysis, as it aims to understand system behavior, application usage, and security events by identifying applications or services from their communications. Early systems relied on transport ports and deep packet inspection (DPI), which recognizes signatures in packet contents [1]. However, the widespread adoption of Transport Layer Security (TLS) has made much of that content opaque, reducing the information available to payload inspection [2]. In response, classifiers instead use observable statistical properties of traffic through feature engineering without parsing the encrypted payload [3], [4]. These task-specific approaches relying on feature engineering nevertheless offer limited transferability across classification settings.
More recently, advances in self-supervised pretraining in natural language processing (NLP) and computer vision (CV) have motivated learning traffic representations from unlabeled traces to reduce reliance on feature engineering. ET-BERT adapts BERT-style masked language modeling (MLM) to overlapping two-byte units [5]. Subsequent models, including YaTC and NetMamba, explore different input granularities and contextual pretraining objectives [6], [7]. However, recent analyses question whether encrypted traffic provides the contextual dependencies assumed by these methods. Zhao et al. [8] report weak pretrained representations and show that data leakage from packet-level splitting can inflate downstream classification accuracy. Once these shortcuts are controlled, the advantage of contextual pretraining over shallow classifiers becomes much less evident [9]. These findings motivate us to revisit the basis and effectiveness of pretraining for encrypted traffic.
From a cryptographic perspective, ciphertext produced by secure encryption is expected to offer little exploitable byte-level context [10]. Yet observed TLS traces also contain unencrypted protocol metadata, including record headers and parts of the handshake. These visible fields may retain dependencies that support pretraining even when ciphertext does not. Understanding the effectiveness of encrypted-traffic pretraining therefore requires considering both the remaining observable structure and effective signal sources of self-supervision. We organize this investigation around four questions.
Q1. What information remains learnable in encrypted traffic? Observed encrypted traffic contains both protocol-visible plaintext and ciphertext. Whether the visible fields retain contextual dependencies useful for pretraining is central to establishing what can be learned.
Q2. How can contextual pretraining better exploit the available dependencies? If useful dependencies exist, their range, strength, and distribution determine how they can support prediction. These characteristics should guide the choice of input units and learning objectives.
Q3. Can alternative pretraining paradigms be effective for encrypted traffic? When contextual dependencies are absent or weak, other sources of supervision like contrastive learning may still support representation learning.
Q4. What are the limits of pretraining for encrypted traffic? Traffic settings differ in the application information they expose, and proxy encapsulation can further conceal that information. Whether current pretraining methods remain effective across these settings determines their practical scope.
Zongxi Liu and Hongyang Du are with the Department of Electrical and Computer Engineering, The University of Hong Kong, Hong Kong SAR, China (e-mail: duhy@hku.hk).
Shuai Mao and Jie Chuai are with Huawei Noah's Ark Lab, Hong Kong SAR, China.
| header | payload | |
|---|---|---|
| App | Encrypted: payload | |
| TLS | Plaintext: length, cipher suites, etc. | |
| TCP | Plaintext: port, sequence number, etc. | |
| IP | Plaintext: IP address, checksum, etc. | |
Fig. 1. Protocol stack and observable fields in TLS-encrypted traffic. The payload includes visible TLS metadata and encrypted content.
Our findings are as follows.
-
Protocol-visible fields retain useful local contextual dependencies. Their byte dependence is substantially stronger than that measured in ciphertext, and the retained payload structure carries classification-relevant information.
-
Byte dependencies in protocol-visible regions are strongest between adjacent bytes, yet existing contextual pretraining schemes do not fully exploit this local structure. Experiments with ByteBERT and TrafficDCNet show that matching prediction granularity to these dependencies yields more discriminative representations and improves performance over the existing schemes.
-
Cross-view contrastive learning complements contextual prediction. AlignTraffic improves frozen representations over both constituent encoders and exceeds shallow learning in fine-tuned Macro-F1 on the main public tasks. Industrial classification and geographic transfer provide further evidence of its utility, although these gains come with additional computational overhead.
-
The effectiveness of pretraining depends on the available application information and the classification unit. Some encapsulated-traffic and individual-packet settings remain challenging for the evaluated representations.
A. Datasets and Preprocessing
TLS is the most widely deployed protocol for securing Internet communications. As shown in Fig. 1, a classic TLS packet contains IP and TCP headers followed by a transport payload carrying TLS records. The outer headers expose addressing and transport metadata. Within the payload, TLS record headers reveal framing information, including record length, and unencrypted handshake messages expose selected protocol parameters. The retained payload therefore combines visible protocol fields with ciphertext.
We use the ISCX suite and CSTNET to study encrypted traffic from different collection environments. We reorganize ISCX traces by access setting into ISCX-Direct, which uses a direct connection, and ISCX-VPN, which uses a VPN proxy [3]. CSTNET contains TLS 1.3 traffic collected on the China Science and Technology Network [5].
The original ISCX traces also include plaintext and non-target traffic. Following the protocol-based preprocessing of Zhao et al. [8], we remove plaintext flows using protocol types decoded by tshark. We then measure the zero-order entropy of the retained payloads. Table I reports post-filtering values of 7.97 and 7.95 bits for ISCX-Direct and ISCX-VPN, respectively, close to the 8-bit maximum for a byte.
TABLE I DATASET STATISTICS AND PAYLOAD ENTROPY BEFORE AND AFTER PREPROCESSING.
| Dataset | Packets | H0(S) | ||
|---|---|---|---|---|
| Before | After | Before | After | |
| ISCX-Direct | 15 715 358 | 2 776 290 | 5.70 | 7.97 |
| ISCX-VPN | 2 816 966 | 321 414 | 7.08 | 7.95 |
| CSTNET | 12 049 643 | — | 7.97 | — |

Fig. 2. Application-exclusive 5-tuple ratios. ISCX-Direct and ISCX-VPN show per-application ratios. CSTNET shows a weighted mean across its applications, with weights proportional to their numbers of distinct 5-tuples.
B. Tasks, Inputs, and Evaluation
We consider two classification tasks. Flow-level classification assigns an application label to a bidirectional TCP flow using its first five retained packets in temporal order. Packet-level classification predicts the parent flow's label from one packet. In both cases, we partition flows before extracting samples, keeping all packets from the same flow in one partition [8]. We follow the CSTNET split protocol of Zhao et al. and use a category-wise 50%/50% flow split for the reorganized ISCX data. Model selection uses three-fold validation within the training partition. CSTNET and ISCX-Direct support flow-level evaluation, while ISCX-VPN, with only 966 independent retained flows, is evaluated at packet level. We also consider packet-level ISCX-Direct and CSTNET.
Source and destination identifiers can provide collection-specific shortcuts. For each application, we measure the fraction of its distinct 5-tuples that occur in no other application. Fig. 2 shows that many tuples are application-exclusive. In unfrozen flow-level CSTNET classification, retaining these identifiers raises ET-BERT's Macro-F1 from 60.04% to 85.23% and YaTC's from 74.42% to 92.92%. We therefore mask IP addresses, transport ports, and the remaining 5-tuple fields in all main public comparisons.
We report accuracy (Acc) and Macro-F1. Acc measures the overall fraction of correct predictions, while Macro-F1 averages class-specific F1 scores with equal weight and therefore captures recognition across imbalanced classes. We report both frozen and unfrozen results. In the frozen setting, the pretrained encoder is fixed and only the classifier is trained, which directly reflects the quality of the learned representation.
In the unfrozen setting, the entire model is fine-tuned to reflect end-to-end performance.
Our contextual baselines are ET-BERT, YaTC, and Net-Mamba [5]–[7]. We also compare with Pcap-Encoder and shallow classifiers, both of which have been reported to outperform contextual pretraining baselines under flow-disjoint evaluation [8], [11]–[13]. Our models comprise two byte-level encoders, ByteBERT and TrafficDCNet, and their alignment framework, AlignTraffic. We introduce their designs in Sections IV and V. Public baselines use released implementations or checkpoints. Appendix Cand D provides reproducibility information.
III. LEARNING FROM PROTOCOL-VISIBLE STRUCTURE
A. Entropy and Mutual Information
We first examine byte-level dependence in the retained payloads. For a sequence over the byte alphabet , let denote the empirical byte distribution. At lag , let be the empirical joint distribution of pairs with . Its marginals are and , with .
We compute marginal entropy, conditional entropy, and mutual information as
(1)
measures marginal byte uncertainty and is at most 8 bits. measures the uncertainty in the later byte given the earlier byte, while measures their shared information. We compute these statistics over the full retained payload and additionally estimate within its protocol-visible and ciphertext regions.
Fig. 3 shows a consistent pattern across ISCX-Direct, ISCX-VPN, and CSTNET. Although full-payload conditional entropy remains close to 8 bits, nonzero mutual information reveals residual byte dependence that peaks between adjacent bytes and generally decreases with lag. Region-specific analysis indicates that this dependence comes primarily from protocol-visible plaintext, which exhibits substantially stronger dependence and follows the same pattern across lags. Ciphertext mutual information remains close to zero across the measured lags, consistent with its expected randomness. The local dependencies retained in visible protocol fields therefore provide a basis for contextual pretraining.
B. Payload Interventions on CSTNET
To further assess the classification value of the visible protocol fields, we conduct controlled payload interventions on CSTNET. CSTNET removes the TCP handshake and the initial client TLS ClientHello. Its first retained packet can still contain visible server-side handshake information, while later

Fig. 3. Payload entropy and mutual information across byte lags. Bars show marginal entropy at k = 0 and conditional entropy at positive lags. Solid, dashed, and dotted curves show mutual information for the full payload, protocol-visible plaintext, and ciphertext, respectively.
| No. | Time | Source | Destination | Protocol | Length Info |
|---|---|---|---|---|---|
| 1 | 0.000004 | 150.242.169.100 | 150.242.169.100 | TLSv1.3 | 1014 Server Hello, Change Cipher Spec |
| 2 | 0.000004 | 104.18.16.13 | 150.242.169.100 | TLSv1.3 | 1323 Application Data |
| 3 | 0.002112 | 150.242.169.100 | 104.18.16.13 | TCP | 68 52804 = 443 [ACC] Seq-1 Ack=2730 Min=821 Len=0 |
| 4 | 0.005380 | 150.242.169.100 | 104.18.16.13 | TLSv1.3 | 118 Change Cipher Spec, Application Data |
| 5 | 0.005722 | 150.242.169.100 | 104.18.16.13 | TLSv1.3 | 146 Application Data |
| 6 | 0.006207 | 150.242.169.100 | 104.18.16.13 | TLSv1.3 | 966 Application Data |
Fig. 4. An example of the retained five-packet prefix in CSTNET. The first retained packet contains server-side TLS handshake information, while the following packets primarily contain TLS-encrypted payload.
TABLE II
UNFROZEN FLOW-LEVEL CLASSIFICATION ON CSTNET UNDER PAYLOAD INTERVENTIONS USING ALIGNTRAFFIC. ACC IS IN PERCENTAGE.
| Payload intervention | Acc |
|---|---|
| Original | 90.35 |
| Shuffle payload | 63.28 |
| Random payload | 60.63 |
| Shuffle only 1st packet payload | 61.14 |
| Shuffle except 1st packet payload | 89.04 |
packets primarily carry encrypted payload. Fig. 4 illustrates a five-packet prefix with this structure.
We therefore examine whether the model can exploit the plaintext protocol information retained in the payload for application classification. Using AlignTraffic as a classification probe, we compare the original input with versions that shuffle only the first packet's payload or only the remaining four packets' payloads. We also shuffle all payload bytes or replace them with random values as two additional controls.
Table II shows that shuffling only the remaining four packets yields 89.04% accuracy, close to the original 90.35%. Shuffling the first retained packet instead reduces accuracy to 61.14%, comparable to shuffling the entire payload at 63.28% or randomizing it at 60.63%. The classification-relevant payload structure is thus concentrated in the first retained packet. Together with the region-specific dependence measurements, these results support the role of visible protocol fields in application classification.
IV. EXPLOITING LOCAL DEPENDENCIES WITH BYTE-LEVEL MODELS
A. Prediction Granularity and Local Context
Section III shows that protocol-visible plaintext in encrypted traffic retains contextual dependencies and provides useful information for application classification. However, Zhao et al. [8] report that shallow classifiers can match or outperform existing pretrained models after controlling for data leakage. This motivates us to examine whether current input representations and pretraining objectives allow models to exploit the available protocol structure effectively.
We notice that Fig. 3 shows that byte dependence in protocol-visible regions is strongest between adjacent bytes and generally decreases with lag. To exploit this local structure, the input units and masking policy should preserve informative neighboring bytes as context.
However, ET-BERT's tokenizer encodes overlapping two-byte units [5]. For bytes , the units are , , and . When the middle unit is masked but its neighbors remain visible, both target bytes are still present in the input. Token recovery can therefore exploit these overlapping copies, weakening the need to learn dependencies between distinct original bytes.
YaTC masks whole patches and minimizes mean squared error (MSE) [6]. Adjacent bytes within a masked patch are hidden together, removing their mutual context. MSE also treats bytes as numerical values and favors a conditional mean under uncertainty, although traffic bytes are discrete symbols. NetMamba similarly masks groups of bytes within a stride [7]. These observations suggest that current contextual pretraining methods do not fully exploit local byte dependencies, motivating byte-level input and prediction objectives that preserve informative neighboring context.
B. Byte-Level Contextual Models
Building on this analysis, we develop two byte-level models designed to exploit neighboring-byte dependencies and evaluate whether better use of this local structure improves pretrained representations and downstream classification.
ByteBERT. We adapt the ET-BERT formulation so that each byte occupies one token position. Single-byte targets remove overlapping copies and allow neighboring unmasked bytes to serve as context.
For raw traffic , every byte occupies one token position, giving with . The encoder produces token representations and a pooled global representation
For sample , each valid position is independently selected with probability to form . The corrupted sequence is . For a batch of samples and , the objective is

Fig. 5. TrafficDCNet with one dynamic-chunking stage.
This formulation exposes neighboring original byte positions to the objective whenever they remain uncorrupted. We match the BERT [14] backbone configuration and training schedule to ET-BERT, while only the vocabulary and prediction units differ.
TrafficDCNet. ByteBERT fixes the input unit at one byte. We further consider whether a model can learn how to group bytes as part of representation learning. Inspired by tokenizer-free hierarchical sequence models [15]–[17], TrafficDCNet embeds raw bytes and learns content-dependent boundaries through dynamic chunking. This design can adapt its internal resolution to the heterogeneous structure of visible fields and ciphertext without a fixed multi-byte vocabulary.
As shown in Fig. 5, its U-Net encoder [18] progressively compresses the byte sequence. A causal Mamba-2 bottleneck [19] processes the compressed states, and a decoder restores the original byte resolution through dechunking and skip connections. Appendix A provides the full architecture, dynamic chunking and dechunking operations, and ratio regularizer.
TrafficDCNet is pretrained by next-byte prediction. With , its objective is
(4)
The ratio loss regularizes dynamic chunking toward the target retained fractions. The encoder returns
ByteBERT uses bidirectional masked prediction, while TrafficDCNet combines causal next-byte prediction with adaptive grouping. Both retain byte-resolution outputs, making them suitable for examining local context with different views.
C. Classification and Representation Quality
Table III compares the five contextual models on flow-level CSTNET and ISCX-Direct. ByteBERT and TrafficDCNet both improve frozen Macro-F1 over ET-BERT, YaTC, and NetMamba. On CSTNET, ByteBERT reaches 48.91% and TrafficDCNet reaches 58.80%, compared with 35.79% for the strongest of these baselines. On ISCX-Direct, their scores
TABLE III FLOW-LEVEL CLASSIFICATION WITH CONTEXTUAL PRETRAINING ON CSTNET AND ISCX-DIRECT. ACC AND MACRO-F1 ARE PERCENTAGES, REPORTED AS MEAN ± STANDARD DEVIATION.
| Method | CSTNET | ISCX-Direct | ||||||
|---|---|---|---|---|---|---|---|---|
| Frozen | Unfrozen | Frozen | Unfrozen | |||||
| Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | |
| ET-BERT | 17.89 ± 1.31 | 11.49 ± 1.81 | 62.56 ± 0.87 | 60.04 ± 0.68 | 23.20 ± 1.68 | 3.77 ± 1.58 | 71.00 ± 1.49 | 56.85 ± 1.55 |
| YaTC | 38.04 ± 1.04 | 35.79 ± 1.74 | 74.52 ± 0.55 | 74.42 ± 1.27 | 65.68 ± 0.74 | 55.08 ± 1.06 | 77.22 ± 1.69 | 61.31 ± 2.00 |
| NetMamba | 14.40 ± 1.38 | 11.80 ± 0.87 | 79.44 ± 0.99 | 77.10 ± 0.85 | 32.07 ± 0.57 | 24.45 ± 1.78 | 67.48 ± 0.74 | 65.57 ± 0.80 |
| ByteBERT | 53.20 ± 0.90 | 48.91 ± 0.55 | 88.62 ± 1.27 | 86.16 ± 1.65 | 71.92 ± 1.81 | 62.55 ± 1.24 | 86.49 ± 1.52 | 77.39 ± 0.65 |
| TrafficDCNet | 62.10 ± 1.14 | 58.80 ± 1.71 | 88.24 ± 0.68 | 85.98 ± 1.66 | 71.33 ± 1.40 | 63.70 ± 1.49 | 78.44 ± 1.08 | 67.74 ± 1.88 |

Fig. 6. 5NN-purity of frozen CSTNET flow representations under different modeling granularities. Each category gives the number of same-class neighbors among five nearest neighbors. Values above the bars denote mean purity.
are 62.55% and 63.70%, compared with 55.08%. After fine-tuning, ByteBERT achieves 86.16% Macro-F1 on CSTNET and 77.39% on ISCX-Direct. These results support byte-level modeling as a way to use the available contextual signal.
We also measure the class consistency of frozen representations. A sample's 5NN-purity is the fraction of its five nearest neighbors that share its class label. Fig. 6 shows mean purity increasing from 0.065 for ET-BERT and 0.306 for YaTC to 0.617 for ByteBERT and 0.698 for TrafficDCNet. This improvement indicates that the byte-level encoders organize samples into more class-consistent neighborhoods before task-specific encoder adaptation. A similar pattern appears in the t-SNE projections [20] in Fig. 7. ByteBERT and TrafficDCNet exhibit compact local groups consistent with their higher purity and frozen classification scores.
We further visualize the models' predictions on their pre-training tasks in Fig. 8. YaTC minimizes MSE and achieves a low error of 0.0777, yet its reconstructions largely collapse toward mean byte values and fail to reproduce the original patterns at masked positions. ET-BERT recovers many masked tokens, but its sliding-window tokenization leaves copies of the target bytes in neighboring tokens. This shortcut allows accurate token recovery with little need to learn dependencies between distinct original bytes, consistent with its weak frozen

(a) ET-BERT

(b) YaTC

(c) ByteBERT

(d) TrafficDCNet
Fig. 7. t-SNE projections of frozen CSTNET flow representations. Each panel uses a model-specific subset of eight classes. Colors indicate class membership within each panel.
classification performance and low 5NN-purity. ByteBERT recovers part of the protocol-visible content through individual-byte prediction without overlapping target copies. Its higher frozen classification scores and 5NN-purity indicate that this contextual prediction produces more useful representations.
V. BEYOND CONTEXTUAL PREDICTION THROUGH CROSS-VIEW ALIGNMENT
A. Aligning Complementary Byte-Level Views
Section III identifies a source of contextual supervision, and Section IV shows how byte-level models can use it more effectively. Yet full-payload mutual information remains small because much of the observed sequence is encrypted. This raises the broader question of whether other pretraining paradigms can provide useful supervision when contextual prediction offers limited signal. One alternative is contrastive learning, which derives supervision from correspondence


(a) YaTC
(b) ET-BERT

(c) ByteBERT
Fig. 8. Qualitative pretraining examples. YaTC shows original, masked, reconstructed, and error images from top left to bottom right. In the byte examples, yellow marks headers, blue marks protocol-visible payload, and magenta marks TLS ciphertext. Green and red mark correct and incorrect predictions.

Fig. 9. Architecture of AlignTraffic.
between different views of the same instance rather than from contextual byte prediction [21], [22]. Such views are often constructed through transformations that preserve the instance's semantic content. For encrypted traffic, however, these transformations are difficult to design because modifying bytes may disrupt protocol structure or remove application-relevant information, while encryption obscures the content needed to assess whether semantics are preserved. We therefore build on the two byte-level encoders developed in Section IV, using their distinct modeling biases to construct complementary views of the same unmodified traffic sample. ByteBERT learns bidirectional dependencies through masked prediction over individual bytes, whereas TrafficDCNet combines causal next-byte prediction with adaptive byte grouping. These distinct modeling choices provide complementary views for alignment.
AlignTraffic aligns the global representations of these views and fuses their byte-level features. Appendix B provides the projection and fusion formulations and full definitions of the contrastive, matching, and MLM objectives.
Projection heads map the pooled features to normalized embeddings and in a shared space. A contrastive ob-
jective brings together the two representations of the same sample relative to those of different samples, using momentum encoders and feature queues [21], [22]. A fusion encoder applies cross-attention to the token-level representations, which share the original byte resolution. A matching objective trains the fused features to distinguish same-sample pairs from hard negative pairs.
Joint training also retains contextual supervision. The auxiliary fused-view MLM objective predicts bytes at synchronized corrupted positions in the two branches. With MLM weight and ratio-loss weight , the complete objective is
We first pretrain ByteBERT and TrafficDCNet independently, then initialize AlignTraffic from those encoders and optimize the joint objective. The correspondence objectives organize the complementary features around sample identity, while fused-view MLM preserves their connection to the observed bytes.
B. Classification with Cross-View Alignment
We next examine whether the additional supervision from cross-view alignment improves classification beyond contextual pretraining alone and whether AlignTraffic can outperform shallow learning, whose effectiveness was emphasized by Zhao et al. [8]. Tables IV and V compare AlignTraffic with shallow learning, Pcap-Encoder, and its two constituent encoders. The shallow baseline selects among Random Forest, XGBoost, and LightGBM using explicit TCP/IP and TLS features, including record statistics and visible ServerHello fields. Appendix D details the feature groups. For Pcap-Encoder, we report only unfrozen flow-level results. Following the original evaluation procedure, we obtain flow labels by majority voting over packet predictions [8].
After fine-tuning, AlignTraffic achieves the highest Macro-F1 among the compared methods on all four public tasks. On flow-level CSTNET and ISCX-Direct, it reaches 89.20% and 83.92%, exceeding shallow learning by 30.70 and 14.84 percentage points, respectively. It also outperforms Pcap-Encoder on both flow-level tasks. On packet-level ISCX-Direct and ISCX-VPN, its gains over shallow learning are 5.97 and 24.01 percentage points.
TABLE IV
FLOW-LEVEL CLASSIFICATION ON CSTNET AND ISCX-DIRECT. ACC AND MACRO-F1 ARE PERCENTAGES, REPORTED AS MEAN ± STANDARD DEVIATION.
| Method | CSTNET | ISCX-Direct | ||||||
|---|---|---|---|---|---|---|---|---|
| Frozen | Unfrozen | Frozen | Unfrozen | |||||
| Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | |
| Shallow learning | - | - | - | - | ||||
| Pcap-Encoder | - | - | - | - | ||||
| ByteBERT | ||||||||
| TrafficDCNet | ||||||||
| AlignTraffic | ||||||||
TABLE V
PACKET-LEVEL CLASSIFICATION ON ISCX-DIRECT AND ISCX-VPN. ACC AND MACRO-F1 ARE PERCENTAGES, REPORTED AS MEAN ± STANDARD DEVIATION.
| Method | ISCX-Direct | ISCX-VPN | ||||||
|---|---|---|---|---|---|---|---|---|
| Frozen | Unfrozen | Frozen | Unfrozen | |||||
| Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | |
| Shallow learning | - | - | - | - | ||||
| Pcap-Encoder | ||||||||
| ByteBERT | ||||||||
| TrafficDCNet | ||||||||
| AlignTraffic | ||||||||

(a) 5NN-purity
(b) AlignTraffic t-SNE
Fig. 10. Frozen CSTNET flow representations after cross-view alignment. Panel (a) compares ByteBERT, TrafficDCNet, and AlignTraffic using the purity categories in Fig. 6. Panel (b) projects eight classes using t-SNE.
Among the reported frozen results, AlignTraffic achieves the highest Macro-F1 on all four public tasks, outperforming both constituent encoders. On CSTNET, alignment raises the score from 48.91% for ByteBERT and 58.80% for TrafficDCNet to 64.22%. Packet-level ISCX-VPN shows the same progression, from 60.17% and 72.70% to 74.31%. The improvement with a fixed downstream encoder demonstrates that alignment strengthens the pretrained representation.
C. Representation Structure and Optimization
Fig. 10a compares the two byte-level encoders with Align-Traffic. Mean 5NN-purity increases from 0.617 for ByteBERT and 0.698 for TrafficDCNet to 0.727 after alignment. The aligned representation has the highest mean purity among the five encoders in the neighborhood analysis. Fig. 10b illustrates
the resulting class structure, with separated groups in the projected features.
Fig. 11(a) shows AlignTraffic recovering protocol-visible byte structure. The two loss curves in Fig. 11(b) and (c) connect independent ByteBERT pretraining to alignment training. ByteBERT's MLM loss decreases early and then stabilizes, whereas fused-view MLM continues to improve during Align-Traffic training. The continuous reference line makes this progression visible across the two stages. Summarising the frozen classification and purity results, these observations show that cross-view training improves how the encoders use the available information.
D. Objective Ablation
We retain the two-branch framework and remove individual objectives to assess their contributions. Table VI shows that removing both alignment objectives reduces frozen Macro-F1 by 17.33 percentage points on CSTNET and 16.60 percentage points on ISCX-Direct. Removing either contrastive or matching supervision also lowers performance. MLM makes a complementary contribution, with its removal producing the largest reduction in frozen Macro-F1. The full objective therefore benefits from both byte-level contextual learning and cross-view correspondence.
E. Industrial Classification and Geographic Transfer
We further evaluate AlignTraffic on a private industrial flow-classification dataset collected from March 2025 to March 2026. It covers 165 applications across multiple devices and network conditions. Inputs retain payloads from flows with at

(a) AlignTraffic MLM predictions

(b) ByteBERT MLM loss

(c) AlignTraffic MLM loss
Fig. 11. Masked-byte prediction and MLM training. In (a), yellow, blue, and magenta indicate headers, protocol-visible payload, and TLS ciphertext. Green and red indicate correct and incorrect predictions. Panels (b) and (c) count epochs within their respective pretraining stages. The continuous green dashed line connects the reference loss across the two panels.
TABLE VI
FLOW-LEVEL OBJECTIVE ABLATION ON CSTNET AND ISCX-DIRECT. ACC AND MACRO-F1 ARE PERCENTAGES.
| Method | CSTNET | ISCX-Direct | ||||||
|---|---|---|---|---|---|---|---|---|
| Frozen | Unfrozen | Frozen | Unfrozen | |||||
| Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | Acc | Macro-F1 | |
| AlignTraffic | 67.08 | 64.22 | 90.35 | 89.20 | 76.34 | 65.04 | 90.36 | 83.92 |
| w/o MLM | 35.84 | 29.97 | 83.03 | 80.76 | 41.59 | 26.44 | 68.60 | 55.50 |
| w/o contrastive | 58.75 | 53.87 | 82.55 | 79.07 | 72.16 | 62.58 | 79.86 | 71.03 |
| w/o matching | 55.84 | 49.97 | 83.03 | 80.76 | 70.62 | 58.42 | 77.37 | 65.77 |
| w/o alignment | 51.11 | 46.89 | 84.23 | 81.94 | 57.70 | 48.44 | 80.09 | 65.58 |
TABLE VII
UNFROZEN FLOW-LEVEL CLASSIFICATION ON THE INDUSTRIAL DATASET. ACC AND MACRO-F1 ARE PERCENTAGES.
| Method | Acc | Macro-F1 |
|---|---|---|
| ET-BERT | 67.87 | 48.21 |
| YaTC | 82.90 | 42.87 |
| Industrial baseline | 92.15 | 42.38 |
| AlignTraffic | 94.54 | 51.26 |
least eight packets and remove packet headers. The training set contains approximately 1.38 million samples, and the test set contains approximately 2.83 million samples with an imbalanced deployment distribution. Appendix E describes the collection.
Table VII shows that AlignTraffic reaches 94.54% Acc and 51.26% Macro-F1. It improves Macro-F1 over the industrial baseline by 8.88 percentage points and exceeds the compared public models. This extends the classification evidence to a larger application set and an industrial collection environment.
In a separate geographic transfer experiment, we train on 887,781 samples from a source region and evaluate on held-out traffic from Beijing and Xi'an without target-region retraining. The two test sets contain 165,144 and 24,626 samples, respectively.
Table VIII shows that AlignTraffic improves Macro-F1 over
TABLE VIII
FLOW-LEVEL CLASSIFICATION ON TRAFFIC FROM BEIJING AND XI'AN WITHOUT TARGET-REGION RETRAINING. ACC AND MACRO-F1 ARE PERCENTAGES.
| Method | Region | Acc | Macro-F1 |
|---|---|---|---|
| Industrial baseline | Beijing | 94.79 | 95.42 |
| AlignTraffic | Beijing | 95.83 | 96.08 |
| Improvement | Beijing | +1.04 | +0.66 |
| Industrial baseline | Xi'an | 81.41 | 83.95 |
| AlignTraffic | Xi'an | 87.51 | 88.69 |
| Improvement | Xi'an | +6.10 | +4.74 |
the industrial baseline by 0.66 percentage points in Beijing and 4.74 percentage points in Xi'an.
F. Computational Cost
Although the additional contrastive supervision improves AlignTraffic's representations and classification performance, its competitiveness in practice also depends on computational efficiency. Encoding each sample through two branches and fusing their features introduces additional computation and memory costs. Table IX reports the parameter counts, latency, and memory usage measured in the offline evaluation. AlignTraffic uses 396.35 million parameters and takes 62.82 ms for inference, compared with 160.67 million parameters and
TABLE IX
COMPUTATIONAL COST IN THE OFFLINE EVALUATION. PARAMETERS ARE IN MILLIONS, LATENCY IN MILLISECONDS, AND MEMORY IN MB.
| Method | Stage | Params (M) | Latency (ms) | Memory (MB) |
|---|---|---|---|---|
| ET-BERT | Inference | 160.67 | 17.54 | 1013.15 |
| Pretraining | 62.69 | 3122.84 | ||
| Pcap-Encoder | Inference | 222.90 | 36.04 | 669.00 |
| Pretraining | 94.69 | 4311.69 | ||
| TrafficDCNet | Inference | 249.32 | 48.38 | 980.42 |
| Pretraining | 199.67 | 2431.41 | ||
| AlignTraffic | Inference | 396.35 | 62.82 | 3789.12 |
| Pretraining | 380.07 | 9648.35 |
TABLE X
PACKET-LEVEL CLASSIFICATION ON ISCX-TOR. ACC AND MACRO-F1 ARE PERCENTAGES, REPORTED AS MEAN ± STANDARD DEVIATION.
| Method | ISCX-Tor | |||
|---|---|---|---|---|
| Frozen | Unfrozen | |||
| Acc | Macro-F1 | Acc | Macro-F1 | |
| ET-BERT | 53.42± 1.29 | 9.40± 1.84 | 55.14± 1.58 | 19.34± 1.11 |
| YaTC | 3.99± 1.52 | 4.34± 1.79 | 11.00± 1.64 | 6.35± 1.36 |
| NetMamba | 2.79± 1.88 | 2.95± 1.56 | 4.50± 1.73 | 1.58± 1.42 |
| Pcap-Encoder | 60.06± 1.35 | 15.00± 1.62 | 63.50± 1.06 | 22.47± 1.49 |
| Shallow learning | – | – | 8.86± 1.69 | 3.22± 1.91 |
| ByteBERT | 59.65± 1.24 | 9.34± 1.71 | 62.60± 1.09 | 25.65± 1.37 |
| TrafficDCNet | 21.44± 1.41 | 15.62± 1.55 | 44.66± 1.28 | 20.64± 1.63 |
| AlignTraffic | 37.61± 1.33 | 23.75± 1.22 | 61.25± 1.04 | 25.78± 1.16 |
17.54 ms for ET-BERT. Its pretraining memory usage reaches 9648.35 MB. For deployments with tight latency or memory budgets, these costs must be weighed against the classification gains [23], [24].
VI. LIMITS OF ENCRYPTED-TRAFFIC PRETRAINING
A. Application Information Concealed by Tor
The preceding sections identify learnable structure in protocol-visible fields and demonstrate how byte-level modeling and cross-view alignment improve traffic representations. We now extend the evaluation to more restricted settings, like ISCX-Tor [25]. Tor carries application streams through encrypted relay cells over TLS channels, concealing the inner application's protocol structure from an observer of the outer connection [26]. This provides a setting with more restricted application-specific observations than direct TLS traffic.
We apply the same protocol-based filtering used for the ISCX datasets. The retained subset contains 1,846,917 packets, compared with 1,854,409 before filtering, and its payload entropy increases from 4.43 to 7.99 bits. With 68 independent retained flows, we evaluate classification at packet level using flow-disjoint partitions and the same identifier masking.
TABLE XI
UNFROZEN PACKET-LEVEL CLASSIFICATION ON CSTNET. ACC AND MACRO-F1 ARE PERCENTAGES.
| Method | CSTNET | |
|---|---|---|
| Acc | Macro-F1 | |
| ET-BERT | 25.41 | 16.15 |
| YaTC | 59.38 | 33.28 |
| NetMamba | 57.21 | 29.33 |
| Shallow learning | 71.06 | 63.73 |
| ByteBERT | 60.71 | 37.21 |
| TrafficDCNet | 31.24 | 23.31 |
| AlignTraffic | 35.47 | 24.97 |
Table X shows low Macro-F1 across the evaluated methods. AlignTraffic obtains the highest frozen and unfrozen scores, 23.75% and 25.78%, respectively, but reliable recognition across classes remains unresolved in this setting. The result identifies a boundary for the current byte-level representations when application structure is concealed by additional encrypted encapsulation.
B. Information Available to Individual Packets
Packet-level CSTNET restricts the observation in a different way. The flow-level interventions in Q1 show that classification-relevant structure is concentrated in the first retained packet. Individual later packets receive the same flow label while containing primarily encrypted payload.
Table XI reports 37.21% Macro-F1 for ByteBERT, 23.31% for TrafficDCNet, and 24.97% for AlignTraffic. Shallow learning reaches 63.73%, showing the utility of explicit protocol features for this packet-level task. The comparison highlights the role of the observation unit. A representation that benefits from a multi-packet prefix may have substantially less class information available in an isolated packet.
VII. RELATED WORK
A. Traffic Classification and Pretraining
Traffic classification evolved from port matching and DPI to statistical features and raw-byte neural models as encryption reduced access to application content [1], [27]–[30]. Self-supervised pretraining extends this progression by learning representations from unlabeled traces. PERT, ET-BERT, YaTC, NetMamba, and PacRep explore different input units and prediction objectives [5]–[7], [31], [32]. Graph-based models and contrastive learning extend these approaches [33]–[35]. We relate model granularity and supervision to the byte dependencies that remain observable in encrypted traces.
B. Evaluation Bias and Generalization
Zhao et al. [8] examine dataset preparation, flow-disjoint splitting, frozen evaluation, and protocol-aware pretraining. Their analysis motivates separating downstream classification accuracy from the quality of a pretrained representation. Related studies investigate outdated datasets and collection-dependent shortcuts [9], [36]. Rosetta shows that TCP dynamics can change the observed shape of TLS flows across environments, while data-drift studies document corresponding classifier sensitivity [37], [38]. We use flow-disjoint partitions, identifier masking, and both frozen and unfrozen evaluations, and extend the comparison to industrial geographic transfer.
C. Protocol-Visible Information
Header-based classification and Pcap-Encoder demonstrate the value of observable protocol information [8], [39], [40]. Akbari et al. [41] show that encrypted-traffic classifiers can rely heavily on visible TLS handshake fields, motivating protocol-aware input design. ET-BERT also discloses ciphertext randomness as a challenge for traffic modeling [5]. Our analysis distinguishes visible fields from ciphertext within retained payloads and connects their byte dependencies to classification through packet-specific interventions. ByteBERT and TrafficDCNet examine ways to exploit local structure, drawing on byte-level and tokenizer-free sequence modeling [15]–[17]. AlignTraffic further uses their complementary views to provide supervision through sample correspondence.
VIII. CONCLUSION
Encrypted traffic retains learnable structure in protocol-visible regions. Our entropy and mutual-information analysis identifies local byte dependencies, and CSTNET payload interventions connect the retained structure to classification. ByteBERT and TrafficDCNet exploit this signal through individual-byte prediction and adaptive grouping. AlignTraffic strengthens their representations with cross-view contrastive and matching supervision, improving public and industrial classification and supporting transfer across geographic collection settings. Evaluations with concealed application structure and individual-packet observations characterize the remaining boundaries. These findings establish a basis for encrypted-traffic pretraining that matches model design and supervision to the information available in observed traces.
APPENDIX A
TRAFFICDCNET ARCHITECTURE
A. Hierarchical encoder and decoder
TrafficDCNet embeds the raw byte sequence into . At level , is the sequence length and is the feature width. For , contextual transformation precedes dynamic chunking
\begin{aligned}\mathbf{e}^{0}&=\operatorname{Emb}(\mathcal{T}),\\\hat{\mathbf{e}}^{l}&=E^{l}(\mathbf{e}^{l}),\ $ \mathbf{e}^{l+1},\mathbf{p}^{l},\mathbf{b}^{l})&=\operatorname{Chunk}_{l}(\hat{\mathbf{e}}^{l}),\\\hat{\mathbf{z}}^{L}&=\mathcal{B}(\mathbf{e}^{L}).\end{aligned} \tag{7}Here, contains boundary probabilities and contains binary selections. The retained states form . The bottleneck processes the coarsest sequence. For , the decoder restores positions and injects skip features
(8)
The projection aligns the skip feature width. The encoder, bottleneck, and decoder use causal Mamba-2 blocks [19]. Width changes append a shared learnable vector during expansion and retain leading channels during reduction [16]. The final state has one feature vector per original byte position and gives the representation in Eq. (5).
B. Dynamic chunking
At level , two learned projections produce and . Following dynamic chunking [15], the boundary probability is
The selection is , and the next level retains the states at selected positions. These are learned boundaries in the representation sequence. The model is not supplied with plaintext-region annotations or supervised protocol boundaries.
During dechunking, let be the boundary probability of retained state m. Exponential smoothing gives
with . For original position , define and the confidence . Causal expansion with a straight-through estimator [42] is
The bracket equals one in the forward pass, while its differentiable component carries the confidence gradient. The expanded states are combined with the skip features before decoder refinement.
C. Prediction and ratio regularization
A linear head projects onto the byte vocabulary to compute in Eq. (4). For each transition, the discrete selected fraction and mean boundary probability are
For target compression ratio , the structural regularizer is
It encourages retained fractions near [15]. Independent pretraining uses next-byte prediction plus this regularizer. Downstream TrafficDCNet training uses classification loss plus , with for unfrozen training and for frozen evaluation.
APPENDIX B ALIGNTRAFFIC OBJECTIVES
AlignTraffic aligns each sample's ByteBERT and TrafficD-CNet representations from Eqs. (2) and (5). MLP heads and project their global features of widths and into normalized embeddings of width .
As shown in Fig. 9, fusion encoder applies cross-attention to both token sequences and produces token and global outputs of width .
(15)
a) Cross-view contrastive loss: The contrastive objective aligns the two views by maximizing the similarity of matched pairs and minimizing the similarity to mismatched samples. Inspired by ALBEF [22] and MoCo [21], we adopt momentum encoders and feature queues to stabilize training and to enlarge the negative set. Concretely, the set indexes a mini-batch. For , and are the online and momentum encoder-head parameters, and is the momentum coefficient. The momentum branch produces under . Each queue stores previous momentum embeddings. The matrix stacks the current momentum keys in sample order followed by . The one-hot vector identifies the th current key. For temperature and distillation weight , cross-entropy is . For , the distributions, soft targets, and symmetric loss are
(16)
b) Cross-view matching loss: Cross-view matching trains the fusion branch to discriminate whether a two-view pair originates from the same encrypted traffic. Specifically, for , each contributes one positive pair and two hard negative pairs, constructed as
(17)
where is the cross-view similarity and are the byte-view and word-view negatives selected based on Pr, respectively. The operator denotes multiset union, and a tuple represents with label .
For each , the fusion encoder produces . The scalar matching head assigns probability , where is the sigmoid function. The matching loss is
c) MLM loss: To maintain contextualized representations during alignment pretraining, we also adopt an auxiliary fused-view MLM objective. In each alignment mini-batch, and are resampled using the same masking and token-corruption policy as in independent ByteBERT pretraining. Within each sample, the same masked positions are shared across the two views, where the corresponding raw bytes are replaced with samples from Unif( ) to form . The head maps fused features to logits over . The target-token probability and fused-view MLM loss are
(19)
The complete objective is Eq. (6). Independent ByteBERT pretraining selects valid positions with probability 0.15 and predicts their original values using Eq. (3). Alignment pretraining resamples the masked positions and synchronizes them between the branches. The raw-byte branch uses uniformly sampled replacement bytes at those positions, as specified above. This avoids leaving an uncorrupted raw-byte target available to the fusion module at a selected position.
APPENDIX C TRAINING SETTINGS
Experiments use Ubuntu 24.04, CUDA 12.8, and PyTorch 2.8.0. Multi-GPU training uses distributed data parallelism on one node. The following settings describe the reported experiments.
A. Contextual baselines and ByteBERT
Our ET-BERT implementation uses HuggingFace BERT while retaining the original vocabulary and model design. Pretraining uses 100 epochs, batch size 128, learning rate , and warmup ratio 0.1. Downstream training uses AdamW for 50 epochs, batch size 128, and dropout 0.5. The unfrozen learning rates are for flow-level and for packet-level classification. Frozen classifier training uses . ByteBERT uses the same backbone configuration and training settings, with single-byte tokens and masking probability 0.15.
YaTC uses AdamW with linear learning-rate scaling, base pretraining rate , batch size 128, and 150,000 pretraining steps. The patch masking ratio is 0.75. Fine-tuning uses 200 epochs, base learning rate , and batch size 128. NetMamba follows its official implementation with the same base pretraining rate, batch size, and number of steps. Its stride masking ratio is 0.9, and its downstream learning rate is [7].
B. TrafficDCNet and AlignTraffic
TrafficDCNet uses three hierarchical levels with widths {512, 768, 1024}. Two transitions each target a compression ratio of 3, giving cumulative ratios {1, 3, 9}. Independent pretraining uses AdamW for 1000 epochs with learning rate , , weight decay 0.01, batch size 128, and a warmup, hold, and decay schedule. The ratio-loss weight is 0.03. Downstream training uses 50 epochs, learning rate , and batch size 128.
AlignTraffic uses a 12-layer BERT-base pathway. Its first six layers form the word-view encoder , and the remaining six layers become the cross-attention fusion module . The byte pathway reuses TrafficDCNet. Alignment training uses AdamW for 50 epochs, including 10 warmup epochs, with batch size 128. The initial, minimum, and warmup learning rates are , , and , respectively. Weight decay is 0.02, followed by a cosine learning-rate schedule. We set , queue size , momentum , distillation weight , MLM weight , and ratio-loss weight . Downstream fine-tuning uses AdamW for 50 epochs, batch size 128, and learning rate .
C. Protocol-aware and shallow baselines
Pcap-Encoder starts from the authors' released T5-AE+Q&A checkpoint and uses their two-layer MLP classifier. Downstream AdamW learning rates are for frozen and for unfrozen training. Flow-level classification trains a packet classifier on the first five packets and uses majority voting for the flow label [8]. The flow-level frozen results are not reported.
The shallow baseline uses AutoGluon TabularPredictor to select among LightGBM, XGBoost, and Random Forest [43]. LightGBM and XGBoost use its default tabular configurations. Random Forest candidates use Gini and entropy splitting criteria. The feature groups are described below.
APPENDIX D
SHALLOW FEATURE GROUPS
The packet-level features describe IP and TCP behavior, generic TLS records, and visible ServerHello information. IP features include length, flags, fragmentation, checksum, protocol, header length, type of service, TTL, version, and identification. TCP features include sequence and acknowledgment numbers, flags, checksum, window, header length, urgent pointer, reserved fields, timestamps, and selective acknowledgment options. Original 5-tuple fields are suppressed in the masked comparison.
TLS features include payload length, TLS presence, the first record's type, version, and length, record count and length
summaries, and application-data, handshake, alert, and change-cipher-spec statistics. When a complete visible ServerHello is available, the features include its selected version, cipher suite, extension count, supported version, and key-share group. ALPN is included when visible in the captured protocol version.
Flow features expand the packet groups across the first five packet positions, add four inter-packet intervals, and aggregate TLS information across those packets. The aggregates include ServerHello recovery and attributes, session-ID length, directional counts, and directional byte statistics. This baseline therefore has explicit access to parsed protocol information, including fields within the retained payload.
APPENDIX E
INDUSTRIAL EVALUATION DETAILS
Script-driven applications generate the industrial traffic across multiple terminal devices and network-quality conditions. Traffic is captured at an intermediate network device. The 165 application classes include voice, video, gaming, social media, and AIGC services, with ground-truth labels derived from plaintext-visible information. Preprocessing retains payloads from flows with at least eight packets and removes packet headers. The training set is relatively balanced, while the test set follows an imbalanced deployment distribution.
We evaluate ET-BERT, YaTC, AlignTraffic, and the deployed industrial baseline in the unfrozen setting. The payload-only inputs omit the header fields used by Pcap-Encoder and our shallow baseline. The collaborator restricts release of the dataset because it contains private traffic information.
REFERENCES
[1] P. Haffner, S. Sen, O. Spatscheck, and D. Wang, “ACAS: automated construction of application signatures,” in Proceedings of the 2005 ACM SIGCOMM workshop on Mining network data, 2005, pp. 197–202.
[2] E. Rescorla, “The transport layer security (TLS) protocol version 1.3,” Internet Engineering Task Force, RFC 8446, Aug. 2018. [Online]. Available: https://www.rfc-editor.org/rfc/rfc8446
[3] G. Draper-Gil, A. H. Lashkari, M. S. I. Mamun, and A. A. Ghorbani, “Characterization of encrypted and VPN traffic using time-related features,” in Proceedings of the 2nd International Conference on Information Systems Security and Privacy - Volume 1: ICISSP, INSTICC. SciTePress, 2016, pp. 407–414.
[4] V. F. Taylor, R. Spolaor, M. Conti, and I. Martinovic, “AppScanner: Automatic fingerprinting of smartphone apps from encrypted network traffic,” in 2016 IEEE European Symposium on Security and Privacy (EuroS&P). IEEE, 2016, pp. 439–454.
[5] X. Lin, G. Xiong, G. Gou, Z. Li, J. Shi, and J. Yu, “ET-BERT: A contextualized datagram representation with pre-training transformers for encrypted traffic classification,” in Proceedings of the ACM Web Conference 2022, ser. WWW '22. New York, NY, USA: Association for Computing Machinery, 2022, p. 633–642.
[6] R. Zhao, M. Zhan, X. Deng, Y. Wang, Y. Wang, G. Gui, and Z. Xue, “Yet another traffic classifier: A masked autoencoder based traffic transformer with multi-level flow representation,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 37, no. 4, pp. 5420–5427, Jun. 2023.
[7] T. Wang, X. Xie, W. Wang, C. Wang, Y. Zhao, and Y. Cui, “NetMamba: Efficient network traffic classification via pre-training unidirectional Mamba,” in 2024 IEEE 32nd International Conference on Network Protocols (ICNP). IEEE, 2024, pp. 1–11.
[8] Y. Zhao, G. Dettori, M. Boffa, L. Vassio, and M. Mellila, “The sweet danger of sugar: Debunking representation learning for encrypted traffic classification,” in Proceedings of the ACM SIGCOMM 2025 Conference, ser. SIGCOMM '25. New York, NY, USA: Association for Computing Machinery, 2025, p. 296–310.
[9] C. Wang, X. Xie, T. Wang, and Y. Cui, “Bias in the shadows: Explore shortcuts in encrypted network traffic classification,” arXiv preprint arXiv:2601.10180, 2026.
[10] P. Rogaway, “Nonce-based symmetric encryption,” in International workshop on fast software encryption. Springer, 2004, pp. 348–358.
[11] L. Breiman, “Random forests,” Machine learning, vol. 45, no. 1, pp. 5–32, 2001.
[12] T. Chen and C. Guestrin, “XGboost: A scalable tree boosting system,” in Proceedings of the 22nd ACM SIGKDD International Conference on knowledge discovery and data mining, 2016, pp. 785–794.
[13] G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T.-Y. Liu, “LightGBM: A highly efficient gradient boosting decision tree,” in Advances in Neural Information Processing Systems, vol. 30. Curran Associates, Inc., 2017, pp. 3146–3154.
[14] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pre-training of deep bidirectional transformers for language understanding,” in Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), J. Burstein, C. Doran, and T. Solorio, Eds. Minneapolis, Minnesota: Association for Computational Linguistics, Jun. 2019, pp. 4171–4186. [Online]. Available: https://aclanthology.org/N19-1423/
[15] S. Hwang, B. Wang, and A. Gu, “Dynamic chunking for end-to-end hierarchical sequence modeling,” arXiv preprint arXiv:2507.07955, 2025.
[16] K. Slagle, “SpaceByte: Towards deleting tokenization from large language modeling,” Advances in Neural Information Processing Systems, vol. 37, pp. 124925–124950, 2024.
[17] M. Videau, B. Y. Idrissi, A. Leite, M. Schoenauer, O. Teytaud, and D. Lopez-Paz, “From bytes to ideas: Language modeling with autoregressive U-Nets,” arXiv preprint arXiv:2506.14761, 2025.
[18] O. Ronneberger, P. Fischer, and T. Brox, “U-Net: Convolutional networks for biomedical image segmentation,” in International Conference on Medical Image Computing and Computer-Assisted Intervention. Springer, 2015, pp. 234–241.
[19] T. Dao and A. Gu, “Transformers are SSMs: generalized models and efficient algorithms through structured state space duality,” in Proceedings of the 41st International Conference on Machine Learning, 2024, pp. 10041–10071.
[20] L. van der Maaten and G. Hinton, “Visualizing data using t-SNE,” Journal of Machine Learning Research, vol. 9, no. 86, pp. 2579–2605, 2008. [Online]. Available: http://jmlr.org/papers/v9/vandermaaten08a.html
[21] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum contrast for unsupervised visual representation learning,” in Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, 2020, pp. 9729–9738.
[22] J. Li, R. Selvaraju, A. Gotmare, S. Joty, C. Xiong, and S. C. H. Hoi, “Align before fuse: Vision and language representation learning with momentum distillation,” Advances in Neural Information Processing Systems, vol. 34, pp. 9694–9705, 2021.
[23] S. U. Jafri, S. Rao, V. Shrivastav, and M. Tawarmalani, “Leo: Online ML-based traffic classification at Multi-Terabit line rate,” in 21st USENIX Symposium on Networked Systems Design and Implementation (NSDI 24), 2024, pp. 1573–1591.
[24] M. Parvez, A. Zulfiqar, R. Beltiukov, S. L. Feibish, W. Willinger, A. Gupta, and M. Shahbaz, “SplitDT: Partitioned decision trees for scalable stateful inference at line rate,” in Proceedings of the ACM SIGCOMM 2025 Conference, 2025, pp. 1238–1240.
[25] A. H. Lashkari, G. D. Gil, M. S. I. Mamun, and A. A. Ghorbani, “Characterization of Tor traffic using time based features,” in Proceedings of the 3rd International Conference on Information Systems Security and Privacy - Volume 1: ICISSP, INSTICC. SciTePress, 2017, pp. 253–262.
[26] The Tor Project, “A short introduction to Tor,” Tor Specifications, accessed October 16, 2026. [Online]. Available: https://spec.torproject.org/intro/index.html
[27] T. Karagiannis, K. Papagiannaki, and M. Faloutsos, “BLINC: multilevel traffic classification in the dark,” in Proceedings of the 2005 conference on Applications, technologies, architectures, and protocols for computer communications, 2005, pp. 229–240.
[28] L. Bernaille and R. Teixeira, “Early recognition of encrypted applications,” in International Conference on Passive and Active Network Measurement. Springer, 2007, pp. 165–175.
[29] W. Wang, M. Zhu, J. Wang, X. Zeng, and Z. Yang, “End-to-end encrypted traffic classification with one-dimensional convolution neural networks,” in 2017 IEEE international conference on intelligence and security informatics (ISI). IEEE, 2017, pp. 43–48.
[30] M. Lotfollahi, M. Jafari Siavoshani, R. Shirali Hossein Zade, and M. Saberian, “Deep Packet: A novel approach for encrypted traffic classification using deep learning,” Soft Computing, vol. 24, no. 3, pp. 1999–2012, 2020.
[31] H. Y. He, Z. G. Yang, and X. N. Chen, “PERT: Payload encoding representation from transformer for encrypted traffic classification,” in 2020 ITU Kaleidoscope: Industry-Driven Digital Transformation (ITU K). IEEE, 2020, pp. 1–8.
[32] X. Meng, Y. Wang, R. Ma, H. Luo, X. Li, and Y. Zhang, “Packet representation learning for traffic classification,” in Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2022, pp. 3546–3554.
[33] H. Zhang, L. Yu, X. Xiao, Q. Li, F. Mercaldo, X. Luo, and Q. Liu, “TFE-GNN: A temporal fusion encoder using graph neural networks for fine-grained encrypted traffic classification,” in Proceedings of the ACM Web Conference 2023, 2023, pp. 2066–2075.
[34] H. Zhang, X. Xiao, L. Yu, Q. Li, Z. Ling, and Y. Zhang, “One train for two tasks: An encrypted traffic classification framework using supervised contrastive learning,” arXiv preprint arXiv:2402.07501, 2024.
[35] X. Lin, L. He, G. Gou, J. Yu, Z. Guan, X. Li, J. Guo, and G. Xiong, “CETP: A novel semi-supervised framework based on contrastive pretraining for imbalanced encrypted traffic classification,” Computers & Security, vol. 143, p. 103892, 2024.
[36] N. Wickramasinghe, A. Shaghaghi, G. Tsdik, and S. Jha, “SoK: Decoding the enigma of encrypted network traffic classifiers,” in 2025 IEEE Symposium on Security and Privacy (SP). IEEE, 2025, pp. 1825–1843.
[37] R. Xie, J. Cao, E. Dong, M. Xu, K. Sun, Q. Li, L. Shen, and M. Zhang, “Rosetta: Enabling robust TLS encrypted traffic classification in diverse network environments with TCP-Aware traffic augmentation,” in 32nd USENIX Security Symposium (USENIX Security 23). Anaheim, CA: USENIX Association, Aug. 2023, pp. 625–642. [Online]. Available: https://www.usenix.org/conference/usenixsecurity23/presentation/xie
[38] N. Malekghaini, E. Akbari, M. A. Salahuddin, N. Limam, R. Boutaba, B. Mathieu, S. Moteau, and S. Tuffin, “Data drift in DL: Lessons learned from encrypted traffic classification,” in 2022 IFIP Networking Conference (IFIP Networking). IEEE, 2022, pp. 1–9.
[39] S. Cui, J. Liu, C. Dong, Z. Lu, and D. Du, “Only header: a reliable encrypted traffic classification framework without privacy risk,” Soft Computing, vol. 26, no. 24, p. 13391–13403, Oct. 2022. [Online]. Available: http://dx.doi.org/10.1007/s00500-022-07450-9
[40] J. Yu, Y. Choi, K. Koo, and D. Moon, “A novel approach for application classification with encrypted traffic using BERT and packet headers,” Computer Networks, vol. 254, p. 110747, 2024.
[41] I. Akbari, M. A. Salahuddin, L. Aniva, N. Limam, R. Boutaba, B. Mathieu, S. Moteau, and S. Tuffin, “Traffic classification in an increasingly encrypted web,” Communications of the ACM, vol. 65, no. 10, pp. 75–83, 2022.
[42] Y. Bengio, N. Léonard, and A. Courville, “Estimating or propagating gradients through stochastic neurons for conditional computation,” arXiv preprint arXiv:1308.3432, 2013.
[43] N. Erickson, J. Mueller, A. Shirkov, H. Zhang, P. Larroy, M. Li, and A. Smola, “Autogluon-tabular: Robust and accurate automl for structured data,” arXiv preprint arXiv:2003.06505, 2020.