{
  "File Number": "1052",
  "Title": "Generalizing Goal-Conditioned Reinforcement Learning with Variational Causal Reasoning",
  "Limitation": "The main limitation of this work is that the explicit estimation of causal structure does not scale well to the number of nodes. Developing efficient gradient-based discovery methods could be a promising direction. In addition, the factorized state and action space assumption may restrict the usage of this work to semantic representations, which need to be processed with abstraction methods. We further discuss the potential negative social impact and additional limitations in Appendix C.3. Acknowledgements. We gratefully acknowledge support from the National Science Foundation under grant CAREER CNS-2047454.",
  "Reviewer Comment": "Reviewer_4: Pros:\nCausal models hold promise to better generalization, especially in RL. Causal models focuses on the right causal variables as well as causal mechanisms between variables. Hence, this paper addresses an very important problem, espeically in RL.\nThe experimental results are interesting, especially the OOD generalization experiments.\nCons:\nThere are some limitations of the work that would be nice to be addressed.\nOne of the main claims of the paper is the identifiability proof in that the algorithm can always identify the true graph. However, this proof is based on assumptions that generally may not hold true, espiecally in high-dimensional data. Another major reason why causal identifiability is so challenging in low-level data is that the causal variables are often latent, making the interventions unknown in the latent space. this is not discussed in the paper.\nHowever, the proof that the authors presents in the paper assumes 2 things, one being that the mapping from the low-level observational space to latent causal variables are trivial and can be easily obtained, and second, that the independence test has perfect information, in that it can tell perfectly which variable cases which other variable upon intervention.\nI think both of these assumptions generally do not hold true. Discovering latent states is non-trivial, and Im not sure if faithfulness generally holds either.\nAnother point that the authors have not discussed is that the interventions are unknown. The intervention is only observed on low-level images, but it's unknown to the abstract (latent) causal variables. I do not see a discussion on this anywhere in the paper.\nThe experiments are interesting. However, the spurious correlation experiments can be solved without learning the underlying causal mechanisms. The model would only need to discover the causal variables (but not necessarily mechanisms). The compositional generalization tasks that the authors proposed is more interesting, but again, the agent doesnt necessarily have to know the undelrying causal graph in order to generalize. For example, stacking 2 objects and stacking 5 objects as proposed by the authors. A model that has not learned the underlying causal structure of the environment might also be able to generalize to this.\nIt's also unclear if the underlying causal structure of the environment for the stacking and door opening experiments are \"interesting\", in the sense that changing the color or backgrounds of the object has no causal influence on anything else in the env.\nIn order to test to see if the model has indeed captured the underlying causal structure, I would propose that the authors use either\n\"Alchemy: A structured task distribution for meta-reinforcement learning\"\n\"Systematic Evaluation of Causal Discovery in Visual Model Based Reinforcement Learning\"\nBoth of these environments have more complicated and interesting causal graphs. There is also a set of interesting OOD experiments that can be performed on these experiments.\nQuestions:\nIt's unclear if the underlying causal structure of the environment for the stacking and door opening experiments are \"interesting\", in the sense that changing the color or backgrounds of the object has no causal influence on anything else in the env.\nCan't the spurious correlation experiment be solved by only focusing on learning what is a causal variables (compared to learning the causal mechanisms).\nLimitations:\nOne of the major limitations of this paper is that the theoretical results the paper presents is based on somewhat unrealistic assumptions. However, this is not discussed properly in the paper.\nOne of the main claims of the paper is the identifiability proof in that the algorithm can always identify the true graph. However, this proof is based on assumptions that generally may not hold true, espiecally in high-dimensional data. Another major reason why causal identifiability is so challenging in low-level data is that the causal variables are often latent, making the interventions unknown in the latent space. this is not discussed in the paper.\nHowever, the proof that the authors presents in the paper assumes 2 things, one being that the mapping from the low-level observational space to latent causal variables are trivial and can be easily obtained, and second, that the independence test has perfect information, in that it can tell perfectly which variable cases which other variable upon intervention.\nI think both of these assumptions generally do not hold true. Discovering latent states is non-trivial, and Im not sure if faithfulness generally holds either.\nAnother point that the authors have not discussed is that the interventions are unknown. The intervention is only observed on low-level images, but it's unknown to the abstract (latent) causal variables. I do not see a discussion on this anywhere in the paper.\nEthics Flag: No\nSoundness: 2 fair\nPresentation: 3 good\nContribution: 2 fair\n\nReviewer_5: [Stengths]\n+Paper is overall clear and well-written. The authors also provide the code and indeed it helps with understanding the idea here.\n+I found the formulation intuitive and reasonable. The math on identifiability and performance guarantee could be a bit dense but I didn't find any major issue.\n+The advantages over MBRL baselines are impressive, especially in the challenging car crash domain. With the code already there, I'm sure the results are reproducible if the authors can release it at some point.\n[Weaknesses]\nI don't have major concerns at this point. But I will appreciate it if the following questions can be addressed in a rebuttal.\n-The authors claim that their approach is for \"goal-based RL\". But it seems that goal is not necessary for all their formulations and implementations. Why not just call it model-based RL or planning in general? Some clarifications here are needed.\n-The causal discovery part might be clear in the formulation but the implementation details are yet to be unveiled. I also check the code, but as far as I could find the causal graphs are pre-defined. The authors are encouraged to elaborate more on this and some pointers to the code will be helpful.\nQuestions:\nSee [Weaknesses]\nLimitations:\nThe authors mentioned that their limitation could be the inability of scaling to causal graphs with more nodes. However, I also doubt whether this approach could be applied to real-world domains with non-symbolic input, ex. pixel-based or other raw sensory input. Extracting symbolic input from these sources could impose new challenges on observation uncertainty, which cold be pivotal to causal discovery and model learning.\nEthics Flag: No\nSoundness: 3 good\nPresentation: 3 good\nContribution: 3 good\n\nReviewer_6: Clarify\nThe paper is easy to read and well written.\nOriginality\nThe individual elements are known in causality literature, and various other works (most of them are cited by the authors). The contribution lies in using these ideas (for ex. planning with a factorial action conditioned model) in the context of goal conditioned policies.\nSignificance\nThe reviewer like the experiments where the authors focussed on using the transition models for doing planning. The reviewer believes it's a step in the right direction.\nQuality\nThe reviewer likes the experimental setup as it's tailored to test generalization (robustness to spurious correlations and compositional generalization).\nQuestions:\nModel learning\nThe authors proposes to represent the transition model, with an ensemble of recurrent models, such that they can take into account variable number of \"causal parents\" for each node of the causal graph. Such a design choice is commonly used in causality papers (already cited by authors [1, 2], where the authors learn structural and functional parameters. Structural parameters corresponds to a soft-adjacency matrix, and functional parameters correspond to a set of MLPs which take in input a set of causal parents. This design choice has also been used as an inductive bias for learning architectures which consists of ensemble of recurrent models, such that each model can decide which other models to pay attention to via the use of attention [3, 4].\n[1] Differentiable causal discovery from interventional data, https://arxiv.org/abs/2007.01754\n[2] Learning neural causal models from unknown interventions, https://arxiv.org/abs/1910.01075\n[3] Neural Production Systems, https://arxiv.org/abs/2103.01937\n[4] Recurrent Independent Mechanisms, https://arxiv.org/abs/1909.10893\nChosen Method for learning causal graph\nIt may be useful to employ gradient based methods of learning causal graph as compared to methods based on independence testing. Recently, few methods have been proposed which allows inferring posterior over the learned causal graph [1, 2, 3].\n[1] DiBS: Differentiable Bayesian Structure Learning, https://arxiv.org/abs/2105.11839\n[2] BCDNets, https://proceedings.neurips.cc/paper/2021/hash/39799c18791e8d7eb29704fc5bc04ac8-Abstract.html\n[3] Bayesian Structure Learning with Generative Flow Networks, https://arxiv.org/abs/2202.13903\nRL benchmarks for causal reasoning\nIt may be useful to evaluate the proposed method on set of problems which are specifically tailored towards measuring generalization in RL (in causal sense) [1]. It may also be useful to evaluate an \"attention\" (or GNN) based baseline which learns interactions between different causal variables to predict the future state for planning.\n[1] Systematic Evaluation of Causal Discovery in Visual Model Based Reinforcement Learning, https://arxiv.org/abs/2107.00848\nLimitations:\nLimitations\nThe paper discusses two limitations: (a) the method may not scale well to large number of nodes, (b) assuming factorized state and action space restricts the scope to scenarios where only observables are low level information i.e., pixels in the case of image data. It may also be useful to discuss that independent testing i.e., the method used to learn causal graph may not scale well as compared to gradient based approaches of learning causal graph.\nEthics Flag: No\nSoundness: 3 good\nPresentation: 4 excellent\nContribution: 2 fair",
  "Limitations_refined": "The main limitation of this work is that the explicit estimation of causal structure does not scale well to the number of nodes. Developing efficient gradient-based discovery methods could be a promising direction. In addition, the factorized state and action space assumption may restrict the usage of this work to semantic representations, which need to be processed with abstraction methods. We further discuss the potential negative social impact and additional limitations in Appendix C.3.",
  "abstractText": "As a pivotal component to attaining generalizable solutions in human intelligence, reasoning provides great potential for reinforcement learning (RL) agents’ generalization towards varied goals by summarizing part-to-whole arguments and discovering cause-and-effect relations. However, how to discover and represent causalities remains a huge gap that hinders the development of causal RL. In this paper, we augment Goal-Conditioned RL (GCRL) with Causal Graph (CG), a structure built upon the relation between objects and events. We novelly formulate the GCRL problem into variational likelihood maximization with CG as latent variables. To optimize the derived objective, we propose a framework with theoretical performance guarantees that alternates between two steps: using interventional data to estimate the posterior of CG; using CG to learn generalizable models and interpretable policies. Due to the lack of public benchmarks that verify generalization capability under reasoning, we design nine tasks and then empirically show the effectiveness of the proposed method against five baselines on these tasks. Further theoretical analysis shows that our performance improvement is attributed to the virtuous cycle of causal discovery, transition modeling, and policy training, which aligns with the experimental evidence in extensive ablation studies. Code is available on https://github.com/GilgameshD/GRADER.",
  "1 Introduction": "The generalizability, which enables an algorithm to handle unseen tasks, is fruitful yet challenging in multifarious decision-making domains. Recent literature [1, 2, 3] reveals the critical role of reasoning in improving the generalization of reinforcement learning (RL). However, most off-the-shelf RL algorithms [4] have not regarded reasoning as an indispensable accessory, thus usually suffering from data inefficiency and performance degradation due to the mismatch between training and testing settings. To attain generalization at the testing stage, some efforts were put into incorporating domain knowledge to learn structured information, including sub-task decomposition [5] and program generation [6, 7, 8, 9, 10], which guide the model to solve complicated tasks in an explainable way. However, such symbolism-dominant methods heavily depend on the re-usability of sub-tasks and pre-defined grammars, which may not always be accessible in decision-making tasks.\nInspired by the close link between reasoning and the cause-and-effect relationship, causality is recently incorporated to compactly represent the aforementioned structured knowledge in RL training [11]. Based on the form of causal knowledge, we divide the related works into two categories, i.e., implicit and explicit causation. With implicit causal representation, researchers ignore the detailed causal structure. For instance, [12] extracts invariant features as one node that influences the reward function, while the other node consists of task-irrelevant features [13, 14, 15, 16]. This neat structure has good scalability but requires access to multiple environments that share the\n36th Conference on Neural Information Processing Systems (NeurIPS 2022).\nsame invariant feature [12, 16, 17]. In contrast, one can turn to the explicit side by estimating detailed causal structures [18, 19, 20, 21], which uses directed graphical models to capture the causality in the environment. A pre-request for this estimation is the object-level or event-level abstraction of the observation, which is available in most tasks and also becoming a frequently studied problem [22, 23, 24]. However, existing explicit causal reasoning RL models either require the true causal graph [25] or rely on heuristic design without theoretical guarantees [18].\nIn this paper, we propose GeneRAlizing by DiscovERing (GRADER), a causal reasoning method that augments the RL algorithm with data efficiency, interpretability, and generalizability. We mainly focus on Goal-Conditioned RL (GCRL) [26], where different goal distributions during training and testing reflect the generalization. We formulate the GCRL into a probabilistic inference problem [27] with a learnable causal graph as the latent variable. This novel formulation naturally explains the learning objective with three components – transition model learning, planning, and causal graph discovery – leading to an optimization framework that alternates between causal discovery and policy learning to gain generalizability. Under some mild conditions, we prove the unique identifiability of the causal graph and the theoretical performance guarantee of the proposed framework.\nTo demonstrate the effectiveness of the proposed method, we conduct comprehensive experiments in environments that require strong reasoning capability. Specifically, we design two types of generalization settings, i.e., spuriousness and composition, and provide an example to illustrate these settings in Figure 1. The evaluation results confirm the advantages of our method in two aspects. First, the proposed data-efficient discovery method provides an explainable causal graph yet requires much fewer data than previous methods, increasing data efficiency and interpretability during task solving. Second, simultaneously discovering the causal graph during policy learning dramatically increases the success rate of solving tasks. In summary, the contribution of this paper is threefold:\n• We use the causal graph as a latent variable to reformulate the GCRL problem and then derive an iterative training framework from solving this problem.\n• We prove that our method uniquely identifies true causal graphs, and the performance of the iterative optimization is guaranteed with a lower bound given converged transition dynamics.\n• We design nine tasks in three environments that require strong reasoning capability and show the effectiveness of the proposed method against strong baselines on these tasks.",
  "2 Problem Formulation and Preliminary": "We start by discussing the setting we consider in this paper and the assumptions required in causal reasoning. Then we briefly introduce the necessary concepts related to causality and causal discovery.",
  "2.1 Factorized Goal-conditioned RL": "We assume the environment follows the Goal-conditioned Markov Decision Process (MDP) setting with full observation. This setting is represented by a tuple M = (S,A,P,R, G), where S is the state space, A is the action space, P is the probabilistic transition model, G ⇢ S is the goal space which is a set of assignment of values to states, and r(s, g) = 1(s = g) 2 R is the sparse deterministic reward function that returns 1 only if the state s match the goal g. In this paper, we focus on the goal-conditioned generalization problem, where the goal for training and testing stages will be sampled from different distributions ptrain(g) and ptest(g). We refer to a goal g 2 G as a task\nand use these two terms interchangeably. To accomplish the causal discovery methods, we make a further assumption similar to [20, 28] for the state and action space: Assumption 1 (Space Factorization). The state space S = {S1 ⇥ · · · ⇥ SM} and action space A = {A1 ⇥ · · ·⇥AN} can be factorized to disjoint components {Si}Mi=1 and {Ai}Ni=1.\nThe components representing one event or object’s property usually have explicit semantic meanings for better interpretability. This assumption can be satisfied by state and action abstraction, which has been widely investigated in [22, 23, 24]. Such factorization also helps deal with the high-dimensional states since it could be intractable to treat each dimension as one random variable [18].",
  "2.2 Causal Reasoning with Graphical Models": "Reasoning with causality relies on specific causal structures, which are commonly represented as directed acyclic graphs (DAGs) [29] over variables. Consider random variables X = (X1, . . . , Xd) with index set V := {1, . . . , d}. A graph G = (V , E) consists of nodes V and edges E ✓ V 2 with (i, j) for any i, j 2 V . A node i is called a parent of j if eij 2 E and eji /2 E . The set of parents of j is denoted by PAGj . We formally discuss the graph representation of causality with two definitions: Definition 1 (Structural Causal Models [29]). A structural causal model (SCM) C := (S,U) consists of a collection S of d functions Xj := fj(PAGj , Uj), j 2 [d], where PAj ⇢ {X1, . . . , Xd}\\{Xj} are called parents of Xj; and a joint distribution U = {U1, . . . , Ud} over the noise variables, which are required to be jointly independent. Definition 2 (Causal Graph [29], CG). The causal graph G of an SCM is obtained by creating one node for each Xj and drawing directed edges from each parent in PAGj to Xj .\nWe note that CG describes the structure of the causality, and SCM further considers the specific causation from the parents of Xj to Xj via fj as well as exogenous noises Uj . To uncover the causal structure from data distribution, we assume that the CG satisfies the Markov Property and Faithfulness [29], which make the independences consistent between the joint distribution P (X1, . . . , Xn) and the graph G. We also follow the Causal Sufficiency assumption [30] that supposes we have measured all the common causes of the measured variables.\nExisting work [31, 20] believes that two objects have causality only if they are close enough while there is no edge between them if the distance is large. Instead of using such a local view of the causality, we assume the causal graph is consistent across all time steps, which also handles the local causal influence. The specific influence indicated by edges is estimated by the function fj(PAj , Uj).",
  "3 Generalizing by Discovering (GRADER)": "With proper definitions and assumptions, we now look at the proposed method. We first derive the framework of GRADER by formulating the GCRL problem as a latent variable model, which provides a variational lower bound to optimize. Then, we divide this objective function into three parts and iteratively update them with a performance guarantee.",
  "3.1 GCRL as Latent Variable Models": "The general objective of RL is to maximize the expected reward function w.r.t. a learnable\npolicy model ⇡. Particularly, in the goal-conditioned setting, such objective is represented as max⇡ E⌧⇠⇡,g⇠p(g)[ PT t=0 r(s\nt, g)], where p(g) is the distribution of goal and ⌧ := {s0, a0, . . . , sT } is the action-state trajectory with maximal time step T . The trajectory ends only if the goal is achieved g = sT or the maximal step is reached.\nInspired by viewing the RL problem as probabilistic inference [32, 27], we replace the objective from “How to find actions to achieve the goal?” to “what are the actions if we achieve the goal?”, leading\nto a likelihood maximization problem for p(⌧ |s⇤) with s⇤ := 1(g = sT ). Different from previous work [33] that recasts actions as latent variables and infers actions that result in “observed” high reward, we decompose p(⌧ |s⇤) with G as the latent variable to get the evidence lower bound (ELBO)\nlog p(⌧ |s⇤) = log Z p(⌧ |G, s⇤)p(G|s⇤)dG Eq(G|⌧)[log p(⌧ |G, s⇤)] DKL[q(G|⌧)||p(G)], (1)\nwhere the prior p(G) and variational posterior q(G|⌧) represent distributions over graph structures, i.e, the probability of the existences of edges in graphs. DKL denotes the Kullback–Leibler (KL) divergence between two graphs, which will be explained in Section 3.3. Recall that the space of goal G is a subset of the state, we extend the meaning of g and assume all trajectories achieve the goal in the final state [34], i.e., g = sT . Such extension makes it possible to further decompose the first term of (1) as (refer to Appendix A.1.2)\nlog p(⌧ |G, s⇤) = log p(s0) + T 1X\nt=0\nlog p(st+1|st, at,G) + T 1X\nt=0\nlog ⇡(at|st, s⇤,G) + log p(g). (2)\nHere, we use the fact that G is effective in both the transition model p(st+1|at, st,G) and the policy model log p(at|st, s⇤,G), g only influences the policy model, and the initial state s0 depends neither on G nor g. We also assume that both initial state log p(s0) and goal log p(g) follow the uniform distribution. Thus, the first and last terms of (2) are constants. The policy term ⇡, selecting action at according to both current state st and goal g, is implemented with the planning method and is further discussed in Section 3.2. Finally, we maximize the likelihood p(⌧ |s⇤) with the following reformulated ELBO as the objective\nJ (✓, ) = Eq (G|⌧) T 1X\nt=0\n⇥ log p✓(s t+1 |st, at,G) + log ⇡✓(a t |st, s⇤,G) ⇤ DKL[q (G|⌧)||p(G)] (3)\nwhere ✓ is the shared parameter of transition model p✓(st+1|at, st,G) and policy ⇡✓(at|st, s⇤,G), and is the parameter of causal graph q (G|⌧). To efficiently solve this optimization problem, we iteratively updates parameter (causal discovery, Section 3.3) and parameter ✓ (model and policy learning, Section 3.2), as shown in Figure 2. Intuitively, these processes can be respectively viewed as the discovery of graph and the update of fi, which share tight connections as discussed in Section 2.2.",
  "3.2 Model and Policy Learning": "Let us start with a simple case where we already obtain a G and use it to guide the learning of parameter ✓ via max✓ J (✓, ). Since the KL divergence of J (✓, ) does not involve ✓, we only need to deal with the first expectation term, i.e., the likelihood of transition model and policy. For the transition p✓(st+1|at, st,G), we connect it with causal structure by further defining a particular type of CG and denote it as G in the rest of this paper: Definition 3 (Transition Causal Graph). We define a bipartite graph G, whose vertices are divided into two disjoint sets U = {At,St} and V = {St+1}. At represents action nodes at step t, St state nodes at step t, and St+1 the state nodes at step t+ 1. All edges start from set U and end in set V .\nModel learning. This definition builds the causal graph between two consecutive time steps, which indicates that the values of states in step t + 1 depend on values in step t. It also implies that the interventions [29] on nodes in U are directly obtained since they have no parent nodes. We denote the marginal distribution of S as pIs⇡ , which is collected by RL policy ⇡. Combined with the Definition 1 of SCM, we find that p✓(st+1|at, st,G) essentially approximates a collection of functions fj following the structure G, which take as input the values of parents of the state node sj and outputs the value sj . Thus, we propose to model the transition corresponding to G with a collection of neural networks f✓(G) := {f✓j}Mj=1 to obtain\nst+1j = f✓j ([PA G j ] t, Uj), (4)\nwhere [PAGj ]t represents the values of all parents of node stj at time step t and Uj follows Gaussian noise Uj ⇠ N (0, I). In practice, we use Gated Recurrent Unit [35] as fj because it supports varying numbers of input nodes. We take stj as the initial hidden embedding and the rest parents [PA G j \\sj ] t\nas the input sequence to fj . The entire model is optimized by stochastic gradient descent with the log-likelihood log p✓(st+1|at, st,G) as objective.\nPolicy learning with planning. Then we turn to the policy term ⇡✓(at|st, s⇤,G) in J (✓, ). We optimize it with planning methods that leverage the estimated transition model. Specifically, the policy aims to optimize an action-state value function Q(st, at) = E hPH t0=0 t0r(st 0+t, at 0+t)|st, at i , which can be obtained by unrolling the transition model with a horizon of H steps and discount factor . In practice, we use model predictive control (MPC) [36] with random shooting [37], which selects the first action in the fixed-horizon trajectory that has the highest action-state value Q(st, at), i.e. ⇡̂(st) = argmaxat2A Q G ✓ (s\nt, at). The formulation we derived so far is highly correlated to the model-based RL framework [38]. However, the main difference is that we obtain it with variational inference by regarding the causal graph as a latent variable.\n3.3 Data-Efficient Causal Discovery\nAlgorithm 1: GRADER Training Input: Trajectory buffer B⌧ , Causal\ngraph G, Transition model f✓, causal discovery threshold ⌘\nwhile ✓ not converged do // Policy from planning Sample a goal g ⇠ ptrain(g) while t < T do\nat Planner(f✓, st, g) st+1, rt Env(at, g) B⌧ B⌧ [ {at, st, st+1}\n// Estimate causal graph for i M +N do\nfor j M do Infer edge eij q (·|B, ⌘)\n// Learn transition model Update f✓(G) via (4) with B\nIn this step, we relax the assumption of knowing G and aim to estimate the posterior distribution q(G|⌧) to optimize ELBO (3) w.r.t. parameter . In most scorebased methods [39], likelihood is used to evaluate the correctness of the causal graph, i.e., a better causal graph leads to a higher likelihood. Since the first term of (3) represents the likelihood of the transition model, we convert the problem of max J (✓, ) to the causal discovery that finds the true causal graph based on collected data samples. As for the second term of (3), the following proposition shows that the KL divergence between q (G|⌧) and p(G) can be approximated by a sparsity regularization (proof in Appendix A.4.2).\nProposition 1 (KL Divergence as Sparsity Regularization). With entry-wise independent Bernoulli prior p(G) and point mass variational distribution q(G|⌧) of DAGs, DKL[q kp] is equivalent to an `1 sparsity regularization for the discovered causal graph.\nWe restrict the posterior q (G|⌧) to point mass distribution and use a threshold ⌘ to control the sparsity. We perform the discovery process from the classification perspective by proposing binary classifiers q (eij |⌧, ⌘) to determine the existence of an edge eij . This classifier q (eij |⌧, ⌘) is implemented by statistic Independent Test [40] and ⌘ is the threshold for the p-value of the hypothesis. A larger ⌘ corresponds to harder sparsity constraints, leading to a sparse G since two nodes are more likely to be considered independent. According to the definition 3, we only need to conduct classification to edges connecting nodes between U and V . If two nodes are dependent, we add one edge directed from the node in U to the node in V . This definition also ensures that we always have q(G|⌧) 2 QDAG, where QDAG is the class of DAG. With this procedure, we identify a unique CG G⇤ under optimality:\nProposition 2 (Identifiability). Given an oracle independent test, with an optimal interventional data distribution p⇤Is⇡ , causal discovery obtains\n⇤ that correctly tells the independence between any two nodes, then the causal graph is uniquely identifiable, with e⇤ij = q ⇤(eij |⌧), 8i 2 [M +N ], j 2 [M ].\nIn practice, we use 2-test for discrete variables and the Fast Conditional Independent Test [40] for continuous variables. The sample size needed for obtaining the oracle test has been widely investigated [41]. However, testing with finite data is not a trivial problem, as stated in [42], especially when the data is sampled from a Goal-conditioned MDP. Usually, the random policy is not enough to satisfy the oracle assumption because some nodes cannot be fully explored when the task is complicated and has a long horizon. To make this assumption empirically possible, it is necessary to simultaneously optimize ⇡✓(at|st, s⇤,G) to access more samples close to finishing the task, which is further analyzed in Section 3.4. We also empirically support this argument in Section 4.2 and provide a detailed theoretical proof in Appendix A.3 and A.4.",
  "3.4 Analysis of Performance Guarantee": "The entire pipeline of GRADER is summarized in Algorithm 1. To analyze the performance of the optimization of (3), we first list important lemmas that connect previous steps and then show that the iteration of these steps in GRADER leads to a virtuous cycle.\nBy the following lemmas, we show the following performance guarantees step by step. Lemma 1 shows model learning is monotonically better at convergence given a better causal graph from causal discovery. Then the learned transition model helps to improve the lower bound of the value function during planning according to Lemma 2. Lemma 3 reveals the connection between policy learning and interventional data distribution, which in turn improves the quality of our causal discovery, as is shown in Lemma 4 and Proposition 2. Lemma 1 (Monotonicity of Transition Likelihood). Assume G⇤ = (V,E⇤) be the true CG, for two CG G1 = (V,E1) and G2 = (V,E2), if SHD(G1,G⇤) < SHD(G2,G⇤), 9 e, s.t. E1 [ {e} = E2, when transition model ✓ converges, the following inequality holds for the transition model in (3):\nlog p✓(s t+1 |at, st,G⇤) log p✓(s t+1 |at, st,G1) log p✓(s t+1 |at, st,G2) (5)\nwhere SHD is the Structural Hamming Distance defined in Appendix A.2. Lemma 2 (Bounded Value Function in Policy Learning). Given a planning horizon H ! 1, if we already have an approximate transition model DTV(p̂(s0|s, a), p(s0|s, a))  ✏m, the approximate policy ⇡̂ achieves a near-optimal value function (refer to Appendix A.3 for detailed analysis):\nkV ⇡ ⇤ (s) V ⇡̂(s)k1\n(1 )2 ✏m (6)\nLemma 3 (Policy Learning Improves Interventional Data Distribution). With a step reward r(s, a) = pg1(s = g), we show that the value function determines an upper bound for TV divergence between the interventional distribution with its optimal (proof details in Appendix A.3):\nDTV(pIs⇡ , pg)  1 (1 )V ⇡(s). (7)\nwhere pIs⇡ is the marginal state distribution in interventional data, and pg is the goal distribution. A better policy with larger V ⇡(s) enforces the distribution of interventional data toward the goal. Lemma 4 (Interventional Data Benefits Causal Discovery). For ✏g = minpg>0 pg, DTV(pIs⇡ , pg) < ✏g , the error of our causal discovery is upper bounded with EĜ [SHD(Ĝ,G⇤)]  |S| 1.\nAfter the close-loop analysis of our model, we are now able to analyze the overall performance of the proposed framework. Under the construction of p✓(st+1|at, st,G) with NN-parameterized functions, the following theorem shows that the learning process will guarantee to perform a close estimation of true ELBO under the iterative optimization among model learning, planning, and causal discovery. Theorem 1. With T-step approximate transition dynamics DTV ⇣ p̂(s0|s, a), p(s0|s, a) ⌘  ✏m, if the\ngoal distribution satisfies ✏g > 1 ✏m, and the distribution prior CG is entry-wise independent Bernoulli(✏G), GRADER guarantees to achieve an approximate ELBO Ĵ with the true ELBO J ⇤:\nkJ ⇤(✓, ) Ĵ (✓̂, ̂)k1   1 +\n(1 )2\n✏mT + log ✓ 1 ✏G ✏G ◆ (|S| 1), (8)\nAn intuitive understanding of the performance guarantee is that a better transition model indicates a better approximation of objective J . The proof of this theorem and corresponding empirical results are in Appendix A.5.\n4 Experiments\nIn this section, we first discuss the setting of our designed environments as well as the baselines used in the experiments. Then, we provide the numerical results and detailed discussions to answer the following important research questions: Q1. Compared to existing strong baselines, how does GRADER gain performance improvement under both in-distribution and generalization settings? Q2.\n6\nCompared to an offline random policy, how does a well-trained policy improve the results of causal discovery? Q3. Compared to score-based causal discovery, does the proposed data-efficient causal discovery pipeline guarantee identifying the true causal graph as stated in Section 3.3? Q4. Considering the correctness of causal graphs, how does the imperfect causal graph influence the tasksolving performance of GCRL agents?",
  "4.1 Environments and Baselines": "Since most commonly used RL benchmarks do not explicitly require causal reasoning for generalization, we design three new environments, which are shown in Figure 3 (excluding Chemistry [43]). These environments use the true state as observation to disentangle the reasoning task from visual understanding. For each environment, we design three settings – in-distribution (I), spuriousness (S), and composition (C) – corresponding to different goal distributions for generalization. We use ptrain(g) and ptest(g) to represent the goal distribution during training and testing, respectively. I uses the same ptrain(g) and ptest(g), S introduces spurious correlations in ptrain(g) but remove them in ptest(g), and C contains more similar sub-goals in ptest(g) than in ptrain(g). The details of these settings in are briefly summarized in the following (details in Appendix C.2.1):\n• Stack: We design this manipulation task inspired by the CausalWorld [44], where the agent must stack objects to match specific shapes and colors. In Stack-S, we let the same shape have the same color in ptrain(g) but randomly sample the color and shape in ptest(g). In Stack-C, the maximum number of object is two in ptrain(g) but five in ptest(g).\n• Unlock: We design this indoor house-holding task for the agent to collect a key to open doors. This environment is built upon the Minigrid [45]. In Stack-S, the door and the key are always in the same row in ptrain(g) but uniformly sample in ptest(g). In Unlock-C, there are one door in ptrain(g) but two doors in ptest(g).\n• Crash: The occurrence of accidents usually relies on causality, e.g., an autonomous vehicle (AV) collides with a jaywalker because its view is blocked by another car [46]. We design such a crash scenario based on highway-env [47], where the goals are to create crashes between a pedestrian and different AVs. In Stack-S, the initial distance between AV and pedestrian is a constant in ptrain(g) but irrelevant in ptest(g). In Stack-C, there is one pedestrian in ptrain(g) but two in ptest(g).\n• Chemistry [43]: There are 10 nodes with different colors. An underlying causal graph controls the color-changing mechanism of all nodes. In one step, the agent changes the color of one node. The goal is to match the given colors of all nodes. In the spuriousness setting, we let all nodes have the same target color. There is no composition setting in this environment.\nWe use the following methods as our baselines to fairly demonstrate the advantages of GRADER. SAC: [48] Soft Actor-Critic is a well-known model-free RL method that uses entropy to increase the diversity of action. ICIN: [25] It uses DAgger [49] to learn goal-conditioned policy with the causal graph estimated from the expert policy. We assume it can access the true causal graph for supervised learning. PETS: [50] We consider the ensemble transition model with random shoot planning as one baseline, which achieves generalization with the uncertainty-aware design. TICSA: [18] This is a causal-augmented MBRL method that simultaneously optimizes a soft adjacent matrix (representing the causality) and a transition model. ICIL: [16] This method proposes an invariant feature learning structure that captures the implicit causality of multiple tasks. We only use it for transition model learning since the original method is designed for imitation learning. GNN: [51] Since graph neural networks are good at learning structural information, we implement a GNN-based baseline using Relational Graph Convolutional Network.",
  "4.2 Results Discussion": "Overall Performance (Q1) We compare the testing reward of all methods under nine tasks and summarize the results in Table 1 to demonstrate the overall performance. Generally, our method outperforms baselines in all tasks except Stack-I because this task is too simple for all methods. We note that the gap between our method and baselines in S and C settings is more significant than in the I setting, showing that our method still works well in the non-trivial generalization task. As a\nmodel-free method, SAC fails in all three tasks of Unlock and Crash environments since they have very sparse rewards. Without learning the causal structure of the environment, PETS even cannot fully solve Unlock-S, Unlock-C, and all Crash tasks. Both TICSA and ICIL learn the causality underlying the task so that they are relatively better than SAC and PETS. However, they are still worse than GRADER in two generalization settings because of the unstable and inefficient causal reasoning mechanism. We also find that even if ICIN is given the true causal graph, the policy learning part cannot efficiently leverage the causality, leading to worse performance in generalization settings.\nTo further analyze the tendency of learning, we plot the curves of all methods under Crash in Figure 4. Our method quickly learns to solve tasks at the beginning of the training, demonstrating high data efficiency. GRADER also outperforms other methods with large gaps in the later training phase. The training figures of the other two environments can be found in Appendix B.1.\nImportance of Policy Learning (Q2) As we mentioned in Section 3.3, we empirically compare GRADER and Offline [52], which uses data collected from offline random policy, and plot results in the right part of Figure 4. We use SHD [53] to compute the distance between the estimated causal graph and the true causal graph. The true causal graph for each environment can be found in Appendix B.2. When we only use samples collected offline by random policy, we cannot obtain variables’ values that require long-horizon reasoning, e.g., the door can be opened only if the agent is close to the door and has the key. As a consequence, the causal graph obtained by Offline harms the performance, as shown in Figure 4. Instead, GRADER gradually explores more regions and quickly obtains the true causal graph when we iteratively discover the causal graph and update the policy.\nAdvantage of Data-efficient Causal Discovery (Q3) To show the advantage of proposed constraintbased methods, we design a model named Score that optimizes a soft adjacent matrix using scorebased method [54], which is recently combined with NN for differentiable training, for example,\nin TICSA. According to the discovery accuracy shown in the right part of Figure 4, we find that score-based discovery is inefficient. Based on the performance of the Score model summarized in Table 1, we also conclude that it is not as good as our constraint-based method and has a large variance due to the unstable learning of the causal graph.\nInfluence of Causal Graph (Q4) To illustrate the importance of the causal graph, we implement another variant of GRADER named Full, which uses a fixed full graph that connects all nodes between the sets U and V . According to the performance shown in Table 1 and Figure 4, we find that the full graph achieves worse results than GRADER because of the redundant and spurious correlation. Intuitively, unrelated information causes additional noises to the learning procedure, and the spurious correlation creates a shortcut that makes the model extract wrong features, leading to worse results in the spuriousness generalization as shown in Table 1.\nWe then investigate how the correctness of the causal graph influences the performance. We use fixed graphs interpolating from the best causal graph to the full graph to train a GRADER model in Unlock-S and summarize the results in Figure 5 The more correct the graph is, the higher reward the agent obtains, which supports our statements in Section 3.4 that the causal graph is important for the reasoning tasks – a better causal graph helps the model have better task-solving performance.",
  "4.3 Further Analysis of Causal Discovery": "Finally, we conduct further analysis of the discovery performance on the Chemistry environment [43], which is a standard benchmark for evaluating causal discovery methods. In this environment, the colors of nodes are controlled by the causal graph, therefore, finding the true causal graph makes it much easier to achieve the goal that requires matching all target colors. The agent can discover the graph by doing interventions via interacting with the environment. We consider four types of causal graphs (Collider, Chain, Jungle, Full) with 10 nodes in this experiment.\nThe discovery performance is shown in Table 2 with five metrics indicating the classification error. We can see that GRADER outperforms the Score method in all 4 types of graphs. In Figure 6, we show the discovered graphs from GRADER (averaged over 10 seeds) and the true causal graphs of Collider and Jungle settings.\nWe also show that GRADER achieves advantages over other baselines in solving the color-matching downstream task, which can be found with detailed experiment results in Appendix B.4.",
  "5 Related Works": "RL Generalization From the agent’s view, algorithms focus on actively obtaining the structure of the task or environment. Some decompose the given task into sub-tasks [55, 56, 57, 5] and when they encounter an unseen task, they rearrange those sub-tasks to solve new tasks. Instead of\ndividing tasks, Symbolic RL learns a program-based policy consisting of domain language [6, 8] or grammar [7, 58]. The generated program is then executed [9] to interact with the environment, which has the potential to solve unseen tasks by searching the symbolic space. From the other view, we can generate environments to augment agents’ experience for better generalization. One straightforward way is data augmentation of image-based observation [59, 60, 61, 62, 63, 64]. When extended to other factors of the environment, Domain Randomization [65] and its variants [66, 67] are proposed. Considering the interaction between agent and environment, Curriculum Learning [68] also gradually generates difficult tasks to train generalizable agents.\nGoal-Conditioned RL (GCRL) The generalization problem is naturally related to GCRL [26], which aims to train an agent for multiple tasks. From the optimization perspective, Universal Value Function [69], reward shaping [70], and latent dynamic model [71] are widely used tools to solve GCRL problem. Sub-goal generation [72] is another intuitive idea to tackle the long horizon with sparse reward, where the core thing is to make sure the generated sub-goals are solvable. Finally, Hindsight Experience Replay (HER) [34], belonging to the relabelling category, is a ground-breaking yet straightforward method that treats visited states as “fake” goals when the goal and state share the same space. Later on, improved versions of HER [73, 74, 75] were widely studied. One limitation is that we cannot directly use a visited state as a goal if the goal has pre-conditions. Similar to our setting, [76] and [77] convert the GCRL problem to variational inference by regarding control as inference [27]. [76] propose an EM framework under the HER setting and [77] treats the last state as the goal and estimates a shaped reward during training.\nRL with Causal Reasoning Causality is now frequently discussed in the machine learning field to complement the interpretability of neural networks [29]. RL algorithms also incorporate causality to improve the reasoning capability [78]. For instance, [25] and [19] explicitly estimate causal structures with the interventional data obtained from the environment. These structures can be used to constraint output space [79] or adjust the buffer priority [20]. Building dynamic models in model-based RL [18, 80, 52] based on causal graphs is also widely studied recently. Implicitly, we can abstract the causal structure and formulate it using the Block MDP [12] setting or training multiple encoders to extract different kinds of representations [15]. Following the idea of invariant risk minimization [81], they assume task-relevant features are invariant and shared across all environments, which can be used as the only cause of the reward.\nCausal Discovery Causal discovery [82] is a long-stand topic in economics and sociology, where the traditional methods can be generally categorized into constraint-based and score-based. Constraintbased methods [30] start from a complete graph and iteratively remove edges with conditional independent test [83, 84] as constraints. Score-based methods [39, 85] use metrics such as Bayesian Information Criterion [86] as scores and prefer edges that maximize the score given the dataset. Recently, researchers extend score-based methods with RL [87] or differentiable discovery [54, 88, 89]. The former selects edges with a learned policy, and the latter learns a soft adjacent matrix with observational or interventional data. Active intervention methods are also explored [90] to increase the efficiency of data collection and decrease the cost of conducting intervention [91].",
  "6 Conclusion": "This paper proposes a latent variable model that injects a causal graph reasoning process into transition model learning and planning to solve GCRL problems under the generalization setting. We theoretically prove that our iterative optimization process can obtain the true causal graph. To evaluate the performance of the proposed method, we designed nine tasks in three environments. The comprehensive experiment results show that our method has better data efficiency and performance than baselines. Our method also provides interpretability by the explicitly discovered causal graph.\nThe main limitation of this work is that the explicit estimation of causal structure does not scale well to the number of nodes. Developing efficient gradient-based discovery methods could be a promising direction. In addition, the factorized state and action space assumption may restrict the usage of this work to semantic representations, which need to be processed with abstraction methods. We further discuss the potential negative social impact and additional limitations in Appendix C.3.\nAcknowledgements. We gratefully acknowledge support from the National Science Foundation under grant CAREER CNS-2047454.",
  "Reviewer Summary": "Reviewer_4: Summary: the paper proposes an algorithm for learning causl strutures from the environment and using it to act and plan. The papers presents experiments on OOD generalization on either spurious correlations or compositional generalization.\n\nReviewer_5: Paper investigates the problem of model-based RL or planning. It proposes to decompose the transition model into a causal graph and some parameterized functions. The causal discovery here is formulated as learning a latent variable model using VI, where the causal graph is the latent variable. Then the transition loss is used to find the best set of parameters. Experiments on several synthetic domains including one designated for causality show some promises over state-of-the-art model-based RL avenues.\n\nReviewer_6: The paper proposes to augment Goal-Conditioned RL (GCRL) with Causal Graph (CG), and treats the causal graph as a latent variable. The paper then proposes to use interventional data to estimate the posterior over the underlying causal graph, and then proposes to use the causal graph to learn factorized action conditioned model and agent's policy.\n=====\nAfter rebuttal: I've read the rebuttal, and I remain by my rating."
}