19 November 2026 in Proceedings of the ACM on Networking
Distributed-application simulators need to model the completion times of individual network transfers because later computation or communication may depend on the timing of earlier completions. Packet-level simulators can model detailed queue and protocol dynamics but are too slow for application modeling. Flow-level models are scalable but inaccurate; they ignore queue buildup and transient contention effects. Existing learned network models are fast but typically are limited to preset traces rather than acting in response to dynamic application behavior. We present m4, a learned flow-level network backend that maintains state across flow arrivals and completions and returns individual completion callbacks. m4 represents the network as a stateful flow-link bipartite graph and uses dense supervision from intermediate signals to improve accuracy. We first train m4 on packet-simulator labels and evaluate on standalone simulation, where it reduces mean error by up to 57.3% versus a flow-level simulator. We then integrate m4 into SimAI, where it achieves 10.9% mean error (vs. 23.3% for the flow-level backend) while delivering a median 40.1x speedup over the packet-level backend. On an RDMA testbed, we fine-tune the checkpoint on 4-host traces and evaluate on 12-host hardware, with median application completion-time error of 15.1% vs. 31.0% for a calibrated packet-level backend and 88.4% for the flow-level backend.