Abstract
Contextual Markov decision processes (CMDPs) provide a powerful framework for modeling reinforcement learning problems in time-varying environments where transition kernels and reward functions are indexed by a context variable. Despite their practical relevance in fields like personalized recommendation and autonomous systems, CMDPs have remained relatively unexplored from a theoretical standpoint. This paper investigates CMDPs through the lens of linear function approximation, focusing on two distinct structures: Model I, featuring context-varying representations with shared linear weights, and Model II, featuring common representations with context-varying weights. We propose novel model-based algorithms for both settings and establish polynomial sample complexity guarantees. Notably, our analysis for Model I improves upon existing tabular CMDP results by eliminating the need for reachability assumptions, while our results for Model II represent the first known guarantees for this class of function approximation models. Our findings highlight that context-varying features offer significantly greater sample efficiency than common representations in linear CMDP environments.
Introduction
In standard Reinforcement Learning (RL), the environment is typically assumed to be a static Markov Decision Process (MDP). However, real-world scenarios often involve dynamics that shift based on external factors, or contexts. For instance, a recommendation engine must adapt to changing user demographics, and an autonomous vehicle must navigate varying weather conditions.
Contextual MDPs (CMDPs) were introduced to model these time-varying dynamics. However, existing theoretical work has largely been confined to tabular settings with finite state and action spaces. This paper extends the theory of CMDPs to large-scale environments using linear function approximation, where transitions and rewards are modeled as linear combinations of features. A central challenge in this setting is determining how to effectively aggregate data across different contexts to learn a policy for a new, unseen context.
Linear Contextual MDP Models
The authors define two primary models to characterize how context influences the MDP structure:
- Model I (Context-Varying Representations): In this model, the feature mapping $\phi_c(s, a)$ depends on the context $c$, but the underlying transition weights $\mu$ are shared across all contexts. This describes environments where the fundamental dynamics are consistent, but the representation or perception of the state space changes with the context.
- Model II (Context-Varying Weights): Here, the features $\phi(s, a)$ are common to all contexts, but the linear weights $\mu_c$ vary. This models systems where the basic components of the environment are fixed, but their interactions or importance change depending on the context (e.g., different traffic patterns in a driving simulator).
Algorithms and Methodology
The authors propose model-based algorithms that leverage a Maximum Likelihood Estimation (MLE) oracle for learning transition kernels and Least Square Regression (LSR) for reward functions. To ensure efficient exploration, they employ an Upper Confidence Bound (UCB) strategy.
A key technical contribution for Model II is the design of a novel bonus term based on the squared norm of features. This innovation is required to rigorously bound the uncertainty arising from context-specific weights, where data from one context provides less direct information about others compared to the shared-weight structure of Model I.
Sample Complexity Results
The paper establishes the first comprehensive sample complexity bounds for linear CMDPs, characterizing the number of episodes required to achieve an $\epsilon$-optimal policy:
- Model I: The sample complexity is shown to be $\tilde{O}(\frac{H^4 d^3}{\epsilon^2})$, where $H$ is the horizon and $d$ is the feature dimension. This result is significant because it matches the complexity of standard, non-contextual linear MDPs, proving that context-varying representations do not inherently increase the learning burden if weights are shared. Furthermore, this result improves upon prior tabular CMDP work by removing the "reachability assumption."
- Model II: The sample complexity is $\tilde{O}(\frac{H^4 d^3 K}{\epsilon^2} \cdot \frac{p_{max}}{p_{min}})$. This bound introduces a dependency on the number of actions $K$ and a state density ratio ($p_{max}/p_{min}$), reflecting the increased difficulty of estimating context-specific weights.
Key Insights and Implications
- Efficiency of Shared Weights: The shared-weight structure of Model I allows the agent to aggregate data across all contexts, leading to optimal sample efficiency.
- Representation vs. Dynamics: The comparison between the two models demonstrates that having context-varying features (Model I) is fundamentally more sample-efficient than having common representations with varying dynamics (Model II).
- Broadening Applicability: By eliminating the reachability assumption for Model I, the authors make the theory applicable to a wider range of practical RL environments where certain states may be difficult to reach under arbitrary policies.
Conclusion and Future Directions
This work provides a rigorous theoretical foundation for linear CMDPs, yet several questions remain open. Future research could extend these results to general function classes with infinite capacity using covering number techniques. Additionally, investigating whether the density ratio requirement in Model II can be relaxed or removed would further strengthen the theory. Finally, while the proposed algorithms are statistically efficient, developing computationally efficient versions of the MLE and LSR oracles for complex feature spaces remains an important practical goal.
Summary updated