Abstract
Modern large-scale recommender systems face significant infrastructure challenges during peak traffic periods. To maintain responsiveness, systems often employ result caches, serving previously computed recommendations instead of generating fresh ones. However, this introduces a complex trade-off: excessive cache usage leads to stale content and decreased user engagement, while insufficient usage risks system overload. We propose the Reinforcement Prediction-Allocation Framework (RPAF), a two-stage approach that optimizes long-term user WatchTime under global computational constraints. RPAF combines a Reinforcement Learning-based prediction stage with a high-efficiency streaming allocation algorithm called PoolRank. Experimental results on the Kuaishou platform show a 1.13% increase in Daily WatchTime and significant gains in long-term user retention.
Introduction
In platforms like TikTok or Kuaishou, generating personalized recommendations in real-time is computationally expensive. During traffic spikes, the demand often exceeds the available hardware capacity. To mitigate this, systems use result caches: when a real-time recommendation is generated, a surplus of items is calculated and stored. Subsequent requests can then be fulfilled by "consuming" these cached items, saving computational resources.
The primary challenge lies in the Value-Strategy Dependency. As shown in Figure 1, user engagement (measured by WatchTime) typically decays as they are served increasingly stale content from the cache. Decisions made now (to use or save the cache) directly impact the available options and expected rewards in the future. Furthermore, the system must adhere to a global budget (e.g., a maximum number of real-time computations per hour) while making instantaneous decisions for a stream of incoming users whose future arrival patterns are unknown.
Methodology: The RPAF Framework
The Reinforcement Prediction-Allocation Framework (RPAF) addresses these challenges by decoupling the long-term value estimation from the immediate budget allocation.
Stage One: Prediction with Relaxed Local Allocator (RLA)
To capture the long-term impact of cache usage, RPAF employs an Actor-Critic reinforcement learning model (such as TD3). Standard RL struggles with hard global constraints. RPAF introduces the Relaxed Local Allocator (RLA) to bridge this gap. During training, instead of enforcing a rigid global budget, the actor's loss function is augmented with a penalty (MSE or KL divergence) that encourages the policy to align with a target allocation ratio. This allows the model to learn a "soft" policy that maximizes long-term WatchTime while respecting the general resource limits.
Stage Two: Allocation with PoolRank
In a live production environment, the system must decide which specific users receive real-time recommendations from a continuous stream. RPAF utilizes PoolRank, a streaming allocation algorithm that treats the decision as a ranking task.
PoolRank uses a "request pool" from the preceding time window to estimate the current distribution of request values. By setting a dynamic threshold based on this proxy distribution, it can make near-optimal allocation decisions in $O(1)$ time complexity. This ensures the allocation process itself does not introduce significant latency.
Experimental Evaluation
The framework was evaluated using the KuaiRand dataset, which includes 32 million interactions from 27k users. To account for the dynamic nature of cache depletion, the authors developed a user simulator that models engagement deterioration over successive cached views.
Key Results
- Offline Benchmarks: RPAF (using TD3) achieved a WatchTime of 2146s, significantly outperforming greedy baselines (1750s) and previous state-of-the-art methods like RL-MPCA (1899s).
- Online Production: In live A/B testing on the Kuaishou app (serving >100 million users), RPAF delivered a +1.13% increase in Daily WatchTime.
- Long-term Retention: A 150-day longitudinal study revealed a steady increase in Daily Active Users (DAU), confirming that smarter cache management improves user satisfaction over time.
Conclusion and Future Work
RPAF demonstrates that cache allocation is inherently a sequential decision problem best solved by separating value prediction from budget enforcement. By leveraging RL for long-term trends and PoolRank for real-time constraints, the system achieves superior performance at scale.
Future research may explore multi-level allocation, where the system chooses from a spectrum of model complexities (e.g., "heavy" vs. "light" models) rather than a binary choice between real-time and cache. Additionally, refining the simulator to account for content-specific decay (e.g., news vs. evergreen videos) could further improve the precision of the prediction stage.
Summary updated