AI
FlowWise accelerates network traffic ML with fast-slow model cascade for streaming analysis
A new serving system uses uncertainty-driven inference to balance speed and accuracy when analyzing encrypted network flows in real time.
Machine learning has become essential for classifying network traffic in cloud and ISP environments, especially as encryption and consolidated services make traditional rule-based detection obsolete. But processing high-speed packet streams presents a fundamental challenge: new flows arrive faster than analysis pipelines can handle them, and each flow's packets trickle in over time, requiring systems to maintain and track per-flow state.
The timing mismatch problem#
Researchers at CMU and elsewhere identified a critical gap in conventional serving approaches. Inference latency across candidate models varies dramatically—up to 141 times slower between models on the same task. Yet waiting for additional packets to accumulate rich features can introduce delays exceeding feature computation and inference by six to eight orders of magnitude at high percentiles. Standard cloud-serving designs, which scale out with stateless workers, struggle with this streaming, stateful workload because each flow's data must remain organized and available as packets arrive unpredictably.
FlowWise's uncertainty-driven approach#
The team developed FlowWise, a system that dynamically chooses both how many packets to collect and which models to run for each flow. The key innovation is an uncertainty-driven fast-slow cascade: a lightweight one-packet model makes a quick prediction first, and only when confidence is low does the system escalate the flow to slower models that accumulate more packets and richer features.
The runtime architecture maintains per-flow state in a queue-centric design, handles asynchronous feature computation, and uses flow-ID-keyed streams to distribute work across heterogeneous CPU and GPU workers. This approach avoids the stateless-scaling trap by treating flow identity as a routing key.
Results in production conditions#
In practice, FlowWise served three-quarters of flows within 16 milliseconds, achieving a 40.5x improvement in median end-to-end latency while maintaining accuracy comparable to always running the full model. Service rate increased substantially. On a single 16-core commodity CPU server with thousands of packet-header features per flow, the system sustained over 48.5k new flows per second—matching reported flow-arrival rates from city-backbone network traces.
The team open sourced the work, submitted to arXiv in February 2024.

