Abstract
Managing congestion in complex stochastic systems—such as hospital triage, semiconductor manufacturing, or cloud computing clusters—is a fundamental challenge in operations research. While Reinforcement Learning (RL) offers a flexible framework for control, standard model-free algorithms often struggle with the high variance and instability inherent in queuing networks. We present a framework for differentiable discrete event simulation (DDES) that achieves a 50x to 1000x improvement in sample efficiency over state-of-the-art RL methods. By leveraging a "straight-through" smoothing technique and a novel "work-conserving softmax" architecture, our approach enables agents to learn from infinitesimal counterfactuals, producing gradients that are orders of magnitude more accurate than traditional estimators.
Introduction
Queuing networks are ubiquitous, yet their optimal control is notoriously difficult. Traditional analytical methods often rely on restrictive assumptions, such as exponential service times, which fail to capture the "bursty" nature of real-world traffic. Conversely, model-free RL algorithms like PPO or REINFORCE treat the system as a black box, leading to two major drawbacks: high variance in reward signals due to stochasticity, and extreme instability where sub-optimal policies cause queues to grow boundlessly. This paper argues for a middle ground: using the known structural dynamics of discrete event systems to calculate superior policy gradients.
Methodology: Pathwise Policy Gradients
The core innovation of this work is the PATHWISE policy gradient estimator. Unlike the trial-and-error approach of standard RL, the PATHWISE estimator utilizes automatic differentiation to determine how the total system cost would change if a scheduling action were marginally perturbed. This provides the agent with much finer-grained feedback than a simple scalar reward.
The "Straight-Through" Estimator
Discrete event simulations (DES) are typically non-differentiable because they rely on discrete logic, such as an argmin operation to select the next event (e.g., an arrival or a departure). To overcome this, the authors employ a straight-through estimator. In the forward pass, the simulation remains discrete and physically realistic. In the backward pass, the gradient is calculated as if the discrete selection were a smooth softmin function. This allows gradients to flow through the simulation without introducing "unphysical" artifacts like fractional jobs.
Work-Conserving Softmax
To prevent the "blow-up" problem common in early training, the authors introduce a work-conserving softmax policy architecture. In queuing theory, a work-conserving policy ensures that a server never remains idle if there is work to be done. By embedding this inductive bias directly into the neural network's output layer, the framework ensures that even randomly initialized agents maintain system stability, significantly smoothing the optimization landscape.
Experiments and Results
The framework was evaluated across several architectures, including simple M/M/1 queues, complex Criss-Cross networks, and large-scale Re-entrant networks mimicking semiconductor fabrication lines.
Key Findings
- Gradient Accuracy: In 94.5% of tested scenarios, the PATHWISE estimator using a single trajectory was more accurate than the REINFORCE estimator using 1,000 trajectories. This is visualized in the alignment of gradient vectors and the high cosine similarity maintained even in heavy traffic (high traffic intensity $\rho$).
- Sample Efficiency: The method achieved a 50x to 1000x improvement in sample efficiency over PPO, particularly in high-dimensional problems (21+ job classes) where zeroth-order methods failed to converge.
- Robustness: The performance gains were most pronounced in congested "heavy traffic" scenarios and systems with high-variance, non-exponential noise distributions.
Conclusion
By incorporating structural knowledge of discrete event systems into the gradient calculation, DDES bridges the gap between rigid analytical models and inefficient black-box RL. The ability to learn from a single trajectory what previously required thousands marks a significant step toward practical, real-time control of complex industrial and computing infrastructure.
Summary updated