# TraceCodec: A Compiler-Backed Neural Codec for Network Traffic Traces

arXiv: https://arxiv.org/abs/2605.29941 · HTML: https://mlsanity.com/paper/2605.29941/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 15 of its 37 references that are in the map.
- First posted on arXiv 28 May 2026.

## Builds on (most cited first, 15 of 15)

- [High-Resolution Image Synthesis with Latent Diffusion Models](https://mlsanity.com/paper/2112.10752/) (2021)
- [Neural Discrete Representation Learning](https://mlsanity.com/paper/1711.00937/) (2017)
- [SoundStream: An End-to-End Neural Audio Codec](https://mlsanity.com/paper/2107.03312/) (2021)
- [Modeling Tabular data using Conditional GAN](https://mlsanity.com/paper/1907.00503/) (2019)
- [Mixed-Type Tabular Data Synthesis with Score-based Diffusion in Latent Space](https://mlsanity.com/paper/2310.09656/) (2023)
- [Deep Packet: A Novel Approach For Encrypted Traffic Classification Using Deep Learning](https://mlsanity.com/paper/1709.02656/) (2017)
- [ET-BERT: A Contextualized Datagram Representation with Pre-training Transformers for Encrypted Traffic Classification](https://mlsanity.com/paper/2202.06335/) (2022)
- [NetDiffusion: Network Data Augmentation Through Protocol-Constrained Traffic Generation](https://mlsanity.com/paper/2310.08543/) (2023)
- [New Directions in Automated Traffic Analysis](https://mlsanity.com/paper/2008.02695/) (2020)
- [NetMamba: Efficient Network Traffic Classification via Pre-training Unidirectional Mamba](https://mlsanity.com/paper/2405.11449/) (2024)
- [TrafficLLM: Enhancing Large Language Models for Network Traffic Analysis with Generic Traffic Representation](https://mlsanity.com/paper/2504.04222/) (2025)
- [Robustifying ML-powered Network Classifiers with PANTS](https://mlsanity.com/paper/2409.04691/) (2024)
- [Generative Active Adaptation for Drifting and Imbalanced Network Intrusion Detection](https://mlsanity.com/paper/2503.03022/) (2025)
- [NetSSM: Multi-Flow and State-Aware Network Trace Generation using State Space Models](https://mlsanity.com/paper/2503.22663/) (2025)
- [PACC: Protocol-Aware Cross-Layer Compression for Compact Network Traffic Representation](https://mlsanity.com/paper/2602.08331/) (2026)

## Abstract (arXiv)

Critical networking workflows require high-fidelity packet captures (PCAPs) for testing, security analysis, and protocol validation, not just statistical flow-level summaries. Recent packet generators have demonstrated protocol-constrained PCAP synthesis, but many operate on raw or near-raw packet representations. These representations can entangle learned behavioral choices with deterministic protocol rules and make packet correctness depend on post-hoc repair. We identify the decode interface as a key bottleneck and present TraceCodec, a compiler-backed neural codec for stateful multi-flow traces. TraceCodec lifts each parsed packet into a timed packet action with explicit flow slots and transport cues, learns a continuous per-packet latent, and uses a state-aware deterministic compiler to decode actions to PCAPs while managing endpoint assignment, TCP sequence and acknowledgment state, declared compatibility constraints, and packet rendering. On CICIDS2017 Monday, TraceCodec matches packet count, protocol composition, and flow population to within 0.03%; raw-field baselines produce substantially larger flow-count and TCP-event errors under the same non-repair policy. In a matched flow-matching continuation setup, TraceCodec yields complete decoded suffixes in 100% of CICIDS2017 cases and 98.44% of MAWI cases, versus at most 10.94% for raw-field latent controls. Structural diagnostics further show that TraceCodec preserves TCP transitions and multi-flow interleaving. Together, these results support TraceCodec as a generator-facing latent interface with a deterministic path back to usable packet traces.
