A Reinforcement Learning Framework for Dynamic Mediation Analysis

Lin Ge, Jitao Wang, Chengchun Shi, Zhenke Wu, Rui Song

Abstract

Traditional mediation analysis, which identifies the causal pathways through which a treatment affects an outcome, is largely limited to point-exposure settings. In sequential decision-making environments, such as mobile health interventions, treatments are delivered over time, and their effects may be mediated by intermediate variables that also evolve dynamically. This paper introduces a novel reinforcement learning (RL) framework for dynamic mediation analysis. By defining a Mediated Markov Decision Process (MMDP), we decompose the average treatment effect into immediate and delayed components. We further propose multiply-robust estimators that remain consistent even under partial model misspecification. Our analysis of the Intern Health Study demonstrates that delayed effects often dominate immediate ones, highlighting the necessity of an infinite-horizon approach to intervention design.

Introduction

In causal inference, mediation analysis seeks to answer how a treatment produces an effect by identifying intermediate variables, or mediators, that lie on the causal path between the intervention and the outcome. While well-established in static settings, mediation analysis faces significant challenges in longitudinal or dynamic environments. In these contexts, treatments are administered repeatedly, and the resulting outcomes are influenced by a complex interplay of past actions, evolving states, and time-varying mediators.

Existing longitudinal methods often focus on finite horizons, where the number of time steps is fixed and small. However, as the number of time steps increases, these methods frequently encounter the "curse of horizon," where the variance of statistical estimates grows exponentially. This paper addresses these limitations by developing a framework for infinite-horizon dynamic mediation analysis, allowing researchers to evaluate the long-term causal mechanisms of adaptive policies.

The Mediated Markov Decision Process (MMDP)

To formalize this problem, we introduce the Mediated Markov Decision Process (MMDP). This framework extends the standard Markov Decision Process (MDP) by explicitly incorporating a mediator variable ($M_t$) at each time step. In an MMDP, an action ($A_t$) taken in state ($S_t$) influences the reward ($R_t$) through two primary pathways: a direct path and an indirect path through the mediator ($M_t$).

Four-Way Effect Decomposition

A central contribution of this work is the decomposition of the Average Treatment Effect (ATE) into four distinct components. This granular breakdown allows for a more nuanced understanding of how interventions function over time:

  1. Immediate Direct Effect (IDE): The instantaneous impact of the action on the current reward, independent of the current mediator.
  2. Immediate Mediation Effect (IME): The instantaneous impact of the action on the reward specifically through the current mediator.
  3. Delayed Direct Effect (DDE): The impact of past actions on the current reward, accounting for the cumulative effect of the policy over time.
  4. Delayed Mediation Effect (DME): The impact of past actions on the current reward as mediated through the history of mediators.

Estimation and Robustness

Estimating these effects in an infinite-horizon setting requires addressing potential model misspecification. We develop Multiply-Robust (MR) estimators for each component of the decomposition. These estimators leverage multiple nuisance models—including the reward function, the mediator distribution, and the policy—to provide a "statistical safety net." The MR estimators remain consistent and unbiased as long as a specific subset of these models is correctly specified, offering greater reliability than traditional direct methods or simple importance sampling.

To mitigate the variance issues associated with long time horizons, we utilize Marginal Importance Sampling (MIS). By focusing on the stationary distribution of states and mediators rather than full trajectories, MIS allows for stable estimation over an infinite horizon, effectively breaking the curse of dimensionality and time.

Empirical Evaluation: The Intern Health Study

We applied our framework to the Intern Health Study (IHS), a longitudinal study of 1,565 medical interns. The study utilized a mobile health app to send daily notifications (actions) intended to improve mood (outcome). Potential mediators included daily step counts and sleep duration.

Key Findings

  • The Dominance of Delayed Effects: Our analysis revealed that both the immediate direct and mediation effects of the notifications were statistically insignificant. Instead, the total effect was driven almost entirely by delayed effects (DDE and DME). This suggests that the impact of health prompts is cumulative and manifests over days rather than hours.
  • Policy Optimization: The baseline analysis showed that the existing randomized notification policy had a slightly negative total effect (-0.100) on mood. This was largely due to "over-treatment," where prompts sent when an intern was already in a positive state proved counterproductive.
  • Improved Outcomes: By applying our framework to derive an optimal policy, we demonstrated that targeted interventions—sending notifications only when specific state conditions are met—could flip the negative effect into a significant positive one (+0.090).

Conclusion and Future Directions

This framework provides a robust toolkit for understanding the mechanisms of sequential interventions. By moving beyond point-exposure models to an infinite-horizon RL approach, we can better design adaptive interventions that account for both immediate feedback and long-term behavioral shifts.

Future work will focus on extending this framework to continuous action spaces, which are common in clinical dosing and economic applications. Additionally, addressing unmeasured confounding—where hidden variables influence both mediators and outcomes—remains a critical challenge for ensuring causal validity in complex, real-world systems.

Summary updated

BibTeX
@inproceedings{ge2023reinforcement,
  author = {Lin Ge and Jitao Wang and Chengchun Shi and Zhenke Wu and Rui Song},
  title = {{A Reinforcement Learning Framework for Dynamic Mediation Analysis}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=hd8wCvtgIN},
}
Figure