PERO: Efficient Robust Post-Training Foundation Models for Encrypted Traffic Classification

Wumei Du, Jiarong Wen, Kaiyu Zhang, Zi Yang, Yiqin Lv, Longfei Zhang, Dong Liang, Zheng XiearXiv 2026

TL;DR

Standard post-training of encrypted traffic foundation models optimizes for average performance, leaving them vulnerable to rare but catastrophic tail-end errors like missing malicious traffic. To solve this without the massive computational overhead of traditional robust optimization, the authors introduce Pre-Evaluation Robust Optimization (PERO). By delegating risk estimation to a lightweight proxy model, PERO slashes training time and memory usage by over 50% while delivering state-of-the-art tail robustness.

What Problem Does This Paper Address?

Encrypted traffic classification is a cornerstone of modern network security, used to detect malware, intrusions, and identify applications. While large foundation models (like ET-BERT) excel at average classification accuracy, they suffer from a dangerous blind spot: they are typically trained using Empirical Risk Minimization (ERM), which prioritizes majority patterns and ignores rare, high-loss "tail events." In a security context, misclassifying a single rare piece of malware can cause catastrophic breaches.

To mitigate this, researchers use robust optimization frameworks like Conditional Value-at-Risk (CVaR) to force models to focus on the worst-performing samples. However, finding these high-loss samples requires running full-model inference on massive candidate batches. For large foundation models with millions of parameters, this "screening bottleneck" is computationally and financially prohibitive.

Methods

The authors propose PERO, a framework that decouples risk estimation from expensive large-model optimization using a two-step pipeline:

  1. Pre-Evaluation Module (The Proxy): Instead of using the massive foundation model to calculate losses for a large pool of candidate samples, PERO employs a lightweight neural network (a small MLP) as an online surrogate risk estimator. This proxy predicts the cross-entropy loss that a sample would likely incur on the current state of the foundation model.
  2. Active Subset Selection: A large candidate pool of traffic samples is passed through the lightweight proxy. The proxy scores the samples, and only a small subset ($B$) of the highest-risk (highest predicted loss) samples is selected.
  3. Targeted Foundation Model Updates: The foundation model performs its expensive forward and backward training passes only on this high-risk subset.

To keep up with the foundation model as its loss landscape evolves during training, the proxy is continuously updated online using the actual losses generated during step 3.

Figure 2. Overview of PERO Framework. Panel (a) shows the optimization loop with the pre-evaluation module ϕ, subset selection module, and classifier θ, with |ϕ| ≪|θ|. Panel (b) depicts iterative batch selection guided by the pre-evaluation module.

Datasets

The authors evaluated PERO across several widely used encrypted traffic benchmarks:

  • USTC-TFC: 97,115 encrypted traffic samples split between 10 malware families and 10 benign applications.
  • ISCX-VPN-Service / ISCX-VPN-App: Traffic datasets capturing VPN and non-VPN scenarios across 12 service-level and 17 application-level classes.
  • ISCX-Tor & CICIoT2022: Used in supplementary experiments to validate the framework's generality across different model backbones (like YaTC) and large-scale IoT traffic.

Key Insights and Ideas

  • The "Scout" Principle: You don't need a multi-million parameter model to find out which data points are difficult. A lightweight model trained on the historical losses of the large model can act as an incredibly efficient scout, identifying high-risk regions of the data space.
  • The Illusion of Macro F1: Traditional metrics hide tail-end vulnerabilities. As shown in the paper, a model can boast a 96.5% Macro F1 score overall, yet drop to a dismal 67.9% F1 score on the worst 10% of samples ($\alpha = 0.9$). Focusing optimization on this tail prevents this drop.
Figure 1. Performance comparison between ERM and our method under macro and tail evaluation, with macro denoting class- averaged F1-score and α-tail denoting the average F1-score over the worst (1 −α) loss-ranked samples.

Key Results

  • Superior Tail Robustness: On the USTC-TFC dataset, PERO achieved a tail F1-score ($F1_{0.9}$) of 87.63%, drastically outperforming standard ERM (31.29%) and beating the standard, computationally heavy MC-CVaR baseline (75.73%).
  • Massive Efficiency Gains: PERO cut post-training runtime roughly in half compared to full CVaR optimization because it avoids full-batch forward/backward passes on the foundation model.
  • Memory Reduction: On the ISCX-VPN-Service dataset, PERO reduced GPU memory usage by 55.1% (consuming 11.75 GB compared to MC-CVaR's 26.18 GB), making robust post-training accessible on standard hardware.
Figure 4. Runtime comparison across three datasets.

Limitations and Future Work

  • Theoretical vs. Practical Smoothness: The paper's theoretical convergence proofs rely on a uniformly bounded loss-Hessian spectral radius—a standard assumption in optimization math that may not strictly hold for massive, non-convex Transformer architectures in the wild.
  • Production Drift: While tested thoroughly on public benchmarks, the authors note that these datasets might not fully capture real-world production network dynamics, such as rapid temporal drift in traffic patterns.
  • Broader Horizons: The authors suggest that this pre-evaluation paradigm isn't limited to traffic classification; it could naturally extend to reinforcement learning (RL) post-training for Large Language Models (LLMs), where evaluating trajectories is similarly expensive.

Summary updated

Abstract

Encrypted traffic classification is vital for network security, yet real-world deployments are inherently sensitive to rare but high-loss errors such as misclassification of malicious traffic. The encrypted traffic foundation model, as a promising general-purpose technique, can achieve impressive overall performance. However, employing standard objectives such as empirical risk minimization often overlooks high-risk tail events, and commonly used performance metrics hardly reflect robustness limitations in risk-sensitive scenarios. Directly applying robust optimization objectives, such as conditional value-at-risk, to post-training is computationally prohibitive for large models, as identifying high-loss samples exhausts substantial computation. To this end, we propose Pre-Evaluation Robust Optimization (PERO), an efficient robust post-training framework for encrypted traffic foundation models. PERO employs a lightweight proxy to estimate sample-wise risk and selects a subset of high-risk samples to update the foundation model, decoupling risk estimation from expensive large-model optimization. Extensive experiments on typical encrypted traffic datasets show that PERO achieves competitive or superior robustness and average performance compared to outstanding robust post-training methods, while significantly reducing computational and memory costs.
BibTeX
@misc{du2026pero,
  author = {Wumei Du and Jiarong Wen and Kaiyu Zhang and Zi Yang and Yiqin Lv and Longfei Zhang and Dong Liang and Zheng Xie},
  title = {{PERO: Efficient Robust Post-Training Foundation Models for Encrypted Traffic Classification}},
  year = {2026},
  eprint = {2608.15504},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.15504},
}
Figure