Abstract: We present regret minimization algorithms for stochastic contextual MDPs under minimum reachability assumption, using an access to an offline least square regression oracle. We analyze three different settings: where the dynamics is known, where the dynamics is unknown but independent of the context and the most challenging setting where the dynamics is unknown and context-dependent. For the latter, our algorithm obtains regret bound of $\widetilde{O}( (H+{1}/{p_{min}})H|S|^{3/2}\sqrt{|A|T\log(\max\{|\mathcal{G}|,|\mathcal{P}|\}/\delta)})$ with probability $1-\delta$, where $\mathcal{P}$ and $\mathcal{G}$ are finite and realizable function classes used to approximate the dynamics and rewards respectively, $p_{min}$ is the minimum reachability parameter, $S$ is the set of states, $A$ the set of actions, $H$ the horizon, and $T$ the number of episodes. To our knowledge, our approach is the first optimistic approach applied to contextual MDPs with general function approximation (i.e., without additional knowledge regarding the function class, such as it being linear and etc.). We present a lower bound of $\Omega(\sqrt{T H |S| |A| \ln(|\mathcal{G}|)/\ln(|A|)})$, on the expected regret which holds even in the case of known dynamics. Lastly, we discuss an extension of our results to CMDPs without minimum reachability, that obtains $\widetilde{O}(T^{3/4})$ regret.
Introduction
In standard Reinforcement Learning (RL), an agent interacts with a static environment. However, many real-world applications—such as personalized medicine or targeted advertising—require the environment to adapt based on external information, or "context." A Contextual Markov Decision Process (CMDP) models this by mapping each context to a specific MDP.
While previous research often relied on restrictive assumptions (like linear models) or computationally impractical "online" estimation oracles, this work introduces the first optimistic RL framework for CMDPs that works with general function approximation. By utilizing an offline least-squares regression oracle, the proposed algorithms achieve sub-linear regret guarantees even when both rewards and environment transitions are context-dependent.
Methods: Optimism and Regression Oracles
The core of the approach is the "Optimism in the Face of Uncertainty" (OFU) principle. The algorithms maintain a model of the environment and add an exploration "bonus" to rewards that have not been sufficiently explored.
Key Innovations
- Offline Least-Square Regression (LSR) Oracle: Instead of complex RL-specific estimators, the framework uses a standard LSR oracle. This allows practitioners to utilize existing supervised learning models, such as deep neural networks or decision trees, to approximate rewards and transitions.
- Contextual Potential: To manage the context space, the authors define a new confidence interval that tracks information gathered about state-action pairs across different contexts and policies.
- Dynamics as Regression: The transition probability estimation is treated as a massive least-squares problem. By feeding the oracle samples of observed transitions, the agent builds an optimistic model of the environment's dynamics.
Theoretical Results
The paper analyzes three scenarios of increasing complexity: known dynamics, unknown context-independent dynamics, and unknown context-dependent dynamics. In all cases, the algorithms achieve sub-linear regret, specifically $\tilde{O}(\sqrt{T})$.
For the most challenging case where both transitions and rewards depend on context, the regret is bounded by $\tilde{O}((H + 1/p_{min})H|S|^{3/2}\sqrt{|A|T \log(\dots)})$. This analysis assumes "minimum reachability" ($p_{min}$), ensuring that any policy has a non-zero probability of reaching any state, preventing the agent from becoming trapped in unlearnable regions of the state space.
Lower Bound Construction
The authors also establish a lower bound for the expected regret, proving that their dependence on the number of episodes ($T$) is near-optimal. This lower bound holds even when the dynamics are known.
As shown in the figure above, the lower bound construction utilizes a specific MDP structure where the agent must distinguish between many possible paths to reach the final state $s_H$, illustrating the inherent complexity of the contextual setting.
Discussion and Future Work
This work demonstrates that generalization in CMDPs is possible without linear assumptions by using any finite, realizable function class. However, several challenges remain:
- Dependency on $p_{min}$: The current $\sqrt{T}$ bounds depend heavily on $1/p_{min}$. If certain states are difficult to reach, the regret constant increases significantly.
- Realizability: The proofs assume the true reward and transition functions reside within the provided function classes. Extending this to "agnostic" settings where the model is misspecified is a key next step.
- Planning Complexity: While efficient relative to the context space, the algorithm requires solving a planning problem (finding the optimal policy for a given MDP) in every episode, which can be computationally expensive for large state spaces.
Summary updated