Abstract
Session-level dynamic ad load optimization aims to personalize the density and types of delivered advertisements in real time during a user's online session by dynamically balancing user experience quality and ad monetization. Traditional causal learning-based approaches struggle with key technical challenges, especially in handling confounding bias and distribution shifts. In this paper, we develop an offline deep Q-network (DQN)-based framework that effectively mitigates confounding bias in dynamic systems and demonstrates more than 80% offline gains compared to the best causal learning-based production baseline. Moreover, to improve the framework's robustness against unanticipated distribution shifts, we further enhance our framework with a novel offline robust dueling DQN approach. This approach achieves more stable rewards on multiple OpenAI-Gym datasets as perturbations increase, and provides an additional 5% offline gains on real-world ad delivery data. Deployed across multiple production systems, our approach has achieved outsized topline gains. Post-launch online A/B tests have shown double-digit improvements in the engagement-ad score trade-off efficiency, significantly enhancing our platform's capability to serve both consumers and advertisers.
Introduction
In the digital advertising ecosystem, platforms must navigate a delicate trade-off: maximizing ad revenue while maintaining a high-quality user experience. Traditionally, many platforms have relied on "static" ad loads—fixed policies determined at the start of a day or session. However, user behavior is inherently fluid. A user’s tolerance for advertisements may fluctuate based on the time of day, their current engagement level, or the sequence of ads they have already encountered.
To address this, researchers at Meta (presented at KDD '25) developed a sophisticated framework for Session-Level Dynamic Ad Load Optimization. By moving from static policies to real-time, session-aware adjustments, the platform can personalize ad density to match the user's immediate context, ensuring that monetization does not come at the cost of long-term retention.
The Technical Challenge: Confounding and Shifts
Transitioning to dynamic optimization introduces two primary technical hurdles that traditional causal inference models often fail to resolve:
- Confounding Bias (Carry-over Effects): In a dynamic system, past ad decisions influence current user behavior. If a model observes a user exiting the app, it must distinguish whether that exit was due to natural behavior or a "carry-over" effect from an aggressive ad load delivered minutes earlier.
- Distribution Shifts: User patterns are non-stationary. A model trained on weekday data may perform poorly during a holiday or a viral event. These temporal shifts require a model that is robust to environments that differ from its training data.
Methodology: Offline Robust Reinforcement Learning
The researchers formulated the ad-loading problem as a Markov Decision Process (MDP) and utilized Offline Reinforcement Learning (RL) to solve it. This approach allows the model to learn from historical logs without requiring risky real-time exploration.
State Space and Confounding Mitigation
To account for confounding bias, the model’s state space includes not only user demographics and real-time behavioral metrics (e.g., scroll depth, time spent) but also previous actions. By explicitly including historical ad loads in the state, the RL agent can learn the long-term downstream effects of its decisions, effectively modeling "ad fatigue."
Robust Dueling DQN and the IPM Trick
The framework employs a Deep Q-Network with a "dueling" architecture, which separately estimates the value of a state and the advantage of specific actions. To combat distribution shifts, the team integrated Robust RL principles using Integral Probability Metrics (IPM).
Rather than assuming the deployment environment perfectly matches the training data, the IPM approach defines an "uncertainty set" of possible environment transitions. The researchers mathematically demonstrated that for this application, achieving robustness simplifies into a specific regularization term in the loss function. This allows the model to remain stable under environmental perturbations without the computational overhead typically associated with robust optimization.
Scalable Deployment: Teacher-Student Framework
Deploying complex RL models to serve billions of users in real-time presents significant latency challenges. To solve this, the researchers used a Teacher-Student architecture. The Robust RL model acts as a "Teacher," labeling historical data with optimal policy decisions. A simpler, highly interpretable Decision Tree (CART) is then trained as a "Student" to mimic the teacher’s logic. This ensures the final production model is fast enough for millisecond-level inference while retaining the strategic insights of the RL framework.
Experimental Results
Offline Evaluation
The framework was tested against Meta’s production data using a "Cookie-Cookie-Day" framework to ensure unbiased evaluation. The RL-based approach achieved an 80%+ improvement in Area Under Cost Curve (AUCC) compared to traditional causal meta-learners. Furthermore, the robust version of the DQN provided an additional 5% gain in stability and performance on real-world data.
Robustness Benchmarking
To validate the robust components, the authors used OpenAI Gym environments (CartPole-v1 and LunarLander-v2). By intentionally altering the simulation physics (e.g., changing gravity or pole length), they confirmed that the Robust Dueling DQN maintained significantly more stable rewards than standard RL algorithms as the environment shifted.
Online Impact
In live production A/B tests at Meta, the framework delivered double-digit improvements in the trade-off efficiency between user engagement and ad revenue. The system successfully identified moments where ad load could be increased with minimal impact on user time-spent, as well as moments where reducing ad load was necessary to preserve the user experience.
Conclusion and Future Directions
This research demonstrates that Reinforcement Learning is a powerful tool for causal inference in dynamic systems, as the Q-value naturally accounts for long-term consequences. By baking robustness directly into the neural network's regularization, the authors have created a framework that is both high-performing and resilient to the unpredictable nature of user behavior.
Future work will focus on moving beyond linear reward functions toward Pareto-front optimization to better balance multiple competing objectives. Additionally, the team plans to develop high-fidelity user simulators to enable safer "online" exploration and explore continuous action spaces for even more granular control over ad delivery.
Summary updated