Forward and Backward State Abstractions for Off-policy Evaluation
Meiling Hao1∗, **fan Su2***Co-first authors, Liyuan Hu2, Zoltán Szabó2, Qingyuan Zhao3 and Chengchun Shi2†††Corresponding author. Email: [email protected]
1 School of Statistics,
University of International Business and Economics,
Bei**g, 100029, China
2 Department of Statistics,
London School of Economics and Political Science,
London, WC2A2AE, United Kingdom
3 Statistics in the Statistical Laboratory, Department of Pure Mathematics and Mathematical Statistics (DPMMS),
University of Cambridge,
Cambridge, CB30WB,United Kingdom
Abstract. Off-policy evaluation (OPE) is crucial for evaluating a target policy’s impact offline before its deployment. However, achieving accurate OPE in large state spaces remains challenging. This paper studies state abstractions – originally designed for policy learning – in the context of OPE. Our contributions are three-fold: (i) We define a set of irrelevance conditions central to learning state abstractions for OPE. (ii) We derive sufficient conditions for achieving irrelevance in Q-functions and marginalized importance sampling ratios, the latter obtained by constructing a time-reversed Markov decision process (MDP) based on the observed MDP. (iii) We propose a novel two-step procedure that sequentially projects the original state space into a smaller space, which substantially simplify the sample complexity of OPE arising from high cardinality.
1 Introduction
Motivation. Off-policy evaluation (OPE) serves as a crucial tool for assessing the impact of a newly developed policy using a pre-collected historical data before its deployment in high-stake applications, such as healthcare (Murphy et al., 2001), recommendation systems (Chapelle & Li, 2011), education (Mandel et al., 2014), dialog systems (Jiang et al., 2021) and robotics (Levine et al., 2020). A fundamental challenge in OPE is its “off-policy” nature, wherein the target policy to be evaluated differs from the behavior policy that generates the offline data. This distributional shift is particularly pronounced in environments with large state spaces of high cardinality. Theoretically, the minimax rate for estimating the target policy’s Q-function decreases rapidly as the state space dimension increases (Chen & Qi, 2022). Empirically, large state space significantly challenges the performance of state-of-the-art OPE algorithms (Fu et al., 2020; Voloshin et al., 2021).
Although different policies induce different trajectories in the large ground state space, they can produce similar paths when restricted to relevant, lower-dimensional state spaces (Pavse & Hanna, 2023). Consequently, applying OPE to these abstract spaces can significantly mitigate the distributional shift between target and behavior policies, enhancing the accuracy in predicting the target policy’s value. This makes state abstraction, designed to reduce state space cardinality, particularly appealing for OPE. However, despite the extensive literature on studying state abstractions for policy learning (see Section 1.1 for details), it has been hardly explored in the context of OPE.
Contributions. This paper aims to systematically investigate state abstractions for OPE to address the aforementioned gap. Our main contributions include:
-
1.
Introduction of a set of irrelevance conditions for OPE, accompanied by validations of various OPE methods when applied to abstract state spaces under these conditions.
-
2.
Derivation of sufficient conditions for state abstractions to achieve irrevelance in Q-functions and marginalized importance sampling (MIS) ratios. A key ingredient of our proposal lies in constructing a time-reversed Markov decision process (MDP, Puterman, 2014) by swap** the future and past. This effectively yields state abstractions that achieve the irrelevance property.
-
3.
Development of a novel two-step procedure to sequentially obtain a smaller state space and reduce the sample complexity of OPE. It is also guaranteed to yield a smaller state space compared to existing single-step abstractions.
1.1 Related work
Our proposal is closely related to OPE and state abstraction. Additional related work on confounder selection in causal inference is relegated to Appendix A.
Off-policy evaluation. OPE aims to estimate the average return of a given target policy, utilizing historical data generated by a possibly different behavior policy (Dudík et al., 2014; Uehara et al., 2022). The majority of methods in the literature can be classified into the following three categories:
- 1.
-
2.
Importance sampling (IS) methods that adjust the observed rewards using the IS ratio, i.e., the ratio of the target policy over the behavior policy, to address their distributional shift. There are two major types: sequential IS (SIS, Precup, 2000; Thomas et al., 2015; Hanna et al., 2019; Hu & Wager, 2023) which employs a cumulative IS ratio, and marginalized IS (Liu et al., 2018; Nachum et al., 2019; Xie et al., 2019; Dai et al., 2020; Yin & Wang, 2020; Wang et al., 2023) which uses the MIS ratio to mitigate the high variance of the SIS estimator.
-
3.
Doubly robust methods or their variants that employ both the IS ratio and the value/reward function to enhance the robustness of OPE (Zhang et al., 2013; Jiang & Li, 2016; Thomas & Brunskill, 2016; Farajtabar et al., 2018; Kallus & Uehara, 2020; Tang et al., 2020; Uehara et al., 2020; Shi et al., 2021; Kallus & Uehara, 2022; Liao et al., 2022; Xie et al., 2023).
However, none of the aforementioned works studied state abstraction, which is our primary focus.
State abstraction. State abstraction aims to obtain a parsimonious state representation to simplify the sample complexity of reinforcement learning (RL), while ensuring that the optimal policy restricted to the abstract state space attains comparable values as in the original, ground state space. There is an extensive literature on the theoretical and methodological development of state abstraction, particularly bisimulation — a type of abstractions that preserve the Markov property in the abstracted state (Singh et al., 1994; Dean & Givan, 1997; Givan et al., 2003; Ravindran, 2004; Jong & Stone, 2005; Li et al., 2006; Ferns et al., 2004, 2011; Pathak et al., 2017; Wang et al., 2017; Ha & Schmidhuber, 2018; François-Lavet et al., 2019; Gelada et al., 2019; Castro, 2020; Zhang et al., 2020; Allen et al., 2021; Abel, 2022). In particular, Li et al. (2006) analyzed five irrelevance conditions for optimal policy learning. Unlike the aforementioned works that focus on policy learning, we introduce irrelevance conditions for OPE, and propose abstractions that satisfy these irrelevant properties. Meanwhile, the proposed abstraction for achieving irrelevance for the MIS ratio resembles the Markov state abstraction developed by Allen et al. (2021) in the context of policy learning.
More recently, Pavse & Hanna (2023) made a pioneering attempt to study state abstraction for OPE, proving its benefits in enhancing OPE accuracy. However, they primarily focused on MIS estimators. In contrast, our theoretical analysis applies to a broader range of estimators. Moreover, their abstraction did not achieve MIS-ratio irrelevance, nor did they implement the two-step procedure.
2 Preliminaries
In this section, we first introduce some key concepts relevant to OPE in RL, such as MDP, target and behavior policies, value functions, IS ratios (Section 2.1). We next review state abstractions for optimal policy learning (Section 2.2), alongside with four prominent OPE methodologies (Section 2.3).
2.1 Data generating process, policy, value and IS ratio
Data. Assume the offline dataset comprises multiple trajectories, each containing a sequence of state-action-reward triplets following a finite MDP, denoted by . Here, and are the discrete state and action spaces, both with finite cardinalities, and are the state transition and reward functions, denotes the initial state distribution, and is the discount factor.
The data is generated as follows: (i) At the initial time, the state is generated according to ; (ii) Subsequently, at each time , the agent finds the environment in a specific state and selects an action according to a behavior policy such that ; (iii) The environment delivers an immediate reward with an expected value of , and transits into the next state according to the transition function . Notice that both the reward and transition functions rely only on the current state-action pair , independent of the past data history. This ensures that the data satisfies the Markov assumption.
Policy and value. Let denote a given target policy we wish to evaluate. We use and to denote the expectation and probability assuming the actions are chosen according to at each time. The regular and without superscript are taking respect to the behavior policy . Our objective lies in estimating the expected cumulative reward under , denoted by using the offline dataset generated under a different policy . Additionally, denote and as the state value function and state-action value function (better known as the Q-function), namely,
(1) |
These functions are pivotal in develo** value-based estimators, as described in Method 1 of Section 2.3. Moreover, we use to denote the optimal policy that maximizes , i.e., , and write the optimal Q- and value functions , as , for brevity.
IS ratio. We also introduce the IS ratio , which quantifies the discrepancy between the target policy and the behavior policy . Furthermore, let denote the MIS ratio . Here, the numerator represents the discounted visitation probability under the target policy , a crucial component in policy-based learning for estimating (Sutton et al., 1999; Schulman et al., 2015). The denominator corresponds to the limiting state-action distribution under the behavior policy. These ratios are fundamental in constructing IS estimators, as detailed in Methods 2 and 3 of Section 2.3.
2.2 State abstractions for policy learning
Let be the ground MDP. A state abstraction is a map** from the state space to certain abstract state space . Below, we review some commonly studied definitions of state abstraction designed for learning the optimal policy ; see Jiang (2018).
Definition 1 (-irrelevance)
is -irrelevant if there exists an optimal policy , such that for any , whenever , we have for any .
Definition 2 (-irrelevance)
is -irrelevant if for any , whenever , the optimal Q-function satisfies for any .
Definitions 1 and 2 are easy to understand, requiring the optimal policy/Q-function to depend on a state only through its abstraction . In practical terms, these definitions encourage the transformation of raw MDP data into a new sequence of state-action-reward triplets for policy learning. However, the transformed data may not necessarily satisfy the Markov assumption. This leads us to define the following model-irrelevance, which aims to preserve the MDP structure while ensuring - and -irrelevance.
Definition 3 (Model-irrelevance)
is model-irrelevant if for any , whenever , the following holds for any , and :
(2) |
The first condition in (2) corresponds to “reward-irrelevance” whereas the second condition represents “transition-irrelevance”. Consequently, Definition 3 defines a “model-based” abstraction, in contrast to “model-free” abstractions considered in Definitions 1 and 2. Notice that the term – appearing in the second equation of (2) – represents the probability of transitioning to in the abstract state space. Thus, the second condition essentially requires the abstract next state to be conditionally independent of given and . Assuming can be decomposed into the union of and , which represent relevant features and irrelevant features, respectively. The condition implies that the evolution of those relevant features depends solely on themselves, independent of those irrelevant features. This ensures that the transformed data triplets remains an MDP. Meanwhile, the evolution of those irrelevant features may still depend on the relevant features; see Figure 1(a) for an illustration.
It is also known that model-irrelevance implies -irrelevance, which in turn implies -irrelevance; see e.g., Theorem 2 in Li et al. (2006). Given that the transformed data remains an MDP under model-irrelevance, one can apply existing state-of-the-art RL algorithms to the abstract state space instead of the original ground space, leading to more effective learning of the optimal policy.
![Refer to caption](extracted/5695467/forwardirrelevance.png)
![Refer to caption](extracted/5695467/backwardirrelevance.png)
2.3 OPE methodologies
We focus on four OPE methods, covering the three families of estimators introduced in Section 1.1. Each method employs a specific formula to identify , which we detail below. The first method is a popular value-based approach – the Q-function-based method. The second and third methods are the two major IS estimators: SIS and MIS. The fourth method is a semi-parametrically efficient doubly robust method, double RL (DRL), known for achieving the smallest possible MSE among a broad class of OPE estimators (Kallus & Uehara, 2020, 2022).
Method 1 (Q-function-based method). For a given Q-function , define as the estimating function with being the initial state. By (1) and the definition of , it is immediate to see that . This motivates the Q-function-based method which uses a plug-in estimator to approximate and thereby estimates . In particular, can be estimated by Q-learning type algorithms (e.g., fitted Q-evaluation, FQE, Le et al., 2019), and the expectation can be approximated based on the empirical initial state distribution.
Method 2 (Sequential importance sampling). For a given IS ratio , let denote the cumulative IS ratio . It follows from the change of measure theorem that the counterfactual reward is equivalent to whose expectation is taken with respect to the offline data distribution. Assuming all trajectories in terminate after a finite time , this allows us to approximate by where . The approximation error is bounded by , which decays exponentially fast with respect to . SIS utilizes a plug-in estimator to initially estimate (when the behavior policy is unknown), and subsequently employs this estimator, along with the empirical data distribution, to approximate . However, a notable limitation of this estimator is its rapidly increasing variance due to the use of the cumulative IS ratio . Specifically, this variance tends to grow exponentially with respect to , a phenomenon often referred to as the curse of horizon (Liu et al., 2018).
Method 3 (Marginalized importance sampling). The MIS estimator is designed to overcome the limitations of the SIS estimator. It breaks the curse of horizon by incorporating the structure of the MDP model. As noted previously, under the Markov assumption, the reward depends only on the current state-action pair, rather than the entire history. This insight allows us to replace the cumulative IS ratio with the MIS ratio, which depends solely on the current state-action pair. This modification considerably reduces variance because is no longer history-dependent. Assuming the data trajectory is stationary over time – that is, all state-action-reward triplets have the same distribution – it can be shown that where for any triplet . Both and the expectation can be effectively estimated and approximated using offline data.
Method 4 (Double reinforcement learning). DRL combines Q-function-based method with MIS. Let , where is defined in Method 1 and denotes a state-action-reward-next-state tuple. Under the stationarity assumption, it can be shown that when either or (Kallus & Uehara, 2022). DRL proposes to learn both and from the data, employing these estimators to calculate and approximate the expectation with empirical data distribution. The resulting estimator benefits from double robustness: it is consistent when either or is correctly specified.
3 Proposed state abstractions for policy evaluation
Here, we propose model-free (Section 3.1) and model-based irrelevance conditions (Section 3.2) for OPE, and analyze the OPE estimators under these conditions (Theorem 1, Theorem 2, Theorem 3). Motivated by this analysis, we propose our two-step procedure (Section 3.3).
3.1 Model-free irrelevance conditions
We first introduce several model-free irrelevance conditions tailored for OPE.
Definition 4 (-irrelevance)
is -irrelevant if for any whenever , we have for any .
Definition 5 (-irrelevance)
is -irrelevant if for any whenever , we have for any .
Definitions 4 and 5 are adaptations of Definitions 1 and 2 designed for policy evaluation, with the optimal policy replaced by the target policy . The following definitions are tailored for IS estimators (see Methods 2 and 3 in Section 2.3).
Definition 6 (-irrelevance)
is -irrelevant if for any whenever , we have for any .
Definition 7 (-irrelevance)
is -irrelevant if for any whenever , we have for any .
Based on the aforementioned definitions, we can immediately state the following theorem:
Theorem 1 (OPE under model-free irrelevance conditions)
Under -, - or -irrelevance, the corresponding methods remain valid when applied to the abstract state space:
-
•
Under -irrelevance, the Q-function-based method (Method 1) remains valid, i.e., the Q-function defined on the abstract state space satisfies ;
-
•
Under -irrelevance, SIS (Method 2) remains valid, i.e., the IS ratio defined on the abstract state space satisfies ;
-
•
Under -irrelevance, MIS (Method 3) remains valid, i.e., the MIS ratio defined on the abstract state space satisfies .
Moreover, when satisfies either -irrelevance or -irrelevance, DRL (Method 4) remains valid, i.e., and defined on the abstract state space satisfy .
Theorem 1 validates the four OPE methods presented in Section 2.3 when applied to the abstract state space, under the corresponding irrelevance conditions. Notably, DRL requires weaker irrelevance conditions compared to the Q-function-based method and MIS, owing to its inherent double robustness property. Nevertheless, methods for deriving abstractions that satisfy these conditions (particularly - and -irrelevance) remain unclear. Furthermore, the state-action-reward triplets transformed via these abstractions might not maintain the MDP structure. This complicates the process of learning and . These challenges motivate us to develop model-based irrelevance conditions in the subsequent section.
3.2 Model-based irrelevance conditions
To begin with, we discuss two perspectives of the data generated within the MDP framework; see Figure 2 for a graphical illustration.
- 1.
-
2.
The second perspective offers a backward view by reversing the time order. Specifically, due to the symmetric nature of the Markov assumption — implying that if the future is independent of the past given the present, the past must also be independent of the future given the present — the reversed state-action pairs also maintain the Markov property. Leveraging this property, we define another backward MDP, which forms the basis for deriving model-based conditions for achieving -irrelevance and motivates the subsequent two-step procedure. This development represents one of our main contributions.
![Refer to caption](extracted/5695467/ForwardMDP.png)
![Refer to caption](extracted/5695467/BackwardMDP.png)
Forward MDP-based model-irrelevance. We first explore the relationship between the model-irrelevance given in Definition 3, and the notions of -, - and -irrelevance.
Theorem 2 (OPE under model-irrelevance)
Let denote a model-irrelevant abstraction.
-
•
If is additionally -irrelevant, then is also -irrelevant.
-
•
While is not necessarily -irrelevant, MIS (Method 3) remains valid when applied to the abstract state space. Indeed, the validity only requires reward-irrelevance (see the first part of (2)).
-
•
While is not necessarily -irrelevant, SIS (Method 2) remains valid when applied to the abstract state space if is additionally -irrelevant.
-
•
DRL (Method 4) remains valid when applied to the abstract state space.
The first bullet point establishes the link between model-irrelevance and -irrelevance, thus proving the validity of the Q-function-based method when applied to the abstract state space. To satisfy -irrelevance, we need both model-irrelevance and -irrelevance. In our implementation, we first adapt existing algorithms (Ha & Schmidhuber, 2018; François-Lavet et al., 2019; Gelada et al., 2019) to train a model-irrelevant abstraction , parameterized via deep neural networks. We next combine with to obtain a new abstraction . This augmentation ensures is -irrelevant, and hence -irrelevant. Refer to Appendix B.1 for the detailed procedures.
The last three bullet points prove the validity of the SIS, MIS and DRL, despite being neither -irrelevant nor -irrelevant. By definition, -irrelevance can be achieved by selecting state features that adequately predict the IS ratio. However, methods for constructing -irrelevant abstractions remain less clear. In the following, we introduce a backward MDP model-based irrelevance condition that ensures -irrelevance. We also note that findings similar to those in the first two bullet points have previously been documented in Li et al. (2006) and Pavse & Hanna (2023), respectively. However, the properties of SIS and DRL estimators under model-irrelevance conditions as summarized in our last two bullet points, remain unexplored in the existing literature.
Backward MDP-based model-irrelevance. To illustrate the rationale behind the proposed model-based abstraction, we introduce the backward MDP model by reversing the time index. Under the (forward) MDP model assumption described in Section 2.1 and that the behavior policy is not history-dependent, actions and states following are independent of those occurred prior to the realization of . Accordingly, is conditionally independent of given . Recall that corresponds to the termination time of trajectories in . We define a time-reversed process consisting of state-action-reward triplets . Its dynamics is described as follows (see also Figure 2(b) for the configuration):
-
•
State-action transition: Due to the aforementioned Markov property, the transition of the past state in the reversed process (future state in the original process) into the current state is independent of the past action in the reversed process (future action in the original process) while the behavior policy that generates depends on both the current state and the past state in the reversed process. This yields the time-reversed state-action transition function .
-
•
Reward generation: For each state-action pair , we manually set the reward to the IS ratio , which plays a crucial role in constructing IS estimators.
Given this MDP, analogous to Definition 3, our objective is to identify a state abstraction that is crucial for predicting the reward (e.g., the IS ratio) and the reversed transition function. We provide the formal definition of the proposed backward MDP-based model-irrelevance (short for backward-model-irrelevance) below.
Definition 8 (Backward-model-irrelevance)
is backward-model-irrelevant if for any whenever , the followings hold for any , and :
(3) |
The conditions of backward-model-irrelevance are similar to those specified for model-irrelevance outlined in Definition 3. The first condition (i) essentially requires reward-irrelevance, i.e., -irrelevance, in the backward MDP. The second condition in equation (8) is equivalent to the conditional independence assumption between the pair and given . As previously assumed, can be decomposed into the union of relevant features and irrelevant features , leading to the following factorization:
This indicates a two-step transition in the forward model: initially from to , and then from to . Importantly, the generation of in the second step is conditionally independent of and . Consequently, extracts state representations that are influenced either by past actions or past relevant features; see Figure 1(b) for an illustration. Combined with -irrelevance, this ensures that all information contained within the historical IS ratios can be effectively summarized using a single and the abstract state , thus achieving -irrelevance (see Theorem 3 below).
Theorem 3 (OPE under backward-model-irrelevance)
Assume is backward-model-irrelevant.
-
•
is both -irrelevant and -irrelevant.
-
•
While is not necessarily -irrelevant, the Q-function-based method (Method 1) remains valid when applied to the abstract state space.
-
•
DRL (Method 4) remains valid when applied to the abstract state space.
The first bullet point in Theorem 3 validates the two IS methods when applied to the abstract state space under the proposed backward-model-irrelevance, whereas the last two bullet points validate the Q-function-based method and DRL.
To conclude this section, we draw a connection between the proposed backward-model-irrelevant abstraction for OPE and the Markov state abstraction (MSA) developed by Allen et al. (2021) for policy learning. MSA impose two conditions: (i) inverse-model-irrelevance, which requires to be conditionally independent of and given and ; (ii) density-ratio-irrelevance, which requires to be conditionally independent of given . For effective policy learning, MSA requires both conditions to hold in data generating processes following a diverse range of behavior policies. When restricting them to one behavior policy, the two conditions are closely related to our backward-model-irrelevance. In particular, they imply our proposed condition in (8) whereas (8) in turn yields density-ratio-irrelevance. This allows us to adapt their algorithm to train state abstractions that satisfy backward-model-irrelevance; see Appendix B.2 for details.
![Refer to caption](extracted/5695467/two_step.jpg)
![Refer to caption](extracted/5695467/toyexample.jpg)
3.3 Two-step procedure for forward and backward state abstraction
The proposed two-step procedure proceeds as follows (see Figure 3(a) for a visualization):
-
1.
Forward abstraction: learn an abstraction from the ground state space to using the data triplets that is both (forward)-model-irrelevant and -irrelevant.
-
2.
Backward abstraction: Learn an abstraction from the abstract state space to using the data triplets that is backward-model-irrelevant.
-
3.
Output for off-policy evaluation.
To summarize, our approach sequentially applies the forward and backward abstraction on the state obtained from the previous iteration, progressively reducing state cardinality. To elaborate the usefulness of the two-step procedure in reducing state cardinality, we first analyze a toy example.
A toy example: Consider an MDP where the state variables can be classified into three groups, depicted in Figure 3(b). For this example, we focus on a specific type of state abstraction known as variable selection, which selects a sub-vector from the original state. Key observations from this example are as follows: (i) The reward depends on the state only through the first group of variables; (ii) The evolution of the first group of variables depends only on the second group, and this dependency is indirect. Specifically, the second group evolves first at each time step and subsequently influences the first group; (iii) The second and third groups in the MDP evolve independently, each relying solely on their own previous states; (iv) The behavior policy depends only on the last two groups; (v) Only the second group of variables is directly influenced by the previous action.
According to (i), selecting the first group of variables achieves reward-irrelevance. Combined with (ii) and (iii), choosing the first two groups achieves model-irrelevance. Assuming the target policy is agnostic to the state, the proposed forward abstraction will select the first two groups of variables.
According to (iv) and that the target policy is state-agnostic, selecting the last two groups attains -irrelevance. Meanwhile, according to (ii) and (v), selecting these variables also achieves backward-model-irrelevance. Thus, the proposed backward abstraction will select the last two groups.
In the two-step procedure, the forward abstraction first eliminates the third group of variables. Given conditions (ii)-(v), selecting just the second group suffices to achieve backward-model-irrelevance, leading to the elimination of the first group in the subsequent backward abstraction. After two iterations, the procedure produces only one group of variables, demonstrating its efficiency in reducing dimensions compared to using either forward or backward abstraction alone.
In more complex scenarios, each abstraction guarantees that the cardinality of the state space does not increase, effectively maintaining or reducing complexity. The reduction is more likely because forward and backward abstractions, as illustrated in Figures 1(a) and (b), differ by definition. Meanwhile, according to Theorems 2 and 3, the post-abstraction-OPE remains valid for any of the four methods.
Theorem 4 (The two-step procedure)
The four OPE methods remain valid when applied to the abstracted state produced by the proposed two-step procedure.
Finally, we note that one may further consider an iterative procedure that alternates between forward and backward abstractions. However, it remains unclear whether these methods have guarantees.
4 Numerical experiments
Method. We investigate the finite sample performance of our proposed methods (details in Appendix B), the forward, backward and two-step procedures.
Comparisons. We compare the proposed abstraction obtained via the two-step procedure (denoted by ‘two-step’), single-iteration forward (‘forward’) and backward (‘backward’) abstractions against Markov state abstraction (Allen et al., 2021) (‘Markov’) and a reconstruction-based abstraction (Lange & Riedmiller, 2010) (‘auto-encoder’). Each abstraction’s performance is tested using FQE (Le et al., 2019) applied to the abstract state space. We also report the performance of a baseline FQE applied to the unabstracted, ground state space (‘FQE’).
Environments. We consider two environments from OpenAI Gym (Brockman et al., 2016), “CartPole-v0” and “LunarLander-v2”, with original state dimensions of 4 and 8, respectively. For each environment, we manually include 296 and 292 irrelevant variables in the state, leading to a challenging 300-dimensional system. Refer to Appendix C for more details about these environments.
Results. We report the MSEs and biases of different post-abstraction-OPE estimators and those of the baseline FQE estimator without abstraction in Figure 4 and Figure C.1 in Appendix C. We summarize our findings as follows. First, the proposed two-step method outperforms other baseline methods, with the smallest MSE and absolute bias in all cases. Since ‘Markov’ and ‘auto-encoder’ are types of model-irrelevant abstractions, these comparisons demonstrate the advantages of the proposed two-step method over single-iteration forward and backward procedures. Second, both figures indicate that the baseline FQE applied to the ground state space performs the worst among all cases. This demonstrates the usefulness of state abstractions for OPE.
![Refer to caption](x1.png)
References
- Abel (2022) Abel, D. A theory of abstraction in reinforcement learning. arXiv preprint arXiv:2203.00397, 2022.
- Abel et al. (2016) Abel, D., Hershkowitz, D., and Littman, M. Near optimal behavior via approximate state abstraction. In International Conference on Machine Learning, pp. 2915–2923, 2016.
- Allen et al. (2021) Allen, C., Parikh, N., Gottesman, O., and Konidaris, G. Learning Markov state abstractions for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 8229–8241, 2021.
- Austin (2011) Austin, P. C. An introduction to propensity score methods for reducing the effects of confounding in observational studies. Multivariate Behavioral Research, 46(3):399–424, 2011.
- Belloni et al. (2014) Belloni, A., Chernozhukov, V., and Hansen, C. Inference on treatment effects after selection among high-dimensional controls. Review of Economic Studies, 81(2):608–650, 2014.
- Brockman et al. (2016) Brockman, G., Cheung, V., Pettersson, L., Schneider, J., Schulman, J., Tang, J., and Zaremba, W. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
- Castro (2020) Castro, P. S. Scalable methods for computing state similarity in deterministic Markov decision processes. In AAAI Conference on Artificial Intelligence, pp. 10069–10076, 2020.
- Chapelle & Li (2011) Chapelle, O. and Li, L. An empirical evaluation of Thompson sampling. In Advances in Neural Information Processing Systems, pp. 2249–2257, 2011.
- Chen & Qi (2022) Chen, X. and Qi, Z. On well-posedness and minimax optimal rates of nonparametric Q-function estimation in off-policy evaluation. In International Conference on Machine Learning, pp. 3558–3582, 2022.
- Dai et al. (2020) Dai, B., Nachum, O., Chow, Y., Li, L., Szepesvári, C., and Schuurmans, D. CoinDICE: Off-policy confidence interval estimation. In Advances in Neural Information Processing Systems, pp. 9398–9411, 2020.
- De Luna et al. (2011) De Luna, X., Waernbaum, I., and Richardson, T. S. Covariate selection for the nonparametric estimation of an average treatment effect. Biometrika, 98(4):861–875, 2011.
- Dean & Givan (1997) Dean, T. and Givan, R. Model minimization in Markov decision processes. In Conference on Artificial Intelligence / Conference on Innovative Applications of Artificial Intelligence, pp. 106–111, 1997.
- Dudík et al. (2014) Dudík, M., Erhan, D., Langford, J., and Li, L. Doubly robust policy evaluation and optimization. Statistical Science, 29(4):485–511, 2014.
- Farajtabar et al. (2018) Farajtabar, M., Chow, Y., and Ghavamzadeh, M. More robust doubly robust off-policy evaluation. In International Conference on Machine Learning, pp. 1447–1456, 2018.
- Feng et al. (2020) Feng, Y., Ren, T., Tang, Z., and Liu, Q. Accountable off-policy evaluation with kernel Bellman statistics. In International Conference on Machine Learning, pp. 3102–3111, 2020.
- Ferns et al. (2004) Ferns, N., Panangaden, P., and Precup, D. Metrics for finite Markov decision processes. In Conference on Uncertainty in Artificial Intelligence, pp. 162–169, 2004.
- Ferns et al. (2011) Ferns, N., Panangaden, P., and Precup, D. Bisimulation metrics for continuous Markov decision processes. SIAM Journal on Computing, 40(6):1662–1714, 2011.
- François-Lavet et al. (2019) François-Lavet, V., Bengio, Y., Precup, D., and Pineau, J. Combined reinforcement learning via abstract representations. In AAAI Conference on Artificial Intelligence, pp. 3582–3589, 2019.
- Fu et al. (2020) Fu, J., Norouzi, M., Nachum, O., Tucker, G., Novikov, A., Yang, M., Zhang, M. R., Chen, Y., Kumar, A., Paduraru, C., et al. Benchmarks for deep off-policy evaluation. In International Conference on Learning Representations, 2020.
- Gelada et al. (2019) Gelada, C., Kumar, S., Buckman, J., Nachum, O., and Bellemare, M. G. DeepMDP: Learning continuous latent space models for representation learning. In International Conference on Machine Learning, pp. 2170–2179, 2019.
- Givan et al. (2003) Givan, R., Dean, T., and Greig, M. Equivalence notions and model minimization in Markov decision processes. Artificial Intelligence, 147(1-2):163–223, 2003.
- Glymour et al. (2008) Glymour, M. M., Weuve, J., and Chen, J. T. Methodological challenges in causal research on racial and ethnic patterns of cognitive trajectories: measurement, selection, and bias. Neuropsychology Review, 18:194–213, 2008.
- Greenland et al. (1999) Greenland, S., Pearl, J., and Robins, J. M. Confounding and collapsibility in causal inference. Statistical science, 14(1):29–46, 1999.
- Guo & Zhao (2023) Guo, F. R. and Zhao, Q. Confounder selection via iterative graph expansion. arXiv preprint arXiv:2309.06053, 2023.
- Guo et al. (2022) Guo, F. R., Lundborg, A. R., and Zhao, Q. Confounder selection: Objectives and approaches. arXiv preprint arXiv:2208.13871, 2022.
- Ha & Schmidhuber (2018) Ha, D. and Schmidhuber, J. Recurrent world models facilitate policy evolution. In Advances in Neural Information Processing Systems, pp. 2455–2467, 2018.
- Hanna et al. (2019) Hanna, J., Niekum, S., and Stone, P. Importance sampling policy evaluation with an estimated behavior policy. In International Conference on Machine Learning, pp. 2605–2613, 2019.
- Hao et al. (2021) Hao, B., Ji, X., Duan, Y., Lu, H., Szepesvari, C., and Wang, M. Bootstrap** fitted Q-evaluation for off-policy inference. In International Conference on Machine Learning, pp. 4074–4084, 2021.
- Hernán & Robins (2010) Hernán, M. A. and Robins, J. M. Causal inference, 2010.
- Hernán & Robins (2016) Hernán, M. A. and Robins, J. M. Using big data to emulate a target trial when a randomized trial is not available. American Journal of Epidemiology, 183(8):758–764, 2016.
- Hu & Wager (2023) Hu, Y. and Wager, S. Off-policy evaluation in partially observed Markov decision processes under sequential ignorability. The Annals of Statistics, 51(4):1561–1585, 2023.
- Jiang et al. (2021) Jiang, H., Dai, B., Yang, M., Zhao, T., and Wei, W. Towards automatic evaluation of dialog systems: A model-free off-policy evaluation approach. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 7419–7451, 2021.
- Jiang (2018) Jiang, N. Notes on state abstractions, 2018.
- Jiang & Li (2016) Jiang, N. and Li, L. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 652–661, 2016.
- Jong & Stone (2005) Jong, N. K. and Stone, P. State abstraction discovery from irrelevant state variables. In International Joint Conference on Artificial Intelligence, pp. 752–757, 2005.
- Kallus & Uehara (2020) Kallus, N. and Uehara, M. Double reinforcement learning for efficient off-policy evaluation in Markov decision processes. Journal of Machine Learning Research, 21(167):1–63, 2020.
- Kallus & Uehara (2022) Kallus, N. and Uehara, M. Efficiently breaking the curse of horizon in off-policy evaluation with double reinforcement learning. Operations Research, 70(6):3282–3302, 2022.
- Kingma & Ba (2014) Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
- Koch et al. (2020) Koch, B., Vock, D. M., Wolfson, J., and Vock, L. B. Variable selection and estimation in causal inference using Bayesian spike and slab priors. Statistical Methods in Medical Research, 29(9):2445–2469, 2020.
- Lange & Riedmiller (2010) Lange, S. and Riedmiller, M. Deep auto-encoder neural networks in reinforcement learning. In International Joint Conference on Neural Networks, pp. 1–8, 2010.
- Laskin et al. (2020) Laskin, M., Srinivas, A., and Abbeel, P. Curl: Contrastive unsupervised representations for reinforcement learning. In International Conference on Machine Learning, pp. 5639–5650, 2020.
- Le et al. (2019) Le, H., Voloshin, C., and Yue, Y. Batch policy learning under constraints. In International Conference on Machine Learning, pp. 3703–3712, 2019.
- Levine et al. (2020) Levine, S., Kumar, A., Tucker, G., and Fu, J. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
- Li et al. (2024) Li, G., Wu, W., Chi, Y., Ma, C., Rinaldo, A., and Wei, Y. High-probability sample complexities for policy evaluation with linear function approximation. IEEE Transactions on Information Theory, 2024.
- Li et al. (2006) Li, L., Walsh, T. J., and Littman, M. L. Towards a unified theory of state abstraction for MDPs. AI&M, 1(2):3, 2006.
- Liao et al. (2021) Liao, P., Klasnja, P., and Murphy, S. Off-policy estimation of long-term average outcomes with applications to mobile health. Journal of the American Statistical Association, 116(533):382–391, 2021.
- Liao et al. (2022) Liao, P., Qi, Z., Wan, R., Klasnja, P., and Murphy, S. A. Batch policy learning in average reward Markov decision processes. Annals of Statistics, 50(6):3364, 2022.
- Liu et al. (2018) Liu, Q., Li, L., Tang, Z., and Zhou, D. Breaking the curse of horizon: Infinite-horizon off-policy estimation. In Advances in Neural Information Processing Systems, pp. 5361–5371, 2018.
- Luckett et al. (2019) Luckett, D. J., Laber, E. B., Kahkoska, A. R., Maahs, D. M., Mayer-Davis, E., and Kosorok, M. R. Estimating dynamic treatment regimes in mobile health using V-learning. Journal of the American Statistical Association, 115:692–706, 2019.
- Ma et al. (2023) Ma, T., Cai, H., Qi, Z., Shi, C., and Laber, E. B. Sequential knockoffs for variable selection in reinforcement learning. arXiv preprint arXiv:2303.14281, 2023.
- Mandel et al. (2014) Mandel, T., Liu, Y.-E., Levine, S., Brunskill, E., and Popovic, Z. Offline policy evaluation across representations with applications to educational games. In International Conference on Autonomous Agents and Multi-Agent Systems, pp. 1077–1084, 2014.
- Murphy et al. (2001) Murphy, S. A., van der Laan, M. J., Robins, J. M., and Group, C. P. P. R. Marginal mean models for dynamic regimes. Journal of the American Statistical Association, 96(456):1410–1423, 2001.
- Nachum et al. (2019) Nachum, O., Chow, Y., Dai, B., and Li, L. DualDICE: Behavior-agnostic estimation of discounted stationary distribution corrections. In Advances in Neural Information Processing systems, pp. 2318–2328, 2019.
- Pathak et al. (2017) Pathak, D., Agrawal, P., Efros, A. A., and Darrell, T. Curiosity-driven exploration by self-supervised prediction. In International Conference on Machine Learning, pp. 2778–2787, 2017.
- Pavse & Hanna (2023) Pavse, B. S. and Hanna, J. P. Scaling marginalized importance sampling to high-dimensional state-spaces via state abstraction. In AAAI Conference on Artificial Intelligence, pp. 9417–9425, 2023.
- Pearl (2009) Pearl, J. Causality. Cambridge University Press, Cambridge, UK, 2 edition, 2009. ISBN 978-0-521-89560-6. doi: 10.1017/CBO9780511803161.
- Persson et al. (2017) Persson, E., Häggström, J., Waernbaum, I., and de Luna, X. Data-driven algorithms for dimension reduction in causal inference. Computational statistics & data analysis, 105:280–292, 2017.
- Precup (2000) Precup, D. Eligibility traces for off-policy policy evaluation. In International Conference on Machine Learning, pp. 759–766, 2000.
- Puterman (2014) Puterman, M. L. Markov decision processes: discrete stochastic dynamic programming. John Wiley & Sons, 2014.
- Ravindran (2004) Ravindran, B. An algebraic approach to abstraction in reinforcement learning. University of Massachusetts Amherst, 2004.
- Robins (1997) Robins, J. M. Causal inference from complex longitudinal data. In Latent variable modeling and applications to causality, pp. 69–117. Springer, 1997.
- Rubin (2009) Rubin, D. B. Should observational studies be designed to allow lack of balance in covariate distributions across treatment groups? Statistics in Medicine, 28(9):1420–1423, 2009.
- Schulman et al. (2015) Schulman, J., Levine, S., Abbeel, P., Jordan, M., and Moritz, P. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015.
- Shelhamer et al. (2016) Shelhamer, E., Mahmoudieh, P., Argus, M., and Darrell, T. Loss is its own reward: Self-supervision for reinforcement learning. arXiv preprint arXiv:1612.07307, 2016.
- Shi et al. (2021) Shi, C., Wan, R., Chernozhukov, V., and Song, R. Deeply-debiased off-policy interval estimation. In International Conference on Machine Learning, pp. 9580–9591, 2021.
- Shi et al. (2022) Shi, C., Zhang, S., Lu, W., and Song, R. Statistical inference of the value function for reinforcement learning in infinite-horizon settings. Journal of the Royal Statistical Society Series B, 84(3):765–793, 2022.
- Shortreed & Ertefaie (2017) Shortreed, S. M. and Ertefaie, A. Outcome-adaptive Lasso: variable selection for causal inference. Biometrics, 73(4):1111–1122, 2017.
- Singh et al. (1994) Singh, S., Jaakkola, T., and Jordan, M. Reinforcement learning with soft state aggregation. In Advances in Neural Information Processing Systems, pp. 361–368, 1994.
- Sutton et al. (1999) Sutton, R. S., McAllester, D., Singh, S., and Mansour, Y. Policy gradient methods for reinforcement learning with function approximation. In Advances in Neural Information Processing Systems, pp. 1057–1063, 1999.
- Sutton et al. (2008) Sutton, R. S., Szepesvári, C., and Maei, H. R. A convergent algorithm for off-policy temporal-difference learning with linear function approximation. In Advances in Neural Information Processing Systems, pp. 1609–1616, 2008.
- Tang et al. (2020) Tang, Z., Feng, Y., Li, L., Zhou, D., and Liu, Q. Doubly robust bias reduction in infinite horizon off-policy estimation. In International Conference on Learning Representations, 2020.
- Tangkaratt et al. (2016) Tangkaratt, V., Morimoto, J., and Sugiyama, M. Model-based reinforcement learning with dimension reduction. Neural Networks, 84:1–16, 2016.
- Thomas & Brunskill (2016) Thomas, P. and Brunskill, E. Data-efficient off-policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, pp. 2139–2148, 2016.
- Thomas et al. (2015) Thomas, P., Theocharous, G., and Ghavamzadeh, M. High-confidence off-policy evaluation. In AAAI Conference on Artificial Intelligence, pp. 3000–3006, 2015.
- Uehara et al. (2020) Uehara, M., Huang, J., and Jiang, N. Minimax weight and Q-function learning for off-policy evaluation. In International Conference on Machine Learning, pp. 9659–9668, 2020.
- Uehara et al. (2021) Uehara, M., Zhang, X., and Sun, W. Representation learning for online and offline RL in low-rank MDPs. In International Conference on Learning Representations, 2021.
- Uehara et al. (2022) Uehara, M., Shi, C., and Kallus, N. A review of off-policy evaluation in reinforcement learning. arXiv preprint arXiv:2212.06355, 2022.
- Vander Weele & Shpitser (2011) Vander Weele, T. J. and Shpitser, I. A new criterion for confounder selection. Biometrics, 67(4):1406–1413, 2011.
- VanderWeele (2019) VanderWeele, T. J. Principles of confounder selection. European Journal of Epidemiology, 34:211–219, 2019.
- Voloshin et al. (2021) Voloshin, C., Le, H. M., Jiang, N., and Yue, Y. Empirical study of off-policy policy evaluation for reinforcement learning. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2021.
- Wang et al. (2023) Wang, J., Qi, Z., and Wong, R. K. Projected state-action balancing weights for offline reinforcement learning. The Annals of Statistics, 51(4):1639–1665, 2023.
- Wang et al. (2017) Wang, L., Laber, E. B., and Witkiewitz, K. Sufficient Markov decision processes with alternating deep neural networks. arXiv preprint arXiv:1704.07531, 2017.
- Xie et al. (2023) Xie, C., Yang, W., and Zhang, Z. Semiparametrically efficient off-policy evaluation in linear Markov decision processes. In International Conference on Machine Learning, pp. 38227–38257, 2023.
- Xie et al. (2019) Xie, T., Ma, Y., and Wang, Y.-X. Towards optimal off-policy evaluation for reinforcement learning with marginalized importance sampling. In Advances in Neural Information Processing Systems, pp. 9668–9678, 2019.
- Yin & Wang (2020) Yin, M. and Wang, Y.-X. Asymptotically efficient off-policy evaluation for tabular reinforcement learning. In International Conference on Artificial Intelligence and Statistics, pp. 3948–3958, 2020.
- Zhang et al. (2020) Zhang, A., McAllister, R. T., Calandra, R., Gal, Y., and Levine, S. Learning invariant representations for reinforcement learning without reconstruction. In International Conference on Learning Representations, 2020.
- Zhang & Zhang (2018) Zhang, B. and Zhang, M. Variable selection for estimating the optimal treatment regimes in the presence of a large number of covariates. The Annals of Applied Statistics, 12(4):2335–2358, 2018.
- Zhang et al. (2013) Zhang, B., Tsiatis, A. A., Laber, E. B., and Davidian, M. Robust estimation of optimal dynamic treatment regimes for sequential treatment decisions. Biometrika, 100(3):681–694, 2013.
Appendix
This appendix is structured as follows: Section A introduces additional related works on confounder selection in causal inference. The implementation details of the proposed state abstraction are discussed in Section B. Additional information concerning the environments and computing resources utilized is presented in Section C. All technical proofs can be found in Section D.
Appendix A Confounder selection in causal inference
Broadly speaking, confounding refers to the problem that even if two variables are not causes of each other, they may exhibit statistical association due to common causes. Controlling for confounding is a central problem in the design of observational studies, and many criteria for confounder selection have been proposed in the literature. A commonly adopted criterion is the “common cause heuristic”, where the user only controls for covariates that are related to both the treatment and the outcome (Glymour et al., 2008; Austin, 2011; Shortreed & Ertefaie, 2017; Koch et al., 2020). Another widely used criterion is to simply use all covariates that are observed before the treatment in time (Rubin, 2009; Hernán & Robins, 2010, 2016). However, both of these approaches are not guaranteed to find a set of covariates that are sufficient to control for confounding. From a graphical perspective, confounder selection is essentially about finding a set of covariates that block all “back-door” paths (Pearl, 2009), but this requires full structural knowledge about the causal relationship between the variables which is often not possible. This motivated some methods that only require partial structural knowledge (Vander Weele & Shpitser, 2011; VanderWeele, 2019; Guo & Zhao, 2023). All the aforementioned methods need substantive knowledge about the treatment, outcome, and covariates. Other methods use statistical tests (usually of conditional independence) to trim a set of covariates that are assumed to control for confounding (Robins, 1997; Greenland et al., 1999; Hernán & Robins, 2010; De Luna et al., 2011; Belloni et al., 2014; Persson et al., 2017). The reader is referred to Guo et al. (2022) for a recent survey of objectives and approaches for confounder selection.
Confounder selection can be considered as a special example of our problem under certain conditions: (i) The state transition is independent, effectively transforming the MDP into a contextual bandit; (ii) The action space is binary, with the target policy consistently assigning either action 0 or action 1, aimed at assessing the average treatment effect; (iii) State abstractions are confined to variable selections. While our proposed two-step procedure shares similar spirits with the aforementioned algorithms, it addresses a more complex problem involving state transitions. Additionally, our focus is on abstraction that facilitates the engineering of new feature vectors, rather than merely selecting a subset of existing ones.
Appendix B Implementation details
In this section, we present implementation details for forward abstraction (Section B.1) and backward abstraction (Section B.2).
B.1 Implementation details for forward abstraction
We provide details for implementing the proposed forward abstraction in this subsection. We use deep neural networks to parameterize the forward abstraction and estimate the parameters by minimzing the following loss function:
(B.1) |
where , and are the loss functions detailed below, is a penalty term, and are positive constant hyper-parameters whose values are reported in Table B.1.
By definition, the forward abstraction is required to achieve both model-irrelevance and -irrelevance. As discussed in Section 3.2, our approach is to learn a model-irrelevant abstraction, denoted as , and then concatenate it with . We denote the concatenated abstraction by .
We next detail the loss functions and the penalty term. The first two losses and are to ensure reward-irrelevance and transition-irrelevance, respectively,
where and are the estimated reward and transition functions applied to the abstract state space parameterized by deep neural networks as well, and is the cardinality of the dataset .
The inclusion of the third loss function, , is motivated by the demonstrated benefits of utilizing model-free objectives to guide the training of state abstractions in policy learning, as evidenced by Gelada et al. (2019); Ha & Schmidhuber (2018); François-Lavet et al. (2019). Given our interest in OPE, we integrate the following FQE loss into the objective function,
where and represent the estimated function applied to the abstract state space during the previous and current iterations, respectively.
The above objectives allow us to effectively train forward abstractions. However, a potential concern is that the resulting abstraction and transition can collapse to some constant such that . To address this limitation, we include the following penalty function of two randomly drawn states to promote diversity in the abstractions:
for some positive scaling constant , and is the estimated abstract state from transition function. can be achieved by shuffling from pairs in the batch. Additionally, we add another penalty to penalize consecutive abstract states for being more than some predefined distance away from each other,
for some positive constant . These components combine into the final penalty function:
The forward model architecture is as follow:
Forward_model( (encoder): Encoder_linear( (activation): ReLU() (encoder_net): Sequential( (0): Linear(in_features=300, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.2, inplace=False) (8): Linear(in_features=64, out_features=100, bias=True) ) ) (transition): Transition( (activation): ReLU() (T_net): Sequential( (0): Linear(in_features=100, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) ) (lstm): LSTMCell(64, 128) (tanh): Tanh() ) (reward): Reward( (activation): ReLU() (reward_net): Sequential( (0): Linear(in_features=100, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.2, inplace=False) (8): Linear(in_features=64, out_features=64, bias=True) (9): ReLU() (10): Dropout(p=0.2, inplace=False) (11): Linear(in_features=64, out_features=64, bias=True) (12): ReLU() (13): Dropout(p=0.2, inplace=False) (14): Linear(in_features=64, out_features=2, bias=True) ) ) (FQE): FQE( (activation): ReLU() (action_net): Sequential( (0): Linear(in_features=1, out_features=16, bias=True) (1): ReLU() (2): Linear(in_features=16, out_features=100, bias=True) ) (xa_net): Linear(in_features=200, out_features=100, bias=True) (FQE_net): Sequential( (0): Linear(in_features=100, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.2, inplace=False) (8): Linear(in_features=64, out_features=2, bias=True) ) ) )
Environment | Hyper-parameters | Values | Hyper-parameters | Values | ||
---|---|---|---|---|---|---|
CartPole-v0 | 1 | 1 | ||||
1 | 1 | |||||
1 | 1 | |||||
1 | ||||||
1 | 1 | |||||
LunarLander-v2 | 1 | 1 | ||||
1 | 1 | |||||
1 | 1 | |||||
1 | ||||||
1 | 1 | |||||
B.2 Implementation details for backward abstraction
We provide details for implementing the proposed backward abstraction in this subsection. Similar to Section B.1, we use deep neural networks to parameterize the abstraction and estimate the parameters by solving the following loss function,
where are positive hyper-parameters specified in Table B.1.
Recall that backward-model-irrelevance requires both -irrelevance (Definition 6) and (8). The first loss function is designed to enforce -irrelevance, specified as
where denotes some consistent estimator of the IS ratio. Note that in two-step procedure, we should replace by:
where is estimated from the abstracted experiences and keeps static due to the -irrelevance property of forward abstraction.
As commented in Section 3.2, the second condition of (8) holds by satisfying the conditional independence assumption between and given . By Bayesian formula, we can show that it is satisfied by the inverse-model-irrelevance and density-ratio-irrelevance when setting the learning policy to . This motivates us to leverage the two objectives and used by Allen et al. (2021) for training MSA. More details regarding these losses can be found in Section 5 of Allen et al. (2021). Note that to obtain non-sequential states used in , we flip in the pairs in each batch instead of shuffling.
Finally, corresponds to the smoothness penalty introduced in Section B.1. The backward model architecture is:
Backward_model( (encoder): Encoder_linear( (activation): ReLU() (encoder_net): Sequential( (0): Linear(in_features=100, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.2, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.2, inplace=False) (8): Linear(in_features=64, out_features=6, bias=True) ) ) (inverse): Inverse( (activation): ReLU() (inverse_net): Sequential( (0): Linear(in_features=12, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.3, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.3, inplace=False) (8): Linear(in_features=64, out_features=64, bias=True) (9): ReLU() (10): Dropout(p=0.3, inplace=False) (11): Linear(in_features=64, out_features=64, bias=True) (12): ReLU() (13): Dropout(p=0.3, inplace=False) (14): Linear(in_features=64, out_features=1, bias=True) ) ) (density): Density( (activation): ReLU() (density_net): Sequential( (0): Linear(in_features=12, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.3, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.3, inplace=False) (8): Linear(in_features=64, out_features=64, bias=True) (9): ReLU() (10): Dropout(p=0.3, inplace=False) (11): Linear(in_features=64, out_features=64, bias=True) (12): ReLU() (13): Dropout(p=0.3, inplace=False) (14): Linear(in_features=64, out_features=1, bias=True) ) ) (rho): Rho( (activation): ReLU() (rho_net): Sequential( (0): Linear(in_features=6, out_features=64, bias=True) (1): ReLU() (2): Linear(in_features=64, out_features=64, bias=True) (3): ReLU() (4): Dropout(p=0.3, inplace=False) (5): Linear(in_features=64, out_features=64, bias=True) (6): ReLU() (7): Dropout(p=0.3, inplace=False) (8): Linear(in_features=64, out_features=2, bias=True) ) ) )
Appendix C Additional Experimental Details
C.1 Reproducibility
We release our code and data on the website at
https://github.com/pufffs/state-abstraction
The hyper-parameters to train the proposed forward and backward abstractions can be found in Table B.1.
C.2 Experimental settings and additional results
For both environments we use Adam Kingma & Ba (2014) optimizer, with learning rate in Cartpole and in LunarLander. Model architectures and hyper-parameters are outlined in B. When conducting OPE, the FQE network has hidden layers with nodes per hidden layer for abstraction methods, and is equipped with hidden layers with nodes per hidden layer for non-abstracted observations (shown as ‘FQE’ in the plot).
C.2.1 CartPole-v0
Data generating processes
We manually insert 296 irrelevant features in the state, each following a first order auto-regressive model (AR(1))
We also define a new state-action-dependent reward as
where and are the first feature (cart position) and third feature (pole angle) of the state , to replace the original constant rewards. The number of trajectories in the offline dataset is chosen from , where each trajectory contains approximately 40 decision points. The target policy is determined by the pole angle: we push the cart to the left if the angle is negative and to the right if it is positive. Namely,
The behavior policy that generates the batch data is set to an -greedy policy with respect to the target policy, with . Results are averaged over 30 runs for each pair.
Model parameters
For the proposed forward and backward models, we set the abstracted state dimension as . For the two-step method, we apply backward abstraction followed by forward abstraction, reducing the dimension from for . We change the abstracted dimension to for .
C.2.2 LunarLander-v2
Data generating processes
We similarly insert 292 irrelevant auto-regressive features in the state:
The number of trajectories in the offline dataset is chosen from , where trajectory length differs significantly in this environment. Some lengthy episodes can have length larger than while short episodes have fewer than decision points. When trained and evaluated on the short episodes, OPE methods will fail due to huge distributional drift. We therefore truncate the episode length at 1000 if it exceeds, define it as long episode and those fewer than 1000 as short episodes. When generating trajectories, we use a long-short combination for each size: . The target policy is an estimated optimal policy pre-trained by an DQN agent whereas the behavior policy again -greedy to the target policy with . Results are averaged over 30 runs for each pair and are reported in Figure C.1
Model parameters
For forward and backward models, we abstract the original state dimension from , and for two-step method we reduce dimensions from , by first using forward model and then backward model.
Pre-trained agent
We pre-train an agent by using DQN as our target policy. The agent is trained until there exists an episode that has accumulative discounted rewards exceeding with discounted rate . We evaluated oracle value (61.7) of the optimized agent by Monte Carlo method with the same discounted rate. The agent model architecture is as follow:
DQN( (fc1): Linear(in_features=8, out_features=64, bias=True) (fc2): Linear(in_features=64, out_features=64, bias=True) (fc3): Linear(in_features=64, out_features=4, bias=True) )
![Refer to caption](x2.png)
C.3 Licences for existing assets
We consider two environments from OpenAI Gym (Brockman et al., 2016), “CartPole-v0” and “LunarLander-v2” with the MIT License and Copyright (c) 2016 OpenAI (https://openai.com).
C.4 Computing resources
C.4.1 CartPole-v0
To build Figure 4, we trained 3 abstraction methods and one non-abstraction method on 4 different sizes of data, each with 30 runs, under 4 values. Each run takes approximately 1.5 minutes for four methods on an E2-series CPU with 64GB memory on Google Cloud Platform (GCP). It takes about 12 compute hours to complete all the experiments in the figure.
C.4.2 LunarLander-v2
To build Figure C.1, we trained 3 abstraction methods and one non-abstraction method on 3 different sizes of data, each with 30 runs, under 3 values. In average, each run takes approximately 4 minutes for four methods on an E2-series CPU with 64GB memory on GCP. It takes about 18 computation hours to complete all the experiments in the figure.
Appendix D Technical proofs
Notations. For events or random variables , means the independence between and whereas means the conditional independence between and given .
D.1 Proof of Theorem 1
We prove Theorem 1 in this subsection. We first prove under -, - or -irrelevance, the corresponding methods remain valid when applied to the abstract state space:
-
•
-irrelevance. By definition, is the expected return given an initial state and . Under -irrelevance, the Q-function depends on only through . It follows that equals the expected return given and , the latter being – the -function when restricted to the abstract state space, i.e., . It follows that
-
•
-irrelevance. We first establish the equivalence between and – the IS ratio defined on the abstract state space. Under -irrelevance, becomes a constant function of . Consequently, for any conditional probability mass function (pmf) such that , we have . By setting to the pmf of given and , it follows that
(D.1) Notice that
The denominator equals , the behavior policy when restricted to the abstract state space at time . Notice that this behavior policy can be non-stationary over time, despite that being time-invariant. As for the numerator, it is straightforward to show that it equals . This together with (D.1) yields
(D.2) where denotes the target policy confined on the abstract state space at time . The last term in (D.2) is given by . Consequently, the cumulative IS ratio is equal to . This in turn yields .
-
•
-irrelevance. Similar to the proof under -irrelevance, the key lies in establishing the equivalence between and , the latter being the MIS ratio defined on the abstract state space. Once this has been proven, it is immediate to see that , so that MIS remains valid when applied to the abstract state space.
As discussed in Section 2.3, to guarantee the unbiasedness of the MIS estimator, we additionally require a stationarity assumption. Under this requirement, for a given state-action pair in the offline data, its joint pmf function can be represented as where denotes the marginal state distribution under the behavior policy. Additionally, let denote the pmf of generated under the target policy . The MIS ratio can be represented by
Similar to (D.2), under -irreleavance, it follows that
Here, the subscript in and is dropped due to stationarity. Additionally, is used to denote the probability mass function (pmf) of , albeit with a slight abuse of notation. Moreover, the numerator represents the discounted visitation probability of under . This proves that .
Finally, we establish the validity of DRL. According to the doubly robustness property, DRL is valid when either or is correctly specified. Under -irrelevance, we have and thus DRL remains valid when applied to the abstract state space. Similarly, we have under -irrelevance, which in turn implies DRL’s validity. This completes the proof.
D.2 Proof of Theorem 2
We prove Theorem 2 in this subsection.
- •
-
•
We will prove that the MIS estimator constructed on the abstract state space remains valid. With a slight abuse of notation, we use to denote the probability . Under the stationarity assumption, direct calculations yield
Notice that we only require reward-irrelevance in the above proof.
-
•
It suffices to show that
(D.4) for any . Under the Markov assumption, is independent of past state-action pairs given and . Consequently, the left-hand-side can be represented as
Additionally, since the generation depends only on , the inner expectation equals which can be further shown to equal to . This allows us to represent the left-hand-side of (D.4) by
(D.5) Using similar arguments in proving the validity of MIS estimator, under reward-irrelevance, (D.5) can be shown to equal to
(D.6) Under transition-irrelevance, the data triplets forms an MDP, satisfying the Markov assumption. Let denote the resulting transition function. Together with -irrelevance, we can rewrite (D.6) as
Notice that is independent of the target policy . Using the change of measure theorem, we can represent above expression by where denotes the cumulative IS ratio defined on the abstract state space. This completes the proof.
-
•
Since model-irrelvance implies -irrelevance, the conclusion directly follows from the last conclusion of Theorem 1.
D.3 Proof of Theorem 3
At the begging of the proof, we name the phenomena as the Inverse Markovianity, namely the reversed state-action pairs maintain the Markov property.
-
•
-irrelevance directly follows from the definition of backward-model-irrelevance. To show -irrelevance, we divide the proof into two steps.
(1) In the first step, we will prove that if satisfies the backward-model-irrelevance, then(D.7) It follows from equation (8) that
We can use the induction method to prove that for ,
(D.8) For , we have for any positive constant ,
(D.9) where the first equation is due to -irrelevance and the second equation follows from (8). This yields
We assume that for the formulation (D.8) holds. Now, we prove that for , (D.8) successes. By similar arguments to that of (• ‣ D.3), we get
(D.10) To prove this, we need to show that for any , we have
(D.11) The definition of inverse model implies when , (D.11) successes. We assume that for the formulation (D.11) successes. Now, we prove that for , (D.11) also hold.
This proves (D.11). Combing (• ‣ D.3) and (D.11), we can get
Then we prove (D.7).
(2)In the second step, we will prove that if satisfies equation (D.7) and -irrelevance, it is -irrelevant, namely for any and satisfying , they will satisfy
It follows from the definition of state abstraction, and , we have
(D.12) Then, we can conclude that backward-model-irrelevance implies the -irrelevance and -irrelevance.
-
•
It follows from the definition of -function-based method that
- •
D.4 Proof of Theorem 4
Theorem 4 directly follows from Theorem 2 and Theorem 3. We just list the -function based method and initialization from forward state abstraction. Firstly, based on the first conclusions in Theorems 1 and 2, we can get that -function based method still remains valid. Namely, for the forward state abstraction function , we have
Based on , we derive the backward state abstraction . The second conclusion in Theorem 3 indicates
This indicates that after the two-step procedure, the -value-based function still works.