Abstract
In modern large-scale online serving systems, computing power is often treated as a fixed overhead rather than a manageable resource. This paper introduces the Dynamic Computation Allocation Framework (DCAF), a system developed by Alibaba to optimize resource distribution across user requests. By framing computation allocation as a constrained optimization problem and employing Lagrangian relaxation alongside PID control, DCAF dynamically adjusts the depth of search and ranking based on predicted request value. Real-world deployment on Taobao demonstrated a 20% reduction in GPU resource consumption and significant improvements in system stability during extreme traffic surges.
Introduction
Online serving systems for e-commerce and advertising typically employ a cascaded architecture to balance latency and accuracy. As illustrated in Figure 1, a single request progresses through stages of increasing complexity: Retrieval, Pre-Ranking, Ranking, and Reranking.
Historically, these systems have relied on fixed quotas ($N$) for each stage. For instance, the Ranking stage might always process exactly 500 items regardless of the user's intent. This approach is inherently inefficient; a high-intent purchaser justifies a deeper, more expensive search, whereas a casual browser does not. Furthermore, fixed-quota systems are brittle during traffic spikes, often requiring manual intervention to prevent system failure.
Methodology
DCAF re-imagines resource allocation as a Knapsack Problem, aiming to maximize total expected revenue (e.g., eCPM) within a global computation budget ($C$).
Lagrangian Optimization
To solve this optimization at scale, DCAF utilizes Lagrangian relaxation. A multiplier, $\lambda$, represents the "price" of computation. For each request $i$, the system selects an action $j$ (number of items to process) that maximizes the value $Q_{ij} - \lambda q_j$, where $Q$ is the predicted gain and $q$ is the cost. The optimal $\lambda$ is determined offline via bisection search on historical logs and then deployed to the online serving environment.
PID Control for System Stability
To account for real-time traffic volatility, DCAF incorporates a "MaxPower" mechanism. This acts as a dynamic ceiling on the computation allocated to any single request. A Proportional-Integral-Derivative (PID) controller adjusts this ceiling every few seconds based on live system health metrics, such as average runtime and request failure rates. This dual-layer approach combines mathematical optimality with robust control theory.
Experimental Results
The framework was evaluated using both offline logs and live A/B testing on Taobao's display advertising traffic.
Efficiency and Revenue Gains
DCAF demonstrated superior resource efficiency, maintaining baseline business performance (CTR/RPM) while reducing GPU consumption by 20%. Conversely, when operating under the same computation budget as the baseline, DCAF improved the Click-Through Rate (CTR) by 0.91% and Revenue Per Mille (RPM) by 0.42%. These results validate the hypothesis that "personalized computation" can extract more value from existing hardware.
System Robustness
One of DCAF's most significant advantages is its resilience. During a simulated 8-fold traffic spike, the PID-controlled MaxPower mechanism reacted instantaneously to throttle computation. As shown in Figure 2, this allowed the system to maintain a low failure rate, whereas a fixed-quota strategy would have been overwhelmed.
Conclusion and Future Work
DCAF successfully shifts the paradigm of online serving from fixed resource quotas to dynamic, value-based allocation. By recognizing the law of diminishing returns in item ranking, the framework effectively prunes low-value computation.
Future research will focus on addressing potential estimation biases in the offline solver and exploring more sophisticated models for request value estimation. Additionally, the team aims to extend DCAF toward a global joint optimization of the entire serving cascade, moving beyond independent stage-wise adjustments to a unified end-to-end resource management strategy.
Summary updated