Datasets:
Add files using upload-large-folder tool
Browse files- parse/dev/68n2s9ZJWF8/68n2s9ZJWF8.md +287 -0
- parse/dev/68n2s9ZJWF8/68n2s9ZJWF8_content_list.json +1350 -0
- parse/dev/8aHzds2uUyB/8aHzds2uUyB.md +0 -0
- parse/dev/8aHzds2uUyB/8aHzds2uUyB_content_list.json +0 -0
- parse/dev/8aHzds2uUyB/8aHzds2uUyB_model.json +0 -0
- parse/dev/FWMQYjFso-a/FWMQYjFso-a.md +305 -0
- parse/dev/FWMQYjFso-a/FWMQYjFso-a_content_list.json +1373 -0
- parse/dev/FWMQYjFso-a/FWMQYjFso-a_middle.json +0 -0
- parse/dev/FWMQYjFso-a/FWMQYjFso-a_model.json +0 -0
- parse/dev/IajGRJuM7D3/IajGRJuM7D3.md +0 -0
- parse/dev/IajGRJuM7D3/IajGRJuM7D3_middle.json +0 -0
- parse/dev/RKiWwhocuiU/RKiWwhocuiU.md +463 -0
- parse/dev/RKiWwhocuiU/RKiWwhocuiU_content_list.json +0 -0
- parse/dev/RKiWwhocuiU/RKiWwhocuiU_middle.json +0 -0
- parse/dev/T0GpzBQ1Fg6/T0GpzBQ1Fg6_content_list.json +0 -0
- parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_content_list.json +0 -0
- parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_middle.json +0 -0
- parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_model.json +0 -0
- parse/dev/hQwb-lbM6EL/hQwb-lbM6EL.md +550 -0
- parse/dev/hQwb-lbM6EL/hQwb-lbM6EL_model.json +0 -0
parse/dev/68n2s9ZJWF8/68n2s9ZJWF8.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OFFLINE REINFORCEMENT LEARNING WITH IMPLICIT Q-LEARNING
|
| 2 |
+
|
| 3 |
+
Ilya Kostrikov, Ashvin Nair & Sergey Levine
|
| 4 |
+
Department of Electrical Engineering and Computer Science
|
| 5 |
+
University of California, Berkeley
|
| 6 |
+
kostrikov,anair17 @berkeley.edu, svlevine@eecs.berkeley.edu
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Offline reinforcement learning requires reconciling two conflicting aims: learning a policy that improves over the behavior policy that collected the dataset, while at the same time minimizing the deviation from the behavior policy so as to avoid errors due to distributional shift. This trade-off is critical, because most current offline reinforcement learning methods need to query the value of unseen actions during training to improve the policy, and therefore need to either constrain these actions to be in-distribution, or else regularize their values. We propose a new offline RL method that never needs to evaluate actions outside of the dataset, but still enables the learned policy to improve substantially over the best behavior in the data through generalization. The main insight in our work is that, instead of evaluating unseen actions from the latest policy, we can approximate the policy improvement step implicitly by treating the state value function as a random variable, with randomness determined by the action (while still integrating over the dynamics to avoid excessive optimism), and then taking a state conditional upper expectile of this random variable to estimate the value of the best actions in that state. This leverages the generalization capacity of the function approximator to estimate the value of the best available action at a given state without ever directly querying a Q-function with this unseen action. Our algorithm alternates between fitting this upper expectile value function and backing it up into a Q-function, without any explicit policy. Then, we extract the policy via advantage-weighted behavioral cloning, which also avoids querying out-of-sample actions. We dub our method implicit Q-learning (IQL). IQL is easy to implement, computationally efficient, and only requires fitting an additional critic with an asymmetric L2 loss. IQL demonstrates the state-of-the-art performance on D4RL, a standard benchmark for offline reinforcement learning. We also demonstrate that IQL achieves strong performance fine-tuning using online interaction after offline initialization.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Offline reinforcement learning (RL) addresses the problem of learning effective policies entirely from previously collected data, without online interaction (Fujimoto et al., 2019; Lange et al., 2012). This is very appealing in a range of real-world domains, from robotics to logistics and operations research, where real-world exploration with untrained policies is costly or dangerous, but prior data is available. However, this also carries with it major challenges: improving the policy beyond the level of the behavior policy that collected the data requires estimating values for actions other than those that were seen in the dataset, and this, in turn, requires trading off policy improvement against distributional shift, since the values of actions that are too different from those in the data are unlikely to be estimated accurately. Prior methods generally address this by either constraining the policy to limit how far it deviates from the behavior policy (Fujimoto et al., 2019; Wu et al., 2019; Fujimoto & Gu, 2021; Kumar et al., 2019; Nair et al., 2020; Wang et al., 2020), or by regularizing the learned value functions to assign low values to out-of-distribution actions (Kumar et al., 2020; Kostrikov et al., 2021). Nevertheless, this imposes a trade-off between how much the policy improves and how vulnerable it is to misestimation due to distributional shift. Can we devise an offline RL method that avoids this issue by never needing to directly query or estimate values for actions that were not seen in the data?
|
| 15 |
+
|
| 16 |
+
In this work, we start from an observation that in-distribution constraints widely used in prior work might not be sufficient to avoid value function extrapolation, and we ask whether it is possible to learn an optimal policy with in-sample learning, without ever querying the values of any unseen actions. The key idea in our method is to approximate an upper expectile of the distribution over values with respect to the distribution of dataset actions for each state. We alternate between fitting this value function with expectile regression, and then using it to compute Bellman backups for training the $Q$ -function. We show that we can do this simply by modifying the loss function in a SARSA-style TD backup, without ever using out-of-sample actions in the target value. Once this $Q$ - function has converged, we extract the corresponding policy using advantage-weighted behavioral cloning. This approach does not require explicit constraints or explicit regularization of out-ofdistribution actions during value function training, though our policy extraction step does implicitly enforce a constraint, as discussed in prior work on advantage-weighted regression (Peters & Schaal, 2007; Peng et al., 2019; Nair et al., 2020; Wang et al., 2020).
|
| 17 |
+
|
| 18 |
+
Our main contribution is implicit Q-learning (IQL), a new offline RL algorithm that avoids ever querying values of unseen actions while still being able to perform multi-step dynamic programming updates. Our method is easy to implement by making a small change to the loss function in a simple SARSA-like TD update and is computationally very efficient. Furthermore, our approach demonstrates the state-of-the-art performance on D4RL, a popular benchmark for offline reinforcement learning. In particular, our approach significantly improves over the prior state-of-the-art on challenging Ant Maze tasks that require to “stitch” several sub-optimal trajectories. Finally, we demonstrate that our approach is suitable for finetuning; after initialization from offline RL, IQL is capable of improving policy performance utilizing additional interactions.
|
| 19 |
+
|
| 20 |
+
# 2 RELATED WORK
|
| 21 |
+
|
| 22 |
+
A significant portion of recently proposed offline RL methods are based on either constrained or regularized approximate dynamic programming (e.g., Q-learning or actor-critic methods), with the constraint or regularizer serving to limit deviation from the behavior policy. We will refer to these methods as “multi-step dynamic programming” algorithms, since they perform true dynamic programming for multiple iterations, and therefore can in principle recover the optimal policy if provided with high-coverage data. The constraints can be implemented via an explicit density model (Wu et al., 2019; Fujimoto et al., 2019; Kumar et al., 2019; Ghasemipour et al., 2021), implicit divergence constraints (Nair et al., 2020; Wang et al., 2020; Peters & Schaal, 2007; Peng et al., 2019; Siegel et al., 2020), or by adding a supervised learning term to the policy improvement objective (Fujimoto & Gu, 2021) Several works have also proposed to directly regularize the Q-function to produce low values for out-of-distribution actions (Kostrikov et al., 2021; Kumar et al., 2020; Fakoor et al., $\boxed { 2 0 2 1 }$ Our method is also a multi-step dynamic programming algorithm. However, in contrast to prior works, our method completely avoids directly querying the learned Q-function with unseen actions during training, removing the need for any constraint during this stage, though the subsequent policy extraction, which is based on advantage-weighted regression (Peng et al., 2019; Nair et al., 2020), does apply an implicit constraint. However, this policy does not actually influence value function training.
|
| 23 |
+
|
| 24 |
+
In contrast to multi-step dynamic programming methods, several recent works have proposed methods that rely either on a single step of policy iteration, fitting the value function or Q-function of the behavior policy and then extracting the corresponding greedy policy (Peng et al., 2019; Brandfonbrener et al., 2021; Gulcehre et al., 2021), or else avoid value functions completely and utilize behavioral cloning-style objectives (Chen et al., 2021). We collectively refer to these as “single-step” approaches. These methods avoid needing to query unseen actions as well, since they either use no value function at all, or learn the value function of the behavior policy. Although these methods are simple to implement and effective on the MuJoCo locomotion tasks in D4RL, we show that such single-step methods perform very poorly on more complex datasets in D4RL, which require combining parts of suboptimal trajectories (“stitching”). Prior multi-step dynamic programming methods perform much better in such settings, as does our method. We discuss this distinction in more detail in Section $5 . 1 .$ Our method also shares the simplicity and computational efficiency of single-step approaches, providing an appealing combination of the strengths of both types of methods.
|
| 25 |
+
|
| 26 |
+
Our method is based on estimating the characteristics of a random variable. Several recent works involve approximating statistical quantities of the value function distribution. In particular, quantile regression $\left( \mathrm { \mathbb { K o e n k e r ~ \& ~ H a l l o c k } } \right) \underline { 2 0 0 1 } $ has been previously used in reinforcement learning to estimate the quantile function of a state-action value function (Dabney et al., 2018b;a; Kuznetsov et al., $\boxed { 2 0 2 0 }$ . Although our method is related, in that we perform expectile regression, our aim is not to estimate the distribution of values that results from stochastic transitions, but rather estimate expectiles of the state value function with respect to random actions. This is a very different statistic: our aim is not to determine how the $Q$ -value can vary with different future outcomes, but how the $Q$ -value can vary with different actions while averaging together future outcomes due to stochastic dynamics. While prior work on distributional RL can also be used for offline RL, it would suffer from the same action extrapolation issues as other methods, and would require similar constraints or regularization, while our method does not.
|
| 27 |
+
|
| 28 |
+
# 3 PRELIMINARIES
|
| 29 |
+
|
| 30 |
+
The RL problem is formulated in the context of a Markov decision process (MDP) $( \mathcal { S } , \mathcal { A } , p _ { 0 } ( \bar { s } ) , p ( s ^ { \prime } | s , a ) , r ( s , a ) , \gamma )$ , where $s$ is a state space, $\mathcal { A }$ is an action space, $p _ { 0 } ( s )$ is a distribution of initial states, $p ( s ^ { \prime } | s , a )$ is the environment dynamics, $r ( s , a )$ is a reward function, and $\gamma$ is a discount factor. The agent interacts with the MDP according to a policy $\pi ( a | s )$ . The goal is to obtain a policy that maximizes the cumulative discounted returns:
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\stackrel { \cdot } { \pi } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } _ { \pi } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } , a _ { t } ) | s _ { 0 } \sim p _ { 0 } ( \cdot ) , a _ { t } \sim \pi ( \cdot | s _ { t } ) , s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) \right] .
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
Off-policy RL methods based on approximate dynamic programming typically utilize a state-action value function ( $Q$ -function), referred to as $Q ( s , a )$ , which corresponds to the discounted returns obtained by starting from the state $s$ and action $a$ , and then following the policy $\pi$ .
|
| 37 |
+
|
| 38 |
+
Offline reinforcement learning. In contrast to online (on-policy or off-policy) RL methods, offline RL uses previously collected data without any additional data collection. Like many recent offline RL methods, our work builds on approximate dynamic programming methods that minimize temporal difference error, according to the following loss:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
L _ { T D } ( \theta ) = \mathbb { E } _ { ( s , a , s ^ { \prime } ) \sim \mathcal { D } } [ ( r ( s , a ) + \gamma \operatorname* { m a x } _ { a ^ { \prime } } Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } ) - Q _ { \theta } ( s , a ) ) ^ { 2 } ] ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\mathcal { D }$ is the dataset, $Q _ { \theta } ( s , a )$ is a parameterized Q-function, $Q _ { \hat { \theta } } ( s , a )$ is a target network (e.g., with soft parameters updates defined via Polyak averaging), and the policy is defined as $\pi ( s ) =$ arg $\operatorname* { m a x } _ { a } Q _ { \theta } ( s , a )$ . Most recent offline RL methods modify either the value function loss (above) to regularize the value function in a way that keeps the resulting policy close to the data, or constrain the arg max policy directly. This is important because out-of-distribution actions $a ^ { \prime }$ can produce erroneous values for $Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } )$ in the above objective, often leading to overestimation as the policy is defined to maximize the (estimated) Q-value.
|
| 45 |
+
|
| 46 |
+
# 4 IMPLICIT Q-LEARNING
|
| 47 |
+
|
| 48 |
+
In this work, we aim to entirely avoid querying out-of-sample (unseen) actions in our TD loss. Although the goal of this work is to approximate the optimal $Q$ -function, we start by considering fitted $Q$ evaluation with a SARSA-style objective which has been considered in prior work on Offline Reinforcement Learning (Brandfonbrener et al., 2021; Gulcehre et al., 2021) . This objective aims to learn the value of the dataset policy $\pi _ { \beta }$ (also called the behavior policy):
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
L ( \theta ) = \mathbb { E } _ { ( s , a , s ^ { \prime } , a ^ { \prime } ) \sim \mathcal { D } } [ ( r ( s , a ) + \gamma Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } ) - Q _ { \theta } ( s , a ) ) ^ { 2 } ] .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
This objective never queries values for out-of-sample actions, in contrast to Eqn. $( 1 )$ . One specific property of this objective that is important for this work is that it uses mean squared error (MSE) that fits $Q _ { \theta } ( s , a )$ to predict the mean statistics of the TD targets. Thus, if we assume unlimited capacity and no sampling error, the optimal parameters should satisfy
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { Q _ { \theta ^ { * } } ( s , a ) \approx r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } ) ] . } \\ { a ^ { \prime } { \sim } \pi _ { \beta } ( \cdot \vert s ) \quad } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
Prior work (Brandfonbrener et al., 2021; Gulcehre et al., 2021; Peng et al., $\boxed { 2 0 1 9 }$ has proposed directly using this objective to learn $Q ^ { \pi _ { \beta } }$ , and then train the policy $\pi _ { \psi }$ to maximize $\overline { { Q } } ^ { \pi _ { \beta } }$ . This avoids any issues with out-of-distribution actions, since the TD loss only uses dataset actions. However, while this procedure works well empirically on simple MuJoCo locomotion tasks in D4RL, we will show that it performs very poorly on more complex tasks that benefit from multi-step dynamic programming. In our method, which we derive next, we retain the benefits of using this SARSA-like objective, but modify it so that it allows us to perform multi-step dynamic programming and learn a near-optimal Q-function.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 1: Left: The asymmetric squared loss used for expectile regression. $\tau = 0 . 5$ corresponds to the standard mean squared error loss, while $\tau = 0 . 9$ gives more weight to positives differences. Center: Expectiles of a normal distribution. Right: an example of estimating state conditional expectiles of a two-dimensional random variable. Each $x$ corresponds to a distribution over $y$ . We can approximate a maximum of this random variable with expectile regression: $\tau = 0 . 5$ correspond to the conditional mean statistics of the distribution, while $\tau \approx 1$ approximates the maximum operator over in-support values of $y$ .
|
| 64 |
+
|
| 65 |
+
Our method will perform a $Q$ -function update similar to Eqn. $\mathbb { Q }$ , but we will aim to estimate the maximum $Q$ -value over actions that are in the support of the data distribution. Crucially, we will show that it is possible to do this without ever querying the learned $Q$ -function on out-of-sample actions by utilizing expectile regression. Formally, the value function we aim to learn is given by:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
L ( \theta ) = \mathbb { E } _ { ( s , a , s ^ { \prime } ) \sim \mathcal { D } } [ ( r ( s , a ) + \gamma \operatorname* { m a x } _ { { a ^ { \prime } \in A } \atop { s . t . \pi _ { \beta } ( a ^ { \prime } | s ^ { \prime } ) > 0 } } Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } ) - Q _ { \theta } ( s , a ) ) ^ { 2 } ] .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Our algorithm, implicit Q-Learning (IQL), aims to estimate this objective while evaluating the $Q$ - function only on the state-action pairs in the dataset. To this end, we propose to fit $Q _ { \theta } ( s , a )$ to estimate state-conditional expectiles of the target values, and show that specific expectiles approximate the maximization defined above. In Section $\boxed { 4 . 4 }$ we show that this approach performs multi-step dynamic programming in theory, and in Section $\underline { { \boldsymbol { \mathsf { F . 1 } } } }$ we show that it does so in practice.
|
| 72 |
+
|
| 73 |
+
# 4.1 EXPECTILE REGRESSION
|
| 74 |
+
|
| 75 |
+
Practical methods for estimating various statistics of a random variable have been thoroughly studies in applied statistics and econometrics. The $\tau \in \mathsf { \Gamma } ( 0 , 1 )$ expectile of some random variable $X$ is defined as a solution to the asymmetric least squares problem:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\underset { m _ { \tau } } { \arg \operatorname* { m i n } } \mathbb { E } _ { x \sim X } [ L _ { 2 } ^ { \tau } ( x - m _ { \tau } ) ] , \mathrm { ~ w h e r e ~ } L _ { 2 } ^ { \tau } ( u ) = | \tau - \mathbb { 1 } ( u < 0 ) | u ^ { 2 } .
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
That is, for $\tau > 0 . 5$ , this asymmetric loss function downweights the contributions of $x$ values smaller than $m _ { \tau }$ while giving more weights to larger values (see Fig. $\bigstar \bigstar$ left). Expectile regression is closely related to quantile regression $\mathrm { ( \mathbb { K } o e n k e r ~ \& ~ H a l l o c k , \mathbb { 2 0 0 1 } ) }$ , which is a popular technique for estimating quantiles of a distribution widely used in reinforcement learning (Dabney et al., 2018b;a) The quantile regression loss is defined as an asymmetric $\ell _ { 1 }$ loss.
|
| 82 |
+
|
| 83 |
+
We can also use this formulation to predict expectiles of a conditional distribution:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\operatorname * { a r g m i n } _ { m _ { \tau } ( x ) } \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } [ L _ { 2 } ^ { \tau } ( y - m _ { \tau } ( x ) ) ] .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Fig. 1 (right) illustrates conditional expectile regression on a simple two-dimensional distribution. Note that we can optimize this objective with stochastic gradient descent. It provides unbiased gradients and is easy to implement with standard machine learning libraries.
|
| 90 |
+
|
| 91 |
+
# 4.2 LEARNING THE VALUE FUNCTION WITH EXPECTILE REGRESSION
|
| 92 |
+
|
| 93 |
+
Expectile regression provides us with a powerful framework to estimate statistics of a random variable beyond mean regression. We can use expectile regression to modify the policy evaluation objective in Eqn. $\textcircled { 2 }$ to predict an upper expectile of the TD targets that approximates the maximum of $\dot { r } ( s , a ) + \gamma \bar { Q } _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } )$ over actions $a ^ { \prime }$ constrained to the dataset actions, as in Eqn. $( 4 )$ . This leads to the following expectile regression objective:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
L ( \theta ) = \mathbb { E } _ { ( s , a , s ^ { \prime } , a ^ { \prime } ) \sim \mathcal { D } } [ L _ { 2 } ^ { \tau } ( r ( s , a ) + \gamma Q _ { \hat { \theta } } ( s ^ { \prime } , a ^ { \prime } ) - Q _ { \theta } ( s , a ) ) ] .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
However, this formulation has a significant drawback. Instead of estimating expectiles just with respect to the actions in the support of the data, it also incorporates stochasticity that comes from the environment dynamics $s ^ { \prime } \sim p ( \cdot | s , a )$ . Therefore, a large target value might not necessarily reflect the existence of a single action that achieves that value, but rather a “lucky” sample that happened to have transitioned into a good state. We resolve this by introducing a separate value function that approximates an expectile only with respect to the action distribution, leading to the following loss:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
L _ { V } ( \psi ) = \mathbb { E } _ { ( s , a ) \sim \mathcal { D } } [ L _ { 2 } ^ { \tau } ( Q _ { \hat { \theta } } ( s , a ) - V _ { \psi } ( s ) ) ] .
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
We can then use this estimate to update the $Q$ -functions with the MSE loss, which averages over the stochasticity from the transitions and avoids the “lucky” sample issue mentioned above:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
L _ { Q } ( \theta ) = \mathbb { E } _ { ( s , a , s ^ { \prime } ) \sim \mathcal { D } } [ ( r ( s , a ) + \gamma V _ { \psi } ( s ^ { \prime } ) - Q _ { \theta } ( s , a ) ) ^ { 2 } ] .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Note that these losses do not use any explicit policy, and only utilize actions from the dataset for both objectives, similarly to SARSA-style policy evaluation. In Section $^ { 4 . 4 , }$ we will show that this procedure recovers the optimal Q-function under some assumptions. Also, even though only one action is available for every state in the dataset for continuous action spaces, due to neural network generalization, the expectile regression does not result in SARSA-style policy evaluation as shown in Section $5 . 2 .$
|
| 112 |
+
|
| 113 |
+
# 4.3 POLICY EXTRACTION AND ALGORITHM SUMMARY
|
| 114 |
+
|
| 115 |
+
While our modified TD learning procedure learns an approximation to the optimal Q-function, it does not explicitly represent the corresponding policy, and therefore requires a separate policy extraction step. While one can consider any technique for policy extraction that constrains the learned policy to stay close to the dataset actions, we aim for a simple method for policy extraction. As before, we aim to avoid using outof-samples actions. Therefore, we extract the policy with advantage-weighted regression (Peters & Schaal, 2007; Peng et al., 2019) previously successfully used for policy extraction in Offline RL (Wang et al., 2018; Nair et al., 2020; Brandfonbrener et al., 2021):
|
| 116 |
+
|
| 117 |
+
# Algorithm 1 Implicit Q-learning
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
L _ { \pi } ( \phi ) = \mathbb { E } _ { ( s , a ) \sim \mathcal { D } } [ \exp ( \beta ( Q _ { \hat { \theta } } ( s , a ) - V _ { \psi } ( s ) ) ) \log \pi _ { \phi } ( a | s ) ] ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Initialize parameters $\psi , \theta , { \hat { \theta } } , \phi$ .
|
| 124 |
+
TD learning (IQL):
|
| 125 |
+
for each gradient step do $\begin{array} { l } { \psi \psi - \lambda _ { V } \nabla _ { \psi } L _ { V } ( \psi ) } \\ { \theta \theta - \lambda _ { Q } \nabla _ { \theta } L _ { Q } ( \theta ) } \\ { \hat { \theta } ( 1 - \alpha ) \hat { \theta } + \alpha \theta } \end{array}$
|
| 126 |
+
end for
|
| 127 |
+
Policy extraction (AWR):
|
| 128 |
+
for each gradient step do $\phi \overset { \cdot } { \phi } - \lambda _ { \pi } \nabla _ { \phi } \bar { L } _ { \pi } ( \phi )$
|
| 129 |
+
end for
|
| 130 |
+
|
| 131 |
+
where $\beta \in [ 0 , \infty )$ is an inverse temperature. Note that this objective does not clone all actions from the dataset but, as shown in prior work, this objective learns a policy that maximizes the $Q$ -values subject to a distribution constraint $\mathrm { ( P e t e r s ~ \& ~ S c h a a l l ) } \mathrm { | 2 0 0 7 | ; | P e n g ~ e t ~ a l . | } \mathrm { | 2 0 1 9 ; | N a i r ~ e t ~ a l . | 2 0 2 0 | }$ . This step can be seen as selecting and cloning the most optimal actions in the dataset.
|
| 132 |
+
|
| 133 |
+
Our final algorithm consists of two stages. First, we fit the value function and $Q$ , performing a number of gradient updates alternating between Eqn. $( 5 )$ and $( 6 )$ . Second, we perform stochastic gradient descent on Eqn. $\overset { \cdot } { ( 7 ) }$ . For both steps, we use a version of clipped double Q-learning $( { \overline { { \mathbb { F } { \mathrm { u j i m o t o ~ e t ~ a l . } } } } } , )$ $\underline { { 2 0 1 8 } } )$ , taking a minimum of two $Q$ -functions for $V$ -function and policy updates. We summarize our final method in Algorithm $^ { 1 . }$ Note that the policy does not influence the value function in any way, and therefore extraction could be performed either concurrently or after TD learning. Concurrent learning provides a way to use IQL with online finetuning, as we discuss in Section ${ \bar { 5 . 3 } } .$
|
| 134 |
+
|
| 135 |
+
# 4.4 ANALYSIS
|
| 136 |
+
|
| 137 |
+
In this section, we will show that IQL can recover the optimal value function under the dataset support constraints. First, we prove a simple lemma that we will then use to show how our approach can enable learning the optimal value function.
|
| 138 |
+
|
| 139 |
+
Lemma 1. Let $X$ be a real-valued random variable with a bounded support and supremum of the support is $x ^ { * }$ . Then,
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\operatorname* { l i m } _ { \tau 1 } m _ { \tau } = x ^ { \ast }
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Proof Sketch. One can show that expectiles of a random variable have the same supremum $x ^ { * }$ . Moreover, for all $\tau _ { 1 }$ and $\tau _ { 2 }$ such that $\tau _ { 1 } < \tau _ { 2 }$ , we get $m _ { \tau _ { 1 } } \leq m _ { \tau _ { 2 } }$ . Therefore, the limit follows from the properties of bounded monotonically non-decreasing functions. □
|
| 146 |
+
|
| 147 |
+
In the following theorems, we show that under certain assumptions, our method indeed approximates the optimal state-action value $Q ^ { * }$ and performs multi-step dynamical programming. We first prove a technical lemma relating different expectiles of the Q-function, and then derive our main result regarding the optimality of our method.
|
| 148 |
+
|
| 149 |
+
For the sake of simplicity, we introduce the following notation for our analysis. Let $\mathbb { E } _ { x \sim X } ^ { \tau } [ x ]$ be a $\tau ^ { \mathrm { { t h } } }$ expectile of $X$ (e.g., $\mathbb { E } ^ { 0 . 5 }$ corresponds to the standard expectation). Then, we define $V _ { \tau } ( s )$ and $Q _ { \tau } ( s , \bar { a } )$ , which correspond to optimal solutions of Eqn. $5$ and $\boxed { 6 }$ correspondingly, recursively as:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
V _ { \tau } ( s ) = \mathbb { E } _ { a \sim \pi _ { \beta } ( \cdot | s ) } ^ { \tau } [ Q _ { \tau } ( s , a ) ] ,
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
Q _ { \tau } ( s , a ) = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V _ { \tau } ( s ^ { \prime } ) ] .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
Lemma 2. For all $s$ , $\tau _ { 1 }$ and $\tau _ { 2 }$ such that $\tau _ { 1 } < \tau _ { 2 }$ we get $V _ { \tau _ { 1 } } ( s ) \leq V _ { \tau _ { 2 } } ( s )$
|
| 160 |
+
|
| 161 |
+
Proof. The proof follows the policy improvement proof (Sutton & Barto, 2018). See Appendix A.
|
| 162 |
+
|
| 163 |
+
Corollary 2.1. For any $\tau$ and s we have $V _ { \tau } ( s ) \leq \mathrm { m a x } \qquad a \in \mathcal { A } \quad \ldots \ : Q ^ { * } ( s , a )$ where $V _ { \tau } ( s )$ is defined s.t. $\pi _ { \beta } ( a | s ) { > } 0$
|
| 164 |
+
as above and $Q ^ { * } ( s , a )$ is an optimal state-action value function constrained to the dataset and
|
| 165 |
+
defined as
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
Q ^ { * } ( s , a ) = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } \left[ \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { A } } Q ^ { * } ( s ^ { \prime } , a ^ { \prime } ) \right] .
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
Proof. The proof follows from the observation that convex combination is smaller than maximum.
|
| 172 |
+
|
| 173 |
+
Theorem 3.
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\operatorname* { l i m } _ { \tau 1 } V _ { \tau } ( s ) = \operatorname* { m a x } _ { a \in \mathcal { A } \atop s . t . \pi _ { \beta } ( a \mid s ) > 0 } Q ^ { \ast } ( s , a ) .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Proof. Follows from combining Lemma 1 and Corollary 2.1.
|
| 180 |
+
|
| 181 |
+
Therefore, for a larger value of $\tau < 1$ , we get a better approximation of the maximum. On the other hand, it also becomes a more challenging optimization problem. Thus, we treat $\tau$ as a hyperparameter. Due to the property discussed in Theorem $\bigtriangledown$ we dub our method implicit Q-learning (IQL). We also emphasize that our value learning method defines the entire spectrum of methods between SARSA $\tau = 0 . 5$ ) and Q-Learning $( \tau 1 )$ ). Note that in contrast to other multi-step methods, IQL absorbs the policy improvement step into value learning. Therefore, fitting Q-function corresponds to the policy evaluation step, while fitting the value function with IQL corresponds to implicit policy improvement.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 2: Evaluation of our algorithm on a toy umaze environment (a). When the static dataset is heavily corrupted by suboptimal actions, one-step policy evaluation results in a value function that degrades to zero far from the rewarding states too quickly (c). Our algorithm aims to learn a near-optimal value function, combining the best properties of SARSA-style evaluation with the ability to perform multi-step dynamic programming, leading to value functions that are much closer to optimality (shown in (b)) and producing a much better policy (d).
|
| 185 |
+
|
| 186 |
+
# 5 EXPERIMENTAL EVALUATION
|
| 187 |
+
|
| 188 |
+
Our experiments aim to evaluate our method comparatively, in contrast to prior offline RL methods, and in particular to understand how our approach compares both to single-step methods and multi-step dynamic programming approaches. We will first demonstrate the benefits of multi-step dynamic programming methods, such as ours, in contrast to single-step methods, showing that on some problems this difference can be extremely large. We will then compare IQL with state-of-theart single-step and multi-step algorithms on the D4RL $\mathrm { ( F u ~ e t ~ a l . , } \mathbb { 2 0 2 0 } )$ benchmark tasks, studying the degree to which we can learn effective policies using only the actions in the dataset. We examine domains that contain near-optimal trajectories, where single-step methods perform well, as well as domains with no optimal trajectories at all, which require multi-step dynamic programming. Finally, we will study how IQL compares to prior methods when finetuning with online RL starting from an offline RL initialization.
|
| 189 |
+
|
| 190 |
+
# 5.1 THE DIFFERENCE BETWEEN ONE-STEP POLICY IMPROVEMENT AND IQL
|
| 191 |
+
|
| 192 |
+
We first use a simple maze environment to illustrate the importance of multi-step dynamic programming for offline RL. The maze has a u-shape, a single start state, and a single goal state (see Fig. 2a) The agent receives a reward of 10 for entering the goal state and zero reward for all other transitions. With a probability of 0.25, the agent transitions to a random state, and otherwise to the commanded state. The dataset consists of 1 optimal trajectory and 99 trajectories with uniform random actions. Due to a short horizon of the problem, we use $\gamma = 0 . 9$ .
|
| 193 |
+
|
| 194 |
+
Fig. $2$ (c, d) illustrates the difference between single-step methods which fit $Q ^ { \pi } ( s , a )$ via SARSAstyle objective, in this case represented by Onepstep RL (Brandfonbrener et al., $\boxed { 2 0 2 1 }$ Wang et al., $\dot { \boxed { 2 0 1 8 } } ;$ Gulcehre et al., 2021) and IQL with $\tau = 0 . 9 5$ . Note that these methods represent a special case of our method with $\bar { \tau } = 0 . 5$ . Although states closer to the high reward state will still have higher values, these values decay much faster as we move further away than they would for the optimal value function, and the resulting policy is highly suboptimal. Since IQL (d) performs iterative dynamic programming, it correctly propagates the signal, and the values are no longer dominated by noise. The resulting value function closely matches the true optimal value function (b).
|
| 195 |
+
|
| 196 |
+
# 5.2 COMPARISONS ON OFFLINE RL BENCHMARKS
|
| 197 |
+
|
| 198 |
+
Next, we evaluate our approach on the D4RL benchmark in comparison to prior methods (see Table $\bigstar \bigstar \bigstar \bigstar$ . The MuJoCo tasks in D4RL consist of the Gym locomotion tasks, the Ant Maze tasks, and the Adroit and Kitchen robotic manipulation environments. Some prior works, particularly those proposing one-step methods, focus entirely on the Gym locomotion tasks. However, these tasks include a significant fraction of near-optimal trajectories in the dataset. In contrast, the Ant Maze tasks, especially the medium and large ones, contain very few or no near-optimal trajectories, making them very challenging for one-step methods. These domains require “stitching” parts of suboptimal trajectories that travel between different states to find a path from the start to the goal of the maze $\mathtt { ( F u ~ e t ~ a l . } ] \mathtt { ( E 0 2 0 ) }$ . As we will show, multi-step dynamic programming is essential in these domains. The Adroit and Kitchen tasks are comparatively less discriminating, and we found that most RL methods perform similarly to imitation learning in these domains (Florence et al., 2021)
|
| 199 |
+
|
| 200 |
+
Table 1: Averaged normalized scores on MuJoCo locomotion and Ant Maze tasks. Our method outperforms prior methods on the challenging Ant Maze tasks, which require dynamic programming, and is competitive with the best prior methods on the locomotion tasks.
|
| 201 |
+
|
| 202 |
+
<table><tr><td>Dataset</td><td>BC</td><td>10%BC</td><td>BCQ</td><td>DT</td><td>ABM</td><td>AWAC</td><td>Onestep RL</td><td>TD3+BC</td><td>CQL</td><td>IQL (Ours)</td></tr><tr><td>halfcheetah-m-v2</td><td>42.6</td><td>42.5</td><td>47.0</td><td>42.6±0.1</td><td>53.6</td><td>43.5</td><td>48.4±0.1</td><td>48.3±0.3</td><td>44.0±5.4</td><td>47.4±0.2</td></tr><tr><td>hopper-m-v2</td><td>52.9</td><td>56.9</td><td>56.7</td><td>67.6±1.0</td><td>0.7</td><td>57.0</td><td>59.6±2.5</td><td>59.3±4.2</td><td>58.5±2.1</td><td>66.2±5.7</td></tr><tr><td>walker2d-m-v2</td><td>75.3</td><td>75.0</td><td>72.6</td><td>74.0±1.4</td><td>0.5</td><td>72.4</td><td>81.8±2.2</td><td>83.7±2.1</td><td>72.5±0.8</td><td>78.3±8.7</td></tr><tr><td>halfcheetah-m-r-v2</td><td>36.6</td><td>40.6</td><td>40.4</td><td>36.6±0.8</td><td>50.5</td><td>40.5</td><td>38.1±1.3</td><td>44.6±0.5</td><td>45.5±0.5</td><td>44.2±1.2</td></tr><tr><td>hopper-m-r-v2</td><td>18.1</td><td>75.9</td><td>53.3</td><td>82.7±7.0</td><td>49.6</td><td>37.2</td><td>97.5±0.7</td><td>60.9±18.8</td><td>95.0±6.4</td><td>94.7±8.6</td></tr><tr><td>walker2d-m-r-v2</td><td>26.0</td><td>62.5</td><td>52.1</td><td>66.6±3.0</td><td>53.8</td><td>27.0</td><td>49.5±12.0</td><td>81.8±5.5</td><td>77.2±5.5</td><td>73.8±7.1</td></tr><tr><td>halfcheetah-m-e-v2</td><td>55.2</td><td>92.9</td><td>89.1</td><td>86.8±1.3</td><td>18.5</td><td>42.8</td><td>93.4±1.6</td><td>90.7±4.3</td><td>91.6±2.8</td><td>86.7±5.3</td></tr><tr><td>hopper-m-e-v2</td><td>52.5</td><td>110.9</td><td>81.8</td><td>107.6±1.8</td><td>0.7</td><td>55.8</td><td>103.3±1.9</td><td>98.0±9.4</td><td>105.4±6.8</td><td>91.5±14.3</td></tr><tr><td>walker2d-m-e-v2</td><td>107.5</td><td>109.0</td><td>109.5</td><td>108.1±0.2</td><td>3.5</td><td>74.5</td><td>113.0±0.4</td><td>110.1±0.5</td><td>108.8±0.7</td><td>109.6±1.0</td></tr><tr><td>locomotion-v2 total</td><td>466.7</td><td>666.2</td><td>602.5</td><td>672.6±16.6</td><td>231.4</td><td>450.7</td><td>684.6±22.7</td><td>677.4±44.5</td><td>698.5±31.0</td><td>692.4±52.1</td></tr><tr><td>antmaze-u-v0</td><td>54.6</td><td>62.8</td><td>89.8</td><td>59.2</td><td>59.9</td><td>56.7</td><td>64.3</td><td>78.6</td><td>74.0</td><td>87.5±2.6</td></tr><tr><td>antmaze-u-d-v0</td><td>45.6</td><td>50.2</td><td>83.0</td><td>53.0</td><td>48.7</td><td>49.3</td><td>60.7</td><td>71.4</td><td>84.0</td><td>62.2 ±13.8</td></tr><tr><td>antmaze-m-p-v0</td><td>0.0</td><td>5.4</td><td>15.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.3</td><td>10.6</td><td>61.2</td><td>71.2 ± 7.3</td></tr><tr><td>antmaze-m-d-v0</td><td>0.0</td><td>9.8</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.7</td><td>0.0</td><td>3.0</td><td>53.7</td><td>70.0��10.9</td></tr><tr><td>antmaze-l-p-v0 antmaze-l-d-v0</td><td>0.0 0.0</td><td>0.0 6.0</td><td>0.0</td><td>0.0</td><td>0.</td><td>0.0</td><td>0.0</td><td>0.2</td><td>15.8</td><td>39.6±5.8</td></tr><tr><td>antmaze-vO total</td><td>100.2</td><td>134.2</td><td>0.0 187.8</td><td>0.0</td><td>0.0</td><td>1.0</td><td>0.0</td><td>0.0</td><td>14.9</td><td>47.5±9.5</td></tr><tr><td></td><td></td><td></td><td></td><td>112.2</td><td>109.1</td><td>107.7</td><td>125.3</td><td>163.8</td><td>303.6</td><td>378.0±49.9</td></tr><tr><td>total</td><td>566.9</td><td>800.4</td><td>790.3</td><td>784.8</td><td>340.5</td><td>558.4</td><td>809.9</td><td>841.2</td><td>1002.1</td><td>1070.4±102.0</td></tr><tr><td>kitchen-v0 total adroit-vO total</td><td>154.5 104.5</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>144.6</td><td>159.8±22.6</td></tr><tr><td></td><td></td><td>:</td><td>=</td><td>-</td><td>-</td><td>=</td><td>-</td><td>-</td><td>93.6</td><td>118.1±30.7</td></tr><tr><td>total+kitchen+adroit</td><td>825.9</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>1240.3</td><td>1348.3±155.3</td></tr><tr><td>runtime</td><td>10m</td><td>10m</td><td></td><td>960m</td><td></td><td>20m</td><td>20m*</td><td>20m</td><td>80m</td><td>20m</td></tr></table>
|
| 203 |
+
|
| 204 |
+
⇤: Note that it is challenging to compare one-step and multi-step methods directly. Also, Brandfonbrener et al. $\boxed { ( 2 0 2 1 ) }$ reports results for a set of hyperparameters, such as batch and network size, that is significantly different from other methods. We report results for the original hyperparameters and runtime for a comparable set of hyperparameters.
|
| 205 |
+
|
| 206 |
+
We therefore focus our analysis on the Gym locomotion and Ant Maze domains, but include full Adroit and Kitchen results in Appendix B for completeness.
|
| 207 |
+
|
| 208 |
+
Comparisons and baselines. We compare to methods that are representative of both multistep dynamic programming and one-step approaches. In the former category, we compare to CQL (Kumar et al., 2020), $\mathrm { T D } 3 { + } \mathrm { B C }$ (Fujimoto & Gu, 2021), and AWAC (Nair et al., 2020). In the latter category, we compare to Onestep RL (Brandfonbrener et al., 2021) and Decision Transformers (Chen et al., 2021). We obtained the Decision Transformers results on Ant Maze subsets of D4RL tasks using the author-provided implementation2 and following authors instructions communicated over email. We obtained results for $\mathrm { T D } 3 { + } \mathrm { B C }$ and Onestep RL (Exp. Weight) directly from the authors. Note that Chen et al. (2021) and Brandfonbrener et al. $\textcircled { 2 0 2 1 }$ incorrectly report results for some prior methods, such as CQL, using the “-v0” environments. These generally produce lower scores than the “-v2” environments that these papers use for their own methods. We use the “-v2” environments for all methods to en
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Figure 3: Left: Estimating a larger expectile $\tau$ is crucial for antmaze tasks that require dynamical programming (’stitching’). Right: Clipped double Q-Learning (CDQ) is crucial for learning values for $\tau = 0 . 9$ .
|
| 212 |
+
|
| 213 |
+
sure a fair comparison, resulting in higher values for CQL. Because of this fix, our reported CQL scores are higher than all other prior methods. We obtained results for $\mathbf { \tilde { \mu } } ^ { 6 6 } \mathbf { - v } 2 \mathbf { \ w } ^ { 5 }$ datasets using an author-suggested implementation.3 On the Gym locomotion tasks (halfcheetah, hopper, walker2d), we find that IQL performs comparably to the best performing prior method, CQL. On the more challenging Ant Maze task, IQL outperforms CQL, and outperforms the one-step methods by a very large margin.
|
| 214 |
+
|
| 215 |
+
Runtime. Our approach is also computationally faster than the baselines (see Table 1). For the baselines, we measure runtime for our reimplementations of the methods in JAX (Bradbury et al., 2018) built on top of JAXRL (Kostrikov, 2021), which are typically faster than the original implementations. For example, the original implementation of CQL takes more than 4 hours to perform 1M updates, while ours takes only 80 minutes. Even so, IQL still requires about $4 \mathbf { x }$ less time than our reimplementation of CQL on average, and is comparable to the fastest prior one-step methods. We did not reimplement Decision Transformers due to their complexity and report runtime of the original implementation.
|
| 216 |
+
|
| 217 |
+
Effect of $\tau$ hyperparameter. We also demonstrate that it is crucial to compute a larger expectile on tasks that require “stitching” (see Fig. 3). We provide complete results in Appendix B. With larger values of $\tau$ , our method approximates $Q$ -learning better, leading to better performance on the Ant Maze tasks. Moreover, due to neural network generalization, values learned with expectile regression increase with a larger $\tau$ and do not degrade to behavior policy values $\tau = 0 . 5$ ). Finally, clipped double Q-Learning is crucial for estimating values for a larger $\tau = 0 . 9$ .
|
| 218 |
+
|
| 219 |
+
# 5.3 ONLINE FINE-TUNING AFTER OFFLINE RL
|
| 220 |
+
|
| 221 |
+
The policies obtained by offline RL can often be improved with a small amount of online interaction. IQL is well-suited for online fine-tuning for two reasons. First, IQL has strong offline performance, as shown in the previous section, which provides a good initialization. Second, IQL implements a weighted behavioral cloning policy extraction step, which has previously been shown to allow for better online policy improvement compared to other types of offline constraints $( \overbrace { { \mathbb { N a i r } \ \mathrm { e t } \ \mathrm { a l . } } } ) \ \big [ 2 0 2 0 \big ]$ To evaluate the finetuning capability of various RL algorithms, we first run offline RL on each
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Dataset</td><td>AWAC</td><td>CQL</td><td>IQL (Ours)</td></tr><tr><td>antmaze-umaze-vO antmaze-umaze-diverse-v0</td><td>56.7 →59.0 49.3 →49.0</td><td>70.1 →99.4 31.1 →99.4</td><td>88.0 →96.3 67.0 →49.0</td></tr><tr><td>antmaze-medium-play-v0</td><td>0.0 →0.0</td><td>23.0 →0.0</td><td>69.0 →89.2</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>0.7 →0.3</td><td>23.0 →32.3</td><td>71.8 →91.4</td></tr><tr><td>antmaze-large-play-v0</td><td>0.0 →0.0</td><td>1.0 →0.0</td><td>36.8 →51.8</td></tr><tr><td>antmaze-large-diverse-v0</td><td>1.0 →0.0</td><td>1.0 →0.0</td><td>42.2 →59.8</td></tr><tr><td>antmaze-vO total</td><td>107.7 →108.3</td><td>151.5 →231.1</td><td>374.8 →437.5</td></tr><tr><td>pen-binary-v0</td><td>44.6 →70.3</td><td>31.2 →9.9</td><td>37.4 →60.7</td></tr><tr><td>door-binary-v0</td><td>1.3 →30.1</td><td>0.2 →0.0</td><td>0.7 →32.3</td></tr><tr><td>relocate-binary-v0</td><td>0.8 →2.7</td><td>0.1 →0.0</td><td>0.0 →31.0</td></tr><tr><td>hand-vO total</td><td>46.7 →103.1</td><td>31.5 →9.9</td><td>38.1 →124.0</td></tr><tr><td>total</td><td>154.4→211.4</td><td>182.8→241.0</td><td>412.9561.5</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Table 2: Online finetuning results showing the initial performance after offline RL, and performance after 1M steps of online RL. In all tasks, IQL is able to finetune to a significantly higher performance than the offline initialization, with final performance that is comparable to or better than the best of either AWAC or CQL on all tasks except pen-binary-v0.
|
| 226 |
+
|
| 227 |
+
dataset, then run 1M steps of online RL, and then report the final performance. We compare to AWAC (Nair et al., $\boxed { 2 0 2 0 }$ , which has been proposed specifically for online finetuning, and CQL $\underline { { \mathbb { K u } } } - \rfloor$ mar et al., $\overline { { \boxed { 2 0 2 0 } } }$ , which showed the best performance among prior methods in our experiments in the previous section. Exact experimental details are provided in Appendix $\mathbf { C } .$ We use the challenging Ant Maze D4RL domains $\mathtt { ( F u ) e t a l . } \mathtt { / } 2 0 2 0 \rVert$ , as well as the high-dimensional dexterous manipulation environments from Rajeswaran et al. $\overline { { \left( \frac { 2 0 1 8 } { \it 1 8 } \right) } }$ , which Nair et al. $\underline { { ( 2 0 2 0 ) } }$ propose to use to study online adaptation with AWAC. Results are shown in Table $\boxed { 5 }$ On the Ant Maze domains, IQL significantly outperforms both prior methods after online finetuning. CQL attains the second best score, while AWAC performs comparatively worse due to much weaker offline initialization. On the dexterous hand tasks, IQL performs significantly better than AWAC on relocate-binary-v0, comparably on door-binary-v0, and slightly worse on pen-binary-v0, with the best overall score.
|
| 228 |
+
|
| 229 |
+
# 6 CONCLUSION
|
| 230 |
+
|
| 231 |
+
We presented implicit Q-Learning (IQL), a general algorithm for offline RL that completely avoids any queries to values of out-of-sample actions during training while still enabling multi-step dynamic programming. To our knowledge, this is the first method that combines both of these features. This has a number of important benefits. First, our algorithm is computationally efficient: we can perform 1M updates on one GTX1080 GPU in less than 20 minutes. Second, it is simple to implement, requiring only minor modifications over a standard SARSA-like TD algorithm, and performing policy extraction with a simple weighted behavioral cloning procedure resembling supervised learning. Finally, despite the simplicity and efficiency of this method, we show that it attains excellent performance across all of the tasks in the D4RL benchmark, matching the best prior methods on the MuJoCo locomotion tasks, and exceeding the state-of-the-art performance on the challenging ant maze environments, where multi-step dynamic programming is essential for good performance.
|
| 232 |
+
|
| 233 |
+
# ACKNOWLEDGEMENTS
|
| 234 |
+
|
| 235 |
+
We thank Dibya Ghosh and the anonymous reviewers for helpful comments on earlier drafts of the paper. This research was supported by the Office of Naval Research, C3.ai, and Intel, with compute support from Google.
|
| 236 |
+
|
| 237 |
+
# REFERENCES
|
| 238 |
+
|
| 239 |
+
James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python $^ +$ NumPy programs, 2018. URL http: //github.com/google/jax.
|
| 240 |
+
David Brandfonbrener, William F Whitney, Rajesh Ranganath, and Joan Bruna. Offline rl without off-policy evaluation. arXiv preprint arXiv:2106.08909, 2021.
|
| 241 |
+
Lili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Michael Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. arXiv preprint arXiv:2106.01345, 2021.
|
| 242 |
+
Will Dabney, Georg Ostrovski, David Silver, and Remi Munos. Implicit quantile networks for ´ distributional reinforcement learning. In International conference on machine learning, pp. 1096– 1105. PMLR, 2018a.
|
| 243 |
+
Will Dabney, Mark Rowland, Marc G Bellemare, and Remi Munos. Distributional reinforcement ´ learning with quantile regression. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018b.
|
| 244 |
+
Rasool Fakoor, Jonas Mueller, Kavosh Asadi, Pratik Chaudhari, and Alexander J Smola. Continuous doubly constrained batch reinforcement learning. arXiv preprint arXiv:2102.09225, 2021.
|
| 245 |
+
Pete Florence, Corey Lynch, Andy Zeng, Oscar Ramirez, Ayzaan Wahid, Laura Downs, Adrian Wong, Johnny Lee, Igor Mordatch, and Jonathan Tompson. Implicit behavioral cloning. arXiv preprint arXiv:2109.00137, 2021.
|
| 246 |
+
Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
|
| 247 |
+
Scott Fujimoto and Shixiang Shane Gu. A minimalist approach to offline reinforcement learning. arXiv preprint arXiv:2106.06860, 2021.
|
| 248 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning, pp. 1587–1596. PMLR, 2018.
|
| 249 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062. PMLR, 2019.
|
| 250 |
+
Seyed Kamyar Seyed Ghasemipour, Dale Schuurmans, and Shixiang Shane Gu. Emaq: Expectedmax q-learning operator for simple yet effective offline and online rl. In International Conference on Machine Learning, pp. 3682–3691. PMLR, 2021.
|
| 251 |
+
Caglar Gulcehre, Sergio Gomez Colmenarejo, Ziyu Wang, Jakub Sygnowski, Thomas Paine, Konrad ´ Zolna, Yutian Chen, Matthew Hoffman, Razvan Pascanu, and Nando de Freitas. Regularized behavior value estimation. arXiv preprint arXiv:2103.09575, 2021.
|
| 252 |
+
Jonathan Heek, Anselm Levskaya, Avital Oliver, Marvin Ritter, Bertrand Rondepierre, Andreas Steiner, and Marc van Zee. Flax: A neural network library and ecosystem for JAX, 2020. URL http://github.com/google/flax.
|
| 253 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 254 |
+
|
| 255 |
+
Roger Koenker and Kevin F Hallock. Quantile regression. Journal of economic perspectives, 15(4): 143–156, 2001.
|
| 256 |
+
|
| 257 |
+
Ilya Kostrikov. JAXRL: Implementations of Reinforcement Learning algorithms in JAX., 10 2021. URL https://github.com/ikostrikov/jaxrl.
|
| 258 |
+
|
| 259 |
+
Ilya Kostrikov, Rob Fergus, Jonathan Tompson, and Ofir Nachum. Offline reinforcement learning with fisher divergence critic regularization. In International Conference on Machine Learning, pp. 5774–5783. PMLR, 2021.
|
| 260 |
+
|
| 261 |
+
Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. arXiv preprint arXiv:1906.00949, 2019.
|
| 262 |
+
|
| 263 |
+
Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 264 |
+
|
| 265 |
+
Arsenii Kuznetsov, Pavel Shvechikov, Alexander Grishin, and Dmitry Vetrov. Controlling overestimation bias with truncated mixture of continuous distributional quantile critics. In International Conference on Machine Learning, pp. 5556–5566. PMLR, 2020.
|
| 266 |
+
|
| 267 |
+
Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pp. 45–73. Springer, 2012.
|
| 268 |
+
|
| 269 |
+
Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Awac: Accelerating online reinforcement learning with offline datasets. 2020.
|
| 270 |
+
|
| 271 |
+
Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019.
|
| 272 |
+
|
| 273 |
+
Jan Peters and Stefan Schaal. Reinforcement learning by reward-weighted regression for operational space control. In Proceedings of the 24th international conference on Machine learning, pp. 745– 750, 2007.
|
| 274 |
+
|
| 275 |
+
Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, John Schulman, Emanuel Todorov, and Sergey Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. In Robotics: Science and Systems, 2018. URL https://arxiv. org/pdf/1709.10087.pdf.
|
| 276 |
+
|
| 277 |
+
Noah Y Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020.
|
| 278 |
+
|
| 279 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014.
|
| 280 |
+
|
| 281 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
|
| 282 |
+
|
| 283 |
+
Qing Wang, Jiechao Xiong, Lei Han, Peng Sun, Han Liu, and Tong Zhang. Exponentially weighted imitation learning for batched historical data. In NeurIPS, pp. 6291–6300, 2018.
|
| 284 |
+
|
| 285 |
+
Ziyu Wang, Alexander Novikov, Konrad Zolna, Jost Tobias Springenberg, Scott Reed, Bobak Shahriari, Noah Siegel, Josh Merel, Caglar Gulcehre, Nicolas Heess, et al. Critic regularized regression. arXiv preprint arXiv:2006.15134, 2020.
|
| 286 |
+
|
| 287 |
+
Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
|
parse/dev/68n2s9ZJWF8/68n2s9ZJWF8_content_list.json
ADDED
|
@@ -0,0 +1,1350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "OFFLINE REINFORCEMENT LEARNING WITH IMPLICIT Q-LEARNING ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
174,
|
| 8 |
+
99,
|
| 9 |
+
633,
|
| 10 |
+
147
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Ilya Kostrikov, Ashvin Nair & Sergey Levine \nDepartment of Electrical Engineering and Computer Science \nUniversity of California, Berkeley \nkostrikov,anair17 @berkeley.edu, svlevine@eecs.berkeley.edu ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
184,
|
| 19 |
+
172,
|
| 20 |
+
759,
|
| 21 |
+
231
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
266,
|
| 32 |
+
544,
|
| 33 |
+
281
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "Offline reinforcement learning requires reconciling two conflicting aims: learning a policy that improves over the behavior policy that collected the dataset, while at the same time minimizing the deviation from the behavior policy so as to avoid errors due to distributional shift. This trade-off is critical, because most current offline reinforcement learning methods need to query the value of unseen actions during training to improve the policy, and therefore need to either constrain these actions to be in-distribution, or else regularize their values. We propose a new offline RL method that never needs to evaluate actions outside of the dataset, but still enables the learned policy to improve substantially over the best behavior in the data through generalization. The main insight in our work is that, instead of evaluating unseen actions from the latest policy, we can approximate the policy improvement step implicitly by treating the state value function as a random variable, with randomness determined by the action (while still integrating over the dynamics to avoid excessive optimism), and then taking a state conditional upper expectile of this random variable to estimate the value of the best actions in that state. This leverages the generalization capacity of the function approximator to estimate the value of the best available action at a given state without ever directly querying a Q-function with this unseen action. Our algorithm alternates between fitting this upper expectile value function and backing it up into a Q-function, without any explicit policy. Then, we extract the policy via advantage-weighted behavioral cloning, which also avoids querying out-of-sample actions. We dub our method implicit Q-learning (IQL). IQL is easy to implement, computationally efficient, and only requires fitting an additional critic with an asymmetric L2 loss. IQL demonstrates the state-of-the-art performance on D4RL, a standard benchmark for offline reinforcement learning. We also demonstrate that IQL achieves strong performance fine-tuning using online interaction after offline initialization. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
232,
|
| 42 |
+
301,
|
| 43 |
+
764,
|
| 44 |
+
660
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
695,
|
| 55 |
+
336,
|
| 56 |
+
710
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Offline reinforcement learning (RL) addresses the problem of learning effective policies entirely from previously collected data, without online interaction (Fujimoto et al., 2019; Lange et al., 2012). This is very appealing in a range of real-world domains, from robotics to logistics and operations research, where real-world exploration with untrained policies is costly or dangerous, but prior data is available. However, this also carries with it major challenges: improving the policy beyond the level of the behavior policy that collected the data requires estimating values for actions other than those that were seen in the dataset, and this, in turn, requires trading off policy improvement against distributional shift, since the values of actions that are too different from those in the data are unlikely to be estimated accurately. Prior methods generally address this by either constraining the policy to limit how far it deviates from the behavior policy (Fujimoto et al., 2019; Wu et al., 2019; Fujimoto & Gu, 2021; Kumar et al., 2019; Nair et al., 2020; Wang et al., 2020), or by regularizing the learned value functions to assign low values to out-of-distribution actions (Kumar et al., 2020; Kostrikov et al., 2021). Nevertheless, this imposes a trade-off between how much the policy improves and how vulnerable it is to misestimation due to distributional shift. Can we devise an offline RL method that avoids this issue by never needing to directly query or estimate values for actions that were not seen in the data? ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
729,
|
| 66 |
+
825,
|
| 67 |
+
924
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "",
|
| 74 |
+
"bbox": [
|
| 75 |
+
173,
|
| 76 |
+
103,
|
| 77 |
+
823,
|
| 78 |
+
132
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 1
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "In this work, we start from an observation that in-distribution constraints widely used in prior work might not be sufficient to avoid value function extrapolation, and we ask whether it is possible to learn an optimal policy with in-sample learning, without ever querying the values of any unseen actions. The key idea in our method is to approximate an upper expectile of the distribution over values with respect to the distribution of dataset actions for each state. We alternate between fitting this value function with expectile regression, and then using it to compute Bellman backups for training the $Q$ -function. We show that we can do this simply by modifying the loss function in a SARSA-style TD backup, without ever using out-of-sample actions in the target value. Once this $Q$ - function has converged, we extract the corresponding policy using advantage-weighted behavioral cloning. This approach does not require explicit constraints or explicit regularization of out-ofdistribution actions during value function training, though our policy extraction step does implicitly enforce a constraint, as discussed in prior work on advantage-weighted regression (Peters & Schaal, 2007; Peng et al., 2019; Nair et al., 2020; Wang et al., 2020). ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
173,
|
| 87 |
+
138,
|
| 88 |
+
825,
|
| 89 |
+
320
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 1
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "Our main contribution is implicit Q-learning (IQL), a new offline RL algorithm that avoids ever querying values of unseen actions while still being able to perform multi-step dynamic programming updates. Our method is easy to implement by making a small change to the loss function in a simple SARSA-like TD update and is computationally very efficient. Furthermore, our approach demonstrates the state-of-the-art performance on D4RL, a popular benchmark for offline reinforcement learning. In particular, our approach significantly improves over the prior state-of-the-art on challenging Ant Maze tasks that require to “stitch” several sub-optimal trajectories. Finally, we demonstrate that our approach is suitable for finetuning; after initialization from offline RL, IQL is capable of improving policy performance utilizing additional interactions. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
173,
|
| 98 |
+
325,
|
| 99 |
+
825,
|
| 100 |
+
452
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "2 RELATED WORK ",
|
| 107 |
+
"text_level": 1,
|
| 108 |
+
"bbox": [
|
| 109 |
+
176,
|
| 110 |
+
472,
|
| 111 |
+
341,
|
| 112 |
+
487
|
| 113 |
+
],
|
| 114 |
+
"page_idx": 1
|
| 115 |
+
},
|
| 116 |
+
{
|
| 117 |
+
"type": "text",
|
| 118 |
+
"text": "A significant portion of recently proposed offline RL methods are based on either constrained or regularized approximate dynamic programming (e.g., Q-learning or actor-critic methods), with the constraint or regularizer serving to limit deviation from the behavior policy. We will refer to these methods as “multi-step dynamic programming” algorithms, since they perform true dynamic programming for multiple iterations, and therefore can in principle recover the optimal policy if provided with high-coverage data. The constraints can be implemented via an explicit density model (Wu et al., 2019; Fujimoto et al., 2019; Kumar et al., 2019; Ghasemipour et al., 2021), implicit divergence constraints (Nair et al., 2020; Wang et al., 2020; Peters & Schaal, 2007; Peng et al., 2019; Siegel et al., 2020), or by adding a supervised learning term to the policy improvement objective (Fujimoto & Gu, 2021) Several works have also proposed to directly regularize the Q-function to produce low values for out-of-distribution actions (Kostrikov et al., 2021; Kumar et al., 2020; Fakoor et al., $\\boxed { 2 0 2 1 }$ Our method is also a multi-step dynamic programming algorithm. However, in contrast to prior works, our method completely avoids directly querying the learned Q-function with unseen actions during training, removing the need for any constraint during this stage, though the subsequent policy extraction, which is based on advantage-weighted regression (Peng et al., 2019; Nair et al., 2020), does apply an implicit constraint. However, this policy does not actually influence value function training. ",
|
| 119 |
+
"bbox": [
|
| 120 |
+
173,
|
| 121 |
+
501,
|
| 122 |
+
825,
|
| 123 |
+
736
|
| 124 |
+
],
|
| 125 |
+
"page_idx": 1
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"type": "text",
|
| 129 |
+
"text": "In contrast to multi-step dynamic programming methods, several recent works have proposed methods that rely either on a single step of policy iteration, fitting the value function or Q-function of the behavior policy and then extracting the corresponding greedy policy (Peng et al., 2019; Brandfonbrener et al., 2021; Gulcehre et al., 2021), or else avoid value functions completely and utilize behavioral cloning-style objectives (Chen et al., 2021). We collectively refer to these as “single-step” approaches. These methods avoid needing to query unseen actions as well, since they either use no value function at all, or learn the value function of the behavior policy. Although these methods are simple to implement and effective on the MuJoCo locomotion tasks in D4RL, we show that such single-step methods perform very poorly on more complex datasets in D4RL, which require combining parts of suboptimal trajectories (“stitching”). Prior multi-step dynamic programming methods perform much better in such settings, as does our method. We discuss this distinction in more detail in Section $5 . 1 .$ Our method also shares the simplicity and computational efficiency of single-step approaches, providing an appealing combination of the strengths of both types of methods. ",
|
| 130 |
+
"bbox": [
|
| 131 |
+
173,
|
| 132 |
+
743,
|
| 133 |
+
825,
|
| 134 |
+
924
|
| 135 |
+
],
|
| 136 |
+
"page_idx": 1
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"type": "text",
|
| 140 |
+
"text": "Our method is based on estimating the characteristics of a random variable. Several recent works involve approximating statistical quantities of the value function distribution. In particular, quantile regression $\\left( \\mathrm { \\mathbb { K o e n k e r ~ \\& ~ H a l l o c k } } \\right) \\underline { 2 0 0 1 } $ has been previously used in reinforcement learning to estimate the quantile function of a state-action value function (Dabney et al., 2018b;a; Kuznetsov et al., $\\boxed { 2 0 2 0 }$ . Although our method is related, in that we perform expectile regression, our aim is not to estimate the distribution of values that results from stochastic transitions, but rather estimate expectiles of the state value function with respect to random actions. This is a very different statistic: our aim is not to determine how the $Q$ -value can vary with different future outcomes, but how the $Q$ -value can vary with different actions while averaging together future outcomes due to stochastic dynamics. While prior work on distributional RL can also be used for offline RL, it would suffer from the same action extrapolation issues as other methods, and would require similar constraints or regularization, while our method does not. ",
|
| 141 |
+
"bbox": [
|
| 142 |
+
173,
|
| 143 |
+
103,
|
| 144 |
+
825,
|
| 145 |
+
270
|
| 146 |
+
],
|
| 147 |
+
"page_idx": 2
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"type": "text",
|
| 151 |
+
"text": "3 PRELIMINARIES ",
|
| 152 |
+
"text_level": 1,
|
| 153 |
+
"bbox": [
|
| 154 |
+
176,
|
| 155 |
+
290,
|
| 156 |
+
339,
|
| 157 |
+
306
|
| 158 |
+
],
|
| 159 |
+
"page_idx": 2
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"type": "text",
|
| 163 |
+
"text": "The RL problem is formulated in the context of a Markov decision process (MDP) $( \\mathcal { S } , \\mathcal { A } , p _ { 0 } ( \\bar { s } ) , p ( s ^ { \\prime } | s , a ) , r ( s , a ) , \\gamma )$ , where $s$ is a state space, $\\mathcal { A }$ is an action space, $p _ { 0 } ( s )$ is a distribution of initial states, $p ( s ^ { \\prime } | s , a )$ is the environment dynamics, $r ( s , a )$ is a reward function, and $\\gamma$ is a discount factor. The agent interacts with the MDP according to a policy $\\pi ( a | s )$ . The goal is to obtain a policy that maximizes the cumulative discounted returns: ",
|
| 164 |
+
"bbox": [
|
| 165 |
+
173,
|
| 166 |
+
320,
|
| 167 |
+
825,
|
| 168 |
+
391
|
| 169 |
+
],
|
| 170 |
+
"page_idx": 2
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"type": "equation",
|
| 174 |
+
"img_path": "images/9fc576211b73d160cee85c5be3121dc4c91c3af566060db70ba726037a731fd1.jpg",
|
| 175 |
+
"text": "$$\n\\stackrel { \\cdot } { \\pi } = \\arg \\operatorname* { m a x } _ { \\pi } \\mathbb { E } _ { \\pi } \\left[ \\sum _ { t = 0 } ^ { \\infty } \\gamma ^ { t } r ( s _ { t } , a _ { t } ) | s _ { 0 } \\sim p _ { 0 } ( \\cdot ) , a _ { t } \\sim \\pi ( \\cdot | s _ { t } ) , s _ { t + 1 } \\sim p ( \\cdot | s _ { t } , a _ { t } ) \\right] .\n$$",
|
| 176 |
+
"text_format": "latex",
|
| 177 |
+
"bbox": [
|
| 178 |
+
232,
|
| 179 |
+
390,
|
| 180 |
+
764,
|
| 181 |
+
433
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 2
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "text",
|
| 187 |
+
"text": "Off-policy RL methods based on approximate dynamic programming typically utilize a state-action value function ( $Q$ -function), referred to as $Q ( s , a )$ , which corresponds to the discounted returns obtained by starting from the state $s$ and action $a$ , and then following the policy $\\pi$ . ",
|
| 188 |
+
"bbox": [
|
| 189 |
+
173,
|
| 190 |
+
436,
|
| 191 |
+
823,
|
| 192 |
+
478
|
| 193 |
+
],
|
| 194 |
+
"page_idx": 2
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"type": "text",
|
| 198 |
+
"text": "Offline reinforcement learning. In contrast to online (on-policy or off-policy) RL methods, offline RL uses previously collected data without any additional data collection. Like many recent offline RL methods, our work builds on approximate dynamic programming methods that minimize temporal difference error, according to the following loss: ",
|
| 199 |
+
"bbox": [
|
| 200 |
+
174,
|
| 201 |
+
482,
|
| 202 |
+
823,
|
| 203 |
+
537
|
| 204 |
+
],
|
| 205 |
+
"page_idx": 2
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"type": "equation",
|
| 209 |
+
"img_path": "images/18682c97be735a0de702f207fb6dea57e5420dffaff2bef7ba78bbf006436d8a.jpg",
|
| 210 |
+
"text": "$$\nL _ { T D } ( \\theta ) = \\mathbb { E } _ { ( s , a , s ^ { \\prime } ) \\sim \\mathcal { D } } [ ( r ( s , a ) + \\gamma \\operatorname* { m a x } _ { a ^ { \\prime } } Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } ) - Q _ { \\theta } ( s , a ) ) ^ { 2 } ] ,\n$$",
|
| 211 |
+
"text_format": "latex",
|
| 212 |
+
"bbox": [
|
| 213 |
+
279,
|
| 214 |
+
540,
|
| 215 |
+
715,
|
| 216 |
+
563
|
| 217 |
+
],
|
| 218 |
+
"page_idx": 2
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"type": "text",
|
| 222 |
+
"text": "where $\\mathcal { D }$ is the dataset, $Q _ { \\theta } ( s , a )$ is a parameterized Q-function, $Q _ { \\hat { \\theta } } ( s , a )$ is a target network (e.g., with soft parameters updates defined via Polyak averaging), and the policy is defined as $\\pi ( s ) =$ arg $\\operatorname* { m a x } _ { a } Q _ { \\theta } ( s , a )$ . Most recent offline RL methods modify either the value function loss (above) to regularize the value function in a way that keeps the resulting policy close to the data, or constrain the arg max policy directly. This is important because out-of-distribution actions $a ^ { \\prime }$ can produce erroneous values for $Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } )$ in the above objective, often leading to overestimation as the policy is defined to maximize the (estimated) Q-value. ",
|
| 223 |
+
"bbox": [
|
| 224 |
+
173,
|
| 225 |
+
561,
|
| 226 |
+
825,
|
| 227 |
+
660
|
| 228 |
+
],
|
| 229 |
+
"page_idx": 2
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"type": "text",
|
| 233 |
+
"text": "4 IMPLICIT Q-LEARNING ",
|
| 234 |
+
"text_level": 1,
|
| 235 |
+
"bbox": [
|
| 236 |
+
176,
|
| 237 |
+
669,
|
| 238 |
+
400,
|
| 239 |
+
685
|
| 240 |
+
],
|
| 241 |
+
"page_idx": 2
|
| 242 |
+
},
|
| 243 |
+
{
|
| 244 |
+
"type": "text",
|
| 245 |
+
"text": "In this work, we aim to entirely avoid querying out-of-sample (unseen) actions in our TD loss. Although the goal of this work is to approximate the optimal $Q$ -function, we start by considering fitted $Q$ evaluation with a SARSA-style objective which has been considered in prior work on Offline Reinforcement Learning (Brandfonbrener et al., 2021; Gulcehre et al., 2021) . This objective aims to learn the value of the dataset policy $\\pi _ { \\beta }$ (also called the behavior policy): ",
|
| 246 |
+
"bbox": [
|
| 247 |
+
173,
|
| 248 |
+
699,
|
| 249 |
+
825,
|
| 250 |
+
770
|
| 251 |
+
],
|
| 252 |
+
"page_idx": 2
|
| 253 |
+
},
|
| 254 |
+
{
|
| 255 |
+
"type": "equation",
|
| 256 |
+
"img_path": "images/4e720c86b56ca34dd838b9e5c9589b06501b4860621539ac68968261d41d18b1.jpg",
|
| 257 |
+
"text": "$$\nL ( \\theta ) = \\mathbb { E } _ { ( s , a , s ^ { \\prime } , a ^ { \\prime } ) \\sim \\mathcal { D } } [ ( r ( s , a ) + \\gamma Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } ) - Q _ { \\theta } ( s , a ) ) ^ { 2 } ] .\n$$",
|
| 258 |
+
"text_format": "latex",
|
| 259 |
+
"bbox": [
|
| 260 |
+
302,
|
| 261 |
+
776,
|
| 262 |
+
696,
|
| 263 |
+
795
|
| 264 |
+
],
|
| 265 |
+
"page_idx": 2
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"type": "text",
|
| 269 |
+
"text": "This objective never queries values for out-of-sample actions, in contrast to Eqn. $( 1 )$ . One specific property of this objective that is important for this work is that it uses mean squared error (MSE) that fits $Q _ { \\theta } ( s , a )$ to predict the mean statistics of the TD targets. Thus, if we assume unlimited capacity and no sampling error, the optimal parameters should satisfy ",
|
| 270 |
+
"bbox": [
|
| 271 |
+
173,
|
| 272 |
+
799,
|
| 273 |
+
825,
|
| 274 |
+
856
|
| 275 |
+
],
|
| 276 |
+
"page_idx": 2
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"type": "equation",
|
| 280 |
+
"img_path": "images/906bc8b6a5ab1e7780eb0bf8639e25516147b9bddb9d53fba0ed5c18e4f644fa.jpg",
|
| 281 |
+
"text": "$$\n\\begin{array} { r } { Q _ { \\theta ^ { * } } ( s , a ) \\approx r ( s , a ) + \\gamma \\mathbb { E } _ { s ^ { \\prime } \\sim p ( \\cdot \\vert s , a ) } [ Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } ) ] . } \\\\ { a ^ { \\prime } { \\sim } \\pi _ { \\beta } ( \\cdot \\vert s ) \\quad } \\end{array}\n$$",
|
| 282 |
+
"text_format": "latex",
|
| 283 |
+
"bbox": [
|
| 284 |
+
341,
|
| 285 |
+
859,
|
| 286 |
+
656,
|
| 287 |
+
891
|
| 288 |
+
],
|
| 289 |
+
"page_idx": 2
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"type": "text",
|
| 293 |
+
"text": "Prior work (Brandfonbrener et al., 2021; Gulcehre et al., 2021; Peng et al., $\\boxed { 2 0 1 9 }$ has proposed directly using this objective to learn $Q ^ { \\pi _ { \\beta } }$ , and then train the policy $\\pi _ { \\psi }$ to maximize $\\overline { { Q } } ^ { \\pi _ { \\beta } }$ . This avoids any issues with out-of-distribution actions, since the TD loss only uses dataset actions. However, while this procedure works well empirically on simple MuJoCo locomotion tasks in D4RL, we will show that it performs very poorly on more complex tasks that benefit from multi-step dynamic programming. In our method, which we derive next, we retain the benefits of using this SARSA-like objective, but modify it so that it allows us to perform multi-step dynamic programming and learn a near-optimal Q-function. ",
|
| 294 |
+
"bbox": [
|
| 295 |
+
173,
|
| 296 |
+
893,
|
| 297 |
+
823,
|
| 298 |
+
924
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 2
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "image",
|
| 304 |
+
"img_path": "images/a699939d6d8c82eb2bdc0f934f9aa239f599ba47ca1dca0a31ff894d10410481.jpg",
|
| 305 |
+
"image_caption": [
|
| 306 |
+
"Figure 1: Left: The asymmetric squared loss used for expectile regression. $\\tau = 0 . 5$ corresponds to the standard mean squared error loss, while $\\tau = 0 . 9$ gives more weight to positives differences. Center: Expectiles of a normal distribution. Right: an example of estimating state conditional expectiles of a two-dimensional random variable. Each $x$ corresponds to a distribution over $y$ . We can approximate a maximum of this random variable with expectile regression: $\\tau = 0 . 5$ correspond to the conditional mean statistics of the distribution, while $\\tau \\approx 1$ approximates the maximum operator over in-support values of $y$ . "
|
| 307 |
+
],
|
| 308 |
+
"image_footnote": [],
|
| 309 |
+
"bbox": [
|
| 310 |
+
192,
|
| 311 |
+
106,
|
| 312 |
+
807,
|
| 313 |
+
255
|
| 314 |
+
],
|
| 315 |
+
"page_idx": 3
|
| 316 |
+
},
|
| 317 |
+
{
|
| 318 |
+
"type": "text",
|
| 319 |
+
"text": "",
|
| 320 |
+
"bbox": [
|
| 321 |
+
173,
|
| 322 |
+
397,
|
| 323 |
+
825,
|
| 324 |
+
483
|
| 325 |
+
],
|
| 326 |
+
"page_idx": 3
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
"type": "text",
|
| 330 |
+
"text": "Our method will perform a $Q$ -function update similar to Eqn. $\\mathbb { Q }$ , but we will aim to estimate the maximum $Q$ -value over actions that are in the support of the data distribution. Crucially, we will show that it is possible to do this without ever querying the learned $Q$ -function on out-of-sample actions by utilizing expectile regression. Formally, the value function we aim to learn is given by: ",
|
| 331 |
+
"bbox": [
|
| 332 |
+
173,
|
| 333 |
+
488,
|
| 334 |
+
825,
|
| 335 |
+
546
|
| 336 |
+
],
|
| 337 |
+
"page_idx": 3
|
| 338 |
+
},
|
| 339 |
+
{
|
| 340 |
+
"type": "equation",
|
| 341 |
+
"img_path": "images/f8554281c96c87da9c183a243f207fe8eb50176fd6b990afd9dca5799ea544c9.jpg",
|
| 342 |
+
"text": "$$\nL ( \\theta ) = \\mathbb { E } _ { ( s , a , s ^ { \\prime } ) \\sim \\mathcal { D } } [ ( r ( s , a ) + \\gamma \\operatorname* { m a x } _ { { a ^ { \\prime } \\in A } \\atop { s . t . \\pi _ { \\beta } ( a ^ { \\prime } | s ^ { \\prime } ) > 0 } } Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } ) - Q _ { \\theta } ( s , a ) ) ^ { 2 } ] .\n$$",
|
| 343 |
+
"text_format": "latex",
|
| 344 |
+
"bbox": [
|
| 345 |
+
263,
|
| 346 |
+
551,
|
| 347 |
+
735,
|
| 348 |
+
589
|
| 349 |
+
],
|
| 350 |
+
"page_idx": 3
|
| 351 |
+
},
|
| 352 |
+
{
|
| 353 |
+
"type": "text",
|
| 354 |
+
"text": "Our algorithm, implicit Q-Learning (IQL), aims to estimate this objective while evaluating the $Q$ - function only on the state-action pairs in the dataset. To this end, we propose to fit $Q _ { \\theta } ( s , a )$ to estimate state-conditional expectiles of the target values, and show that specific expectiles approximate the maximization defined above. In Section $\\boxed { 4 . 4 }$ we show that this approach performs multi-step dynamic programming in theory, and in Section $\\underline { { \\boldsymbol { \\mathsf { F . 1 } } } }$ we show that it does so in practice. ",
|
| 355 |
+
"bbox": [
|
| 356 |
+
174,
|
| 357 |
+
595,
|
| 358 |
+
825,
|
| 359 |
+
667
|
| 360 |
+
],
|
| 361 |
+
"page_idx": 3
|
| 362 |
+
},
|
| 363 |
+
{
|
| 364 |
+
"type": "text",
|
| 365 |
+
"text": "4.1 EXPECTILE REGRESSION ",
|
| 366 |
+
"text_level": 1,
|
| 367 |
+
"bbox": [
|
| 368 |
+
174,
|
| 369 |
+
681,
|
| 370 |
+
388,
|
| 371 |
+
695
|
| 372 |
+
],
|
| 373 |
+
"page_idx": 3
|
| 374 |
+
},
|
| 375 |
+
{
|
| 376 |
+
"type": "text",
|
| 377 |
+
"text": "Practical methods for estimating various statistics of a random variable have been thoroughly studies in applied statistics and econometrics. The $\\tau \\in \\mathsf { \\Gamma } ( 0 , 1 )$ expectile of some random variable $X$ is defined as a solution to the asymmetric least squares problem: ",
|
| 378 |
+
"bbox": [
|
| 379 |
+
173,
|
| 380 |
+
707,
|
| 381 |
+
825,
|
| 382 |
+
750
|
| 383 |
+
],
|
| 384 |
+
"page_idx": 3
|
| 385 |
+
},
|
| 386 |
+
{
|
| 387 |
+
"type": "equation",
|
| 388 |
+
"img_path": "images/2c61b0f4a2cc9c313b18eed3dc4caea16f4cf07d24b6fece07b224492b3b2255.jpg",
|
| 389 |
+
"text": "$$\n\\underset { m _ { \\tau } } { \\arg \\operatorname* { m i n } } \\mathbb { E } _ { x \\sim X } [ L _ { 2 } ^ { \\tau } ( x - m _ { \\tau } ) ] , \\mathrm { ~ w h e r e ~ } L _ { 2 } ^ { \\tau } ( u ) = | \\tau - \\mathbb { 1 } ( u < 0 ) | u ^ { 2 } .\n$$",
|
| 390 |
+
"text_format": "latex",
|
| 391 |
+
"bbox": [
|
| 392 |
+
282,
|
| 393 |
+
756,
|
| 394 |
+
710,
|
| 395 |
+
784
|
| 396 |
+
],
|
| 397 |
+
"page_idx": 3
|
| 398 |
+
},
|
| 399 |
+
{
|
| 400 |
+
"type": "text",
|
| 401 |
+
"text": "That is, for $\\tau > 0 . 5$ , this asymmetric loss function downweights the contributions of $x$ values smaller than $m _ { \\tau }$ while giving more weights to larger values (see Fig. $\\bigstar \\bigstar$ left). Expectile regression is closely related to quantile regression $\\mathrm { ( \\mathbb { K } o e n k e r ~ \\& ~ H a l l o c k , \\mathbb { 2 0 0 1 } ) }$ , which is a popular technique for estimating quantiles of a distribution widely used in reinforcement learning (Dabney et al., 2018b;a) The quantile regression loss is defined as an asymmetric $\\ell _ { 1 }$ loss. ",
|
| 402 |
+
"bbox": [
|
| 403 |
+
174,
|
| 404 |
+
790,
|
| 405 |
+
825,
|
| 406 |
+
861
|
| 407 |
+
],
|
| 408 |
+
"page_idx": 3
|
| 409 |
+
},
|
| 410 |
+
{
|
| 411 |
+
"type": "text",
|
| 412 |
+
"text": "We can also use this formulation to predict expectiles of a conditional distribution: ",
|
| 413 |
+
"bbox": [
|
| 414 |
+
171,
|
| 415 |
+
103,
|
| 416 |
+
714,
|
| 417 |
+
118
|
| 418 |
+
],
|
| 419 |
+
"page_idx": 4
|
| 420 |
+
},
|
| 421 |
+
{
|
| 422 |
+
"type": "equation",
|
| 423 |
+
"img_path": "images/9d6565d4be234184cf027b8fd1a9db8abd350bc957b0249ab61c4a630e553387.jpg",
|
| 424 |
+
"text": "$$\n\\operatorname * { a r g m i n } _ { m _ { \\tau } ( x ) } \\mathbb { E } _ { ( x , y ) \\sim \\mathcal { D } } [ L _ { 2 } ^ { \\tau } ( y - m _ { \\tau } ( x ) ) ] .\n$$",
|
| 425 |
+
"text_format": "latex",
|
| 426 |
+
"bbox": [
|
| 427 |
+
379,
|
| 428 |
+
125,
|
| 429 |
+
617,
|
| 430 |
+
154
|
| 431 |
+
],
|
| 432 |
+
"page_idx": 4
|
| 433 |
+
},
|
| 434 |
+
{
|
| 435 |
+
"type": "text",
|
| 436 |
+
"text": "Fig. 1 (right) illustrates conditional expectile regression on a simple two-dimensional distribution. Note that we can optimize this objective with stochastic gradient descent. It provides unbiased gradients and is easy to implement with standard machine learning libraries. ",
|
| 437 |
+
"bbox": [
|
| 438 |
+
173,
|
| 439 |
+
160,
|
| 440 |
+
825,
|
| 441 |
+
203
|
| 442 |
+
],
|
| 443 |
+
"page_idx": 4
|
| 444 |
+
},
|
| 445 |
+
{
|
| 446 |
+
"type": "text",
|
| 447 |
+
"text": "4.2 LEARNING THE VALUE FUNCTION WITH EXPECTILE REGRESSION ",
|
| 448 |
+
"text_level": 1,
|
| 449 |
+
"bbox": [
|
| 450 |
+
174,
|
| 451 |
+
219,
|
| 452 |
+
671,
|
| 453 |
+
234
|
| 454 |
+
],
|
| 455 |
+
"page_idx": 4
|
| 456 |
+
},
|
| 457 |
+
{
|
| 458 |
+
"type": "text",
|
| 459 |
+
"text": "Expectile regression provides us with a powerful framework to estimate statistics of a random variable beyond mean regression. We can use expectile regression to modify the policy evaluation objective in Eqn. $\\textcircled { 2 }$ to predict an upper expectile of the TD targets that approximates the maximum of $\\dot { r } ( s , a ) + \\gamma \\bar { Q } _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } )$ over actions $a ^ { \\prime }$ constrained to the dataset actions, as in Eqn. $( 4 )$ . This leads to the following expectile regression objective: ",
|
| 460 |
+
"bbox": [
|
| 461 |
+
173,
|
| 462 |
+
246,
|
| 463 |
+
825,
|
| 464 |
+
316
|
| 465 |
+
],
|
| 466 |
+
"page_idx": 4
|
| 467 |
+
},
|
| 468 |
+
{
|
| 469 |
+
"type": "equation",
|
| 470 |
+
"img_path": "images/3d3b988ed2174b94e9b117094923a46074ff5d84d7df3dae95b6373b08418442.jpg",
|
| 471 |
+
"text": "$$\nL ( \\theta ) = \\mathbb { E } _ { ( s , a , s ^ { \\prime } , a ^ { \\prime } ) \\sim \\mathcal { D } } [ L _ { 2 } ^ { \\tau } ( r ( s , a ) + \\gamma Q _ { \\hat { \\theta } } ( s ^ { \\prime } , a ^ { \\prime } ) - Q _ { \\theta } ( s , a ) ) ] .\n$$",
|
| 472 |
+
"text_format": "latex",
|
| 473 |
+
"bbox": [
|
| 474 |
+
295,
|
| 475 |
+
323,
|
| 476 |
+
700,
|
| 477 |
+
342
|
| 478 |
+
],
|
| 479 |
+
"page_idx": 4
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"type": "text",
|
| 483 |
+
"text": "However, this formulation has a significant drawback. Instead of estimating expectiles just with respect to the actions in the support of the data, it also incorporates stochasticity that comes from the environment dynamics $s ^ { \\prime } \\sim p ( \\cdot | s , a )$ . Therefore, a large target value might not necessarily reflect the existence of a single action that achieves that value, but rather a “lucky” sample that happened to have transitioned into a good state. We resolve this by introducing a separate value function that approximates an expectile only with respect to the action distribution, leading to the following loss: ",
|
| 484 |
+
"bbox": [
|
| 485 |
+
173,
|
| 486 |
+
348,
|
| 487 |
+
825,
|
| 488 |
+
433
|
| 489 |
+
],
|
| 490 |
+
"page_idx": 4
|
| 491 |
+
},
|
| 492 |
+
{
|
| 493 |
+
"type": "equation",
|
| 494 |
+
"img_path": "images/51ad350ad0c80c36aed365b48e63fd15832c814ad84056536d15345bd65d3ba7.jpg",
|
| 495 |
+
"text": "$$\nL _ { V } ( \\psi ) = \\mathbb { E } _ { ( s , a ) \\sim \\mathcal { D } } [ L _ { 2 } ^ { \\tau } ( Q _ { \\hat { \\theta } } ( s , a ) - V _ { \\psi } ( s ) ) ] .\n$$",
|
| 496 |
+
"text_format": "latex",
|
| 497 |
+
"bbox": [
|
| 498 |
+
349,
|
| 499 |
+
439,
|
| 500 |
+
647,
|
| 501 |
+
458
|
| 502 |
+
],
|
| 503 |
+
"page_idx": 4
|
| 504 |
+
},
|
| 505 |
+
{
|
| 506 |
+
"type": "text",
|
| 507 |
+
"text": "We can then use this estimate to update the $Q$ -functions with the MSE loss, which averages over the stochasticity from the transitions and avoids the “lucky” sample issue mentioned above: ",
|
| 508 |
+
"bbox": [
|
| 509 |
+
171,
|
| 510 |
+
463,
|
| 511 |
+
821,
|
| 512 |
+
492
|
| 513 |
+
],
|
| 514 |
+
"page_idx": 4
|
| 515 |
+
},
|
| 516 |
+
{
|
| 517 |
+
"type": "equation",
|
| 518 |
+
"img_path": "images/9fd38717e672bc56176e7593227ca23400d3e15e817605fa21388e1e9a68855d.jpg",
|
| 519 |
+
"text": "$$\nL _ { Q } ( \\theta ) = \\mathbb { E } _ { ( s , a , s ^ { \\prime } ) \\sim \\mathcal { D } } [ ( r ( s , a ) + \\gamma V _ { \\psi } ( s ^ { \\prime } ) - Q _ { \\theta } ( s , a ) ) ^ { 2 } ] .\n$$",
|
| 520 |
+
"text_format": "latex",
|
| 521 |
+
"bbox": [
|
| 522 |
+
310,
|
| 523 |
+
497,
|
| 524 |
+
686,
|
| 525 |
+
517
|
| 526 |
+
],
|
| 527 |
+
"page_idx": 4
|
| 528 |
+
},
|
| 529 |
+
{
|
| 530 |
+
"type": "text",
|
| 531 |
+
"text": "Note that these losses do not use any explicit policy, and only utilize actions from the dataset for both objectives, similarly to SARSA-style policy evaluation. In Section $^ { 4 . 4 , }$ we will show that this procedure recovers the optimal Q-function under some assumptions. Also, even though only one action is available for every state in the dataset for continuous action spaces, due to neural network generalization, the expectile regression does not result in SARSA-style policy evaluation as shown in Section $5 . 2 .$ ",
|
| 532 |
+
"bbox": [
|
| 533 |
+
173,
|
| 534 |
+
523,
|
| 535 |
+
825,
|
| 536 |
+
608
|
| 537 |
+
],
|
| 538 |
+
"page_idx": 4
|
| 539 |
+
},
|
| 540 |
+
{
|
| 541 |
+
"type": "text",
|
| 542 |
+
"text": "4.3 POLICY EXTRACTION AND ALGORITHM SUMMARY ",
|
| 543 |
+
"text_level": 1,
|
| 544 |
+
"bbox": [
|
| 545 |
+
174,
|
| 546 |
+
625,
|
| 547 |
+
570,
|
| 548 |
+
640
|
| 549 |
+
],
|
| 550 |
+
"page_idx": 4
|
| 551 |
+
},
|
| 552 |
+
{
|
| 553 |
+
"type": "text",
|
| 554 |
+
"text": "While our modified TD learning procedure learns an approximation to the optimal Q-function, it does not explicitly represent the corresponding policy, and therefore requires a separate policy extraction step. While one can consider any technique for policy extraction that constrains the learned policy to stay close to the dataset actions, we aim for a simple method for policy extraction. As before, we aim to avoid using outof-samples actions. Therefore, we extract the policy with advantage-weighted regression (Peters & Schaal, 2007; Peng et al., 2019) previously successfully used for policy extraction in Offline RL (Wang et al., 2018; Nair et al., 2020; Brandfonbrener et al., 2021): ",
|
| 555 |
+
"bbox": [
|
| 556 |
+
174,
|
| 557 |
+
650,
|
| 558 |
+
581,
|
| 559 |
+
819
|
| 560 |
+
],
|
| 561 |
+
"page_idx": 4
|
| 562 |
+
},
|
| 563 |
+
{
|
| 564 |
+
"type": "text",
|
| 565 |
+
"text": "Algorithm 1 Implicit Q-learning ",
|
| 566 |
+
"text_level": 1,
|
| 567 |
+
"bbox": [
|
| 568 |
+
594,
|
| 569 |
+
685,
|
| 570 |
+
813,
|
| 571 |
+
700
|
| 572 |
+
],
|
| 573 |
+
"page_idx": 4
|
| 574 |
+
},
|
| 575 |
+
{
|
| 576 |
+
"type": "equation",
|
| 577 |
+
"img_path": "images/613a01a2152d7f2a1717b695387be34e3487a7c23d15ac180b9aa3e99c04b0a4.jpg",
|
| 578 |
+
"text": "$$\nL _ { \\pi } ( \\phi ) = \\mathbb { E } _ { ( s , a ) \\sim \\mathcal { D } } [ \\exp ( \\beta ( Q _ { \\hat { \\theta } } ( s , a ) - V _ { \\psi } ( s ) ) ) \\log \\pi _ { \\phi } ( a | s ) ] ,\n$$",
|
| 579 |
+
"text_format": "latex",
|
| 580 |
+
"bbox": [
|
| 581 |
+
178,
|
| 582 |
+
824,
|
| 583 |
+
576,
|
| 584 |
+
843
|
| 585 |
+
],
|
| 586 |
+
"page_idx": 4
|
| 587 |
+
},
|
| 588 |
+
{
|
| 589 |
+
"type": "text",
|
| 590 |
+
"text": "Initialize parameters $\\psi , \\theta , { \\hat { \\theta } } , \\phi$ . \nTD learning (IQL): \nfor each gradient step do $\\begin{array} { l } { \\psi \\psi - \\lambda _ { V } \\nabla _ { \\psi } L _ { V } ( \\psi ) } \\\\ { \\theta \\theta - \\lambda _ { Q } \\nabla _ { \\theta } L _ { Q } ( \\theta ) } \\\\ { \\hat { \\theta } ( 1 - \\alpha ) \\hat { \\theta } + \\alpha \\theta } \\end{array}$ \nend for \nPolicy extraction (AWR): \nfor each gradient step do $\\phi \\overset { \\cdot } { \\phi } - \\lambda _ { \\pi } \\nabla _ { \\phi } \\bar { L } _ { \\pi } ( \\phi )$ \nend for ",
|
| 591 |
+
"bbox": [
|
| 592 |
+
606,
|
| 593 |
+
707,
|
| 594 |
+
818,
|
| 595 |
+
863
|
| 596 |
+
],
|
| 597 |
+
"page_idx": 4
|
| 598 |
+
},
|
| 599 |
+
{
|
| 600 |
+
"type": "text",
|
| 601 |
+
"text": "where $\\beta \\in [ 0 , \\infty )$ is an inverse temperature. Note that this objective does not clone all actions from the dataset but, as shown in prior work, this objective learns a policy that maximizes the $Q$ -values subject to a distribution constraint $\\mathrm { ( P e t e r s ~ \\& ~ S c h a a l l ) } \\mathrm { | 2 0 0 7 | ; | P e n g ~ e t ~ a l . | } \\mathrm { | 2 0 1 9 ; | N a i r ~ e t ~ a l . | 2 0 2 0 | }$ . This step can be seen as selecting and cloning the most optimal actions in the dataset. ",
|
| 602 |
+
"bbox": [
|
| 603 |
+
176,
|
| 604 |
+
854,
|
| 605 |
+
581,
|
| 606 |
+
882
|
| 607 |
+
],
|
| 608 |
+
"page_idx": 4
|
| 609 |
+
},
|
| 610 |
+
{
|
| 611 |
+
"type": "text",
|
| 612 |
+
"text": "",
|
| 613 |
+
"bbox": [
|
| 614 |
+
176,
|
| 615 |
+
883,
|
| 616 |
+
821,
|
| 617 |
+
924
|
| 618 |
+
],
|
| 619 |
+
"page_idx": 4
|
| 620 |
+
},
|
| 621 |
+
{
|
| 622 |
+
"type": "text",
|
| 623 |
+
"text": "Our final algorithm consists of two stages. First, we fit the value function and $Q$ , performing a number of gradient updates alternating between Eqn. $( 5 )$ and $( 6 )$ . Second, we perform stochastic gradient descent on Eqn. $\\overset { \\cdot } { ( 7 ) }$ . For both steps, we use a version of clipped double Q-learning $( { \\overline { { \\mathbb { F } { \\mathrm { u j i m o t o ~ e t ~ a l . } } } } } , )$ $\\underline { { 2 0 1 8 } } )$ , taking a minimum of two $Q$ -functions for $V$ -function and policy updates. We summarize our final method in Algorithm $^ { 1 . }$ Note that the policy does not influence the value function in any way, and therefore extraction could be performed either concurrently or after TD learning. Concurrent learning provides a way to use IQL with online finetuning, as we discuss in Section ${ \\bar { 5 . 3 } } .$ ",
|
| 624 |
+
"bbox": [
|
| 625 |
+
173,
|
| 626 |
+
103,
|
| 627 |
+
825,
|
| 628 |
+
202
|
| 629 |
+
],
|
| 630 |
+
"page_idx": 5
|
| 631 |
+
},
|
| 632 |
+
{
|
| 633 |
+
"type": "text",
|
| 634 |
+
"text": "4.4 ANALYSIS ",
|
| 635 |
+
"text_level": 1,
|
| 636 |
+
"bbox": [
|
| 637 |
+
174,
|
| 638 |
+
217,
|
| 639 |
+
287,
|
| 640 |
+
231
|
| 641 |
+
],
|
| 642 |
+
"page_idx": 5
|
| 643 |
+
},
|
| 644 |
+
{
|
| 645 |
+
"type": "text",
|
| 646 |
+
"text": "In this section, we will show that IQL can recover the optimal value function under the dataset support constraints. First, we prove a simple lemma that we will then use to show how our approach can enable learning the optimal value function. ",
|
| 647 |
+
"bbox": [
|
| 648 |
+
176,
|
| 649 |
+
242,
|
| 650 |
+
823,
|
| 651 |
+
285
|
| 652 |
+
],
|
| 653 |
+
"page_idx": 5
|
| 654 |
+
},
|
| 655 |
+
{
|
| 656 |
+
"type": "text",
|
| 657 |
+
"text": "Lemma 1. Let $X$ be a real-valued random variable with a bounded support and supremum of the support is $x ^ { * }$ . Then, ",
|
| 658 |
+
"bbox": [
|
| 659 |
+
173,
|
| 660 |
+
286,
|
| 661 |
+
820,
|
| 662 |
+
315
|
| 663 |
+
],
|
| 664 |
+
"page_idx": 5
|
| 665 |
+
},
|
| 666 |
+
{
|
| 667 |
+
"type": "equation",
|
| 668 |
+
"img_path": "images/3123e0d4150d1a44dc8737af054373b26472ac0c1bb7be9f8801d27960f877f4.jpg",
|
| 669 |
+
"text": "$$\n\\operatorname* { l i m } _ { \\tau 1 } m _ { \\tau } = x ^ { \\ast }\n$$",
|
| 670 |
+
"text_format": "latex",
|
| 671 |
+
"bbox": [
|
| 672 |
+
450,
|
| 673 |
+
306,
|
| 674 |
+
545,
|
| 675 |
+
329
|
| 676 |
+
],
|
| 677 |
+
"page_idx": 5
|
| 678 |
+
},
|
| 679 |
+
{
|
| 680 |
+
"type": "text",
|
| 681 |
+
"text": "Proof Sketch. One can show that expectiles of a random variable have the same supremum $x ^ { * }$ . Moreover, for all $\\tau _ { 1 }$ and $\\tau _ { 2 }$ such that $\\tau _ { 1 } < \\tau _ { 2 }$ , we get $m _ { \\tau _ { 1 } } \\leq m _ { \\tau _ { 2 } }$ . Therefore, the limit follows from the properties of bounded monotonically non-decreasing functions. □ ",
|
| 682 |
+
"bbox": [
|
| 683 |
+
174,
|
| 684 |
+
335,
|
| 685 |
+
825,
|
| 686 |
+
378
|
| 687 |
+
],
|
| 688 |
+
"page_idx": 5
|
| 689 |
+
},
|
| 690 |
+
{
|
| 691 |
+
"type": "text",
|
| 692 |
+
"text": "In the following theorems, we show that under certain assumptions, our method indeed approximates the optimal state-action value $Q ^ { * }$ and performs multi-step dynamical programming. We first prove a technical lemma relating different expectiles of the Q-function, and then derive our main result regarding the optimality of our method. ",
|
| 693 |
+
"bbox": [
|
| 694 |
+
174,
|
| 695 |
+
392,
|
| 696 |
+
825,
|
| 697 |
+
449
|
| 698 |
+
],
|
| 699 |
+
"page_idx": 5
|
| 700 |
+
},
|
| 701 |
+
{
|
| 702 |
+
"type": "text",
|
| 703 |
+
"text": "For the sake of simplicity, we introduce the following notation for our analysis. Let $\\mathbb { E } _ { x \\sim X } ^ { \\tau } [ x ]$ be a $\\tau ^ { \\mathrm { { t h } } }$ expectile of $X$ (e.g., $\\mathbb { E } ^ { 0 . 5 }$ corresponds to the standard expectation). Then, we define $V _ { \\tau } ( s )$ and $Q _ { \\tau } ( s , \\bar { a } )$ , which correspond to optimal solutions of Eqn. $5$ and $\\boxed { 6 }$ correspondingly, recursively as: ",
|
| 704 |
+
"bbox": [
|
| 705 |
+
173,
|
| 706 |
+
455,
|
| 707 |
+
825,
|
| 708 |
+
500
|
| 709 |
+
],
|
| 710 |
+
"page_idx": 5
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"type": "equation",
|
| 714 |
+
"img_path": "images/d4d196c6eee6179125e817c92a26bad2713c3abd84c57a0771427528202a265b.jpg",
|
| 715 |
+
"text": "$$\nV _ { \\tau } ( s ) = \\mathbb { E } _ { a \\sim \\pi _ { \\beta } ( \\cdot | s ) } ^ { \\tau } [ Q _ { \\tau } ( s , a ) ] ,\n$$",
|
| 716 |
+
"text_format": "latex",
|
| 717 |
+
"bbox": [
|
| 718 |
+
375,
|
| 719 |
+
501,
|
| 720 |
+
573,
|
| 721 |
+
520
|
| 722 |
+
],
|
| 723 |
+
"page_idx": 5
|
| 724 |
+
},
|
| 725 |
+
{
|
| 726 |
+
"type": "equation",
|
| 727 |
+
"img_path": "images/9d2daf2c2bf3ae508a2be34242fed7dc8cce8bd1542f8cf25b8bd49cd72ebc14.jpg",
|
| 728 |
+
"text": "$$\nQ _ { \\tau } ( s , a ) = r ( s , a ) + \\gamma \\mathbb { E } _ { s ^ { \\prime } \\sim p ( \\cdot \\vert s , a ) } [ V _ { \\tau } ( s ^ { \\prime } ) ] .\n$$",
|
| 729 |
+
"text_format": "latex",
|
| 730 |
+
"bbox": [
|
| 731 |
+
354,
|
| 732 |
+
522,
|
| 733 |
+
638,
|
| 734 |
+
539
|
| 735 |
+
],
|
| 736 |
+
"page_idx": 5
|
| 737 |
+
},
|
| 738 |
+
{
|
| 739 |
+
"type": "text",
|
| 740 |
+
"text": "Lemma 2. For all $s$ , $\\tau _ { 1 }$ and $\\tau _ { 2 }$ such that $\\tau _ { 1 } < \\tau _ { 2 }$ we get $V _ { \\tau _ { 1 } } ( s ) \\leq V _ { \\tau _ { 2 } } ( s )$ ",
|
| 741 |
+
"bbox": [
|
| 742 |
+
176,
|
| 743 |
+
540,
|
| 744 |
+
655,
|
| 745 |
+
556
|
| 746 |
+
],
|
| 747 |
+
"page_idx": 5
|
| 748 |
+
},
|
| 749 |
+
{
|
| 750 |
+
"type": "text",
|
| 751 |
+
"text": "Proof. The proof follows the policy improvement proof (Sutton & Barto, 2018). See Appendix A. ",
|
| 752 |
+
"bbox": [
|
| 753 |
+
174,
|
| 754 |
+
569,
|
| 755 |
+
813,
|
| 756 |
+
598
|
| 757 |
+
],
|
| 758 |
+
"page_idx": 5
|
| 759 |
+
},
|
| 760 |
+
{
|
| 761 |
+
"type": "text",
|
| 762 |
+
"text": "Corollary 2.1. For any $\\tau$ and s we have $V _ { \\tau } ( s ) \\leq \\mathrm { m a x } \\qquad a \\in \\mathcal { A } \\quad \\ldots \\ : Q ^ { * } ( s , a )$ where $V _ { \\tau } ( s )$ is defined s.t. $\\pi _ { \\beta } ( a | s ) { > } 0$ \nas above and $Q ^ { * } ( s , a )$ is an optimal state-action value function constrained to the dataset and \ndefined as ",
|
| 763 |
+
"bbox": [
|
| 764 |
+
173,
|
| 765 |
+
608,
|
| 766 |
+
826,
|
| 767 |
+
660
|
| 768 |
+
],
|
| 769 |
+
"page_idx": 5
|
| 770 |
+
},
|
| 771 |
+
{
|
| 772 |
+
"type": "equation",
|
| 773 |
+
"img_path": "images/4c5ae9c24a7029782ab98fde56e7b1a143f8fbb59a6ca98af99b4691a803ab12.jpg",
|
| 774 |
+
"text": "$$\nQ ^ { * } ( s , a ) = r ( s , a ) + \\gamma \\mathbb { E } _ { s ^ { \\prime } \\sim p ( \\cdot \\vert s , a ) } \\left[ \\operatorname* { m a x } _ { a ^ { \\prime } \\in \\mathcal { A } } Q ^ { * } ( s ^ { \\prime } , a ^ { \\prime } ) \\right] .\n$$",
|
| 775 |
+
"text_format": "latex",
|
| 776 |
+
"bbox": [
|
| 777 |
+
290,
|
| 778 |
+
645,
|
| 779 |
+
705,
|
| 780 |
+
700
|
| 781 |
+
],
|
| 782 |
+
"page_idx": 5
|
| 783 |
+
},
|
| 784 |
+
{
|
| 785 |
+
"type": "text",
|
| 786 |
+
"text": "Proof. The proof follows from the observation that convex combination is smaller than maximum. ",
|
| 787 |
+
"bbox": [
|
| 788 |
+
169,
|
| 789 |
+
699,
|
| 790 |
+
825,
|
| 791 |
+
726
|
| 792 |
+
],
|
| 793 |
+
"page_idx": 5
|
| 794 |
+
},
|
| 795 |
+
{
|
| 796 |
+
"type": "text",
|
| 797 |
+
"text": "Theorem 3. ",
|
| 798 |
+
"bbox": [
|
| 799 |
+
174,
|
| 800 |
+
733,
|
| 801 |
+
254,
|
| 802 |
+
748
|
| 803 |
+
],
|
| 804 |
+
"page_idx": 5
|
| 805 |
+
},
|
| 806 |
+
{
|
| 807 |
+
"type": "equation",
|
| 808 |
+
"img_path": "images/7f438634fee57f50fd80523cd44198b33013cdb29936c44ecab10361c0f20413.jpg",
|
| 809 |
+
"text": "$$\n\\operatorname* { l i m } _ { \\tau 1 } V _ { \\tau } ( s ) = \\operatorname* { m a x } _ { a \\in \\mathcal { A } \\atop s . t . \\pi _ { \\beta } ( a \\mid s ) > 0 } Q ^ { \\ast } ( s , a ) .\n$$",
|
| 810 |
+
"text_format": "latex",
|
| 811 |
+
"bbox": [
|
| 812 |
+
382,
|
| 813 |
+
746,
|
| 814 |
+
616,
|
| 815 |
+
780
|
| 816 |
+
],
|
| 817 |
+
"page_idx": 5
|
| 818 |
+
},
|
| 819 |
+
{
|
| 820 |
+
"type": "text",
|
| 821 |
+
"text": "Proof. Follows from combining Lemma 1 and Corollary 2.1. ",
|
| 822 |
+
"bbox": [
|
| 823 |
+
173,
|
| 824 |
+
782,
|
| 825 |
+
575,
|
| 826 |
+
799
|
| 827 |
+
],
|
| 828 |
+
"page_idx": 5
|
| 829 |
+
},
|
| 830 |
+
{
|
| 831 |
+
"type": "text",
|
| 832 |
+
"text": "Therefore, for a larger value of $\\tau < 1$ , we get a better approximation of the maximum. On the other hand, it also becomes a more challenging optimization problem. Thus, we treat $\\tau$ as a hyperparameter. Due to the property discussed in Theorem $\\bigtriangledown$ we dub our method implicit Q-learning (IQL). We also emphasize that our value learning method defines the entire spectrum of methods between SARSA $\\tau = 0 . 5$ ) and Q-Learning $( \\tau 1 )$ ). Note that in contrast to other multi-step methods, IQL absorbs the policy improvement step into value learning. Therefore, fitting Q-function corresponds to the policy evaluation step, while fitting the value function with IQL corresponds to implicit policy improvement. ",
|
| 833 |
+
"bbox": [
|
| 834 |
+
173,
|
| 835 |
+
811,
|
| 836 |
+
825,
|
| 837 |
+
924
|
| 838 |
+
],
|
| 839 |
+
"page_idx": 5
|
| 840 |
+
},
|
| 841 |
+
{
|
| 842 |
+
"type": "image",
|
| 843 |
+
"img_path": "images/38d9e8ba0505f1fcda3e8c36c5bd6166024a05cfac64e3433ec793f149d35e0d.jpg",
|
| 844 |
+
"image_caption": [
|
| 845 |
+
"Figure 2: Evaluation of our algorithm on a toy umaze environment (a). When the static dataset is heavily corrupted by suboptimal actions, one-step policy evaluation results in a value function that degrades to zero far from the rewarding states too quickly (c). Our algorithm aims to learn a near-optimal value function, combining the best properties of SARSA-style evaluation with the ability to perform multi-step dynamic programming, leading to value functions that are much closer to optimality (shown in (b)) and producing a much better policy (d). "
|
| 846 |
+
],
|
| 847 |
+
"image_footnote": [],
|
| 848 |
+
"bbox": [
|
| 849 |
+
187,
|
| 850 |
+
101,
|
| 851 |
+
805,
|
| 852 |
+
209
|
| 853 |
+
],
|
| 854 |
+
"page_idx": 6
|
| 855 |
+
},
|
| 856 |
+
{
|
| 857 |
+
"type": "text",
|
| 858 |
+
"text": "5 EXPERIMENTAL EVALUATION ",
|
| 859 |
+
"text_level": 1,
|
| 860 |
+
"bbox": [
|
| 861 |
+
178,
|
| 862 |
+
333,
|
| 863 |
+
452,
|
| 864 |
+
348
|
| 865 |
+
],
|
| 866 |
+
"page_idx": 6
|
| 867 |
+
},
|
| 868 |
+
{
|
| 869 |
+
"type": "text",
|
| 870 |
+
"text": "Our experiments aim to evaluate our method comparatively, in contrast to prior offline RL methods, and in particular to understand how our approach compares both to single-step methods and multi-step dynamic programming approaches. We will first demonstrate the benefits of multi-step dynamic programming methods, such as ours, in contrast to single-step methods, showing that on some problems this difference can be extremely large. We will then compare IQL with state-of-theart single-step and multi-step algorithms on the D4RL $\\mathrm { ( F u ~ e t ~ a l . , } \\mathbb { 2 0 2 0 } )$ benchmark tasks, studying the degree to which we can learn effective policies using only the actions in the dataset. We examine domains that contain near-optimal trajectories, where single-step methods perform well, as well as domains with no optimal trajectories at all, which require multi-step dynamic programming. Finally, we will study how IQL compares to prior methods when finetuning with online RL starting from an offline RL initialization. ",
|
| 871 |
+
"bbox": [
|
| 872 |
+
173,
|
| 873 |
+
352,
|
| 874 |
+
825,
|
| 875 |
+
503
|
| 876 |
+
],
|
| 877 |
+
"page_idx": 6
|
| 878 |
+
},
|
| 879 |
+
{
|
| 880 |
+
"type": "text",
|
| 881 |
+
"text": "5.1 THE DIFFERENCE BETWEEN ONE-STEP POLICY IMPROVEMENT AND IQL",
|
| 882 |
+
"text_level": 1,
|
| 883 |
+
"bbox": [
|
| 884 |
+
174,
|
| 885 |
+
516,
|
| 886 |
+
725,
|
| 887 |
+
531
|
| 888 |
+
],
|
| 889 |
+
"page_idx": 6
|
| 890 |
+
},
|
| 891 |
+
{
|
| 892 |
+
"type": "text",
|
| 893 |
+
"text": "We first use a simple maze environment to illustrate the importance of multi-step dynamic programming for offline RL. The maze has a u-shape, a single start state, and a single goal state (see Fig. 2a) The agent receives a reward of 10 for entering the goal state and zero reward for all other transitions. With a probability of 0.25, the agent transitions to a random state, and otherwise to the commanded state. The dataset consists of 1 optimal trajectory and 99 trajectories with uniform random actions. Due to a short horizon of the problem, we use $\\gamma = 0 . 9$ . ",
|
| 894 |
+
"bbox": [
|
| 895 |
+
174,
|
| 896 |
+
536,
|
| 897 |
+
825,
|
| 898 |
+
619
|
| 899 |
+
],
|
| 900 |
+
"page_idx": 6
|
| 901 |
+
},
|
| 902 |
+
{
|
| 903 |
+
"type": "text",
|
| 904 |
+
"text": "Fig. $2$ (c, d) illustrates the difference between single-step methods which fit $Q ^ { \\pi } ( s , a )$ via SARSAstyle objective, in this case represented by Onepstep RL (Brandfonbrener et al., $\\boxed { 2 0 2 1 }$ Wang et al., $\\dot { \\boxed { 2 0 1 8 } } ;$ Gulcehre et al., 2021) and IQL with $\\tau = 0 . 9 5$ . Note that these methods represent a special case of our method with $\\bar { \\tau } = 0 . 5$ . Although states closer to the high reward state will still have higher values, these values decay much faster as we move further away than they would for the optimal value function, and the resulting policy is highly suboptimal. Since IQL (d) performs iterative dynamic programming, it correctly propagates the signal, and the values are no longer dominated by noise. The resulting value function closely matches the true optimal value function (b). ",
|
| 905 |
+
"bbox": [
|
| 906 |
+
173,
|
| 907 |
+
627,
|
| 908 |
+
825,
|
| 909 |
+
738
|
| 910 |
+
],
|
| 911 |
+
"page_idx": 6
|
| 912 |
+
},
|
| 913 |
+
{
|
| 914 |
+
"type": "text",
|
| 915 |
+
"text": "5.2 COMPARISONS ON OFFLINE RL BENCHMARKS ",
|
| 916 |
+
"text_level": 1,
|
| 917 |
+
"bbox": [
|
| 918 |
+
174,
|
| 919 |
+
751,
|
| 920 |
+
537,
|
| 921 |
+
765
|
| 922 |
+
],
|
| 923 |
+
"page_idx": 6
|
| 924 |
+
},
|
| 925 |
+
{
|
| 926 |
+
"type": "text",
|
| 927 |
+
"text": "Next, we evaluate our approach on the D4RL benchmark in comparison to prior methods (see Table $\\bigstar \\bigstar \\bigstar \\bigstar$ . The MuJoCo tasks in D4RL consist of the Gym locomotion tasks, the Ant Maze tasks, and the Adroit and Kitchen robotic manipulation environments. Some prior works, particularly those proposing one-step methods, focus entirely on the Gym locomotion tasks. However, these tasks include a significant fraction of near-optimal trajectories in the dataset. In contrast, the Ant Maze tasks, especially the medium and large ones, contain very few or no near-optimal trajectories, making them very challenging for one-step methods. These domains require “stitching” parts of suboptimal trajectories that travel between different states to find a path from the start to the goal of the maze $\\mathtt { ( F u ~ e t ~ a l . } ] \\mathtt { ( E 0 2 0 ) }$ . As we will show, multi-step dynamic programming is essential in these domains. The Adroit and Kitchen tasks are comparatively less discriminating, and we found that most RL methods perform similarly to imitation learning in these domains (Florence et al., 2021) ",
|
| 928 |
+
"bbox": [
|
| 929 |
+
173,
|
| 930 |
+
771,
|
| 931 |
+
825,
|
| 932 |
+
924
|
| 933 |
+
],
|
| 934 |
+
"page_idx": 6
|
| 935 |
+
},
|
| 936 |
+
{
|
| 937 |
+
"type": "table",
|
| 938 |
+
"img_path": "images/bb09557cf0cbff7d1dcd4a1b20f72d15f5f16db0fc8c59692121e513818de2cc.jpg",
|
| 939 |
+
"table_caption": [
|
| 940 |
+
"Table 1: Averaged normalized scores on MuJoCo locomotion and Ant Maze tasks. Our method outperforms prior methods on the challenging Ant Maze tasks, which require dynamic programming, and is competitive with the best prior methods on the locomotion tasks. "
|
| 941 |
+
],
|
| 942 |
+
"table_footnote": [
|
| 943 |
+
"⇤: Note that it is challenging to compare one-step and multi-step methods directly. Also, Brandfonbrener et al. $\\boxed { ( 2 0 2 1 ) }$ reports results for a set of hyperparameters, such as batch and network size, that is significantly different from other methods. We report results for the original hyperparameters and runtime for a comparable set of hyperparameters. "
|
| 944 |
+
],
|
| 945 |
+
"table_body": "<table><tr><td>Dataset</td><td>BC</td><td>10%BC</td><td>BCQ</td><td>DT</td><td>ABM</td><td>AWAC</td><td>Onestep RL</td><td>TD3+BC</td><td>CQL</td><td>IQL (Ours)</td></tr><tr><td>halfcheetah-m-v2</td><td>42.6</td><td>42.5</td><td>47.0</td><td>42.6±0.1</td><td>53.6</td><td>43.5</td><td>48.4±0.1</td><td>48.3±0.3</td><td>44.0±5.4</td><td>47.4±0.2</td></tr><tr><td>hopper-m-v2</td><td>52.9</td><td>56.9</td><td>56.7</td><td>67.6±1.0</td><td>0.7</td><td>57.0</td><td>59.6±2.5</td><td>59.3±4.2</td><td>58.5±2.1</td><td>66.2±5.7</td></tr><tr><td>walker2d-m-v2</td><td>75.3</td><td>75.0</td><td>72.6</td><td>74.0±1.4</td><td>0.5</td><td>72.4</td><td>81.8±2.2</td><td>83.7±2.1</td><td>72.5±0.8</td><td>78.3±8.7</td></tr><tr><td>halfcheetah-m-r-v2</td><td>36.6</td><td>40.6</td><td>40.4</td><td>36.6±0.8</td><td>50.5</td><td>40.5</td><td>38.1±1.3</td><td>44.6±0.5</td><td>45.5±0.5</td><td>44.2±1.2</td></tr><tr><td>hopper-m-r-v2</td><td>18.1</td><td>75.9</td><td>53.3</td><td>82.7±7.0</td><td>49.6</td><td>37.2</td><td>97.5±0.7</td><td>60.9±18.8</td><td>95.0±6.4</td><td>94.7±8.6</td></tr><tr><td>walker2d-m-r-v2</td><td>26.0</td><td>62.5</td><td>52.1</td><td>66.6±3.0</td><td>53.8</td><td>27.0</td><td>49.5±12.0</td><td>81.8±5.5</td><td>77.2±5.5</td><td>73.8±7.1</td></tr><tr><td>halfcheetah-m-e-v2</td><td>55.2</td><td>92.9</td><td>89.1</td><td>86.8±1.3</td><td>18.5</td><td>42.8</td><td>93.4±1.6</td><td>90.7±4.3</td><td>91.6±2.8</td><td>86.7±5.3</td></tr><tr><td>hopper-m-e-v2</td><td>52.5</td><td>110.9</td><td>81.8</td><td>107.6±1.8</td><td>0.7</td><td>55.8</td><td>103.3±1.9</td><td>98.0±9.4</td><td>105.4±6.8</td><td>91.5±14.3</td></tr><tr><td>walker2d-m-e-v2</td><td>107.5</td><td>109.0</td><td>109.5</td><td>108.1±0.2</td><td>3.5</td><td>74.5</td><td>113.0±0.4</td><td>110.1±0.5</td><td>108.8±0.7</td><td>109.6±1.0</td></tr><tr><td>locomotion-v2 total</td><td>466.7</td><td>666.2</td><td>602.5</td><td>672.6±16.6</td><td>231.4</td><td>450.7</td><td>684.6±22.7</td><td>677.4±44.5</td><td>698.5±31.0</td><td>692.4±52.1</td></tr><tr><td>antmaze-u-v0</td><td>54.6</td><td>62.8</td><td>89.8</td><td>59.2</td><td>59.9</td><td>56.7</td><td>64.3</td><td>78.6</td><td>74.0</td><td>87.5±2.6</td></tr><tr><td>antmaze-u-d-v0</td><td>45.6</td><td>50.2</td><td>83.0</td><td>53.0</td><td>48.7</td><td>49.3</td><td>60.7</td><td>71.4</td><td>84.0</td><td>62.2 ±13.8</td></tr><tr><td>antmaze-m-p-v0</td><td>0.0</td><td>5.4</td><td>15.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.3</td><td>10.6</td><td>61.2</td><td>71.2 ± 7.3</td></tr><tr><td>antmaze-m-d-v0</td><td>0.0</td><td>9.8</td><td>0.0</td><td>0.0</td><td>0.5</td><td>0.7</td><td>0.0</td><td>3.0</td><td>53.7</td><td>70.0±10.9</td></tr><tr><td>antmaze-l-p-v0 antmaze-l-d-v0</td><td>0.0 0.0</td><td>0.0 6.0</td><td>0.0</td><td>0.0</td><td>0.</td><td>0.0</td><td>0.0</td><td>0.2</td><td>15.8</td><td>39.6±5.8</td></tr><tr><td>antmaze-vO total</td><td>100.2</td><td>134.2</td><td>0.0 187.8</td><td>0.0</td><td>0.0</td><td>1.0</td><td>0.0</td><td>0.0</td><td>14.9</td><td>47.5±9.5</td></tr><tr><td></td><td></td><td></td><td></td><td>112.2</td><td>109.1</td><td>107.7</td><td>125.3</td><td>163.8</td><td>303.6</td><td>378.0±49.9</td></tr><tr><td>total</td><td>566.9</td><td>800.4</td><td>790.3</td><td>784.8</td><td>340.5</td><td>558.4</td><td>809.9</td><td>841.2</td><td>1002.1</td><td>1070.4±102.0</td></tr><tr><td>kitchen-v0 total adroit-vO total</td><td>154.5 104.5</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>144.6</td><td>159.8±22.6</td></tr><tr><td></td><td></td><td>:</td><td>=</td><td>-</td><td>-</td><td>=</td><td>-</td><td>-</td><td>93.6</td><td>118.1±30.7</td></tr><tr><td>total+kitchen+adroit</td><td>825.9</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>1240.3</td><td>1348.3±155.3</td></tr><tr><td>runtime</td><td>10m</td><td>10m</td><td></td><td>960m</td><td></td><td>20m</td><td>20m*</td><td>20m</td><td>80m</td><td>20m</td></tr></table>",
|
| 946 |
+
"bbox": [
|
| 947 |
+
173,
|
| 948 |
+
154,
|
| 949 |
+
856,
|
| 950 |
+
372
|
| 951 |
+
],
|
| 952 |
+
"page_idx": 7
|
| 953 |
+
},
|
| 954 |
+
{
|
| 955 |
+
"type": "text",
|
| 956 |
+
"text": "We therefore focus our analysis on the Gym locomotion and Ant Maze domains, but include full Adroit and Kitchen results in Appendix B for completeness. ",
|
| 957 |
+
"bbox": [
|
| 958 |
+
171,
|
| 959 |
+
419,
|
| 960 |
+
823,
|
| 961 |
+
448
|
| 962 |
+
],
|
| 963 |
+
"page_idx": 7
|
| 964 |
+
},
|
| 965 |
+
{
|
| 966 |
+
"type": "text",
|
| 967 |
+
"text": "Comparisons and baselines. We compare to methods that are representative of both multistep dynamic programming and one-step approaches. In the former category, we compare to CQL (Kumar et al., 2020), $\\mathrm { T D } 3 { + } \\mathrm { B C }$ (Fujimoto & Gu, 2021), and AWAC (Nair et al., 2020). In the latter category, we compare to Onestep RL (Brandfonbrener et al., 2021) and Decision Transformers (Chen et al., 2021). We obtained the Decision Transformers results on Ant Maze subsets of D4RL tasks using the author-provided implementation2 and following authors instructions communicated over email. We obtained results for $\\mathrm { T D } 3 { + } \\mathrm { B C }$ and Onestep RL (Exp. Weight) directly from the authors. Note that Chen et al. (2021) and Brandfonbrener et al. $\\textcircled { 2 0 2 1 }$ incorrectly report results for some prior methods, such as CQL, using the “-v0” environments. These generally produce lower scores than the “-v2” environments that these papers use for their own methods. We use the “-v2” environments for all methods to en",
|
| 968 |
+
"bbox": [
|
| 969 |
+
174,
|
| 970 |
+
450,
|
| 971 |
+
483,
|
| 972 |
+
755
|
| 973 |
+
],
|
| 974 |
+
"page_idx": 7
|
| 975 |
+
},
|
| 976 |
+
{
|
| 977 |
+
"type": "image",
|
| 978 |
+
"img_path": "images/ebf51974b9f350c5ae5937dd4d592cc16cd89ef325c8a60d98e04f724acc5a9b.jpg",
|
| 979 |
+
"image_caption": [
|
| 980 |
+
"Figure 3: Left: Estimating a larger expectile $\\tau$ is crucial for antmaze tasks that require dynamical programming (’stitching’). Right: Clipped double Q-Learning (CDQ) is crucial for learning values for $\\tau = 0 . 9$ . "
|
| 981 |
+
],
|
| 982 |
+
"image_footnote": [],
|
| 983 |
+
"bbox": [
|
| 984 |
+
509,
|
| 985 |
+
472,
|
| 986 |
+
812,
|
| 987 |
+
642
|
| 988 |
+
],
|
| 989 |
+
"page_idx": 7
|
| 990 |
+
},
|
| 991 |
+
{
|
| 992 |
+
"type": "text",
|
| 993 |
+
"text": "sure a fair comparison, resulting in higher values for CQL. Because of this fix, our reported CQL scores are higher than all other prior methods. We obtained results for $\\mathbf { \\tilde { \\mu } } ^ { 6 6 } \\mathbf { - v } 2 \\mathbf { \\ w } ^ { 5 }$ datasets using an author-suggested implementation.3 On the Gym locomotion tasks (halfcheetah, hopper, walker2d), we find that IQL performs comparably to the best performing prior method, CQL. On the more challenging Ant Maze task, IQL outperforms CQL, and outperforms the one-step methods by a very large margin. ",
|
| 994 |
+
"bbox": [
|
| 995 |
+
174,
|
| 996 |
+
755,
|
| 997 |
+
825,
|
| 998 |
+
838
|
| 999 |
+
],
|
| 1000 |
+
"page_idx": 7
|
| 1001 |
+
},
|
| 1002 |
+
{
|
| 1003 |
+
"type": "text",
|
| 1004 |
+
"text": "Runtime. Our approach is also computationally faster than the baselines (see Table 1). For the baselines, we measure runtime for our reimplementations of the methods in JAX (Bradbury et al., 2018) built on top of JAXRL (Kostrikov, 2021), which are typically faster than the original implementations. For example, the original implementation of CQL takes more than 4 hours to perform 1M updates, while ours takes only 80 minutes. Even so, IQL still requires about $4 \\mathbf { x }$ less time than our reimplementation of CQL on average, and is comparable to the fastest prior one-step methods. We did not reimplement Decision Transformers due to their complexity and report runtime of the original implementation. ",
|
| 1005 |
+
"bbox": [
|
| 1006 |
+
174,
|
| 1007 |
+
842,
|
| 1008 |
+
825,
|
| 1009 |
+
885
|
| 1010 |
+
],
|
| 1011 |
+
"page_idx": 7
|
| 1012 |
+
},
|
| 1013 |
+
{
|
| 1014 |
+
"type": "text",
|
| 1015 |
+
"text": "",
|
| 1016 |
+
"bbox": [
|
| 1017 |
+
174,
|
| 1018 |
+
103,
|
| 1019 |
+
825,
|
| 1020 |
+
174
|
| 1021 |
+
],
|
| 1022 |
+
"page_idx": 8
|
| 1023 |
+
},
|
| 1024 |
+
{
|
| 1025 |
+
"type": "text",
|
| 1026 |
+
"text": "Effect of $\\tau$ hyperparameter. We also demonstrate that it is crucial to compute a larger expectile on tasks that require “stitching” (see Fig. 3). We provide complete results in Appendix B. With larger values of $\\tau$ , our method approximates $Q$ -learning better, leading to better performance on the Ant Maze tasks. Moreover, due to neural network generalization, values learned with expectile regression increase with a larger $\\tau$ and do not degrade to behavior policy values $\\tau = 0 . 5$ ). Finally, clipped double Q-Learning is crucial for estimating values for a larger $\\tau = 0 . 9$ . ",
|
| 1027 |
+
"bbox": [
|
| 1028 |
+
174,
|
| 1029 |
+
180,
|
| 1030 |
+
825,
|
| 1031 |
+
263
|
| 1032 |
+
],
|
| 1033 |
+
"page_idx": 8
|
| 1034 |
+
},
|
| 1035 |
+
{
|
| 1036 |
+
"type": "text",
|
| 1037 |
+
"text": "5.3 ONLINE FINE-TUNING AFTER OFFLINE RL",
|
| 1038 |
+
"text_level": 1,
|
| 1039 |
+
"bbox": [
|
| 1040 |
+
174,
|
| 1041 |
+
273,
|
| 1042 |
+
509,
|
| 1043 |
+
287
|
| 1044 |
+
],
|
| 1045 |
+
"page_idx": 8
|
| 1046 |
+
},
|
| 1047 |
+
{
|
| 1048 |
+
"type": "text",
|
| 1049 |
+
"text": "The policies obtained by offline RL can often be improved with a small amount of online interaction. IQL is well-suited for online fine-tuning for two reasons. First, IQL has strong offline performance, as shown in the previous section, which provides a good initialization. Second, IQL implements a weighted behavioral cloning policy extraction step, which has previously been shown to allow for better online policy improvement compared to other types of offline constraints $( \\overbrace { { \\mathbb { N a i r } \\ \\mathrm { e t } \\ \\mathrm { a l . } } } ) \\ \\big [ 2 0 2 0 \\big ]$ To evaluate the finetuning capability of various RL algorithms, we first run offline RL on each ",
|
| 1050 |
+
"bbox": [
|
| 1051 |
+
174,
|
| 1052 |
+
291,
|
| 1053 |
+
387,
|
| 1054 |
+
554
|
| 1055 |
+
],
|
| 1056 |
+
"page_idx": 8
|
| 1057 |
+
},
|
| 1058 |
+
{
|
| 1059 |
+
"type": "table",
|
| 1060 |
+
"img_path": "images/56f1351426b9430c424f36a98f95ff1826d410d631f5a074c75974d2fdf95ffc.jpg",
|
| 1061 |
+
"table_caption": [],
|
| 1062 |
+
"table_footnote": [],
|
| 1063 |
+
"table_body": "<table><tr><td>Dataset</td><td>AWAC</td><td>CQL</td><td>IQL (Ours)</td></tr><tr><td>antmaze-umaze-vO antmaze-umaze-diverse-v0</td><td>56.7 →59.0 49.3 →49.0</td><td>70.1 →99.4 31.1 →99.4</td><td>88.0 →96.3 67.0 →49.0</td></tr><tr><td>antmaze-medium-play-v0</td><td>0.0 →0.0</td><td>23.0 →0.0</td><td>69.0 →89.2</td></tr><tr><td>antmaze-medium-diverse-v0</td><td>0.7 →0.3</td><td>23.0 →32.3</td><td>71.8 →91.4</td></tr><tr><td>antmaze-large-play-v0</td><td>0.0 →0.0</td><td>1.0 →0.0</td><td>36.8 →51.8</td></tr><tr><td>antmaze-large-diverse-v0</td><td>1.0 →0.0</td><td>1.0 →0.0</td><td>42.2 →59.8</td></tr><tr><td>antmaze-vO total</td><td>107.7 →108.3</td><td>151.5 →231.1</td><td>374.8 →437.5</td></tr><tr><td>pen-binary-v0</td><td>44.6 →70.3</td><td>31.2 →9.9</td><td>37.4 →60.7</td></tr><tr><td>door-binary-v0</td><td>1.3 →30.1</td><td>0.2 →0.0</td><td>0.7 →32.3</td></tr><tr><td>relocate-binary-v0</td><td>0.8 →2.7</td><td>0.1 →0.0</td><td>0.0 →31.0</td></tr><tr><td>hand-vO total</td><td>46.7 →103.1</td><td>31.5 →9.9</td><td>38.1 →124.0</td></tr><tr><td>total</td><td>154.4→211.4</td><td>182.8→241.0</td><td>412.9561.5</td></tr></table>",
|
| 1064 |
+
"bbox": [
|
| 1065 |
+
400,
|
| 1066 |
+
308,
|
| 1067 |
+
826,
|
| 1068 |
+
449
|
| 1069 |
+
],
|
| 1070 |
+
"page_idx": 8
|
| 1071 |
+
},
|
| 1072 |
+
{
|
| 1073 |
+
"type": "text",
|
| 1074 |
+
"text": "Table 2: Online finetuning results showing the initial performance after offline RL, and performance after 1M steps of online RL. In all tasks, IQL is able to finetune to a significantly higher performance than the offline initialization, with final performance that is comparable to or better than the best of either AWAC or CQL on all tasks except pen-binary-v0. ",
|
| 1075 |
+
"bbox": [
|
| 1076 |
+
400,
|
| 1077 |
+
458,
|
| 1078 |
+
823,
|
| 1079 |
+
541
|
| 1080 |
+
],
|
| 1081 |
+
"page_idx": 8
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"type": "text",
|
| 1085 |
+
"text": "dataset, then run 1M steps of online RL, and then report the final performance. We compare to AWAC (Nair et al., $\\boxed { 2 0 2 0 }$ , which has been proposed specifically for online finetuning, and CQL $\\underline { { \\mathbb { K u } } } - \\rfloor$ mar et al., $\\overline { { \\boxed { 2 0 2 0 } } }$ , which showed the best performance among prior methods in our experiments in the previous section. Exact experimental details are provided in Appendix $\\mathbf { C } .$ We use the challenging Ant Maze D4RL domains $\\mathtt { ( F u ) e t a l . } \\mathtt { / } 2 0 2 0 \\rVert$ , as well as the high-dimensional dexterous manipulation environments from Rajeswaran et al. $\\overline { { \\left( \\frac { 2 0 1 8 } { \\it 1 8 } \\right) } }$ , which Nair et al. $\\underline { { ( 2 0 2 0 ) } }$ propose to use to study online adaptation with AWAC. Results are shown in Table $\\boxed { 5 }$ On the Ant Maze domains, IQL significantly outperforms both prior methods after online finetuning. CQL attains the second best score, while AWAC performs comparatively worse due to much weaker offline initialization. On the dexterous hand tasks, IQL performs significantly better than AWAC on relocate-binary-v0, comparably on door-binary-v0, and slightly worse on pen-binary-v0, with the best overall score. ",
|
| 1086 |
+
"bbox": [
|
| 1087 |
+
173,
|
| 1088 |
+
555,
|
| 1089 |
+
825,
|
| 1090 |
+
708
|
| 1091 |
+
],
|
| 1092 |
+
"page_idx": 8
|
| 1093 |
+
},
|
| 1094 |
+
{
|
| 1095 |
+
"type": "text",
|
| 1096 |
+
"text": "6 CONCLUSION ",
|
| 1097 |
+
"text_level": 1,
|
| 1098 |
+
"bbox": [
|
| 1099 |
+
174,
|
| 1100 |
+
722,
|
| 1101 |
+
318,
|
| 1102 |
+
737
|
| 1103 |
+
],
|
| 1104 |
+
"page_idx": 8
|
| 1105 |
+
},
|
| 1106 |
+
{
|
| 1107 |
+
"type": "text",
|
| 1108 |
+
"text": "We presented implicit Q-Learning (IQL), a general algorithm for offline RL that completely avoids any queries to values of out-of-sample actions during training while still enabling multi-step dynamic programming. To our knowledge, this is the first method that combines both of these features. This has a number of important benefits. First, our algorithm is computationally efficient: we can perform 1M updates on one GTX1080 GPU in less than 20 minutes. Second, it is simple to implement, requiring only minor modifications over a standard SARSA-like TD algorithm, and performing policy extraction with a simple weighted behavioral cloning procedure resembling supervised learning. Finally, despite the simplicity and efficiency of this method, we show that it attains excellent performance across all of the tasks in the D4RL benchmark, matching the best prior methods on the MuJoCo locomotion tasks, and exceeding the state-of-the-art performance on the challenging ant maze environments, where multi-step dynamic programming is essential for good performance. ",
|
| 1109 |
+
"bbox": [
|
| 1110 |
+
173,
|
| 1111 |
+
746,
|
| 1112 |
+
825,
|
| 1113 |
+
911
|
| 1114 |
+
],
|
| 1115 |
+
"page_idx": 8
|
| 1116 |
+
},
|
| 1117 |
+
{
|
| 1118 |
+
"type": "text",
|
| 1119 |
+
"text": "ACKNOWLEDGEMENTS ",
|
| 1120 |
+
"text_level": 1,
|
| 1121 |
+
"bbox": [
|
| 1122 |
+
176,
|
| 1123 |
+
103,
|
| 1124 |
+
367,
|
| 1125 |
+
117
|
| 1126 |
+
],
|
| 1127 |
+
"page_idx": 9
|
| 1128 |
+
},
|
| 1129 |
+
{
|
| 1130 |
+
"type": "text",
|
| 1131 |
+
"text": "We thank Dibya Ghosh and the anonymous reviewers for helpful comments on earlier drafts of the paper. This research was supported by the Office of Naval Research, C3.ai, and Intel, with compute support from Google. ",
|
| 1132 |
+
"bbox": [
|
| 1133 |
+
174,
|
| 1134 |
+
133,
|
| 1135 |
+
825,
|
| 1136 |
+
176
|
| 1137 |
+
],
|
| 1138 |
+
"page_idx": 9
|
| 1139 |
+
},
|
| 1140 |
+
{
|
| 1141 |
+
"type": "text",
|
| 1142 |
+
"text": "REFERENCES ",
|
| 1143 |
+
"text_level": 1,
|
| 1144 |
+
"bbox": [
|
| 1145 |
+
174,
|
| 1146 |
+
199,
|
| 1147 |
+
285,
|
| 1148 |
+
213
|
| 1149 |
+
],
|
| 1150 |
+
"page_idx": 9
|
| 1151 |
+
},
|
| 1152 |
+
{
|
| 1153 |
+
"type": "text",
|
| 1154 |
+
"text": "James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python $^ +$ NumPy programs, 2018. URL http: //github.com/google/jax. \nDavid Brandfonbrener, William F Whitney, Rajesh Ranganath, and Joan Bruna. Offline rl without off-policy evaluation. arXiv preprint arXiv:2106.08909, 2021. \nLili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee, Aditya Grover, Michael Laskin, Pieter Abbeel, Aravind Srinivas, and Igor Mordatch. Decision transformer: Reinforcement learning via sequence modeling. arXiv preprint arXiv:2106.01345, 2021. \nWill Dabney, Georg Ostrovski, David Silver, and Remi Munos. Implicit quantile networks for ´ distributional reinforcement learning. In International conference on machine learning, pp. 1096– 1105. PMLR, 2018a. \nWill Dabney, Mark Rowland, Marc G Bellemare, and Remi Munos. Distributional reinforcement ´ learning with quantile regression. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018b. \nRasool Fakoor, Jonas Mueller, Kavosh Asadi, Pratik Chaudhari, and Alexander J Smola. Continuous doubly constrained batch reinforcement learning. arXiv preprint arXiv:2102.09225, 2021. \nPete Florence, Corey Lynch, Andy Zeng, Oscar Ramirez, Ayzaan Wahid, Laura Downs, Adrian Wong, Johnny Lee, Igor Mordatch, and Jonathan Tompson. Implicit behavioral cloning. arXiv preprint arXiv:2109.00137, 2021. \nJustin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020. \nScott Fujimoto and Shixiang Shane Gu. A minimalist approach to offline reinforcement learning. arXiv preprint arXiv:2106.06860, 2021. \nScott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning, pp. 1587–1596. PMLR, 2018. \nScott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pp. 2052–2062. PMLR, 2019. \nSeyed Kamyar Seyed Ghasemipour, Dale Schuurmans, and Shixiang Shane Gu. Emaq: Expectedmax q-learning operator for simple yet effective offline and online rl. In International Conference on Machine Learning, pp. 3682–3691. PMLR, 2021. \nCaglar Gulcehre, Sergio Gomez Colmenarejo, Ziyu Wang, Jakub Sygnowski, Thomas Paine, Konrad ´ Zolna, Yutian Chen, Matthew Hoffman, Razvan Pascanu, and Nando de Freitas. Regularized behavior value estimation. arXiv preprint arXiv:2103.09575, 2021. \nJonathan Heek, Anselm Levskaya, Avital Oliver, Marvin Ritter, Bertrand Rondepierre, Andreas Steiner, and Marc van Zee. Flax: A neural network library and ecosystem for JAX, 2020. URL http://github.com/google/flax. \nDiederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
|
| 1155 |
+
"bbox": [
|
| 1156 |
+
171,
|
| 1157 |
+
207,
|
| 1158 |
+
826,
|
| 1159 |
+
926
|
| 1160 |
+
],
|
| 1161 |
+
"page_idx": 9
|
| 1162 |
+
},
|
| 1163 |
+
{
|
| 1164 |
+
"type": "text",
|
| 1165 |
+
"text": "Roger Koenker and Kevin F Hallock. Quantile regression. Journal of economic perspectives, 15(4): 143–156, 2001. ",
|
| 1166 |
+
"bbox": [
|
| 1167 |
+
171,
|
| 1168 |
+
103,
|
| 1169 |
+
823,
|
| 1170 |
+
132
|
| 1171 |
+
],
|
| 1172 |
+
"page_idx": 10
|
| 1173 |
+
},
|
| 1174 |
+
{
|
| 1175 |
+
"type": "text",
|
| 1176 |
+
"text": "Ilya Kostrikov. JAXRL: Implementations of Reinforcement Learning algorithms in JAX., 10 2021. URL https://github.com/ikostrikov/jaxrl. ",
|
| 1177 |
+
"bbox": [
|
| 1178 |
+
171,
|
| 1179 |
+
141,
|
| 1180 |
+
823,
|
| 1181 |
+
171
|
| 1182 |
+
],
|
| 1183 |
+
"page_idx": 10
|
| 1184 |
+
},
|
| 1185 |
+
{
|
| 1186 |
+
"type": "text",
|
| 1187 |
+
"text": "Ilya Kostrikov, Rob Fergus, Jonathan Tompson, and Ofir Nachum. Offline reinforcement learning with fisher divergence critic regularization. In International Conference on Machine Learning, pp. 5774–5783. PMLR, 2021. ",
|
| 1188 |
+
"bbox": [
|
| 1189 |
+
174,
|
| 1190 |
+
179,
|
| 1191 |
+
825,
|
| 1192 |
+
222
|
| 1193 |
+
],
|
| 1194 |
+
"page_idx": 10
|
| 1195 |
+
},
|
| 1196 |
+
{
|
| 1197 |
+
"type": "text",
|
| 1198 |
+
"text": "Aviral Kumar, Justin Fu, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. arXiv preprint arXiv:1906.00949, 2019. ",
|
| 1199 |
+
"bbox": [
|
| 1200 |
+
171,
|
| 1201 |
+
231,
|
| 1202 |
+
825,
|
| 1203 |
+
260
|
| 1204 |
+
],
|
| 1205 |
+
"page_idx": 10
|
| 1206 |
+
},
|
| 1207 |
+
{
|
| 1208 |
+
"type": "text",
|
| 1209 |
+
"text": "Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020. ",
|
| 1210 |
+
"bbox": [
|
| 1211 |
+
171,
|
| 1212 |
+
267,
|
| 1213 |
+
825,
|
| 1214 |
+
297
|
| 1215 |
+
],
|
| 1216 |
+
"page_idx": 10
|
| 1217 |
+
},
|
| 1218 |
+
{
|
| 1219 |
+
"type": "text",
|
| 1220 |
+
"text": "Arsenii Kuznetsov, Pavel Shvechikov, Alexander Grishin, and Dmitry Vetrov. Controlling overestimation bias with truncated mixture of continuous distributional quantile critics. In International Conference on Machine Learning, pp. 5556–5566. PMLR, 2020. ",
|
| 1221 |
+
"bbox": [
|
| 1222 |
+
174,
|
| 1223 |
+
306,
|
| 1224 |
+
823,
|
| 1225 |
+
349
|
| 1226 |
+
],
|
| 1227 |
+
"page_idx": 10
|
| 1228 |
+
},
|
| 1229 |
+
{
|
| 1230 |
+
"type": "text",
|
| 1231 |
+
"text": "Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pp. 45–73. Springer, 2012. ",
|
| 1232 |
+
"bbox": [
|
| 1233 |
+
174,
|
| 1234 |
+
357,
|
| 1235 |
+
821,
|
| 1236 |
+
387
|
| 1237 |
+
],
|
| 1238 |
+
"page_idx": 10
|
| 1239 |
+
},
|
| 1240 |
+
{
|
| 1241 |
+
"type": "text",
|
| 1242 |
+
"text": "Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Awac: Accelerating online reinforcement learning with offline datasets. 2020. ",
|
| 1243 |
+
"bbox": [
|
| 1244 |
+
173,
|
| 1245 |
+
395,
|
| 1246 |
+
821,
|
| 1247 |
+
424
|
| 1248 |
+
],
|
| 1249 |
+
"page_idx": 10
|
| 1250 |
+
},
|
| 1251 |
+
{
|
| 1252 |
+
"type": "text",
|
| 1253 |
+
"text": "Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019. ",
|
| 1254 |
+
"bbox": [
|
| 1255 |
+
174,
|
| 1256 |
+
433,
|
| 1257 |
+
820,
|
| 1258 |
+
463
|
| 1259 |
+
],
|
| 1260 |
+
"page_idx": 10
|
| 1261 |
+
},
|
| 1262 |
+
{
|
| 1263 |
+
"type": "text",
|
| 1264 |
+
"text": "Jan Peters and Stefan Schaal. Reinforcement learning by reward-weighted regression for operational space control. In Proceedings of the 24th international conference on Machine learning, pp. 745– 750, 2007. ",
|
| 1265 |
+
"bbox": [
|
| 1266 |
+
173,
|
| 1267 |
+
470,
|
| 1268 |
+
825,
|
| 1269 |
+
513
|
| 1270 |
+
],
|
| 1271 |
+
"page_idx": 10
|
| 1272 |
+
},
|
| 1273 |
+
{
|
| 1274 |
+
"type": "text",
|
| 1275 |
+
"text": "Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, John Schulman, Emanuel Todorov, and Sergey Levine. Learning Complex Dexterous Manipulation with Deep Reinforcement Learning and Demonstrations. In Robotics: Science and Systems, 2018. URL https://arxiv. org/pdf/1709.10087.pdf. ",
|
| 1276 |
+
"bbox": [
|
| 1277 |
+
173,
|
| 1278 |
+
522,
|
| 1279 |
+
825,
|
| 1280 |
+
579
|
| 1281 |
+
],
|
| 1282 |
+
"page_idx": 10
|
| 1283 |
+
},
|
| 1284 |
+
{
|
| 1285 |
+
"type": "text",
|
| 1286 |
+
"text": "Noah Y Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavioral modelling priors for offline reinforcement learning. arXiv preprint arXiv:2002.08396, 2020. ",
|
| 1287 |
+
"bbox": [
|
| 1288 |
+
173,
|
| 1289 |
+
588,
|
| 1290 |
+
825,
|
| 1291 |
+
643
|
| 1292 |
+
],
|
| 1293 |
+
"page_idx": 10
|
| 1294 |
+
},
|
| 1295 |
+
{
|
| 1296 |
+
"type": "text",
|
| 1297 |
+
"text": "Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1):1929–1958, 2014. ",
|
| 1298 |
+
"bbox": [
|
| 1299 |
+
176,
|
| 1300 |
+
652,
|
| 1301 |
+
823,
|
| 1302 |
+
695
|
| 1303 |
+
],
|
| 1304 |
+
"page_idx": 10
|
| 1305 |
+
},
|
| 1306 |
+
{
|
| 1307 |
+
"type": "text",
|
| 1308 |
+
"text": "Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. ",
|
| 1309 |
+
"bbox": [
|
| 1310 |
+
171,
|
| 1311 |
+
704,
|
| 1312 |
+
823,
|
| 1313 |
+
720
|
| 1314 |
+
],
|
| 1315 |
+
"page_idx": 10
|
| 1316 |
+
},
|
| 1317 |
+
{
|
| 1318 |
+
"type": "text",
|
| 1319 |
+
"text": "Qing Wang, Jiechao Xiong, Lei Han, Peng Sun, Han Liu, and Tong Zhang. Exponentially weighted imitation learning for batched historical data. In NeurIPS, pp. 6291–6300, 2018. ",
|
| 1320 |
+
"bbox": [
|
| 1321 |
+
171,
|
| 1322 |
+
728,
|
| 1323 |
+
823,
|
| 1324 |
+
758
|
| 1325 |
+
],
|
| 1326 |
+
"page_idx": 10
|
| 1327 |
+
},
|
| 1328 |
+
{
|
| 1329 |
+
"type": "text",
|
| 1330 |
+
"text": "Ziyu Wang, Alexander Novikov, Konrad Zolna, Jost Tobias Springenberg, Scott Reed, Bobak Shahriari, Noah Siegel, Josh Merel, Caglar Gulcehre, Nicolas Heess, et al. Critic regularized regression. arXiv preprint arXiv:2006.15134, 2020. ",
|
| 1331 |
+
"bbox": [
|
| 1332 |
+
174,
|
| 1333 |
+
766,
|
| 1334 |
+
825,
|
| 1335 |
+
809
|
| 1336 |
+
],
|
| 1337 |
+
"page_idx": 10
|
| 1338 |
+
},
|
| 1339 |
+
{
|
| 1340 |
+
"type": "text",
|
| 1341 |
+
"text": "Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019. ",
|
| 1342 |
+
"bbox": [
|
| 1343 |
+
169,
|
| 1344 |
+
818,
|
| 1345 |
+
823,
|
| 1346 |
+
847
|
| 1347 |
+
],
|
| 1348 |
+
"page_idx": 10
|
| 1349 |
+
}
|
| 1350 |
+
]
|
parse/dev/8aHzds2uUyB/8aHzds2uUyB.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/8aHzds2uUyB/8aHzds2uUyB_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/8aHzds2uUyB/8aHzds2uUyB_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/FWMQYjFso-a/FWMQYjFso-a.md
ADDED
|
@@ -0,0 +1,305 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Pre-Trained Language Models for Interactive Decision-Making
|
| 2 |
+
|
| 3 |
+
Shuang Li 1⇤ , Xavier $\mathbf { P u i g ^ { 1 } }$ , Chris Paxton2, Yilun $\mathbf { D } \mathbf { u } ^ { 1 }$ , Clinton Wang1, Linxi Fan2, Tao Chen1, De-An Huang2, Ekin Akyürek1, Anima Anandkumar2,3,†, Jacob Andreas1,†, Igor Mordatch4,†, Antonio Torralba1,†, Yuke Zhu2,5,†
|
| 4 |
+
|
| 5 |
+
1MIT, 2Nvidia, 3Caltech, 4Google Brain, 5UT Austin Junior authors are ordered based on contributions and senior authors† are ordered alphabetically.
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Language model (LM) pre-training is useful in many language processing tasks. But can pre-trained LMs be further leveraged for more general machine learning problems? We propose an approach for using LMs to scaffold learning and generalization in general sequential decision-making problems. In this approach, goals and observations are represented as a sequence of embeddings, and a policy network initialized with a pre-trained LM predicts the next action. We demonstrate that this framework enables effective combinatorial generalization across different environments and supervisory modalities. We begin by assuming access to a set of expert demonstrations, and show that initializing policies with LMs and fine-tuning them via behavior cloning improves task completion rates by $4 3 . 6 \%$ in the VirtualHome environment. Next, we integrate an active data gathering procedure in which agents iteratively interact with the environment, relabel past “failed” experiences with new goals, and update their policies in a self-supervised loop. Active data gathering further improves combinatorial generalization, outperforming the best baseline by $2 5 . 1 \%$ . Finally, we explain these results by investigating three possible factors underlying the effectiveness of the LM-based policy. We find that sequential input representations (vs. fixed-dimensional feature vectors) and LM-based weight initialization are both important for generalization. Surprisingly, however, the format of the policy inputs encoding (e.g. as a natural language string vs. an arbitrary sequential encoding) has little influence. Together, these results suggest that language modeling induces representations that are useful for modeling not just language, but also goals and plans; these representations can aid learning and generalization even outside of language processing. 2
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Language models (LMs) play a key role in machine learning approaches to natural language processing tasks $\mathbb { P }$ . This includes tasks that are not purely linguistic, and require nontrivial planning and reasoning capabilities [24, 13]: for example, instruction following, vision-language navigation, and visual question answering. Indeed, some of these tasks are so distant from language modeling that one can ask whether pre-trained LMs can be used as a general framework even for tasks that involve no language at all. If so, how might these capabilities be accessed in a model trained only to process and generate natural language strings?
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Environments (left): Different environments have different types of observations and goals. Our approach (right): We use pre-trained LMs as a general framework for interactive decision-making by converting policy inputs into sequential data. Such a method enables effective combinatorial generalization to novel tasks.
|
| 17 |
+
|
| 18 |
+
In this paper, we study these questions through the lens of embodied decision-making, investigating the effectiveness of LM pre-training as a general framework for learning policies across a variety of environments. We propose LID, a framework that uses Pre-Trained Language Models for Interactive Decision-Making. As shown in Figure $\boxed { 1 }$ (right), we encode the inputs to a policy—including observations, goals, and history—as a sequence of embeddings. These embeddings are passed to a policy network initialized with the parameters of a pre-trained LM, which is fine-tuned to predict actions. This framework is broadly applicable, accommodating goals and environment states represented as natural language strings, image patches, or scene graphs.
|
| 19 |
+
|
| 20 |
+
We find that imitation learning using pre-trained LMs as policy initializers improves in-domain performance and enables strong generalization over novel tasks. For i.i.d. training and evaluation tasks, this approach yields $20 \%$ more successful policies than other baseline methods in VirtualHome $\textcircled { \scriptsize { 1 3 1 } }$ . For combinatorial generalization to out-of-distribution tasks, i.e. tasks involving new combinations of goals, states or objects, LM pre-training confers even more benefits: it improves task completion rates by $4 3 . 6 \%$ for novel tasks (see Figure $3 )$ . These results hold for a variety of environment representations: encoding states as natural language strings, when possible, improves the data-efficiency of training, but even LMs fine-tuned on random environment encodings generalize combinatorially to new goals and states when trained on large enough datasets.
|
| 21 |
+
|
| 22 |
+
We further examine how our method may be used in environments where expert data is not available, and agents must instead actively gather data. To do this, we integrate an Active Data Gathering (ADG) procedure into pre-trained LMs as shown in Figure 2. Our proposed approach to ADG consists of three parts. First, exploration collects trajectories using a mix of random actions and actions generated by the current policy. Exploration is insufficient in this high dimensional problem and most of the trajectories will likely fail to achieve the end goal. A key insight is that even the failed trajectories contain useful sub-trajectories that solve certain sub-goals, and we relabel these goals in a hindsight relabeling stage. The relabeled goal describes what was achieved in the extracted sub-trajectory. The policy update stage samples relabeled trajectories to update the policy. The active data gathering procedure allows us to train the LM-policy without pre-collected expert data. It also outperforms reinforcement learning (RL) methods on embodied decision-making tasks and enables more effective generalization to novel tasks.
|
| 23 |
+
|
| 24 |
+
Finally, we investigate why LID contributes to generalization. We hypothesize three possible causes for the effectiveness of LM-based policy initialization: (1) the use of language-based input encodings, and more generally LMs’ ability to reason about natural language strings; (2) the sequential structure of transformer inputs, in contrast to the fixed-sized observations used by most policy architectures, and (3) task-general inductive bias conferred by weight initialization with LM pretraining. We investigate (1) by encoding the policy inputs as different types of sequences. Different input encoding schemes have only a negligible impact on the performance: the effectiveness of language modeling is not limited to utilizing natural strings, but in fact extends to arbitrary sequential encodings. We study (2) by encoding observations with a single vector embedding, thereby removing its sequential structure. This operation significantly degrades the model’s performance on novel tasks. Finally, we investigate (3) by learning the parameters of the policy from scratch. The success rate after removing the pre-trained LM weights drops by $1 1 . 2 \%$ , indicating that LM pretraining provides useful inductive bias for sequence processing even when sequences are not natural language strings.
|
| 25 |
+
|
| 26 |
+
To summarize, our work has four main contributions:
|
| 27 |
+
|
| 28 |
+
• First, we propose to use pre-trained LMs as a general scaffold for interactive decision-making across a variety of environments by converting all policy inputs into sequential data.
|
| 29 |
+
• Second, we demonstrate that language modeling improves combinatorial generalization in policy learning: initializing a policy with a pre-trained LM substantially improves out-of-distribution performance on novel tasks.
|
| 30 |
+
• Third, we integrate an active data gathering procedure into the proposed approach to further enable policy learning on environments without using pre-collected expert data.
|
| 31 |
+
• Finally, we perform several analyses to explain the generalization capabilities of pre-trained LMs, finding that natural strings are not needed to benefit from LM pre-training, but the sequential input encoding and weight pre-training are important.
|
| 32 |
+
|
| 33 |
+
These results point to the effectiveness of the proposed framework with pre-trained LMs as a generalpurpose framework to promote structured generalization in interactive decision-making.
|
| 34 |
+
|
| 35 |
+
# 2 Related Work
|
| 36 |
+
|
| 37 |
+
In recent years, word and sentence representations from pre-trained LMs [29, 9, 33] have become ubiquitous in natural language processing [49, 30]. Some of the most successful applications of pre-training lie at the boundary of natural language processing and other domains, as in instruction following $\bar { \mathbb { L } } 3 \mathbb { I }$ and language-guided image retrieval $\bar { \lVert \boldsymbol { 2 2 } \rVert }$ .
|
| 38 |
+
|
| 39 |
+
Learning representations of language. From nearly the earliest days of the field, natural language processing researchers observed that representations of words derived from distributional statistics in large text corpora serve as useful features for downstream tasks $\mathbb { B } \mathbb { B }$ . The earliest versions of these representation learning schemes focused on isolated word forms [25, 28]. However, recent years have seen a number of techniques for training (masked or autoregressive) language models to produce contextualized word representations (which incorporate information neighboring words in sentences and paragraphs) via a variety of masked-word prediction objectives [9, 47].
|
| 40 |
+
|
| 41 |
+
Applications of pre-trained LMs. LMs can be fine-tuned to perform language processing tasks other than language modeling by casting those tasks as word-prediction problems. Successful uses of representations from pre-trained models include syntactic parsing $\pmb { \mathbb { I } }$ and language-to-code translation $\lVert \boldsymbol { \mathsf { E } } \boldsymbol { \mathsf { 5 } } \rVert$ ; successful adaptations of LM prediction heads include machine translation [49], sentiment classification $\textcircled { 6 }$ and style transfer $[ \overline { { 1 8 } } ]$ . A number of tasks integrate language and other modalities, including visual question answering and image captioning $\lVert \rVert$ . Recent works find that image representations can be injected directly into LMs’ embedding layers [42].
|
| 42 |
+
|
| 43 |
+
Policy learning and LM. Traditional policy learning methods, such as PPO [37], DQN [27], DDPG [21], A3C [26], perform well on playing tasks on Atari, OpenAI gym [5], and MuJoCo [41]. Some of them might fail to solve more challenging tasks on embodied environments [31, 39]. Several recent papers [36, 17, 15] propose to use LM for policy learning. Frozen Pretrained Transformer (FPT) $\bar { \mathbb { Z } 3 } \mathbb { I }$ demonstrates that pre-trained LMs require very little fine-tuning to match the performance of task-specific models on several image classification and numerical sequence processing tasks. Semi-Supervised Skill Learning with Latent Language (SL)3 [38] shows that LMs can serve as an effective backbone for hierarchical policies that express plans as natural language strings [2, 4]. In this paper, we focus on building a general framework for decision-making tasks using pre-trained LMs, even when language is not provided as an input or output.
|
| 44 |
+
|
| 45 |
+
# 3 Decision-Making and Language Modeling
|
| 46 |
+
|
| 47 |
+
# 3.1 POMDPs and Policy Learning
|
| 48 |
+
|
| 49 |
+
We explore the application of LMs to general sequential decision-making tasks in partially observed environments. These tasks may be formalized as partially observable Markov decision processes (POMDPs). A POMDP is defined by a set of states, a set of observations, a set of actions, and a transition model $\mathscr { T } ( s _ { t + 1 } | s _ { t } , a _ { t } )$ that maps the current state and action to the next state. Importantly, in a POMDP setting, the observation $o _ { t }$ only captures a portion of the underlying state $s _ { t }$ , and an optimal decision-making strategy (a policy) must incorporate both the current observation and the history of previous observations and actions. In our experiments, policies are parametric models $\pi _ { \phi } ( a _ { t } | g , h _ { t } , o _ { t } )$ that output the probability of an action given the goals $g$ , history information $h _ { t } =$ $\{ o _ { 1 } , a _ { 1 } , \cdot \cdot \cdot , o _ { t - 1 } , a _ { t - 1 } \}$ , and partial observations $o _ { t }$ of the current state $s _ { t }$ .
|
| 50 |
+
|
| 51 |
+
In Figure $\overline { { \vert 1 \vert } } ( \mathrm { r i g h t } )$ , we show a high-level overview of the proposed method. We first convert all policy inputs into a sequence and provide them as input to a transformer encoder. Representations from this encoder model are then passed to a task-specific decoder that predicts actions. We collect a dataset of $N$ training trajectories $\mathcal { D } = \{ d ^ { i } \} _ { i = 1 } ^ { N }$ , where each trajectory consists of a goal and a sequence of observations and actions: $d ^ { i } = \{ \tilde { g } ^ { i } , \tilde { o } _ { 1 } ^ { i } , \tilde { a } _ { 1 } ^ { i } , \tilde { \cdot } \cdot \cdot , o _ { T _ { i } } ^ { i } , a _ { T _ { i } } ^ { i } \}$ , where $T _ { i }$ is the length of the trajectory. We then train the policy to maximize the probability of actions we want to achieve $\pmb { a } ^ { i } = \{ a _ { 1 } ^ { i } , \dots , a _ { T _ { i } } ^ { i } \}$ across trajectories using the cross-entropy loss:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\boldsymbol { \phi } ^ { * } = \underset { \boldsymbol { \phi } } { \arg \operatorname* { m i n } } \left( - \sum _ { i = 1 } ^ { N } \sum _ { t = 1 } ^ { T _ { i } } \ln \pi _ { \phi } ( a _ { t } ^ { i } | \boldsymbol { g } ^ { i } , \boldsymbol { h } _ { t } ^ { i } , \boldsymbol { o } _ { t } ^ { i } ) \right) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
# 3.2 Language models as policy initializers
|
| 58 |
+
|
| 59 |
+
Our experiments focus on autoregressive, transformer-based LMs $\mathbb { \lVert \overline { { 4 3 } } \rVert }$ . These models are trained to fit a distribution over a text sequence $\pmb { y } = \{ y _ { i } \} _ { i = 1 } ^ { n }$ via the chain rule $\begin{array} { r } { p ( \pmb { y } ) = p ( y _ { 1 } ) \prod _ { i = 2 } ^ { n } p ( y _ { i } \ | } \end{array}$ $y _ { 1 } , \dotsc , y _ { i - 1 } )$ . Each term on the right hand side is parameterized by a transformer network, which accepts the conditioned tokens as input. Each token passes through a learned embedding layer $F _ { \theta }$ , then the full conditioned sequence is fed into the LM. In our work, we use a standard LM, GPT-2, to process the input sequence rather than to predict future tokens.
|
| 60 |
+
|
| 61 |
+
Both POMDP decision-making and language modeling are naturally framed as sequence prediction tasks, where successive words or actions/observations are predicted based on a sequence of previous words or actions/observations. This suggests that pre-trained LMs can be used to initialize POMDP policies by fine-tuning them to model high-reward or expert trajectories, as described below.
|
| 62 |
+
|
| 63 |
+
# 4 Approach
|
| 64 |
+
|
| 65 |
+
We evaluate the effectiveness of pre-trained LMs in solving decision-making tasks across environments. We use BabyAI $\mathbb { I H }$ and VirtualHome $\textcircled { \scriptsize { 1 3 1 } }$ to evaluate the proposed method. While both environments feature complex goals, the nature of these goals, as well as the state and action sequences that accomplish them, differ substantially across environments (Figure 1 (left)).
|
| 66 |
+
|
| 67 |
+
# 4.1 Policy Network
|
| 68 |
+
|
| 69 |
+
We first examine whether pre-trained LMs provide effective initializers when states and action histories are represented as natural language strings. We encode the inputs to the policy—including observations, goals, and action histories—as sequences of words. These word sequences are passed to the LM (using its pre-trained word embedding layer $F _ { \theta }$ ) and used to obtain contextualized token representations. Token representations are averaged and used to predict actions. We design a policy network following the general policy framework proposed in Figure 1.
|
| 70 |
+
|
| 71 |
+
Environment encodings in VirtualHome. In VirtualHome, each goal consists of a sequence of predicates and multiplicities, and is translated into a templated English sentence (e.g. “Inside(apple, fridge):2” becomes “put two apples inside the fridge”). To encode the agent’s partial observation, we extract a list of currently visible objects, their states (e.g. “open, clean”), and 3D world coordinates. We use a fully-connected layer to encode the 3D information and generate a feature representation of each object in the observation. To encode history, we store information about all previous actions and convert them into templated English sentences (e.g. “I have put the plate on the kitchen table and the apple inside the fridge”).
|
| 72 |
+
|
| 73 |
+
Environment encodings in BabyAI. The observation by default is a $7 \times 7$ grid. We convert the observation into $7 \times 7$ text descriptions, e.g. “purple ball”, “grey wall”, “open door”, and combine them into a long sentence. We then convert the history actions into text descriptions, e.g. “turn left” and “go forward”. We combine the language instruction (without modification) with the observation and history text descriptions, and feed them to the pre-trained LM.
|
| 74 |
+
|
| 75 |
+
We note that the policy network described above does not strictly require that these encodings take the form of natural language strings—other encodings of the environment as a sequence also work (see Section $^ { 7 ) }$ . This framework could be also generalized to support pixel-based observations using discretization schemes like the one employed in the Vision Transformer [10].
|
| 76 |
+
|
| 77 |
+
Action prediction. We pool LM outputs into a “context representation” that is used to predict the next action. In training, we maximize the probabilities of demonstrated actions. In inference, we select the valid action with the highest probability. See Appendix C.1 for details.
|
| 78 |
+
|
| 79 |
+
VirtualHome and BabyAI have quite different observation spaces, action spaces, and goal spaces; however, we show that embedding policy inputs as sequences and utilizing the pre-trained LM as a policy initializer, enables effective generalization to novel tasks on both environments. We note that LID is not limited to VirtualHome and BabyAI, but is straightforwardly applicable to other embodied environments, such as ALFRED $\mathbb { \left| \mathrm { \overline { { 4 0 } } } }\right|$ and iGibson $\mathbb { \lVert 3 9 \rVert }$ .
|
| 80 |
+
|
| 81 |
+
# 4.2 Training
|
| 82 |
+
|
| 83 |
+
We first examine LID through imitation learning on data collected by experts in Section $4 . 2 . 1 .$ We then show that integrating an active data gathering procedure into LID enables policy learning without using expert data in Section $4 . 2 . 2 .$ We use VirtualHome as an example to explain the data gathering.
|
| 84 |
+
|
| 85 |
+
# 4.2.1 Policy Learning with Expert Data
|
| 86 |
+
|
| 87 |
+
The policy model is first initialized from a pre-trained LM and then fine-tuned on data collected by experts. We build on the VirtualHome environment to collect a set of expert trajectories using regression planning $\pmb { \mathbb { Z } } 0 \|$ and create a VirtualHome-Imitation Learning dataset. Given a task described by goal predicates, the planner generates an action sequence to accomplish this task (See Appendix E.1). The planner has access to privileged information, such as information about the pre-conditions and effects of each action, allowing an agent to robustly perform tasks in partially observable environments and generate expert trajectories for training and evaluation.
|
| 88 |
+
|
| 89 |
+
# 4.2.2 Policy Learning with Active Data Gathering
|
| 90 |
+
|
| 91 |
+
Collecting expert data is sometimes challenging. It may require privileged information of the environment or human annotations, which can be timeconsuming and difficult to scale. A promising way to scale up supervision is Hindsight Experience Replay (HER) [3], which allows agents to learn from orders of magnitude more data without supervision. However, existing HER methods [12] focus on simple tasks with small state/action space and full observability. They cannot tackle more complicated embodied decision-making tasks, requiring nontrivial planning and reasoning or natural language understanding. LID with the active data gathering (LIDADG) can be used in solving tasks in such environments.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 2: LID with the active data gathering procedure. By iteratively repeating the exploration, hindsight relabeling, and policy update, LID with active data gathering can learn an effective policy without using pre-collected expert data.
|
| 95 |
+
|
| 96 |
+
As shown in Figure 2, LID-ADG consists of three stages, i.e. exploration, hindsight relabeling, and policy update. The key idea is to gradually improve the task success rate by asking the agent to iteratively explore the environment, relabel failure samples, and update its policy using imitation learning. In the exploration stage, we first randomly sample a goal and an initial state. We then use a mix of random actions and actions generated by the current policy $\pi _ { \phi } ( a _ { t } | g , h _ { t } , o _ { t } )$ to obtain the next action. We repeat this process until this episode ends. We collect $M$ trajectories and store them in the replay buffers. The generated actions in the early stages rarely complete the given task.
|
| 97 |
+
|
| 98 |
+
However, even the failed trajectories contain useful sub-trajectories that solve certain sub-goals. In the hindsight relabeling stage, we extract useful sub-trajectories and relabel a goal $g ^ { \prime }$ for each of them. We design a goal relabel function $f _ { l }$ that generates a goal based on the sequence of observations and actions using hand-designed templates. In practice, we implement the goal relabel function as a program (see Appendix E.2). The hindsight relabeling stage allows sample-efficient learning by reusing the failure cases. During policy update, the agent samples the data from the replay buffers and updates its policy network $\pi _ { \phi }$ .
|
| 99 |
+
|
| 100 |
+
By interleaving the exploration, hindsight relabeling, and policy update, LID-ADG can gradually improve the policy without requiring pre-collected expert data. In embodied environments with large action spaces, sparse rewards, and long-horizon planning, RL methods often struggle to obtain stable policy gradients during training. Our method enables sample-efficient learning from the sparse rewards by relabeling new goals for the bad samples that the agent fails to achieve. In addition, LID-ADG leverages the stability of supervised learning in the policy update stage, enabling it to outperform RL approaches on a wide range of decision-making tasks.
|
| 101 |
+
|
| 102 |
+
# 5 Experiment Setup
|
| 103 |
+
|
| 104 |
+
We evaluate the proposed method and baselines on VirtualHome and BabyAI.
|
| 105 |
+
|
| 106 |
+
# 5.1 VirtualHome
|
| 107 |
+
|
| 108 |
+
VirtualHome is a 3D embodied environment featuring partial observability, large action spaces, and long time horizons. We evaluate policies’ performance from three aspects: (1) performance on in-distribution tasks; (2) generalization to novel scenes; and (3) generalization to novel tasks.
|
| 109 |
+
|
| 110 |
+
In-Distribution. The predicate types and their counts in the goal are randomly sampled from the same distribution as the training data. The objects are initially placed in the environment according to common-sense layouts (e.g. plates appear inside the kitchen cabinets rather than the bathtub).
|
| 111 |
+
|
| 112 |
+
Novel Scenes. The objects are placed in random positions in the initial environment without commonsense constraints (e.g. apples may appear inside the dishwasher).
|
| 113 |
+
|
| 114 |
+
Novel Tasks. The components of all goal predicates are never seen together during training (e.g. both plates and fridges appear in training goals, but Inside(plate, fridge) only appears in the test set. (See Appendix $\bar { \underline { { \mathbf { F } } } }$ for more details.)
|
| 115 |
+
|
| 116 |
+
We evaluate the success rates of different methods on each test set. A given episode is scored as successful if the policy completes its entire goal within the maximum allowed steps of the environment. On each of the 3 test subsets, we use 5 different random seeds and test 100 tasks under each seed. Thus there are 1500 examples used to evaluate each model.
|
| 117 |
+
|
| 118 |
+
# 5.2 BabyAI
|
| 119 |
+
|
| 120 |
+
BabyAI is a 2D grid world environment for instruction following. Observations in BabyAI are $7 \times 7 \times 3$ grids describing a partial and local egocentric view of the state of the environment. We evaluate the methods on four representative tasks: GoToRedBall, GoToLocal, PickupLoc, and PutNextLocal. Performing well on the test set requires the models to generalize to new environment layouts and goals, resulting in new combinations of tasks not seen in training. For each method, we compute success rates over 500 episodes on each task.
|
| 121 |
+
|
| 122 |
+
# 6 Experiments
|
| 123 |
+
|
| 124 |
+
We first show results of the proposed method and baselines for embodied decision-making tasks using expert data in Section $\boxed { 6 . 1 }$ We then show our results when using actively gathered data in Section $6 . { \overset { \vartriangle } { 6 } }$
|
| 125 |
+
|
| 126 |
+
# 6.1 Embodied Decision Making with Pre-trained Language Model (LID)
|
| 127 |
+
|
| 128 |
+
# 6.1.1 Results on VirtualHome
|
| 129 |
+
|
| 130 |
+
We evaluate the following methods:
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 3: Comparisons of the proposed method and baselines on VirtualHome. All the methods are trained on expert data using imitation learning. MLP-1, MLP, and LSTM are baselines without using the pre-trained LM. The proposed method, LID-Text (Ours), outperforms all baselines.
|
| 134 |
+
|
| 135 |
+
Table 1: Success rates on BabyAI tasks. All the methods are trained on offline expert data using imitation learning. LID-Text (Ours) outperforms BabyAIOri, the method used in the original paper [16].
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Tasks</td><td>Methods</td><td colspan="3">Number of Demos</td></tr><tr><td></td><td></td><td>100 500 1K</td><td>5K</td><td>10K</td></tr><tr><td>GoToRedBall</td><td>BabyAI-Ori 国 LID-Text (Ours)</td><td>81.0 96.0 99.0 93.999.4 99.7</td><td>99.5 100.0</td><td>99.9 100.0</td></tr><tr><td>GoToLocal</td><td>BabyAI-Ori 国 LID-Text (Ours) </td><td>55.9 84.3 98.6 64.6 97.9 99.0</td><td>99.9 99.5</td><td>99.8 99.5</td></tr><tr><td>PickupLoc</td><td>BabyAI-Ori[16 LID-Text (0urs) 28.7 73.4 99.0</td><td>28.0 58.0 93.3</td><td>97.9 99.6</td><td>99.8 99.8</td></tr><tr><td>PutNextLocal</td><td>BabyAI-Ori 国 LID-Text (Ours)</td><td>14.3 16.8 43.4 11.1 93.0 93.2</td><td>81.2 98.9</td><td>97.7 99.9</td></tr></table>
|
| 138 |
+
|
| 139 |
+
LID-Text (Ours) is the proposed method that converts all environments inputs into text descriptions. The pre-trained LM is fine-tuned for decision-making (conditioned on goals, observations, and histories) as described in Section 4.1.
|
| 140 |
+
|
| 141 |
+
Recurrent Network. We compare our method with a recurrent baseline using an LSTM $\mathbb { \lVert \underline { { 4 } } \rVert }$ to encode the history information. The hidden representation from the last timestep, together with the goal and current observation, are used to predict the next action.
|
| 142 |
+
|
| 143 |
+
MLP and MLP-1. We perform additional comparisons with baselines that do not use recurrent networks or pre-trained LMs. MLP and MLP-1 take the goal, histories, and the current observation as input and send them to the multilayer perceptron neural network (MLP) to predict actions. MLP-1 has three more average-pooling layers than $M L P$ that average the features of tokens in the goal, history actions, and the current observation, respectively, before sending them to the MLP layer.
|
| 144 |
+
|
| 145 |
+
Quantitative results. Each method is trained on $2 0 K$ demos from the VirtualHome-Imitation Learning dataset, and then evaluated on the three test subsets: In-Distribution, Novel Scenes, and Novel Tasks. In Figure $\textcircled{3}$ LID-Text (Ours), which initializes the policy with a pre-trained LM, has higher success rates than other methods. This difference is most pronounced in the Novel Tasks setting, where test tasks require combinatorial generalization across goals that are never seen during training. Here, LID-Text (Ours) dramatically $( 4 3 . 6 \% )$ improves upon all baselines. Such combinatorial generalization is necessary to construct general purpose agents, but is often difficult for existing approaches. Our results suggest that pre-trained LMs can serve as a computational backbone for combinatorial generalization.
|
| 146 |
+
|
| 147 |
+
# 6.1.2 Results on BabyAI
|
| 148 |
+
|
| 149 |
+
We use the standard training and test data provided by [16]. In BabyAI, performing well on unseen test tasks with new environment layouts and goals requires combinatorial reasoning. In Table $\bigstar$ we report the success rate of models trained on different number of demos. BabyAI-Ori [16] is the method used in the original paper. LID-Text (Ours) is the proposed method that converts policy inputs into a text sequence. Given enough training data, i.e. 10K demos, both methods achieve high success rates, but LID-Text (Ours) outperforms BabyAI-Ori with less training data, indicating the proposed method improves sample efficiency when generalizing to novel tasks.
|
| 150 |
+
|
| 151 |
+
# 6.2 Pre-trained Language Model with Active Data Gathering (LID-ADG)
|
| 152 |
+
|
| 153 |
+
We compare LID-ADG, the proposed LM framework for decision-making using actively gathered data (Section $\boxed { 4 . 2 . 2 }$ , to a variety of baselines that do not use pre-collected expert data on VirtualHome.
|
| 154 |
+
|
| 155 |
+
Random. The agent selects the next action randomly from the valid action space at that state. Goal-Object. The agent randomly selects an object that in the goal and in the valid action space to interact with. For example, given a goal of “Inside(apple, fridge):1”, this baseline might choose “grab apple”, “open fridge”, or other actions containing “apple” or “fridge”. Online RL. We compare with PPO $\pmb { \mathbb { B 7 } }$ , one of the most commonly used online RL methods. For fair comparison, we equip PPO with the same main policy network as the proposed method. Our implementation is
|
| 156 |
+
|
| 157 |
+
Table 2: Comparisons of methods without using expert data on VirtualHome. LID-ADG (Ours) is the only successful approach.
|
| 158 |
+
|
| 159 |
+
<table><tr><td>In-Distribution Novel Scenes Novel Tasks</td></tr><tr><td>Random</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>Goal-Object</td><td>0.8±0.5 0.0±0.0</td><td>0.4±0.4</td></tr><tr><td>PPO</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>DQN+HER</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>LID-ADG (Ours)</td><td>46.7 ± 2.7 32.2 ± 3.3</td><td>25.5± 4.1</td></tr></table>
|
| 160 |
+
|
| 161 |
+
<table><tr><td></td><td>In-Distribution Novel Scenes Novel Tasks</td><td></td></tr><tr><td>LID-ADG (Ours)</td><td>46.7 ± 2.7</td><td>32.2 ± 3.3 25.5 ± 4.1</td></tr><tr><td>PPO (LID-ADG Init)</td><td>53.7± 3.5 30.2±3.4</td><td>27.8± 2.7</td></tr><tr><td>DT (LID-ADG Data)</td><td>42.4 ± 1.5</td><td>21.6 ± 2.48 16.8 ± 1.0</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 3: The proposed method with active data gathering, LID-ADG (Ours), can be used as an policy initializer for online RL or a data provider for offline RL.
|
| 164 |
+
|
| 165 |
+
based on Stable Baselines3 [35]. Hindsight Experience Replay. We compare with DQN+HER used in [3] and modify its main policy network to be the same as the proposed method.
|
| 166 |
+
|
| 167 |
+
Quantitative results. We compare LID-ADG with baselines on VirtualHome in Table 2. Each experiment is performed 5 times with different random seeds. The Random baseline is always 0, indicating the tasks in VirtualHome cannot be easily solved by a random policy. Goal-Object is better than Random because Goal-Object has access to objects in the goal and it samples actions from a much smaller action space. The online RL baseline, PPO, fails to solve tasks in VirtualHome featured by partially observation, large state/action space, and long-term horizon. $\mathbf { D Q N + H E R }$ works well on simple tasks on 2D environments, but they cannot tackle VirtualHome tasks neither, requiring nontrivial planning and reasoning. LID-ADG does not require expert data and can solve the complicated tasks in 3D embodied environments which cannot be easily achieved using RL.
|
| 168 |
+
|
| 169 |
+
Policy initializer and data provider. LID-ADG can further be used to initialize the weights for finetuning RL policies and to gather data for offline learning. As shown in Table 2, directly training RL, e.g. PPO, fails to solve tasks in VirtualHome. However, after using the policy trained by LID-ADG to initialize the PPO policy, we may effectively learn an interactive policy with good performance. In Table 3, PPO (LID-ADG Init) is initialized from LID-ADG and further fine-tuned to solve the tasks in VirtualHome. After initialization, PPO improves its success rate by $5 3 . 7 \%$ on the In-Distribution setting (See PPO results in Table $2$ and Table $\mathsf { \bar { \rho } } _ { 3 ) }$ . In addition, LID-ADG can provide data for offline learning. LID-ADG saves the relabeled data in replay buffers. We train Decision Transformer (DT) [7] using the data collected by LID-ADG. See DT (LID-ADG Data) in Table 3.
|
| 170 |
+
|
| 171 |
+
# 7 Analysis: Understanding the Sources of Generalization
|
| 172 |
+
|
| 173 |
+
The pre-trained LM policy, fine-tuned on either expert data or actively gathered data, exhibits effective combinatorial generalization. Is this simply because LMs are effective models of relations between natural language descriptions of states and actions $\mathbb { M }$ , or because they provide a more general framework for combinatorial generalization in decision-making? We hypothesize and investigate three possible factors to understand the sources of such combinatorial generalization. We use policies trained on the expert data as an example to explain the experiments.
|
| 174 |
+
|
| 175 |
+
# 7.1 Input Encoding Scheme
|
| 176 |
+
|
| 177 |
+
We first hypothesize that converting environment inputs into natural language contributes to the combinatorial generalization as the LMs are trained on language data. We explore the role of natural language by investigating three alternative ways of encoding policy inputs to our model without using natural language strings: two in VirtualHome, and one in BabyAI. BabyAI results are in Appendix A.
|
| 178 |
+
|
| 179 |
+
Index encoding in VirtualHome. Rather than natural language strings, LID-Index (Ours) converts policy inputs into integer indices. LID-Index (Ours) retains the discrete, serial format of the goal, history, and observation, but replaces each word with an integer, and replaces the embedding layer from the pre-trained LM with a new embedding layer trained from scratch. For example, grab apple is mapped to (5,3) based on the positions of grab and apple in the vocabulary set.
|
| 180 |
+
|
| 181 |
+
Unnatural string encoding in VirtualHome. LID-Unnatural (Ours) replaces the natural language tokens (e.g. converting the goal “On(fork, table):1” to put one fork on the table) with random ones (e.g. converting On(fork, table) to brought wise character trees fine yet). This is done by randomly permuting the entire vocabulary, mapping each token to a new token. Such a permutation breaks the semantic information in natural strings.
|
| 182 |
+
|
| 183 |
+
Table 4: Success rates of policies trained with different input encodings in the Novel Tasks setting on VirtualHome. The text encoding is the most sample-efficient, but all models converge to similar performance given sufficient training data.
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Methods</td><td colspan="6">Number of Demos</td></tr><tr><td></td><td>100</td><td>500</td><td>1K</td><td>5K</td><td>10K</td><td>20K</td></tr><tr><td>LID-Text (Ours)</td><td>8.8 ± 1.4</td><td>22.2 ±1.7</td><td>26.8 ±1.0</td><td>46.0 ± 1.0</td><td>58.2 ±1.2</td><td>58.2 ±1.6</td></tr><tr><td>LID-Index (Ours)</td><td>6.4 ± 0.6</td><td>18.0±3.8</td><td>18.8 ±1.0</td><td>45.5± 2.1</td><td>54.6 ± 0.8</td><td>57.8 ± 0.9</td></tr><tr><td>LID-Unnatural (Ours)</td><td>6.8 ±1.3</td><td>18.6 ± 2.1</td><td>27.0 ± 1.1</td><td>47.2 ± 1.7</td><td>55.8 ± 0.8</td><td>58.8 ± 0.9</td></tr></table>
|
| 186 |
+
|
| 187 |
+
LID-Index (Ours) and LID-Unnatural (Ours) have the same policy network as LID-Text (Ours). All are fine-tuned on the expert data. The averaged results using 5 different random seeds on the Novel Tasks setting are reported in Table $\textcircled { 4 }$ Given few training data, e.g. 100 demos, all the models perform poorly, with success rates lower than $1 0 \%$ . LID-Text (Ours) achieves higher success rates than LID-Index (Ours) and LID-Unnatural (Ours) when dataset size increases, e.g. LID-Text (Ours) is around $4 \%$ higher than LID-Index (Ours) and LID-Unnatural (Ours) with 500 training demos. When the training dataset is further enlarged, e.g. 20K demos, success rates of all approaches reach similar performance. This result indicates that the effectiveness of pre-trained LMs in compositional generalization is not unique to natural language strings, but can be leveraged from arbitrary encodings, although adapting the model to arbitrary encodings may require more training data.
|
| 188 |
+
|
| 189 |
+
# 7.2 Sequential Input Representation
|
| 190 |
+
|
| 191 |
+
Next, we explore whether generalization requires the sequential processing mechanisms in transformer-based LMs. We investigate whether the LM pre-trained policy will still be effective when the input encoding is not sequential. No-Seq encodes the goal as a single vector by averaging all goal embeddings. History and observation features are obtained in the same way. All features are then sent to the pre-trained LM to predict actions. As shown in Table $5 ,$ removing sequential structure significantly hurts performance on Novel Tasks. No
|
| 192 |
+
|
| 193 |
+
Table 5: Experiments on sequential inputs and weight initialization. Fine-tuning the pre-trained weights and the usage of sequential encoding are important for combinatorial generalization.
|
| 194 |
+
|
| 195 |
+
<table><tr><td colspan="2">In-Distribution</td><td>Novel Tasks</td></tr><tr><td>LID-Text (Ours)</td><td>87.6 ± 1.9</td><td>58.2 ± 2.3</td></tr><tr><td>No-Seq</td><td>74.0 ± 2.3</td><td>2.0± 0.6</td></tr><tr><td>No-Pretrain</td><td>90.8 ± 2.0</td><td>47.0 ±2.8</td></tr><tr><td>No-FT</td><td>51.2 ± 4.5</td><td>17.0 ± 2.9</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Seq achieves good performance on test tasks that are closer to training tasks, but cannot generalize well to more challenging unseen tasks. Thus, combinatorial generalization in pre-trained LMs may be attributed in part to transformers’ ability to process sequential input representations effectively.
|
| 198 |
+
|
| 199 |
+
# 7.3 Favorable Weight Initialization
|
| 200 |
+
|
| 201 |
+
Finally, we investigate if the favorable weight initialization from LM pre-training enables effective generalization of the proposed model. No-Pretrain does not initialize the policy using the pre-trained LM, but instead training the policy on the expert data from scratch. In Table $5 ,$ we find that removing the pre-trained weights can fit the in-domain data and thus performs well on the In-Distribution setting. However, its success rate is $1 1 . 2 \%$ lower than the proposed model on the Novel Tasks setting, indicating the pre-trained weights are important for effective generalization, but not necessary for effective data fitting. We further test a baseline, No-FT, that keeps the pre-trained weights of the language model but freezes them while training the rest model on our expert data. Freezing the pretrained weights without fine-tuning significantly hurts the performance on both settings, suggesting that fine-tuning of the transformer weights is essential for effective combinatorial generalization.
|
| 202 |
+
|
| 203 |
+
Together, these results suggest that sequential input representations (vs. fixed-dimensional feature vectors) and favorable weight initialization are both important for generalization, however, the input encoding schemes (e.g. as a natural language string vs. an arbitrary encoding scheme) has little influence. These results point to the potential broader applicability of pre-trained LMs as a computational backbone for compositional embodied decision making, where arbitrary inputs, such as language, images, or grids, may be converted to sequential encodings.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 4: Qualitative results of our model on VirtualHome and BabyAI. We only show a sub-trajectory in each example to save space. The interacted objects are labelled by green bounding boxes.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 5: Failure cases. We show failure cases caused by the grounding error and policy error. The interacted objects are labelled by green bounding boxes.
|
| 210 |
+
|
| 211 |
+
# 8 Qualitative Results
|
| 212 |
+
|
| 213 |
+
In Figure $^ { 4 , }$ we show examples of LID-Text (Ours) completing tasks in VirtualHome and BabyAI. We show two successful examples from VirtualHome on the In-Distribution and Novel Tasks settings, and two successful examples from BabyAI on solving the GoToLocal and PickupLoc tasks. We only show short trajectories or extract a sub-trajectory for saving space.
|
| 214 |
+
|
| 215 |
+
Failure case analysis. In Figure 5, we show some failure cases of the proposed method. We observed two main types of failure cases: grounding error and policy error. For failures caused by the grounding error, the agent interacts with a wrong object that is not related to the given goal, e.g. the agent puts cutlets instead of the salmon inside the fridge. For failures caused by the policy error, the agent cannot find the target objects or does not interact with them. The proposed method that converts policy inputs into sequential encodings and feeds them to the general LM framework can accomplish decision-making tasks efficiently, however, there are still challenging tasks that the policy fails to accomplish. Larger LMs, e.g. GPT-3 [6], may improve the success rate of those challenging tasks.
|
| 216 |
+
|
| 217 |
+
# 9 Conclusion and Broader Impact
|
| 218 |
+
|
| 219 |
+
In this paper, we introduced LID, a general approach to sequential decision-making that converts goals, histories, and observations into sequences and processes them using a policy initialized with a pre-trained LM. We integrated an active data gathering procedure into the proposed method to enable policy learning without using expert data. Our analysis showed that input representation and favorable weight initialization both contribute to the generalization while the input encoding scheme has little influence. One drawback of the active data gathering is that it relies on hand-designed rules for task relabeling. More generally, a potential disadvantage of the proposed approach is that biases of the pre-trained LMs may influence its behavior, and further study of LID-based models’ bias is required before they may be deployed in sensitive downstream applications. Nevertheless, our results demonstrate that LID enables effective combinatorial generalization across different environments, and highlight the promise of LM pre-training for more general decision-making problems.
|
| 220 |
+
|
| 221 |
+
# References
|
| 222 |
+
|
| 223 |
+
[1] P. Ammanabrolu and M. O. Riedl. Playing text-adventure games with graph-based deep reinforcement learning. arXiv preprint arXiv:1812.01628, 2018.
|
| 224 |
+
[2] J. Andreas and D. Klein. Learning with latent language. In North American Association for Computational Linguistics, 2022.
|
| 225 |
+
[3] M. Andrychowicz, F. Wolski, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba. Hindsight experience replay. arXiv preprint arXiv:1707.01495, 2017.
|
| 226 |
+
[4] M. L. Athul Paul Jacob and J. Andreas. Multitasking inhibits semantic drift. In North American Association for Computational Linguistics, 2021.
|
| 227 |
+
[5] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym, 2016.
|
| 228 |
+
[6] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 229 |
+
[7] L. Chen, K. Lu, A. Rajeswaran, K. Lee, A. Grover, M. Laskin, P. Abbeel, A. Srinivas, and I. Mordatch. Decision transformer: Reinforcement learning via sequence modeling. arXiv preprint arXiv:2106.01345, 2021.
|
| 230 |
+
[8] S. Deerwester, S. T. Dumais, G. W. Furnas, T. K. Landauer, and R. Harshman. Indexing by latent semantic analysis. Journal of the American society for information science, 41(6):391–407, 1990.
|
| 231 |
+
[9] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 232 |
+
[10] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 233 |
+
[11] S. T. Dumais. Latent semantic analysis. Annual review of information science and technology, 38(1):188–230, 2004.
|
| 234 |
+
[12] D. Ghosh, A. Gupta, A. Reddy, J. Fu, C. Devin, B. Eysenbach, and S. Levine. Learning to reach goals via iterated supervised learning. arXiv preprint arXiv:1912.06088, 2019.
|
| 235 |
+
[13] F. Hill, S. Mokra, N. Wong, and T. Harley. Human instruction-following with deep reinforcement learning via transfer-learning from text. arXiv preprint arXiv:2005.09382, 2020.
|
| 236 |
+
[14] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735– 1780, 1997.
|
| 237 |
+
[15] W. Huang, P. Abbeel, D. Pathak, and I. Mordatch. Language models as zero-shot planners: Extracting actionable knowledge for embodied agents. arXiv preprint arXiv:2201.07207, 2022.
|
| 238 |
+
[16] D. Y.-T. Hui, M. Chevalier-Boisvert, D. Bahdanau, and Y. Bengio. Babyai 1.1, 2020.
|
| 239 |
+
[17] E. Jang, A. Irpan, M. Khansari, D. Kappler, F. Ebert, C. Lynch, S. Levine, and C. Finn. Bc-z: Zero-shot task generalization with robotic imitation learning. In Conference on Robot Learning, pages 991–1002. PMLR, 2022.
|
| 240 |
+
[18] N. S. Keskar, B. McCann, L. R. Varshney, C. Xiong, and R. Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019.
|
| 241 |
+
[19] N. Kitaev, S. Cao, and D. Klein. Multilingual constituency parsing with self-attention and pre-training. arXiv preprint arXiv:1812.11760, 2018.
|
| 242 |
+
[20] R. E. Korf. Planning as search: A quantitative approach. Artificial intelligence, 33(1):65–88, 1987.
|
| 243 |
+
[21] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 244 |
+
[22] J. Lu, D. Batra, D. Parikh, and S. Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. arXiv preprint arXiv:1908.02265, 2019.
|
| 245 |
+
[23] K. Lu, A. Grover, P. Abbeel, and I. Mordatch. Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247, 2021.
|
| 246 |
+
[24] A. Majumdar, A. Shrivastava, S. Lee, P. Anderson, D. Parikh, and D. Batra. Improving visionand-language navigation with image-text pairs from the web. In European Conference on Computer Vision, pages 259–274. Springer, 2020.
|
| 247 |
+
[25] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013.
|
| 248 |
+
[26] V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pages 1928–1937. PMLR, 2016.
|
| 249 |
+
[27] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 250 |
+
[28] J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014.
|
| 251 |
+
[29] M. E. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, and L. Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
|
| 252 |
+
[30] E. A. Platanios, A. Pauls, S. Roy, Y. Zhang, A. Kyte, A. Guo, S. Thomson, J. Krishnamurthy, J. Wolfe, J. Andreas, et al. Value-agnostic conversational semantic parsing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 3666–3681, 2021.
|
| 253 |
+
[31] X. Puig, K. Ra, M. Boben, J. Li, T. Wang, S. Fidler, and A. Torralba. Virtualhome: Simulating household activities via programs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8494–8502, 2018.
|
| 254 |
+
[32] X. Puig, T. Shu, S. Li, Z. Wang, J. B. Tenenbaum, S. Fidler, and A. Torralba. Watch-and-help: A challenge for social perception and human-ai collaboration. arXiv preprint arXiv:2010.09890, 2020.
|
| 255 |
+
[33] A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving language understanding by generative pre-training. 2018.
|
| 256 |
+
[34] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 257 |
+
[35] A. Raffin, A. Hill, A. Gleave, A. Kanervisto, M. Ernestus, and N. Dormann. Stable-baselines3: Reliable reinforcement learning implementations. Journal of Machine Learning Research, 22(268):1–8, 2021.
|
| 258 |
+
[36] M. Reid, Y. Yamada, and S. S. Gu. Can wikipedia help offline reinforcement learning? arXiv preprint arXiv:2201.12122, 2022.
|
| 259 |
+
[37] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 260 |
+
[38] P. Sharma, A. Torralba, and J. Andreas. Skill induction and planning with latent language. In Association for Computational Linguistics, 2022.
|
| 261 |
+
[39] B. Shen, F. Xia, C. Li, R. Martín-Martín, L. Fan, G. Wang, S. Buch, C. D’Arpino, S. Srivastava, L. P. Tchapmi, et al. igibson, a simulation environment for interactive tasks in large realisticscenes. arXiv preprint arXiv:2012.02924, 2020.
|
| 262 |
+
[40] M. Shridhar, J. Thomason, D. Gordon, Y. Bisk, W. Han, R. Mottaghi, L. Zettlemoyer, and D. Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10740–10749, 2020.
|
| 263 |
+
[41] E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5026–5033. IEEE, 2012.
|
| 264 |
+
[42] M. Tsimpoukelli, J. Menick, S. Cabi, S. Eslami, O. Vinyals, and F. Hill. Multimodal few-shot learning with frozen language models. arXiv preprint arXiv:2106.13884, 2021.
|
| 265 |
+
[43] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 266 |
+
[44] J. Vig. A multiscale visualization of attention in the transformer model. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 37–42, Florence, Italy, July 2019. Association for Computational Linguistics.
|
| 267 |
+
[45] B. Wang, R. Shin, X. Liu, O. Polozov, and M. Richardson. Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942, 2019.
|
| 268 |
+
[46] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, et al. Huggingface’s transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019.
|
| 269 |
+
[47] Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. R. Salakhutdinov, and Q. V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019.
|
| 270 |
+
[48] Z. Yang, N. Garcia, C. Chu, M. Otani, Y. Nakashima, and H. Takemura. Bert representations for video question answering. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 1556–1565, 2020.
|
| 271 |
+
[49] J. Zhu, Y. Xia, L. Wu, D. He, T. Qin, W. Zhou, H. Li, and T.-Y. Liu. Incorporating bert into neural machine translation. arXiv preprint arXiv:2002.06823, 2020.
|
| 272 |
+
|
| 273 |
+
# Checklist
|
| 274 |
+
|
| 275 |
+
1. For all authors...
|
| 276 |
+
|
| 277 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 278 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 9.
|
| 279 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 9.
|
| 280 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 281 |
+
|
| 282 |
+
2. If you are including theoretical results...
|
| 283 |
+
|
| 284 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 285 |
+
|
| 286 |
+
3. If you ran experiments...
|
| 287 |
+
|
| 288 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] In the supplemental material.
|
| 289 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 6 and Appendix C.2.
|
| 290 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 6.
|
| 291 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix C.2.
|
| 292 |
+
|
| 293 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 294 |
+
|
| 295 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 296 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 297 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 298 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 299 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] See Section 9.
|
| 300 |
+
|
| 301 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 302 |
+
|
| 303 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 304 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 305 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
parse/dev/FWMQYjFso-a/FWMQYjFso-a_content_list.json
ADDED
|
@@ -0,0 +1,1373 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "Pre-Trained Language Models for Interactive Decision-Making ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
294,
|
| 8 |
+
122,
|
| 9 |
+
705,
|
| 10 |
+
172
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Shuang Li 1⇤ , Xavier $\\mathbf { P u i g ^ { 1 } }$ , Chris Paxton2, Yilun $\\mathbf { D } \\mathbf { u } ^ { 1 }$ , Clinton Wang1, Linxi Fan2, Tao Chen1, De-An Huang2, Ekin Akyürek1, Anima Anandkumar2,3,†, Jacob Andreas1,†, Igor Mordatch4,†, Antonio Torralba1,†, Yuke Zhu2,5,† ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
215,
|
| 19 |
+
224,
|
| 20 |
+
789,
|
| 21 |
+
270
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "1MIT, 2Nvidia, 3Caltech, 4Google Brain, 5UT Austin Junior authors are ordered based on contributions and senior authors† are ordered alphabetically. ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
181,
|
| 30 |
+
284,
|
| 31 |
+
813,
|
| 32 |
+
314
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "Abstract ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
462,
|
| 42 |
+
349,
|
| 43 |
+
535,
|
| 44 |
+
367
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "Language model (LM) pre-training is useful in many language processing tasks. But can pre-trained LMs be further leveraged for more general machine learning problems? We propose an approach for using LMs to scaffold learning and generalization in general sequential decision-making problems. In this approach, goals and observations are represented as a sequence of embeddings, and a policy network initialized with a pre-trained LM predicts the next action. We demonstrate that this framework enables effective combinatorial generalization across different environments and supervisory modalities. We begin by assuming access to a set of expert demonstrations, and show that initializing policies with LMs and fine-tuning them via behavior cloning improves task completion rates by $4 3 . 6 \\%$ in the VirtualHome environment. Next, we integrate an active data gathering procedure in which agents iteratively interact with the environment, relabel past “failed” experiences with new goals, and update their policies in a self-supervised loop. Active data gathering further improves combinatorial generalization, outperforming the best baseline by $2 5 . 1 \\%$ . Finally, we explain these results by investigating three possible factors underlying the effectiveness of the LM-based policy. We find that sequential input representations (vs. fixed-dimensional feature vectors) and LM-based weight initialization are both important for generalization. Surprisingly, however, the format of the policy inputs encoding (e.g. as a natural language string vs. an arbitrary sequential encoding) has little influence. Together, these results suggest that language modeling induces representations that are useful for modeling not just language, but also goals and plans; these representations can aid learning and generalization even outside of language processing. 2 ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
233,
|
| 53 |
+
381,
|
| 54 |
+
766,
|
| 55 |
+
700
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 Introduction ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
723,
|
| 66 |
+
310,
|
| 67 |
+
741
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Language models (LMs) play a key role in machine learning approaches to natural language processing tasks $\\mathbb { P }$ . This includes tasks that are not purely linguistic, and require nontrivial planning and reasoning capabilities [24, 13]: for example, instruction following, vision-language navigation, and visual question answering. Indeed, some of these tasks are so distant from language modeling that one can ask whether pre-trained LMs can be used as a general framework even for tasks that involve no language at all. If so, how might these capabilities be accessed in a model trained only to process and generate natural language strings? ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
755,
|
| 77 |
+
825,
|
| 78 |
+
852
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "image",
|
| 84 |
+
"img_path": "images/2e1db4790ba71bd4142a8919e8e736330fc46ee6636ed107d41233d2195e2f1a.jpg",
|
| 85 |
+
"image_caption": [
|
| 86 |
+
"Figure 1: Environments (left): Different environments have different types of observations and goals. Our approach (right): We use pre-trained LMs as a general framework for interactive decision-making by converting policy inputs into sequential data. Such a method enables effective combinatorial generalization to novel tasks. "
|
| 87 |
+
],
|
| 88 |
+
"image_footnote": [],
|
| 89 |
+
"bbox": [
|
| 90 |
+
178,
|
| 91 |
+
87,
|
| 92 |
+
823,
|
| 93 |
+
244
|
| 94 |
+
],
|
| 95 |
+
"page_idx": 1
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"type": "text",
|
| 99 |
+
"text": "In this paper, we study these questions through the lens of embodied decision-making, investigating the effectiveness of LM pre-training as a general framework for learning policies across a variety of environments. We propose LID, a framework that uses Pre-Trained Language Models for Interactive Decision-Making. As shown in Figure $\\boxed { 1 }$ (right), we encode the inputs to a policy—including observations, goals, and history—as a sequence of embeddings. These embeddings are passed to a policy network initialized with the parameters of a pre-trained LM, which is fine-tuned to predict actions. This framework is broadly applicable, accommodating goals and environment states represented as natural language strings, image patches, or scene graphs. ",
|
| 100 |
+
"bbox": [
|
| 101 |
+
173,
|
| 102 |
+
310,
|
| 103 |
+
825,
|
| 104 |
+
422
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "We find that imitation learning using pre-trained LMs as policy initializers improves in-domain performance and enables strong generalization over novel tasks. For i.i.d. training and evaluation tasks, this approach yields $20 \\%$ more successful policies than other baseline methods in VirtualHome $\\textcircled { \\scriptsize { 1 3 1 } }$ . For combinatorial generalization to out-of-distribution tasks, i.e. tasks involving new combinations of goals, states or objects, LM pre-training confers even more benefits: it improves task completion rates by $4 3 . 6 \\%$ for novel tasks (see Figure $3 )$ . These results hold for a variety of environment representations: encoding states as natural language strings, when possible, improves the data-efficiency of training, but even LMs fine-tuned on random environment encodings generalize combinatorially to new goals and states when trained on large enough datasets. ",
|
| 111 |
+
"bbox": [
|
| 112 |
+
173,
|
| 113 |
+
429,
|
| 114 |
+
825,
|
| 115 |
+
553
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "We further examine how our method may be used in environments where expert data is not available, and agents must instead actively gather data. To do this, we integrate an Active Data Gathering (ADG) procedure into pre-trained LMs as shown in Figure 2. Our proposed approach to ADG consists of three parts. First, exploration collects trajectories using a mix of random actions and actions generated by the current policy. Exploration is insufficient in this high dimensional problem and most of the trajectories will likely fail to achieve the end goal. A key insight is that even the failed trajectories contain useful sub-trajectories that solve certain sub-goals, and we relabel these goals in a hindsight relabeling stage. The relabeled goal describes what was achieved in the extracted sub-trajectory. The policy update stage samples relabeled trajectories to update the policy. The active data gathering procedure allows us to train the LM-policy without pre-collected expert data. It also outperforms reinforcement learning (RL) methods on embodied decision-making tasks and enables more effective generalization to novel tasks. ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
174,
|
| 124 |
+
559,
|
| 125 |
+
825,
|
| 126 |
+
724
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "Finally, we investigate why LID contributes to generalization. We hypothesize three possible causes for the effectiveness of LM-based policy initialization: (1) the use of language-based input encodings, and more generally LMs’ ability to reason about natural language strings; (2) the sequential structure of transformer inputs, in contrast to the fixed-sized observations used by most policy architectures, and (3) task-general inductive bias conferred by weight initialization with LM pretraining. We investigate (1) by encoding the policy inputs as different types of sequences. Different input encoding schemes have only a negligible impact on the performance: the effectiveness of language modeling is not limited to utilizing natural strings, but in fact extends to arbitrary sequential encodings. We study (2) by encoding observations with a single vector embedding, thereby removing its sequential structure. This operation significantly degrades the model’s performance on novel tasks. Finally, we investigate (3) by learning the parameters of the policy from scratch. The success rate after removing the pre-trained LM weights drops by $1 1 . 2 \\%$ , indicating that LM pretraining provides useful inductive bias for sequence processing even when sequences are not natural language strings. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
731,
|
| 136 |
+
825,
|
| 137 |
+
911
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "To summarize, our work has four main contributions: ",
|
| 144 |
+
"bbox": [
|
| 145 |
+
178,
|
| 146 |
+
92,
|
| 147 |
+
522,
|
| 148 |
+
106
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 2
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "• First, we propose to use pre-trained LMs as a general scaffold for interactive decision-making across a variety of environments by converting all policy inputs into sequential data. \n• Second, we demonstrate that language modeling improves combinatorial generalization in policy learning: initializing a policy with a pre-trained LM substantially improves out-of-distribution performance on novel tasks. \n• Third, we integrate an active data gathering procedure into the proposed approach to further enable policy learning on environments without using pre-collected expert data. \n• Finally, we perform several analyses to explain the generalization capabilities of pre-trained LMs, finding that natural strings are not needed to benefit from LM pre-training, but the sequential input encoding and weight pre-training are important. ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
178,
|
| 157 |
+
111,
|
| 158 |
+
826,
|
| 159 |
+
266
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 2
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "These results point to the effectiveness of the proposed framework with pre-trained LMs as a generalpurpose framework to promote structured generalization in interactive decision-making. ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
174,
|
| 168 |
+
277,
|
| 169 |
+
825,
|
| 170 |
+
306
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 2
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "2 Related Work ",
|
| 177 |
+
"text_level": 1,
|
| 178 |
+
"bbox": [
|
| 179 |
+
174,
|
| 180 |
+
325,
|
| 181 |
+
321,
|
| 182 |
+
343
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "In recent years, word and sentence representations from pre-trained LMs [29, 9, 33] have become ubiquitous in natural language processing [49, 30]. Some of the most successful applications of pre-training lie at the boundary of natural language processing and other domains, as in instruction following $\\bar { \\mathbb { L } } 3 \\mathbb { I }$ and language-guided image retrieval $\\bar { \\lVert \\boldsymbol { 2 2 } \\rVert }$ . ",
|
| 189 |
+
"bbox": [
|
| 190 |
+
174,
|
| 191 |
+
357,
|
| 192 |
+
825,
|
| 193 |
+
412
|
| 194 |
+
],
|
| 195 |
+
"page_idx": 2
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"type": "text",
|
| 199 |
+
"text": "Learning representations of language. From nearly the earliest days of the field, natural language processing researchers observed that representations of words derived from distributional statistics in large text corpora serve as useful features for downstream tasks $\\mathbb { B } \\mathbb { B }$ . The earliest versions of these representation learning schemes focused on isolated word forms [25, 28]. However, recent years have seen a number of techniques for training (masked or autoregressive) language models to produce contextualized word representations (which incorporate information neighboring words in sentences and paragraphs) via a variety of masked-word prediction objectives [9, 47]. ",
|
| 200 |
+
"bbox": [
|
| 201 |
+
174,
|
| 202 |
+
420,
|
| 203 |
+
825,
|
| 204 |
+
517
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 2
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "text",
|
| 210 |
+
"text": "Applications of pre-trained LMs. LMs can be fine-tuned to perform language processing tasks other than language modeling by casting those tasks as word-prediction problems. Successful uses of representations from pre-trained models include syntactic parsing $\\pmb { \\mathbb { I } }$ and language-to-code translation $\\lVert \\boldsymbol { \\mathsf { E } } \\boldsymbol { \\mathsf { 5 } } \\rVert$ ; successful adaptations of LM prediction heads include machine translation [49], sentiment classification $\\textcircled { 6 }$ and style transfer $[ \\overline { { 1 8 } } ]$ . A number of tasks integrate language and other modalities, including visual question answering and image captioning $\\lVert \\rVert$ . Recent works find that image representations can be injected directly into LMs’ embedding layers [42]. ",
|
| 211 |
+
"bbox": [
|
| 212 |
+
174,
|
| 213 |
+
522,
|
| 214 |
+
825,
|
| 215 |
+
619
|
| 216 |
+
],
|
| 217 |
+
"page_idx": 2
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"type": "text",
|
| 221 |
+
"text": "Policy learning and LM. Traditional policy learning methods, such as PPO [37], DQN [27], DDPG [21], A3C [26], perform well on playing tasks on Atari, OpenAI gym [5], and MuJoCo [41]. Some of them might fail to solve more challenging tasks on embodied environments [31, 39]. Several recent papers [36, 17, 15] propose to use LM for policy learning. Frozen Pretrained Transformer (FPT) $\\bar { \\mathbb { Z } 3 } \\mathbb { I }$ demonstrates that pre-trained LMs require very little fine-tuning to match the performance of task-specific models on several image classification and numerical sequence processing tasks. Semi-Supervised Skill Learning with Latent Language (SL)3 [38] shows that LMs can serve as an effective backbone for hierarchical policies that express plans as natural language strings [2, 4]. In this paper, we focus on building a general framework for decision-making tasks using pre-trained LMs, even when language is not provided as an input or output. ",
|
| 222 |
+
"bbox": [
|
| 223 |
+
173,
|
| 224 |
+
626,
|
| 225 |
+
826,
|
| 226 |
+
765
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 2
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "text",
|
| 232 |
+
"text": "3 Decision-Making and Language Modeling ",
|
| 233 |
+
"text_level": 1,
|
| 234 |
+
"bbox": [
|
| 235 |
+
174,
|
| 236 |
+
784,
|
| 237 |
+
557,
|
| 238 |
+
803
|
| 239 |
+
],
|
| 240 |
+
"page_idx": 2
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"type": "text",
|
| 244 |
+
"text": "3.1 POMDPs and Policy Learning ",
|
| 245 |
+
"text_level": 1,
|
| 246 |
+
"bbox": [
|
| 247 |
+
176,
|
| 248 |
+
815,
|
| 249 |
+
424,
|
| 250 |
+
832
|
| 251 |
+
],
|
| 252 |
+
"page_idx": 2
|
| 253 |
+
},
|
| 254 |
+
{
|
| 255 |
+
"type": "text",
|
| 256 |
+
"text": "We explore the application of LMs to general sequential decision-making tasks in partially observed environments. These tasks may be formalized as partially observable Markov decision processes (POMDPs). A POMDP is defined by a set of states, a set of observations, a set of actions, and a transition model $\\mathscr { T } ( s _ { t + 1 } | s _ { t } , a _ { t } )$ that maps the current state and action to the next state. Importantly, in a POMDP setting, the observation $o _ { t }$ only captures a portion of the underlying state $s _ { t }$ , and an optimal decision-making strategy (a policy) must incorporate both the current observation and the history of previous observations and actions. In our experiments, policies are parametric models $\\pi _ { \\phi } ( a _ { t } | g , h _ { t } , o _ { t } )$ that output the probability of an action given the goals $g$ , history information $h _ { t } =$ $\\{ o _ { 1 } , a _ { 1 } , \\cdot \\cdot \\cdot , o _ { t - 1 } , a _ { t - 1 } \\}$ , and partial observations $o _ { t }$ of the current state $s _ { t }$ . ",
|
| 257 |
+
"bbox": [
|
| 258 |
+
174,
|
| 259 |
+
842,
|
| 260 |
+
825,
|
| 261 |
+
911
|
| 262 |
+
],
|
| 263 |
+
"page_idx": 2
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"type": "text",
|
| 267 |
+
"text": "",
|
| 268 |
+
"bbox": [
|
| 269 |
+
174,
|
| 270 |
+
90,
|
| 271 |
+
825,
|
| 272 |
+
147
|
| 273 |
+
],
|
| 274 |
+
"page_idx": 3
|
| 275 |
+
},
|
| 276 |
+
{
|
| 277 |
+
"type": "text",
|
| 278 |
+
"text": "In Figure $\\overline { { \\vert 1 \\vert } } ( \\mathrm { r i g h t } )$ , we show a high-level overview of the proposed method. We first convert all policy inputs into a sequence and provide them as input to a transformer encoder. Representations from this encoder model are then passed to a task-specific decoder that predicts actions. We collect a dataset of $N$ training trajectories $\\mathcal { D } = \\{ d ^ { i } \\} _ { i = 1 } ^ { N }$ , where each trajectory consists of a goal and a sequence of observations and actions: $d ^ { i } = \\{ \\tilde { g } ^ { i } , \\tilde { o } _ { 1 } ^ { i } , \\tilde { a } _ { 1 } ^ { i } , \\tilde { \\cdot } \\cdot \\cdot , o _ { T _ { i } } ^ { i } , a _ { T _ { i } } ^ { i } \\}$ , where $T _ { i }$ is the length of the trajectory. We then train the policy to maximize the probability of actions we want to achieve $\\pmb { a } ^ { i } = \\{ a _ { 1 } ^ { i } , \\dots , a _ { T _ { i } } ^ { i } \\}$ across trajectories using the cross-entropy loss: ",
|
| 279 |
+
"bbox": [
|
| 280 |
+
173,
|
| 281 |
+
152,
|
| 282 |
+
825,
|
| 283 |
+
253
|
| 284 |
+
],
|
| 285 |
+
"page_idx": 3
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"type": "equation",
|
| 289 |
+
"img_path": "images/9681a0f6fda02dfe9e59286728b5c84eeb8527c0c1469b7504847ffb8eef105e.jpg",
|
| 290 |
+
"text": "$$\n\\boldsymbol { \\phi } ^ { * } = \\underset { \\boldsymbol { \\phi } } { \\arg \\operatorname* { m i n } } \\left( - \\sum _ { i = 1 } ^ { N } \\sum _ { t = 1 } ^ { T _ { i } } \\ln \\pi _ { \\phi } ( a _ { t } ^ { i } | \\boldsymbol { g } ^ { i } , \\boldsymbol { h } _ { t } ^ { i } , \\boldsymbol { o } _ { t } ^ { i } ) \\right) .\n$$",
|
| 291 |
+
"text_format": "latex",
|
| 292 |
+
"bbox": [
|
| 293 |
+
338,
|
| 294 |
+
260,
|
| 295 |
+
660,
|
| 296 |
+
304
|
| 297 |
+
],
|
| 298 |
+
"page_idx": 3
|
| 299 |
+
},
|
| 300 |
+
{
|
| 301 |
+
"type": "text",
|
| 302 |
+
"text": "3.2 Language models as policy initializers ",
|
| 303 |
+
"text_level": 1,
|
| 304 |
+
"bbox": [
|
| 305 |
+
174,
|
| 306 |
+
319,
|
| 307 |
+
478,
|
| 308 |
+
333
|
| 309 |
+
],
|
| 310 |
+
"page_idx": 3
|
| 311 |
+
},
|
| 312 |
+
{
|
| 313 |
+
"type": "text",
|
| 314 |
+
"text": "Our experiments focus on autoregressive, transformer-based LMs $\\mathbb { \\lVert \\overline { { 4 3 } } \\rVert }$ . These models are trained to fit a distribution over a text sequence $\\pmb { y } = \\{ y _ { i } \\} _ { i = 1 } ^ { n }$ via the chain rule $\\begin{array} { r } { p ( \\pmb { y } ) = p ( y _ { 1 } ) \\prod _ { i = 2 } ^ { n } p ( y _ { i } \\ | } \\end{array}$ $y _ { 1 } , \\dotsc , y _ { i - 1 } )$ . Each term on the right hand side is parameterized by a transformer network, which accepts the conditioned tokens as input. Each token passes through a learned embedding layer $F _ { \\theta }$ , then the full conditioned sequence is fed into the LM. In our work, we use a standard LM, GPT-2, to process the input sequence rather than to predict future tokens. ",
|
| 315 |
+
"bbox": [
|
| 316 |
+
173,
|
| 317 |
+
339,
|
| 318 |
+
825,
|
| 319 |
+
424
|
| 320 |
+
],
|
| 321 |
+
"page_idx": 3
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"type": "text",
|
| 325 |
+
"text": "Both POMDP decision-making and language modeling are naturally framed as sequence prediction tasks, where successive words or actions/observations are predicted based on a sequence of previous words or actions/observations. This suggests that pre-trained LMs can be used to initialize POMDP policies by fine-tuning them to model high-reward or expert trajectories, as described below. ",
|
| 326 |
+
"bbox": [
|
| 327 |
+
174,
|
| 328 |
+
429,
|
| 329 |
+
825,
|
| 330 |
+
486
|
| 331 |
+
],
|
| 332 |
+
"page_idx": 3
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"type": "text",
|
| 336 |
+
"text": "4 Approach ",
|
| 337 |
+
"text_level": 1,
|
| 338 |
+
"bbox": [
|
| 339 |
+
174,
|
| 340 |
+
505,
|
| 341 |
+
287,
|
| 342 |
+
522
|
| 343 |
+
],
|
| 344 |
+
"page_idx": 3
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"type": "text",
|
| 348 |
+
"text": "We evaluate the effectiveness of pre-trained LMs in solving decision-making tasks across environments. We use BabyAI $\\mathbb { I H }$ and VirtualHome $\\textcircled { \\scriptsize { 1 3 1 } }$ to evaluate the proposed method. While both environments feature complex goals, the nature of these goals, as well as the state and action sequences that accomplish them, differ substantially across environments (Figure 1 (left)). ",
|
| 349 |
+
"bbox": [
|
| 350 |
+
174,
|
| 351 |
+
536,
|
| 352 |
+
825,
|
| 353 |
+
593
|
| 354 |
+
],
|
| 355 |
+
"page_idx": 3
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"type": "text",
|
| 359 |
+
"text": "4.1 Policy Network ",
|
| 360 |
+
"text_level": 1,
|
| 361 |
+
"bbox": [
|
| 362 |
+
174,
|
| 363 |
+
609,
|
| 364 |
+
320,
|
| 365 |
+
625
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 3
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "text",
|
| 371 |
+
"text": "We first examine whether pre-trained LMs provide effective initializers when states and action histories are represented as natural language strings. We encode the inputs to the policy—including observations, goals, and action histories—as sequences of words. These word sequences are passed to the LM (using its pre-trained word embedding layer $F _ { \\theta }$ ) and used to obtain contextualized token representations. Token representations are averaged and used to predict actions. We design a policy network following the general policy framework proposed in Figure 1. ",
|
| 372 |
+
"bbox": [
|
| 373 |
+
174,
|
| 374 |
+
635,
|
| 375 |
+
825,
|
| 376 |
+
719
|
| 377 |
+
],
|
| 378 |
+
"page_idx": 3
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"type": "text",
|
| 382 |
+
"text": "Environment encodings in VirtualHome. In VirtualHome, each goal consists of a sequence of predicates and multiplicities, and is translated into a templated English sentence (e.g. “Inside(apple, fridge):2” becomes “put two apples inside the fridge”). To encode the agent’s partial observation, we extract a list of currently visible objects, their states (e.g. “open, clean”), and 3D world coordinates. We use a fully-connected layer to encode the 3D information and generate a feature representation of each object in the observation. To encode history, we store information about all previous actions and convert them into templated English sentences (e.g. “I have put the plate on the kitchen table and the apple inside the fridge”). ",
|
| 383 |
+
"bbox": [
|
| 384 |
+
173,
|
| 385 |
+
724,
|
| 386 |
+
826,
|
| 387 |
+
835
|
| 388 |
+
],
|
| 389 |
+
"page_idx": 3
|
| 390 |
+
},
|
| 391 |
+
{
|
| 392 |
+
"type": "text",
|
| 393 |
+
"text": "Environment encodings in BabyAI. The observation by default is a $7 \\times 7$ grid. We convert the observation into $7 \\times 7$ text descriptions, e.g. “purple ball”, “grey wall”, “open door”, and combine them into a long sentence. We then convert the history actions into text descriptions, e.g. “turn left” and “go forward”. We combine the language instruction (without modification) with the observation and history text descriptions, and feed them to the pre-trained LM. ",
|
| 394 |
+
"bbox": [
|
| 395 |
+
174,
|
| 396 |
+
842,
|
| 397 |
+
825,
|
| 398 |
+
911
|
| 399 |
+
],
|
| 400 |
+
"page_idx": 3
|
| 401 |
+
},
|
| 402 |
+
{
|
| 403 |
+
"type": "text",
|
| 404 |
+
"text": "We note that the policy network described above does not strictly require that these encodings take the form of natural language strings—other encodings of the environment as a sequence also work (see Section $^ { 7 ) }$ . This framework could be also generalized to support pixel-based observations using discretization schemes like the one employed in the Vision Transformer [10]. ",
|
| 405 |
+
"bbox": [
|
| 406 |
+
173,
|
| 407 |
+
90,
|
| 408 |
+
825,
|
| 409 |
+
147
|
| 410 |
+
],
|
| 411 |
+
"page_idx": 4
|
| 412 |
+
},
|
| 413 |
+
{
|
| 414 |
+
"type": "text",
|
| 415 |
+
"text": "Action prediction. We pool LM outputs into a “context representation” that is used to predict the next action. In training, we maximize the probabilities of demonstrated actions. In inference, we select the valid action with the highest probability. See Appendix C.1 for details. ",
|
| 416 |
+
"bbox": [
|
| 417 |
+
173,
|
| 418 |
+
154,
|
| 419 |
+
823,
|
| 420 |
+
196
|
| 421 |
+
],
|
| 422 |
+
"page_idx": 4
|
| 423 |
+
},
|
| 424 |
+
{
|
| 425 |
+
"type": "text",
|
| 426 |
+
"text": "VirtualHome and BabyAI have quite different observation spaces, action spaces, and goal spaces; however, we show that embedding policy inputs as sequences and utilizing the pre-trained LM as a policy initializer, enables effective generalization to novel tasks on both environments. We note that LID is not limited to VirtualHome and BabyAI, but is straightforwardly applicable to other embodied environments, such as ALFRED $\\mathbb { \\left| \\mathrm { \\overline { { 4 0 } } } }\\right|$ and iGibson $\\mathbb { \\lVert 3 9 \\rVert }$ . ",
|
| 427 |
+
"bbox": [
|
| 428 |
+
173,
|
| 429 |
+
200,
|
| 430 |
+
825,
|
| 431 |
+
271
|
| 432 |
+
],
|
| 433 |
+
"page_idx": 4
|
| 434 |
+
},
|
| 435 |
+
{
|
| 436 |
+
"type": "text",
|
| 437 |
+
"text": "4.2 Training ",
|
| 438 |
+
"text_level": 1,
|
| 439 |
+
"bbox": [
|
| 440 |
+
174,
|
| 441 |
+
289,
|
| 442 |
+
274,
|
| 443 |
+
304
|
| 444 |
+
],
|
| 445 |
+
"page_idx": 4
|
| 446 |
+
},
|
| 447 |
+
{
|
| 448 |
+
"type": "text",
|
| 449 |
+
"text": "We first examine LID through imitation learning on data collected by experts in Section $4 . 2 . 1 .$ We then show that integrating an active data gathering procedure into LID enables policy learning without using expert data in Section $4 . 2 . 2 .$ We use VirtualHome as an example to explain the data gathering. ",
|
| 450 |
+
"bbox": [
|
| 451 |
+
174,
|
| 452 |
+
310,
|
| 453 |
+
825,
|
| 454 |
+
354
|
| 455 |
+
],
|
| 456 |
+
"page_idx": 4
|
| 457 |
+
},
|
| 458 |
+
{
|
| 459 |
+
"type": "text",
|
| 460 |
+
"text": "4.2.1 Policy Learning with Expert Data ",
|
| 461 |
+
"text_level": 1,
|
| 462 |
+
"bbox": [
|
| 463 |
+
176,
|
| 464 |
+
369,
|
| 465 |
+
459,
|
| 466 |
+
385
|
| 467 |
+
],
|
| 468 |
+
"page_idx": 4
|
| 469 |
+
},
|
| 470 |
+
{
|
| 471 |
+
"type": "text",
|
| 472 |
+
"text": "The policy model is first initialized from a pre-trained LM and then fine-tuned on data collected by experts. We build on the VirtualHome environment to collect a set of expert trajectories using regression planning $\\pmb { \\mathbb { Z } } 0 \\|$ and create a VirtualHome-Imitation Learning dataset. Given a task described by goal predicates, the planner generates an action sequence to accomplish this task (See Appendix E.1). The planner has access to privileged information, such as information about the pre-conditions and effects of each action, allowing an agent to robustly perform tasks in partially observable environments and generate expert trajectories for training and evaluation. ",
|
| 473 |
+
"bbox": [
|
| 474 |
+
173,
|
| 475 |
+
393,
|
| 476 |
+
825,
|
| 477 |
+
492
|
| 478 |
+
],
|
| 479 |
+
"page_idx": 4
|
| 480 |
+
},
|
| 481 |
+
{
|
| 482 |
+
"type": "text",
|
| 483 |
+
"text": "4.2.2 Policy Learning with Active Data Gathering ",
|
| 484 |
+
"text_level": 1,
|
| 485 |
+
"bbox": [
|
| 486 |
+
174,
|
| 487 |
+
507,
|
| 488 |
+
532,
|
| 489 |
+
522
|
| 490 |
+
],
|
| 491 |
+
"page_idx": 4
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"type": "text",
|
| 495 |
+
"text": "Collecting expert data is sometimes challenging. It may require privileged information of the environment or human annotations, which can be timeconsuming and difficult to scale. A promising way to scale up supervision is Hindsight Experience Replay (HER) [3], which allows agents to learn from orders of magnitude more data without supervision. However, existing HER methods [12] focus on simple tasks with small state/action space and full observability. They cannot tackle more complicated embodied decision-making tasks, requiring nontrivial planning and reasoning or natural language understanding. LID with the active data gathering (LIDADG) can be used in solving tasks in such environments. ",
|
| 496 |
+
"bbox": [
|
| 497 |
+
174,
|
| 498 |
+
532,
|
| 499 |
+
421,
|
| 500 |
+
808
|
| 501 |
+
],
|
| 502 |
+
"page_idx": 4
|
| 503 |
+
},
|
| 504 |
+
{
|
| 505 |
+
"type": "image",
|
| 506 |
+
"img_path": "images/92464930c49a2a45eac39baccf383b0cc641bf8706c9bb6f6e2c786974cf9eed.jpg",
|
| 507 |
+
"image_caption": [
|
| 508 |
+
"Figure 2: LID with the active data gathering procedure. By iteratively repeating the exploration, hindsight relabeling, and policy update, LID with active data gathering can learn an effective policy without using pre-collected expert data. "
|
| 509 |
+
],
|
| 510 |
+
"image_footnote": [],
|
| 511 |
+
"bbox": [
|
| 512 |
+
431,
|
| 513 |
+
536,
|
| 514 |
+
821,
|
| 515 |
+
739
|
| 516 |
+
],
|
| 517 |
+
"page_idx": 4
|
| 518 |
+
},
|
| 519 |
+
{
|
| 520 |
+
"type": "text",
|
| 521 |
+
"text": "As shown in Figure 2, LID-ADG consists of three stages, i.e. exploration, hindsight relabeling, and policy update. The key idea is to gradually improve the task success rate by asking the agent to iteratively explore the environment, relabel failure samples, and update its policy using imitation learning. In the exploration stage, we first randomly sample a goal and an initial state. We then use a mix of random actions and actions generated by the current policy $\\pi _ { \\phi } ( a _ { t } | g , h _ { t } , o _ { t } )$ to obtain the next action. We repeat this process until this episode ends. We collect $M$ trajectories and store them in the replay buffers. The generated actions in the early stages rarely complete the given task. ",
|
| 522 |
+
"bbox": [
|
| 523 |
+
174,
|
| 524 |
+
814,
|
| 525 |
+
825,
|
| 526 |
+
911
|
| 527 |
+
],
|
| 528 |
+
"page_idx": 4
|
| 529 |
+
},
|
| 530 |
+
{
|
| 531 |
+
"type": "text",
|
| 532 |
+
"text": "However, even the failed trajectories contain useful sub-trajectories that solve certain sub-goals. In the hindsight relabeling stage, we extract useful sub-trajectories and relabel a goal $g ^ { \\prime }$ for each of them. We design a goal relabel function $f _ { l }$ that generates a goal based on the sequence of observations and actions using hand-designed templates. In practice, we implement the goal relabel function as a program (see Appendix E.2). The hindsight relabeling stage allows sample-efficient learning by reusing the failure cases. During policy update, the agent samples the data from the replay buffers and updates its policy network $\\pi _ { \\phi }$ . ",
|
| 533 |
+
"bbox": [
|
| 534 |
+
174,
|
| 535 |
+
90,
|
| 536 |
+
825,
|
| 537 |
+
189
|
| 538 |
+
],
|
| 539 |
+
"page_idx": 5
|
| 540 |
+
},
|
| 541 |
+
{
|
| 542 |
+
"type": "text",
|
| 543 |
+
"text": "By interleaving the exploration, hindsight relabeling, and policy update, LID-ADG can gradually improve the policy without requiring pre-collected expert data. In embodied environments with large action spaces, sparse rewards, and long-horizon planning, RL methods often struggle to obtain stable policy gradients during training. Our method enables sample-efficient learning from the sparse rewards by relabeling new goals for the bad samples that the agent fails to achieve. In addition, LID-ADG leverages the stability of supervised learning in the policy update stage, enabling it to outperform RL approaches on a wide range of decision-making tasks. ",
|
| 544 |
+
"bbox": [
|
| 545 |
+
174,
|
| 546 |
+
194,
|
| 547 |
+
825,
|
| 548 |
+
291
|
| 549 |
+
],
|
| 550 |
+
"page_idx": 5
|
| 551 |
+
},
|
| 552 |
+
{
|
| 553 |
+
"type": "text",
|
| 554 |
+
"text": "5 Experiment Setup ",
|
| 555 |
+
"text_level": 1,
|
| 556 |
+
"bbox": [
|
| 557 |
+
174,
|
| 558 |
+
313,
|
| 559 |
+
356,
|
| 560 |
+
330
|
| 561 |
+
],
|
| 562 |
+
"page_idx": 5
|
| 563 |
+
},
|
| 564 |
+
{
|
| 565 |
+
"type": "text",
|
| 566 |
+
"text": "We evaluate the proposed method and baselines on VirtualHome and BabyAI. ",
|
| 567 |
+
"bbox": [
|
| 568 |
+
173,
|
| 569 |
+
339,
|
| 570 |
+
681,
|
| 571 |
+
354
|
| 572 |
+
],
|
| 573 |
+
"page_idx": 5
|
| 574 |
+
},
|
| 575 |
+
{
|
| 576 |
+
"type": "text",
|
| 577 |
+
"text": "5.1 VirtualHome ",
|
| 578 |
+
"text_level": 1,
|
| 579 |
+
"bbox": [
|
| 580 |
+
174,
|
| 581 |
+
369,
|
| 582 |
+
305,
|
| 583 |
+
383
|
| 584 |
+
],
|
| 585 |
+
"page_idx": 5
|
| 586 |
+
},
|
| 587 |
+
{
|
| 588 |
+
"type": "text",
|
| 589 |
+
"text": "VirtualHome is a 3D embodied environment featuring partial observability, large action spaces, and long time horizons. We evaluate policies’ performance from three aspects: (1) performance on in-distribution tasks; (2) generalization to novel scenes; and (3) generalization to novel tasks. ",
|
| 590 |
+
"bbox": [
|
| 591 |
+
174,
|
| 592 |
+
396,
|
| 593 |
+
823,
|
| 594 |
+
438
|
| 595 |
+
],
|
| 596 |
+
"page_idx": 5
|
| 597 |
+
},
|
| 598 |
+
{
|
| 599 |
+
"type": "text",
|
| 600 |
+
"text": "In-Distribution. The predicate types and their counts in the goal are randomly sampled from the same distribution as the training data. The objects are initially placed in the environment according to common-sense layouts (e.g. plates appear inside the kitchen cabinets rather than the bathtub). ",
|
| 601 |
+
"bbox": [
|
| 602 |
+
174,
|
| 603 |
+
444,
|
| 604 |
+
825,
|
| 605 |
+
486
|
| 606 |
+
],
|
| 607 |
+
"page_idx": 5
|
| 608 |
+
},
|
| 609 |
+
{
|
| 610 |
+
"type": "text",
|
| 611 |
+
"text": "Novel Scenes. The objects are placed in random positions in the initial environment without commonsense constraints (e.g. apples may appear inside the dishwasher). ",
|
| 612 |
+
"bbox": [
|
| 613 |
+
171,
|
| 614 |
+
492,
|
| 615 |
+
823,
|
| 616 |
+
520
|
| 617 |
+
],
|
| 618 |
+
"page_idx": 5
|
| 619 |
+
},
|
| 620 |
+
{
|
| 621 |
+
"type": "text",
|
| 622 |
+
"text": "Novel Tasks. The components of all goal predicates are never seen together during training (e.g. both plates and fridges appear in training goals, but Inside(plate, fridge) only appears in the test set. (See Appendix $\\bar { \\underline { { \\mathbf { F } } } }$ for more details.) ",
|
| 623 |
+
"bbox": [
|
| 624 |
+
174,
|
| 625 |
+
526,
|
| 626 |
+
821,
|
| 627 |
+
569
|
| 628 |
+
],
|
| 629 |
+
"page_idx": 5
|
| 630 |
+
},
|
| 631 |
+
{
|
| 632 |
+
"type": "text",
|
| 633 |
+
"text": "We evaluate the success rates of different methods on each test set. A given episode is scored as successful if the policy completes its entire goal within the maximum allowed steps of the environment. On each of the 3 test subsets, we use 5 different random seeds and test 100 tasks under each seed. Thus there are 1500 examples used to evaluate each model. ",
|
| 634 |
+
"bbox": [
|
| 635 |
+
174,
|
| 636 |
+
575,
|
| 637 |
+
826,
|
| 638 |
+
631
|
| 639 |
+
],
|
| 640 |
+
"page_idx": 5
|
| 641 |
+
},
|
| 642 |
+
{
|
| 643 |
+
"type": "text",
|
| 644 |
+
"text": "5.2 BabyAI ",
|
| 645 |
+
"text_level": 1,
|
| 646 |
+
"bbox": [
|
| 647 |
+
174,
|
| 648 |
+
645,
|
| 649 |
+
267,
|
| 650 |
+
660
|
| 651 |
+
],
|
| 652 |
+
"page_idx": 5
|
| 653 |
+
},
|
| 654 |
+
{
|
| 655 |
+
"type": "text",
|
| 656 |
+
"text": "BabyAI is a 2D grid world environment for instruction following. Observations in BabyAI are $7 \\times 7 \\times 3$ grids describing a partial and local egocentric view of the state of the environment. We evaluate the methods on four representative tasks: GoToRedBall, GoToLocal, PickupLoc, and PutNextLocal. Performing well on the test set requires the models to generalize to new environment layouts and goals, resulting in new combinations of tasks not seen in training. For each method, we compute success rates over 500 episodes on each task. ",
|
| 657 |
+
"bbox": [
|
| 658 |
+
174,
|
| 659 |
+
669,
|
| 660 |
+
825,
|
| 661 |
+
751
|
| 662 |
+
],
|
| 663 |
+
"page_idx": 5
|
| 664 |
+
},
|
| 665 |
+
{
|
| 666 |
+
"type": "text",
|
| 667 |
+
"text": "6 Experiments ",
|
| 668 |
+
"text_level": 1,
|
| 669 |
+
"bbox": [
|
| 670 |
+
174,
|
| 671 |
+
773,
|
| 672 |
+
312,
|
| 673 |
+
791
|
| 674 |
+
],
|
| 675 |
+
"page_idx": 5
|
| 676 |
+
},
|
| 677 |
+
{
|
| 678 |
+
"type": "text",
|
| 679 |
+
"text": "We first show results of the proposed method and baselines for embodied decision-making tasks using expert data in Section $\\boxed { 6 . 1 }$ We then show our results when using actively gathered data in Section $6 . { \\overset { \\vartriangle } { 6 } }$ ",
|
| 680 |
+
"bbox": [
|
| 681 |
+
173,
|
| 682 |
+
803,
|
| 683 |
+
825,
|
| 684 |
+
832
|
| 685 |
+
],
|
| 686 |
+
"page_idx": 5
|
| 687 |
+
},
|
| 688 |
+
{
|
| 689 |
+
"type": "text",
|
| 690 |
+
"text": "6.1 Embodied Decision Making with Pre-trained Language Model (LID) ",
|
| 691 |
+
"text_level": 1,
|
| 692 |
+
"bbox": [
|
| 693 |
+
173,
|
| 694 |
+
845,
|
| 695 |
+
692,
|
| 696 |
+
861
|
| 697 |
+
],
|
| 698 |
+
"page_idx": 5
|
| 699 |
+
},
|
| 700 |
+
{
|
| 701 |
+
"type": "text",
|
| 702 |
+
"text": "6.1.1 Results on VirtualHome ",
|
| 703 |
+
"text_level": 1,
|
| 704 |
+
"bbox": [
|
| 705 |
+
174,
|
| 706 |
+
872,
|
| 707 |
+
393,
|
| 708 |
+
887
|
| 709 |
+
],
|
| 710 |
+
"page_idx": 5
|
| 711 |
+
},
|
| 712 |
+
{
|
| 713 |
+
"type": "text",
|
| 714 |
+
"text": "We evaluate the following methods: ",
|
| 715 |
+
"bbox": [
|
| 716 |
+
176,
|
| 717 |
+
897,
|
| 718 |
+
408,
|
| 719 |
+
911
|
| 720 |
+
],
|
| 721 |
+
"page_idx": 5
|
| 722 |
+
},
|
| 723 |
+
{
|
| 724 |
+
"type": "image",
|
| 725 |
+
"img_path": "images/a9e31f69c046893e2bf632ce0fd80c8098718ad62f60c6511e23c38f3bf99452.jpg",
|
| 726 |
+
"image_caption": [
|
| 727 |
+
"Figure 3: Comparisons of the proposed method and baselines on VirtualHome. All the methods are trained on expert data using imitation learning. MLP-1, MLP, and LSTM are baselines without using the pre-trained LM. The proposed method, LID-Text (Ours), outperforms all baselines. "
|
| 728 |
+
],
|
| 729 |
+
"image_footnote": [],
|
| 730 |
+
"bbox": [
|
| 731 |
+
176,
|
| 732 |
+
89,
|
| 733 |
+
501,
|
| 734 |
+
214
|
| 735 |
+
],
|
| 736 |
+
"page_idx": 6
|
| 737 |
+
},
|
| 738 |
+
{
|
| 739 |
+
"type": "table",
|
| 740 |
+
"img_path": "images/a684dd6872b9d587b3773eb23f62bf1c7b917908ca7c8acdf9fc26dc447d6cfe.jpg",
|
| 741 |
+
"table_caption": [
|
| 742 |
+
"Table 1: Success rates on BabyAI tasks. All the methods are trained on offline expert data using imitation learning. LID-Text (Ours) outperforms BabyAIOri, the method used in the original paper [16]. "
|
| 743 |
+
],
|
| 744 |
+
"table_footnote": [],
|
| 745 |
+
"table_body": "<table><tr><td>Tasks</td><td>Methods</td><td colspan=\"3\">Number of Demos</td></tr><tr><td></td><td></td><td>100 500 1K</td><td>5K</td><td>10K</td></tr><tr><td>GoToRedBall</td><td>BabyAI-Ori 国 LID-Text (Ours)</td><td>81.0 96.0 99.0 93.999.4 99.7</td><td>99.5 100.0</td><td>99.9 100.0</td></tr><tr><td>GoToLocal</td><td>BabyAI-Ori 国 LID-Text (Ours) </td><td>55.9 84.3 98.6 64.6 97.9 99.0</td><td>99.9 99.5</td><td>99.8 99.5</td></tr><tr><td>PickupLoc</td><td>BabyAI-Ori[16 LID-Text (0urs) 28.7 73.4 99.0</td><td>28.0 58.0 93.3</td><td>97.9 99.6</td><td>99.8 99.8</td></tr><tr><td>PutNextLocal</td><td>BabyAI-Ori 国 LID-Text (Ours)</td><td>14.3 16.8 43.4 11.1 93.0 93.2</td><td>81.2 98.9</td><td>97.7 99.9</td></tr></table>",
|
| 746 |
+
"bbox": [
|
| 747 |
+
513,
|
| 748 |
+
97,
|
| 749 |
+
823,
|
| 750 |
+
232
|
| 751 |
+
],
|
| 752 |
+
"page_idx": 6
|
| 753 |
+
},
|
| 754 |
+
{
|
| 755 |
+
"type": "text",
|
| 756 |
+
"text": "LID-Text (Ours) is the proposed method that converts all environments inputs into text descriptions. The pre-trained LM is fine-tuned for decision-making (conditioned on goals, observations, and histories) as described in Section 4.1. ",
|
| 757 |
+
"bbox": [
|
| 758 |
+
174,
|
| 759 |
+
311,
|
| 760 |
+
826,
|
| 761 |
+
354
|
| 762 |
+
],
|
| 763 |
+
"page_idx": 6
|
| 764 |
+
},
|
| 765 |
+
{
|
| 766 |
+
"type": "text",
|
| 767 |
+
"text": "Recurrent Network. We compare our method with a recurrent baseline using an LSTM $\\mathbb { \\lVert \\underline { { 4 } } \\rVert }$ to encode the history information. The hidden representation from the last timestep, together with the goal and current observation, are used to predict the next action. ",
|
| 768 |
+
"bbox": [
|
| 769 |
+
174,
|
| 770 |
+
359,
|
| 771 |
+
825,
|
| 772 |
+
401
|
| 773 |
+
],
|
| 774 |
+
"page_idx": 6
|
| 775 |
+
},
|
| 776 |
+
{
|
| 777 |
+
"type": "text",
|
| 778 |
+
"text": "MLP and MLP-1. We perform additional comparisons with baselines that do not use recurrent networks or pre-trained LMs. MLP and MLP-1 take the goal, histories, and the current observation as input and send them to the multilayer perceptron neural network (MLP) to predict actions. MLP-1 has three more average-pooling layers than $M L P$ that average the features of tokens in the goal, history actions, and the current observation, respectively, before sending them to the MLP layer. ",
|
| 779 |
+
"bbox": [
|
| 780 |
+
174,
|
| 781 |
+
407,
|
| 782 |
+
825,
|
| 783 |
+
478
|
| 784 |
+
],
|
| 785 |
+
"page_idx": 6
|
| 786 |
+
},
|
| 787 |
+
{
|
| 788 |
+
"type": "text",
|
| 789 |
+
"text": "Quantitative results. Each method is trained on $2 0 K$ demos from the VirtualHome-Imitation Learning dataset, and then evaluated on the three test subsets: In-Distribution, Novel Scenes, and Novel Tasks. In Figure $\\textcircled{3}$ LID-Text (Ours), which initializes the policy with a pre-trained LM, has higher success rates than other methods. This difference is most pronounced in the Novel Tasks setting, where test tasks require combinatorial generalization across goals that are never seen during training. Here, LID-Text (Ours) dramatically $( 4 3 . 6 \\% )$ improves upon all baselines. Such combinatorial generalization is necessary to construct general purpose agents, but is often difficult for existing approaches. Our results suggest that pre-trained LMs can serve as a computational backbone for combinatorial generalization. ",
|
| 790 |
+
"bbox": [
|
| 791 |
+
173,
|
| 792 |
+
483,
|
| 793 |
+
825,
|
| 794 |
+
608
|
| 795 |
+
],
|
| 796 |
+
"page_idx": 6
|
| 797 |
+
},
|
| 798 |
+
{
|
| 799 |
+
"type": "text",
|
| 800 |
+
"text": "6.1.2 Results on BabyAI ",
|
| 801 |
+
"text_level": 1,
|
| 802 |
+
"bbox": [
|
| 803 |
+
174,
|
| 804 |
+
626,
|
| 805 |
+
356,
|
| 806 |
+
640
|
| 807 |
+
],
|
| 808 |
+
"page_idx": 6
|
| 809 |
+
},
|
| 810 |
+
{
|
| 811 |
+
"type": "text",
|
| 812 |
+
"text": "We use the standard training and test data provided by [16]. In BabyAI, performing well on unseen test tasks with new environment layouts and goals requires combinatorial reasoning. In Table $\\bigstar$ we report the success rate of models trained on different number of demos. BabyAI-Ori [16] is the method used in the original paper. LID-Text (Ours) is the proposed method that converts policy inputs into a text sequence. Given enough training data, i.e. 10K demos, both methods achieve high success rates, but LID-Text (Ours) outperforms BabyAI-Ori with less training data, indicating the proposed method improves sample efficiency when generalizing to novel tasks. ",
|
| 813 |
+
"bbox": [
|
| 814 |
+
173,
|
| 815 |
+
650,
|
| 816 |
+
825,
|
| 817 |
+
747
|
| 818 |
+
],
|
| 819 |
+
"page_idx": 6
|
| 820 |
+
},
|
| 821 |
+
{
|
| 822 |
+
"type": "text",
|
| 823 |
+
"text": "6.2 Pre-trained Language Model with Active Data Gathering (LID-ADG) ",
|
| 824 |
+
"text_level": 1,
|
| 825 |
+
"bbox": [
|
| 826 |
+
176,
|
| 827 |
+
767,
|
| 828 |
+
699,
|
| 829 |
+
782
|
| 830 |
+
],
|
| 831 |
+
"page_idx": 6
|
| 832 |
+
},
|
| 833 |
+
{
|
| 834 |
+
"type": "text",
|
| 835 |
+
"text": "We compare LID-ADG, the proposed LM framework for decision-making using actively gathered data (Section $\\boxed { 4 . 2 . 2 }$ , to a variety of baselines that do not use pre-collected expert data on VirtualHome. ",
|
| 836 |
+
"bbox": [
|
| 837 |
+
173,
|
| 838 |
+
792,
|
| 839 |
+
823,
|
| 840 |
+
821
|
| 841 |
+
],
|
| 842 |
+
"page_idx": 6
|
| 843 |
+
},
|
| 844 |
+
{
|
| 845 |
+
"type": "text",
|
| 846 |
+
"text": "Random. The agent selects the next action randomly from the valid action space at that state. Goal-Object. The agent randomly selects an object that in the goal and in the valid action space to interact with. For example, given a goal of “Inside(apple, fridge):1”, this baseline might choose “grab apple”, “open fridge”, or other actions containing “apple” or “fridge”. Online RL. We compare with PPO $\\pmb { \\mathbb { B 7 } }$ , one of the most commonly used online RL methods. For fair comparison, we equip PPO with the same main policy network as the proposed method. Our implementation is ",
|
| 847 |
+
"bbox": [
|
| 848 |
+
174,
|
| 849 |
+
828,
|
| 850 |
+
825,
|
| 851 |
+
911
|
| 852 |
+
],
|
| 853 |
+
"page_idx": 6
|
| 854 |
+
},
|
| 855 |
+
{
|
| 856 |
+
"type": "table",
|
| 857 |
+
"img_path": "images/9a9ab00c81bb695a706a8e1e3c989c55ca31b352d5773afd374a4aaf6af97074.jpg",
|
| 858 |
+
"table_caption": [
|
| 859 |
+
"Table 2: Comparisons of methods without using expert data on VirtualHome. LID-ADG (Ours) is the only successful approach. "
|
| 860 |
+
],
|
| 861 |
+
"table_footnote": [],
|
| 862 |
+
"table_body": "<table><tr><td>In-Distribution Novel Scenes Novel Tasks</td></tr><tr><td>Random</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>Goal-Object</td><td>0.8±0.5 0.0±0.0</td><td>0.4±0.4</td></tr><tr><td>PPO</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>DQN+HER</td><td>0.0±0.0 0.0±0.0</td><td>0.0±0.0</td></tr><tr><td>LID-ADG (Ours)</td><td>46.7 ± 2.7 32.2 ± 3.3</td><td>25.5± 4.1</td></tr></table>",
|
| 863 |
+
"bbox": [
|
| 864 |
+
179,
|
| 865 |
+
88,
|
| 866 |
+
482,
|
| 867 |
+
161
|
| 868 |
+
],
|
| 869 |
+
"page_idx": 7
|
| 870 |
+
},
|
| 871 |
+
{
|
| 872 |
+
"type": "table",
|
| 873 |
+
"img_path": "images/b3a90574d44c48f84293c935d7a8c690120ad2a055e685d8ef039f2de3294ffe.jpg",
|
| 874 |
+
"table_caption": [],
|
| 875 |
+
"table_footnote": [],
|
| 876 |
+
"table_body": "<table><tr><td></td><td>In-Distribution Novel Scenes Novel Tasks</td><td></td></tr><tr><td>LID-ADG (Ours)</td><td>46.7 ± 2.7</td><td>32.2 ± 3.3 25.5 ± 4.1</td></tr><tr><td>PPO (LID-ADG Init)</td><td>53.7± 3.5 30.2±3.4</td><td>27.8± 2.7</td></tr><tr><td>DT (LID-ADG Data)</td><td>42.4 ± 1.5</td><td>21.6 ± 2.48 16.8 ± 1.0</td></tr></table>",
|
| 877 |
+
"bbox": [
|
| 878 |
+
495,
|
| 879 |
+
95,
|
| 880 |
+
820,
|
| 881 |
+
150
|
| 882 |
+
],
|
| 883 |
+
"page_idx": 7
|
| 884 |
+
},
|
| 885 |
+
{
|
| 886 |
+
"type": "text",
|
| 887 |
+
"text": "Table 3: The proposed method with active data gathering, LID-ADG (Ours), can be used as an policy initializer for online RL or a data provider for offline RL. ",
|
| 888 |
+
"bbox": [
|
| 889 |
+
493,
|
| 890 |
+
157,
|
| 891 |
+
820,
|
| 892 |
+
196
|
| 893 |
+
],
|
| 894 |
+
"page_idx": 7
|
| 895 |
+
},
|
| 896 |
+
{
|
| 897 |
+
"type": "text",
|
| 898 |
+
"text": "based on Stable Baselines3 [35]. Hindsight Experience Replay. We compare with DQN+HER used in [3] and modify its main policy network to be the same as the proposed method. ",
|
| 899 |
+
"bbox": [
|
| 900 |
+
173,
|
| 901 |
+
219,
|
| 902 |
+
823,
|
| 903 |
+
248
|
| 904 |
+
],
|
| 905 |
+
"page_idx": 7
|
| 906 |
+
},
|
| 907 |
+
{
|
| 908 |
+
"type": "text",
|
| 909 |
+
"text": "Quantitative results. We compare LID-ADG with baselines on VirtualHome in Table 2. Each experiment is performed 5 times with different random seeds. The Random baseline is always 0, indicating the tasks in VirtualHome cannot be easily solved by a random policy. Goal-Object is better than Random because Goal-Object has access to objects in the goal and it samples actions from a much smaller action space. The online RL baseline, PPO, fails to solve tasks in VirtualHome featured by partially observation, large state/action space, and long-term horizon. $\\mathbf { D Q N + H E R }$ works well on simple tasks on 2D environments, but they cannot tackle VirtualHome tasks neither, requiring nontrivial planning and reasoning. LID-ADG does not require expert data and can solve the complicated tasks in 3D embodied environments which cannot be easily achieved using RL. ",
|
| 910 |
+
"bbox": [
|
| 911 |
+
173,
|
| 912 |
+
253,
|
| 913 |
+
825,
|
| 914 |
+
380
|
| 915 |
+
],
|
| 916 |
+
"page_idx": 7
|
| 917 |
+
},
|
| 918 |
+
{
|
| 919 |
+
"type": "text",
|
| 920 |
+
"text": "Policy initializer and data provider. LID-ADG can further be used to initialize the weights for finetuning RL policies and to gather data for offline learning. As shown in Table 2, directly training RL, e.g. PPO, fails to solve tasks in VirtualHome. However, after using the policy trained by LID-ADG to initialize the PPO policy, we may effectively learn an interactive policy with good performance. In Table 3, PPO (LID-ADG Init) is initialized from LID-ADG and further fine-tuned to solve the tasks in VirtualHome. After initialization, PPO improves its success rate by $5 3 . 7 \\%$ on the In-Distribution setting (See PPO results in Table $2$ and Table $\\mathsf { \\bar { \\rho } } _ { 3 ) }$ . In addition, LID-ADG can provide data for offline learning. LID-ADG saves the relabeled data in replay buffers. We train Decision Transformer (DT) [7] using the data collected by LID-ADG. See DT (LID-ADG Data) in Table 3. ",
|
| 921 |
+
"bbox": [
|
| 922 |
+
173,
|
| 923 |
+
385,
|
| 924 |
+
826,
|
| 925 |
+
511
|
| 926 |
+
],
|
| 927 |
+
"page_idx": 7
|
| 928 |
+
},
|
| 929 |
+
{
|
| 930 |
+
"type": "text",
|
| 931 |
+
"text": "7 Analysis: Understanding the Sources of Generalization ",
|
| 932 |
+
"text_level": 1,
|
| 933 |
+
"bbox": [
|
| 934 |
+
174,
|
| 935 |
+
530,
|
| 936 |
+
663,
|
| 937 |
+
549
|
| 938 |
+
],
|
| 939 |
+
"page_idx": 7
|
| 940 |
+
},
|
| 941 |
+
{
|
| 942 |
+
"type": "text",
|
| 943 |
+
"text": "The pre-trained LM policy, fine-tuned on either expert data or actively gathered data, exhibits effective combinatorial generalization. Is this simply because LMs are effective models of relations between natural language descriptions of states and actions $\\mathbb { M }$ , or because they provide a more general framework for combinatorial generalization in decision-making? We hypothesize and investigate three possible factors to understand the sources of such combinatorial generalization. We use policies trained on the expert data as an example to explain the experiments. ",
|
| 944 |
+
"bbox": [
|
| 945 |
+
173,
|
| 946 |
+
563,
|
| 947 |
+
825,
|
| 948 |
+
647
|
| 949 |
+
],
|
| 950 |
+
"page_idx": 7
|
| 951 |
+
},
|
| 952 |
+
{
|
| 953 |
+
"type": "text",
|
| 954 |
+
"text": "7.1 Input Encoding Scheme ",
|
| 955 |
+
"text_level": 1,
|
| 956 |
+
"bbox": [
|
| 957 |
+
174,
|
| 958 |
+
665,
|
| 959 |
+
379,
|
| 960 |
+
680
|
| 961 |
+
],
|
| 962 |
+
"page_idx": 7
|
| 963 |
+
},
|
| 964 |
+
{
|
| 965 |
+
"type": "text",
|
| 966 |
+
"text": "We first hypothesize that converting environment inputs into natural language contributes to the combinatorial generalization as the LMs are trained on language data. We explore the role of natural language by investigating three alternative ways of encoding policy inputs to our model without using natural language strings: two in VirtualHome, and one in BabyAI. BabyAI results are in Appendix A. ",
|
| 967 |
+
"bbox": [
|
| 968 |
+
173,
|
| 969 |
+
691,
|
| 970 |
+
825,
|
| 971 |
+
747
|
| 972 |
+
],
|
| 973 |
+
"page_idx": 7
|
| 974 |
+
},
|
| 975 |
+
{
|
| 976 |
+
"type": "text",
|
| 977 |
+
"text": "Index encoding in VirtualHome. Rather than natural language strings, LID-Index (Ours) converts policy inputs into integer indices. LID-Index (Ours) retains the discrete, serial format of the goal, history, and observation, but replaces each word with an integer, and replaces the embedding layer from the pre-trained LM with a new embedding layer trained from scratch. For example, grab apple is mapped to (5,3) based on the positions of grab and apple in the vocabulary set. ",
|
| 978 |
+
"bbox": [
|
| 979 |
+
173,
|
| 980 |
+
753,
|
| 981 |
+
825,
|
| 982 |
+
824
|
| 983 |
+
],
|
| 984 |
+
"page_idx": 7
|
| 985 |
+
},
|
| 986 |
+
{
|
| 987 |
+
"type": "text",
|
| 988 |
+
"text": "Unnatural string encoding in VirtualHome. LID-Unnatural (Ours) replaces the natural language tokens (e.g. converting the goal “On(fork, table):1” to put one fork on the table) with random ones (e.g. converting On(fork, table) to brought wise character trees fine yet). This is done by randomly permuting the entire vocabulary, mapping each token to a new token. Such a permutation breaks the semantic information in natural strings. ",
|
| 989 |
+
"bbox": [
|
| 990 |
+
176,
|
| 991 |
+
829,
|
| 992 |
+
823,
|
| 993 |
+
872
|
| 994 |
+
],
|
| 995 |
+
"page_idx": 7
|
| 996 |
+
},
|
| 997 |
+
{
|
| 998 |
+
"type": "table",
|
| 999 |
+
"img_path": "images/8738b48e4a69e1a79dd05c344f47f40bb195a91d1853b7c0f9b51834cbcbc081.jpg",
|
| 1000 |
+
"table_caption": [
|
| 1001 |
+
"Table 4: Success rates of policies trained with different input encodings in the Novel Tasks setting on VirtualHome. The text encoding is the most sample-efficient, but all models converge to similar performance given sufficient training data. "
|
| 1002 |
+
],
|
| 1003 |
+
"table_footnote": [],
|
| 1004 |
+
"table_body": "<table><tr><td>Methods</td><td colspan=\"6\">Number of Demos</td></tr><tr><td></td><td>100</td><td>500</td><td>1K</td><td>5K</td><td>10K</td><td>20K</td></tr><tr><td>LID-Text (Ours)</td><td>8.8 ± 1.4</td><td>22.2 ±1.7</td><td>26.8 ±1.0</td><td>46.0 ± 1.0</td><td>58.2 ±1.2</td><td>58.2 ±1.6</td></tr><tr><td>LID-Index (Ours)</td><td>6.4 ± 0.6</td><td>18.0±3.8</td><td>18.8 ±1.0</td><td>45.5± 2.1</td><td>54.6 ± 0.8</td><td>57.8 ± 0.9</td></tr><tr><td>LID-Unnatural (Ours)</td><td>6.8 ±1.3</td><td>18.6 ± 2.1</td><td>27.0 ± 1.1</td><td>47.2 ± 1.7</td><td>55.8 ± 0.8</td><td>58.8 ± 0.9</td></tr></table>",
|
| 1005 |
+
"bbox": [
|
| 1006 |
+
217,
|
| 1007 |
+
136,
|
| 1008 |
+
776,
|
| 1009 |
+
209
|
| 1010 |
+
],
|
| 1011 |
+
"page_idx": 8
|
| 1012 |
+
},
|
| 1013 |
+
{
|
| 1014 |
+
"type": "text",
|
| 1015 |
+
"text": "",
|
| 1016 |
+
"bbox": [
|
| 1017 |
+
174,
|
| 1018 |
+
226,
|
| 1019 |
+
823,
|
| 1020 |
+
253
|
| 1021 |
+
],
|
| 1022 |
+
"page_idx": 8
|
| 1023 |
+
},
|
| 1024 |
+
{
|
| 1025 |
+
"type": "text",
|
| 1026 |
+
"text": "LID-Index (Ours) and LID-Unnatural (Ours) have the same policy network as LID-Text (Ours). All are fine-tuned on the expert data. The averaged results using 5 different random seeds on the Novel Tasks setting are reported in Table $\\textcircled { 4 }$ Given few training data, e.g. 100 demos, all the models perform poorly, with success rates lower than $1 0 \\%$ . LID-Text (Ours) achieves higher success rates than LID-Index (Ours) and LID-Unnatural (Ours) when dataset size increases, e.g. LID-Text (Ours) is around $4 \\%$ higher than LID-Index (Ours) and LID-Unnatural (Ours) with 500 training demos. When the training dataset is further enlarged, e.g. 20K demos, success rates of all approaches reach similar performance. This result indicates that the effectiveness of pre-trained LMs in compositional generalization is not unique to natural language strings, but can be leveraged from arbitrary encodings, although adapting the model to arbitrary encodings may require more training data. ",
|
| 1027 |
+
"bbox": [
|
| 1028 |
+
173,
|
| 1029 |
+
258,
|
| 1030 |
+
826,
|
| 1031 |
+
398
|
| 1032 |
+
],
|
| 1033 |
+
"page_idx": 8
|
| 1034 |
+
},
|
| 1035 |
+
{
|
| 1036 |
+
"type": "text",
|
| 1037 |
+
"text": "7.2 Sequential Input Representation ",
|
| 1038 |
+
"text_level": 1,
|
| 1039 |
+
"bbox": [
|
| 1040 |
+
174,
|
| 1041 |
+
417,
|
| 1042 |
+
439,
|
| 1043 |
+
433
|
| 1044 |
+
],
|
| 1045 |
+
"page_idx": 8
|
| 1046 |
+
},
|
| 1047 |
+
{
|
| 1048 |
+
"type": "text",
|
| 1049 |
+
"text": "Next, we explore whether generalization requires the sequential processing mechanisms in transformer-based LMs. We investigate whether the LM pre-trained policy will still be effective when the input encoding is not sequential. No-Seq encodes the goal as a single vector by averaging all goal embeddings. History and observation features are obtained in the same way. All features are then sent to the pre-trained LM to predict actions. As shown in Table $5 ,$ removing sequential structure significantly hurts performance on Novel Tasks. No",
|
| 1050 |
+
"bbox": [
|
| 1051 |
+
174,
|
| 1052 |
+
444,
|
| 1053 |
+
508,
|
| 1054 |
+
595
|
| 1055 |
+
],
|
| 1056 |
+
"page_idx": 8
|
| 1057 |
+
},
|
| 1058 |
+
{
|
| 1059 |
+
"type": "table",
|
| 1060 |
+
"img_path": "images/439c8225217aa4ef998605181e13a7bcdbeb613cfa7db52b8e403fe1f19f7c9f.jpg",
|
| 1061 |
+
"table_caption": [
|
| 1062 |
+
"Table 5: Experiments on sequential inputs and weight initialization. Fine-tuning the pre-trained weights and the usage of sequential encoding are important for combinatorial generalization. "
|
| 1063 |
+
],
|
| 1064 |
+
"table_footnote": [],
|
| 1065 |
+
"table_body": "<table><tr><td colspan=\"2\">In-Distribution</td><td>Novel Tasks</td></tr><tr><td>LID-Text (Ours)</td><td>87.6 ± 1.9</td><td>58.2 ± 2.3</td></tr><tr><td>No-Seq</td><td>74.0 ± 2.3</td><td>2.0± 0.6</td></tr><tr><td>No-Pretrain</td><td>90.8 ± 2.0</td><td>47.0 ±2.8</td></tr><tr><td>No-FT</td><td>51.2 ± 4.5</td><td>17.0 ± 2.9</td></tr></table>",
|
| 1066 |
+
"bbox": [
|
| 1067 |
+
524,
|
| 1068 |
+
502,
|
| 1069 |
+
826,
|
| 1070 |
+
582
|
| 1071 |
+
],
|
| 1072 |
+
"page_idx": 8
|
| 1073 |
+
},
|
| 1074 |
+
{
|
| 1075 |
+
"type": "text",
|
| 1076 |
+
"text": "Seq achieves good performance on test tasks that are closer to training tasks, but cannot generalize well to more challenging unseen tasks. Thus, combinatorial generalization in pre-trained LMs may be attributed in part to transformers’ ability to process sequential input representations effectively. ",
|
| 1077 |
+
"bbox": [
|
| 1078 |
+
174,
|
| 1079 |
+
597,
|
| 1080 |
+
826,
|
| 1081 |
+
637
|
| 1082 |
+
],
|
| 1083 |
+
"page_idx": 8
|
| 1084 |
+
},
|
| 1085 |
+
{
|
| 1086 |
+
"type": "text",
|
| 1087 |
+
"text": "7.3 Favorable Weight Initialization ",
|
| 1088 |
+
"text_level": 1,
|
| 1089 |
+
"bbox": [
|
| 1090 |
+
176,
|
| 1091 |
+
656,
|
| 1092 |
+
428,
|
| 1093 |
+
671
|
| 1094 |
+
],
|
| 1095 |
+
"page_idx": 8
|
| 1096 |
+
},
|
| 1097 |
+
{
|
| 1098 |
+
"type": "text",
|
| 1099 |
+
"text": "Finally, we investigate if the favorable weight initialization from LM pre-training enables effective generalization of the proposed model. No-Pretrain does not initialize the policy using the pre-trained LM, but instead training the policy on the expert data from scratch. In Table $5 ,$ we find that removing the pre-trained weights can fit the in-domain data and thus performs well on the In-Distribution setting. However, its success rate is $1 1 . 2 \\%$ lower than the proposed model on the Novel Tasks setting, indicating the pre-trained weights are important for effective generalization, but not necessary for effective data fitting. We further test a baseline, No-FT, that keeps the pre-trained weights of the language model but freezes them while training the rest model on our expert data. Freezing the pretrained weights without fine-tuning significantly hurts the performance on both settings, suggesting that fine-tuning of the transformer weights is essential for effective combinatorial generalization. ",
|
| 1100 |
+
"bbox": [
|
| 1101 |
+
173,
|
| 1102 |
+
683,
|
| 1103 |
+
825,
|
| 1104 |
+
821
|
| 1105 |
+
],
|
| 1106 |
+
"page_idx": 8
|
| 1107 |
+
},
|
| 1108 |
+
{
|
| 1109 |
+
"type": "text",
|
| 1110 |
+
"text": "Together, these results suggest that sequential input representations (vs. fixed-dimensional feature vectors) and favorable weight initialization are both important for generalization, however, the input encoding schemes (e.g. as a natural language string vs. an arbitrary encoding scheme) has little influence. These results point to the potential broader applicability of pre-trained LMs as a computational backbone for compositional embodied decision making, where arbitrary inputs, such as language, images, or grids, may be converted to sequential encodings. ",
|
| 1111 |
+
"bbox": [
|
| 1112 |
+
174,
|
| 1113 |
+
828,
|
| 1114 |
+
823,
|
| 1115 |
+
911
|
| 1116 |
+
],
|
| 1117 |
+
"page_idx": 8
|
| 1118 |
+
},
|
| 1119 |
+
{
|
| 1120 |
+
"type": "image",
|
| 1121 |
+
"img_path": "images/f8aa180f8eaafe5ce642d2c03f4ce3aa2f8886c67e45582301e5f08266c90b8f.jpg",
|
| 1122 |
+
"image_caption": [
|
| 1123 |
+
"Figure 4: Qualitative results of our model on VirtualHome and BabyAI. We only show a sub-trajectory in each example to save space. The interacted objects are labelled by green bounding boxes. "
|
| 1124 |
+
],
|
| 1125 |
+
"image_footnote": [],
|
| 1126 |
+
"bbox": [
|
| 1127 |
+
173,
|
| 1128 |
+
89,
|
| 1129 |
+
825,
|
| 1130 |
+
280
|
| 1131 |
+
],
|
| 1132 |
+
"page_idx": 9
|
| 1133 |
+
},
|
| 1134 |
+
{
|
| 1135 |
+
"type": "image",
|
| 1136 |
+
"img_path": "images/9ff2f93ae2335a13e7b8c6aa730ac6312915d7a24f62a4f957df8d5a09eed5d7.jpg",
|
| 1137 |
+
"image_caption": [
|
| 1138 |
+
"Figure 5: Failure cases. We show failure cases caused by the grounding error and policy error. The interacted objects are labelled by green bounding boxes. "
|
| 1139 |
+
],
|
| 1140 |
+
"image_footnote": [],
|
| 1141 |
+
"bbox": [
|
| 1142 |
+
173,
|
| 1143 |
+
323,
|
| 1144 |
+
823,
|
| 1145 |
+
458
|
| 1146 |
+
],
|
| 1147 |
+
"page_idx": 9
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"type": "text",
|
| 1151 |
+
"text": "8 Qualitative Results ",
|
| 1152 |
+
"text_level": 1,
|
| 1153 |
+
"bbox": [
|
| 1154 |
+
174,
|
| 1155 |
+
505,
|
| 1156 |
+
364,
|
| 1157 |
+
522
|
| 1158 |
+
],
|
| 1159 |
+
"page_idx": 9
|
| 1160 |
+
},
|
| 1161 |
+
{
|
| 1162 |
+
"type": "text",
|
| 1163 |
+
"text": "In Figure $^ { 4 , }$ we show examples of LID-Text (Ours) completing tasks in VirtualHome and BabyAI. We show two successful examples from VirtualHome on the In-Distribution and Novel Tasks settings, and two successful examples from BabyAI on solving the GoToLocal and PickupLoc tasks. We only show short trajectories or extract a sub-trajectory for saving space. ",
|
| 1164 |
+
"bbox": [
|
| 1165 |
+
174,
|
| 1166 |
+
535,
|
| 1167 |
+
825,
|
| 1168 |
+
592
|
| 1169 |
+
],
|
| 1170 |
+
"page_idx": 9
|
| 1171 |
+
},
|
| 1172 |
+
{
|
| 1173 |
+
"type": "text",
|
| 1174 |
+
"text": "Failure case analysis. In Figure 5, we show some failure cases of the proposed method. We observed two main types of failure cases: grounding error and policy error. For failures caused by the grounding error, the agent interacts with a wrong object that is not related to the given goal, e.g. the agent puts cutlets instead of the salmon inside the fridge. For failures caused by the policy error, the agent cannot find the target objects or does not interact with them. The proposed method that converts policy inputs into sequential encodings and feeds them to the general LM framework can accomplish decision-making tasks efficiently, however, there are still challenging tasks that the policy fails to accomplish. Larger LMs, e.g. GPT-3 [6], may improve the success rate of those challenging tasks. ",
|
| 1175 |
+
"bbox": [
|
| 1176 |
+
173,
|
| 1177 |
+
597,
|
| 1178 |
+
825,
|
| 1179 |
+
709
|
| 1180 |
+
],
|
| 1181 |
+
"page_idx": 9
|
| 1182 |
+
},
|
| 1183 |
+
{
|
| 1184 |
+
"type": "text",
|
| 1185 |
+
"text": "9 Conclusion and Broader Impact ",
|
| 1186 |
+
"text_level": 1,
|
| 1187 |
+
"bbox": [
|
| 1188 |
+
174,
|
| 1189 |
+
728,
|
| 1190 |
+
473,
|
| 1191 |
+
744
|
| 1192 |
+
],
|
| 1193 |
+
"page_idx": 9
|
| 1194 |
+
},
|
| 1195 |
+
{
|
| 1196 |
+
"type": "text",
|
| 1197 |
+
"text": "In this paper, we introduced LID, a general approach to sequential decision-making that converts goals, histories, and observations into sequences and processes them using a policy initialized with a pre-trained LM. We integrated an active data gathering procedure into the proposed method to enable policy learning without using expert data. Our analysis showed that input representation and favorable weight initialization both contribute to the generalization while the input encoding scheme has little influence. One drawback of the active data gathering is that it relies on hand-designed rules for task relabeling. More generally, a potential disadvantage of the proposed approach is that biases of the pre-trained LMs may influence its behavior, and further study of LID-based models’ bias is required before they may be deployed in sensitive downstream applications. Nevertheless, our results demonstrate that LID enables effective combinatorial generalization across different environments, and highlight the promise of LM pre-training for more general decision-making problems. ",
|
| 1198 |
+
"bbox": [
|
| 1199 |
+
173,
|
| 1200 |
+
758,
|
| 1201 |
+
825,
|
| 1202 |
+
911
|
| 1203 |
+
],
|
| 1204 |
+
"page_idx": 9
|
| 1205 |
+
},
|
| 1206 |
+
{
|
| 1207 |
+
"type": "text",
|
| 1208 |
+
"text": "References ",
|
| 1209 |
+
"text_level": 1,
|
| 1210 |
+
"bbox": [
|
| 1211 |
+
174,
|
| 1212 |
+
90,
|
| 1213 |
+
267,
|
| 1214 |
+
106
|
| 1215 |
+
],
|
| 1216 |
+
"page_idx": 10
|
| 1217 |
+
},
|
| 1218 |
+
{
|
| 1219 |
+
"type": "text",
|
| 1220 |
+
"text": "[1] P. Ammanabrolu and M. O. Riedl. Playing text-adventure games with graph-based deep reinforcement learning. arXiv preprint arXiv:1812.01628, 2018. \n[2] J. Andreas and D. Klein. Learning with latent language. In North American Association for Computational Linguistics, 2022. \n[3] M. Andrychowicz, F. Wolski, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba. Hindsight experience replay. arXiv preprint arXiv:1707.01495, 2017. \n[4] M. L. Athul Paul Jacob and J. Andreas. Multitasking inhibits semantic drift. In North American Association for Computational Linguistics, 2021. \n[5] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. Openai gym, 2016. \n[6] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. \n[7] L. Chen, K. Lu, A. Rajeswaran, K. Lee, A. Grover, M. Laskin, P. Abbeel, A. Srinivas, and I. Mordatch. Decision transformer: Reinforcement learning via sequence modeling. arXiv preprint arXiv:2106.01345, 2021. \n[8] S. Deerwester, S. T. Dumais, G. W. Furnas, T. K. Landauer, and R. Harshman. Indexing by latent semantic analysis. Journal of the American society for information science, 41(6):391–407, 1990. \n[9] J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. \n[10] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. \n[11] S. T. Dumais. Latent semantic analysis. Annual review of information science and technology, 38(1):188–230, 2004. \n[12] D. Ghosh, A. Gupta, A. Reddy, J. Fu, C. Devin, B. Eysenbach, and S. Levine. Learning to reach goals via iterated supervised learning. arXiv preprint arXiv:1912.06088, 2019. \n[13] F. Hill, S. Mokra, N. Wong, and T. Harley. Human instruction-following with deep reinforcement learning via transfer-learning from text. arXiv preprint arXiv:2005.09382, 2020. \n[14] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735– 1780, 1997. \n[15] W. Huang, P. Abbeel, D. Pathak, and I. Mordatch. Language models as zero-shot planners: Extracting actionable knowledge for embodied agents. arXiv preprint arXiv:2201.07207, 2022. \n[16] D. Y.-T. Hui, M. Chevalier-Boisvert, D. Bahdanau, and Y. Bengio. Babyai 1.1, 2020. \n[17] E. Jang, A. Irpan, M. Khansari, D. Kappler, F. Ebert, C. Lynch, S. Levine, and C. Finn. Bc-z: Zero-shot task generalization with robotic imitation learning. In Conference on Robot Learning, pages 991–1002. PMLR, 2022. \n[18] N. S. Keskar, B. McCann, L. R. Varshney, C. Xiong, and R. Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019. \n[19] N. Kitaev, S. Cao, and D. Klein. Multilingual constituency parsing with self-attention and pre-training. arXiv preprint arXiv:1812.11760, 2018. \n[20] R. E. Korf. Planning as search: A quantitative approach. Artificial intelligence, 33(1):65–88, 1987. \n[21] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015. \n[22] J. Lu, D. Batra, D. Parikh, and S. Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. arXiv preprint arXiv:1908.02265, 2019. \n[23] K. Lu, A. Grover, P. Abbeel, and I. Mordatch. Pretrained transformers as universal computation engines. arXiv preprint arXiv:2103.05247, 2021. \n[24] A. Majumdar, A. Shrivastava, S. Lee, P. Anderson, D. Parikh, and D. Batra. Improving visionand-language navigation with image-text pairs from the web. In European Conference on Computer Vision, pages 259–274. Springer, 2020. \n[25] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013. \n[26] V. Mnih, A. P. Badia, M. Mirza, A. Graves, T. Lillicrap, T. Harley, D. Silver, and K. Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pages 1928–1937. PMLR, 2016. \n[27] V. Mnih, K. Kavukcuoglu, D. Silver, A. Graves, I. Antonoglou, D. Wierstra, and M. Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013. \n[28] J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 1532–1543, 2014. \n[29] M. E. Peters, M. Neumann, M. Iyyer, M. Gardner, C. Clark, K. Lee, and L. Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018. \n[30] E. A. Platanios, A. Pauls, S. Roy, Y. Zhang, A. Kyte, A. Guo, S. Thomson, J. Krishnamurthy, J. Wolfe, J. Andreas, et al. Value-agnostic conversational semantic parsing. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 3666–3681, 2021. \n[31] X. Puig, K. Ra, M. Boben, J. Li, T. Wang, S. Fidler, and A. Torralba. Virtualhome: Simulating household activities via programs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8494–8502, 2018. \n[32] X. Puig, T. Shu, S. Li, Z. Wang, J. B. Tenenbaum, S. Fidler, and A. Torralba. Watch-and-help: A challenge for social perception and human-ai collaboration. arXiv preprint arXiv:2010.09890, 2020. \n[33] A. Radford, K. Narasimhan, T. Salimans, and I. Sutskever. Improving language understanding by generative pre-training. 2018. \n[34] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, I. Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. \n[35] A. Raffin, A. Hill, A. Gleave, A. Kanervisto, M. Ernestus, and N. Dormann. Stable-baselines3: Reliable reinforcement learning implementations. Journal of Machine Learning Research, 22(268):1–8, 2021. \n[36] M. Reid, Y. Yamada, and S. S. Gu. Can wikipedia help offline reinforcement learning? arXiv preprint arXiv:2201.12122, 2022. \n[37] J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. \n[38] P. Sharma, A. Torralba, and J. Andreas. Skill induction and planning with latent language. In Association for Computational Linguistics, 2022. \n[39] B. Shen, F. Xia, C. Li, R. Martín-Martín, L. Fan, G. Wang, S. Buch, C. D’Arpino, S. Srivastava, L. P. Tchapmi, et al. igibson, a simulation environment for interactive tasks in large realisticscenes. arXiv preprint arXiv:2012.02924, 2020. \n[40] M. Shridhar, J. Thomason, D. Gordon, Y. Bisk, W. Han, R. Mottaghi, L. Zettlemoyer, and D. Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 10740–10749, 2020. \n[41] E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pages 5026–5033. IEEE, 2012. \n[42] M. Tsimpoukelli, J. Menick, S. Cabi, S. Eslami, O. Vinyals, and F. Hill. Multimodal few-shot learning with frozen language models. arXiv preprint arXiv:2106.13884, 2021. \n[43] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. \n[44] J. Vig. A multiscale visualization of attention in the transformer model. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics: System Demonstrations, pages 37–42, Florence, Italy, July 2019. Association for Computational Linguistics. \n[45] B. Wang, R. Shin, X. Liu, O. Polozov, and M. Richardson. Rat-sql: Relation-aware schema encoding and linking for text-to-sql parsers. arXiv preprint arXiv:1911.04942, 2019. \n[46] T. Wolf, L. Debut, V. Sanh, J. Chaumond, C. Delangue, A. Moi, P. Cistac, T. Rault, R. Louf, M. Funtowicz, et al. Huggingface’s transformers: State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019. \n[47] Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. R. Salakhutdinov, and Q. V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. \n[48] Z. Yang, N. Garcia, C. Chu, M. Otani, Y. Nakashima, and H. Takemura. Bert representations for video question answering. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 1556–1565, 2020. \n[49] J. Zhu, Y. Xia, L. Wu, D. He, T. Qin, W. Zhou, H. Li, and T.-Y. Liu. Incorporating bert into neural machine translation. arXiv preprint arXiv:2002.06823, 2020. ",
|
| 1221 |
+
"bbox": [
|
| 1222 |
+
173,
|
| 1223 |
+
108,
|
| 1224 |
+
828,
|
| 1225 |
+
920
|
| 1226 |
+
],
|
| 1227 |
+
"page_idx": 10
|
| 1228 |
+
},
|
| 1229 |
+
{
|
| 1230 |
+
"type": "text",
|
| 1231 |
+
"text": "",
|
| 1232 |
+
"bbox": [
|
| 1233 |
+
168,
|
| 1234 |
+
56,
|
| 1235 |
+
826,
|
| 1236 |
+
917
|
| 1237 |
+
],
|
| 1238 |
+
"page_idx": 11
|
| 1239 |
+
},
|
| 1240 |
+
{
|
| 1241 |
+
"type": "text",
|
| 1242 |
+
"text": "",
|
| 1243 |
+
"bbox": [
|
| 1244 |
+
171,
|
| 1245 |
+
87,
|
| 1246 |
+
828,
|
| 1247 |
+
661
|
| 1248 |
+
],
|
| 1249 |
+
"page_idx": 12
|
| 1250 |
+
},
|
| 1251 |
+
{
|
| 1252 |
+
"type": "text",
|
| 1253 |
+
"text": "Checklist ",
|
| 1254 |
+
"text_level": 1,
|
| 1255 |
+
"bbox": [
|
| 1256 |
+
174,
|
| 1257 |
+
89,
|
| 1258 |
+
254,
|
| 1259 |
+
106
|
| 1260 |
+
],
|
| 1261 |
+
"page_idx": 13
|
| 1262 |
+
},
|
| 1263 |
+
{
|
| 1264 |
+
"type": "text",
|
| 1265 |
+
"text": "1. For all authors... ",
|
| 1266 |
+
"bbox": [
|
| 1267 |
+
214,
|
| 1268 |
+
116,
|
| 1269 |
+
339,
|
| 1270 |
+
131
|
| 1271 |
+
],
|
| 1272 |
+
"page_idx": 13
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"type": "text",
|
| 1276 |
+
"text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See Section 9. \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 9. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
|
| 1277 |
+
"bbox": [
|
| 1278 |
+
238,
|
| 1279 |
+
135,
|
| 1280 |
+
825,
|
| 1281 |
+
239
|
| 1282 |
+
],
|
| 1283 |
+
"page_idx": 13
|
| 1284 |
+
},
|
| 1285 |
+
{
|
| 1286 |
+
"type": "text",
|
| 1287 |
+
"text": "2. If you are including theoretical results... ",
|
| 1288 |
+
"bbox": [
|
| 1289 |
+
214,
|
| 1290 |
+
243,
|
| 1291 |
+
493,
|
| 1292 |
+
258
|
| 1293 |
+
],
|
| 1294 |
+
"page_idx": 13
|
| 1295 |
+
},
|
| 1296 |
+
{
|
| 1297 |
+
"type": "text",
|
| 1298 |
+
"text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
|
| 1299 |
+
"bbox": [
|
| 1300 |
+
238,
|
| 1301 |
+
262,
|
| 1302 |
+
738,
|
| 1303 |
+
294
|
| 1304 |
+
],
|
| 1305 |
+
"page_idx": 13
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"type": "text",
|
| 1309 |
+
"text": "3. If you ran experiments... ",
|
| 1310 |
+
"bbox": [
|
| 1311 |
+
212,
|
| 1312 |
+
299,
|
| 1313 |
+
393,
|
| 1314 |
+
313
|
| 1315 |
+
],
|
| 1316 |
+
"page_idx": 13
|
| 1317 |
+
},
|
| 1318 |
+
{
|
| 1319 |
+
"type": "text",
|
| 1320 |
+
"text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] In the supplemental material. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 6 and Appendix C.2. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 6. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix C.2. ",
|
| 1321 |
+
"bbox": [
|
| 1322 |
+
238,
|
| 1323 |
+
316,
|
| 1324 |
+
825,
|
| 1325 |
+
449
|
| 1326 |
+
],
|
| 1327 |
+
"page_idx": 13
|
| 1328 |
+
},
|
| 1329 |
+
{
|
| 1330 |
+
"type": "text",
|
| 1331 |
+
"text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
|
| 1332 |
+
"bbox": [
|
| 1333 |
+
220,
|
| 1334 |
+
453,
|
| 1335 |
+
821,
|
| 1336 |
+
468
|
| 1337 |
+
],
|
| 1338 |
+
"page_idx": 13
|
| 1339 |
+
},
|
| 1340 |
+
{
|
| 1341 |
+
"type": "text",
|
| 1342 |
+
"text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] See Section 9. ",
|
| 1343 |
+
"bbox": [
|
| 1344 |
+
238,
|
| 1345 |
+
472,
|
| 1346 |
+
825,
|
| 1347 |
+
593
|
| 1348 |
+
],
|
| 1349 |
+
"page_idx": 13
|
| 1350 |
+
},
|
| 1351 |
+
{
|
| 1352 |
+
"type": "text",
|
| 1353 |
+
"text": "5. If you used crowdsourcing or conducted research with human subjects... ",
|
| 1354 |
+
"bbox": [
|
| 1355 |
+
214,
|
| 1356 |
+
598,
|
| 1357 |
+
705,
|
| 1358 |
+
612
|
| 1359 |
+
],
|
| 1360 |
+
"page_idx": 13
|
| 1361 |
+
},
|
| 1362 |
+
{
|
| 1363 |
+
"type": "text",
|
| 1364 |
+
"text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
|
| 1365 |
+
"bbox": [
|
| 1366 |
+
238,
|
| 1367 |
+
616,
|
| 1368 |
+
825,
|
| 1369 |
+
705
|
| 1370 |
+
],
|
| 1371 |
+
"page_idx": 13
|
| 1372 |
+
}
|
| 1373 |
+
]
|
parse/dev/FWMQYjFso-a/FWMQYjFso-a_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/FWMQYjFso-a/FWMQYjFso-a_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/IajGRJuM7D3/IajGRJuM7D3.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/IajGRJuM7D3/IajGRJuM7D3_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/RKiWwhocuiU/RKiWwhocuiU.md
ADDED
|
@@ -0,0 +1,463 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DOMAIN GENERALIZATION WITH SMALL DATA
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this work, we propose to tackle the problem of domain generalization in the context of insufficient samples. Instead of extracting latent feature embeddings based on deterministic models, we propose to learn a domain-invariant representation based on the probabilistic framework by mapping each data point into probabilistic embeddings. Specifically, we first extend empirical maximum mean discrepancy (MMD) to a novel probabilistic MMD that can measure the discrepancy between mixture distributions (i.e., source domains) consisted of a serial of latent distributions rather than latent points. Moreover, instead of imposing the contrastive semantic alignment (CSA) loss based on pairs of latent points, a novel probabilistic CSA loss encourages positive probabilistic embedding pairs to be closer while pulling other negative ones apart. Benefiting from the learned representation captured by probabilistic models, our proposed method can marriage the measurement on the distribution over distributions (i.e., the global perspective alignment) and the distribution-based contrastive semantic alignment (i.e., the local perspective alignment). Extensive experimental results on three challenging medical datasets show the effectiveness of our proposed method in the context of insufficient data compared with state-of-the-art baseline methods.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Nowadays, we have witnessed a lot of successes via imposing machine learning techniques in a variety of tasks related to computer vision and natural language processing, such as face recognition Li et al. (2022b), object detection Zaidi et al. (2022), and speech recognition Mridha et al. (2022). Despite many achievements so far, the widely-adopted assumption for most existing methods, i.e., it is identically and independently distributed between training and testing data, may not always hold in actual applications Zhou et al. (2022); Liu et al. (2022). In the real-world scenario, it is quite common that the distribution between training and testing data may be different, owing to sophisticated environments. For example, resulting from the differences of device vendor and staining method, acquired histopathological images of breast cancer from different healthcare centers exist significant domain gaps (a.k.a., domain shift, see Figure 1 for more details), which may lead to the catastrophic deterioration of the performance Qi et al. (2020). To address this issue, domain generalization (DG) is developed to learn a model from multiple related yet different domains (a.k.a., source domains) that is able to generalize well on unseen testing domain (a.k.a., target domain).
|
| 12 |
+
|
| 13 |
+
Recently, researchers proposed quite a few domain generalization approaches, such as data augmentation with randomization Yue et al. (2019), data generalization with stylization Verma et al. (2019); Zhou et al. (2021), meta learning Li et al. (2018a); Kim et al. (2021)-based training schemes, among which representation learning-based methods are one of the most popular ones. These representation learning-based methods Balaji et al. (2019) aim to learn domain-invariant feature representation. To be specific, if the discrepancy between source domains in feature space can be minimized, the model is expected to be better generalize well on unseen target domain, owning to learned domaininvariant and transferable feature representation Ben-David et al. (2006). For instance, an classical contrastive semantic alignment (CSA) loss proposed by (Motiian et al., 2017) was to encourage positive sample pairs (with same label) from different domains closer while pulling other negative pairs (with different labels) apart. (Dou et al., 2019) introduced the CSA loss which jointly considers local class alignment loss (for point-wise domain alignment) and global class alignment loss (for distribution-wise alignment).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Histopathological image examples of breast cancer tissue from three different healthcare institutes, including NKI with 626 images, IHC with 645 images, and VGH with 1324 images. There are two different tissue types, including epithelium and stroma. Obvious domain gaps (e.g., the density of tissue and the staining color) can be observed.
|
| 17 |
+
|
| 18 |
+
Despite the progress being achieved so far, it should be noted that a reliable contrastive semantic loss with point-wise (or local) perspective usually requires sufficient samples on source domains such that diverse sample-to-sample pairs can be constructed Sohn (2016); Khosla et al. (2020). For example, (Khosla et al., 2020) proposed a supervised contrastive semantic loss with a considerable volume of batch size on large-scale datasets such that decent performance can be guaranteed. (Yao et al., 2022) also emphasized the importance of the number of sample-to-sample pairs influenced by data sizes for contrastive-based loss on DG problem. Meanwhile, in the eye of distribution-wise (or global) alignment between domains Dou et al. (2019), a consistent distribution measurement (e.g., Kullback–Leibler (KL) divergence) theoretically relies on sufficient samples for the distribution estimation as discussed by (Bu et al., 2018). However, these sufficient samples from multiple source domains may not always be available and accessible, especially for the medical imaging data, due to potential ethic, privacy and proprietorship risks. It is therefore necessary to develop reliable and effective contrastive semantic alignments with local and global perspectives in the context of insufficient samples (a.k.a., small-data scenario) from source domains, in order to achieve better domain-invariant representations.
|
| 19 |
+
|
| 20 |
+
In this paper, we propose to learn domain-invariant representation from multiple source domains to tackle the domain generalization problem in the context of insufficient samples. Instead of extracting latent embeddings (i.e., latent points) based on deterministic models (e.g., convolutional neural networks, CNNs), we propose to leverage a probabilistic framework endowed by variational Bayesian inference to map each data point into probabilistic embeddings (i.e., the latent distribution) for domain generalization. Specifically, by following the domain-invariant learning from global (distribution-wise) perspective, we propose to extend empirical maximum mean discrepancy (MMD) to a novel probabilistic MMD (P-MMD) that can empirically measure the discrepancy between mixture distributions (a.k.a., distributions over distributions), consisted of a serial of latent distributions rather than latent points. From a local perspective, instead of imposing the CSA loss based on pairs of latent points, a novel probabilistic contrastive semantic alignment (P-CSA) loss with kernel mean embedding is proposed to encourage positive probabilistic embedding pairs closer while pulling other negative ones apart. Extensive experimental results on three challenging medical imaging classification tasks, including epithelium stroma classification on insufficient histopathological images, imbalanced-class based skin lesion classification, and spinal cord gray matter segmentation, show that our proposed method can achieve better cross-domain performance in the context of insufficient data compared with state-of-the-art baseline methods.
|
| 21 |
+
|
| 22 |
+
# 2 RELATED WORKS
|
| 23 |
+
|
| 24 |
+
# 2.1 DOMAIN GENERALIZATION AND ITS APPLICATION IN MEDICAL IMAGE CLASSIFICATION
|
| 25 |
+
|
| 26 |
+
Existing DG methods can be generally categorized into three different streams, namely data augmentation/generation Yue et al. (2019); Graves (2011); Zhou et al. (2021), meta-learning Li et al. (2018a); Kim et al. (2021) and feature representation learning Li et al. (2018b); Gong et al. (2019); Xiao et al. (2021). Among these methods, feature representation learning, which aims to explore invariant feature information that can be shared across domains, demonstrates to be a widely adopted method for the problem of DG. For feature representation learning-based DG method, Li et al.
|
| 27 |
+
|
| 28 |
+
(2018b) proposed to conduct multi-domain alignment in latent space via a multi-domain MMD distance. Gong et al. (2019) leveraged adversarial training to eliminate the domain discrepancy such that domain-invariant representation can be learned in a manifold space. Due to the varieties of imaging protocol (e.g., the choice of image solution for MRI image), device vendors (e.g., Philips or Siemens CT scanners), and patient populations (the race and age group), the acquired imaging data from different medical sites may exist significant domain shift problem Liu et al. (2021). Dou et al. (2019) proposed a meta-learning framework to perform local and global semantic alignment for medical image classification. Similar design is also adopted by Li et al. (2022a) for tissue image classification. Qi et al. (2020) utilized the curriculum learning scheme to transfer the knowledge for histopathological images classification. Li et al. (2020a) combined the data augmentation and domain alignment to achieve decent performance on multiple medical data classification tasks. However, these methods may not focus on learning domain-invariant representation on insufficient samples from source domains. This scenario may widely encounter in clinical environments because 1) The cost of annotated data by experienced professionals are typically prohibitive, leading to the lack of samples in size and diversity Yoon et al. (2019). 2) For rare diseases (e.g., glioblastoma and lymphoma), the size of data is usually small Lee et al. (2022). 3) medical imaging data are strictly insufficient in most cases due to potential ethic and privacy-preserving concerns Li et al. (2020b).
|
| 29 |
+
|
| 30 |
+
# 2.2 PROBABILISTIC NEURAL NETWORKS
|
| 31 |
+
|
| 32 |
+
Compared with deterministic models, probabilistic neural networks turns to learn a distribution over model parameters, which can integrate the uncertainty in predictive modeling Kingma et al. (2015); Gal & Ghahramani (2016). When the data is insufficient, probabilistic models usually can achieve better generalized performance due to its probabilistic property (as an implicit regularization) Blundell et al. (2015). In the context of insufficient samples, Bayesian neural network Neal (2012) (BNN) with variational inference, a representative probabilistic model, not only can improve predictive accuracy as a classifier Wilson & Izmailov (2020), but also can build up the quality of low-dimensional embeddings of insufficient data Mallick et al. (2021), which is a crucial motivation for this paper. Meanwhile, modern analytical approximation techniques (e.g., Variational inference Blei et al. (2017), empirical Bayes Krishnan et al. (2020)) can efficiently infer the posterior distribution of model parameters with stochastic gradient descent method, which can integrate BNN with deterministic DNN conveniently.
|
| 33 |
+
|
| 34 |
+
In Xiao et al. (2021), the authors proposed to consider the uncertainty of a generalizable model based on BNN, where the distances of positive probabilistic embedding pairs and class distribution are minimized via KL measure. Despite the effectiveness, the dissimilar pairs (i.e., negative pairs) are ignored, which may not benefit feature representation learning. Moreover, they only focused on sample similarity while the distribution information is ignored. Instead, our proposed method comprehensively considers both positive and negative probabilistic embedding pairs via a novel distribution-based contrastive semantic loss.
|
| 35 |
+
|
| 36 |
+
# 3 METHOD
|
| 37 |
+
|
| 38 |
+
# 3.1 PRELIMINARY
|
| 39 |
+
|
| 40 |
+
Assume that there are $K$ domains from different collected environments. The samples in each domain can be represented as $\mathbf { X } _ { l } = \{ \mathbf { x } _ { l _ { 1 } } , \cdot \cdot \cdot , \mathbf { x } _ { l _ { n _ { l } } } \}$ , where $l \in \mathbb { N } ^ { + } : \{ 1 , \cdots , K \}$ , $\mathbf { \bar { x } } _ { l _ { i } } \in \mathbb { R } ^ { d \times 1 }$ denotes a sample with the $d$ dimension vector in the $l$ -th domain. $n _ { l }$ is the total number of samples in the $l$ -th domain. The corresponding labels of samples in each domain can be denoted as ${ \bf Y } _ { l } = { \bf \Phi }$ $\{ \mathbf { y } _ { l _ { 1 } } , \cdots , \mathbf { y } _ { l _ { n _ { l } } } \}$ , where $\mathbf { y } _ { l _ { i } } \in \mathbb { R } ^ { m \times 1 }$ is the form of one-hot encoding with $m$ classes in total. For lthe setting of domain generalization, the source domain data represented as $\{ \mathbf { X } _ { l } ^ { S } , \mathbf { Y } _ { l } ^ { S } \} _ { l = 1 } ^ { K }$ , can be available in the training phase only, whereas the target domain data, denoted by $\mathbf { X } ^ { T }$ , are only seen in test phase.
|
| 41 |
+
|
| 42 |
+
Here, we provide a framework that can learn better domain-invariant representation when there is insufficient source domain data. The probabilistic neural network is imposed to enable high-quality and powerful feature representation in the context of insufficient samples. To effectively perform global perspective alignment, a novel probabilistic MMD is proposed to empirically measure the discrepancy between distributions over distributions based on reproducing kernel Hilbert space. We also propose a probabilistic contrastive semantic alignment to adapt probabilistic embeddings with local perspective. The details of our proposed method are discussed as below.
|
| 43 |
+
|
| 44 |
+
# 3.2 PROBABILISTIC EMBEDDING OF INSUFFICIENT DATA
|
| 45 |
+
|
| 46 |
+
Compared with deterministic models, the probabilistic models can learn a distribution over model weights, which has shown a better capacity to represent latent embeddings Mallick et al. (2021) under insufficient sample scenario, which is a key motivation for this work. Here, Bayesian neural network (BNN) Blei et al. (2017) is utilized to extract the low-dimensional embeddings from highdimensional inputs. By feeding the inputs into BNN with parameter $\mathbf { W } \sim p ( \mathbf { W } )$ , the samples $\mathbf { X } _ { l } = \{ \mathbf { x } _ { l _ { 1 } } , \cdot \cdot \cdot , \mathbf { x } _ { l _ { n _ { l } } } \}$ of each domain can be represented by a set of probabilistic embeddings (i.e., latent distributions), i.e., $p ( \mathbf { Z } | \mathbf { X } _ { l } ) = \{ p ( \mathbf { z } | \mathbf { x } _ { l _ { 1 } } , \mathbf { W } ) , \cdot \cdot \cdot , p ( \mathbf { z } | \mathbf { x } _ { l _ { n _ { l } } } , \mathbf { W } ) \}$ where $\mathbf { W } \sim p ( \mathbf { W } )$ is sampled stochastically. The variational inference is used to approximate the posterior distribution of W with the evidence lower bound (ELBO) (more details can be found in appendix). By using Monte Carlo (MC) estimators with $T$ stochastic sampling operations from the W, the predictive distribution of each $p ( \mathbf { z } | \mathbf { x } )$ can be unbiased approximation. The number of MC samples and the corresponding issue of computational efficiency is discussed in A.6.
|
| 47 |
+
|
| 48 |
+
# 3.3 DISTRIBUTION ALIGNMENT VIA PROBABILISTIC MAXIMUM MEAN DISCREPANCY
|
| 49 |
+
|
| 50 |
+
In this section, we introduce an approach to learning domain-invariant representation from a global perspective by minimizing the discrepancy among domains. Among various distribution distance metrics, Maximum Mean Discrepancy (MMD) is widely adopted Long et al. (2017); Li et al. (2018b) which aims to measure the distance between two probability distributions in a non-parametric manner. Specifically, assume that latent embeddings $\mathbf { Z } _ { l } = \{ \mathbf { z } _ { l _ { 1 } } , \cdots , \mathbf { z } _ { l _ { n _ { l } } } \}$ and $\mathbf { Z } _ { t } = \{ \mathbf { z } _ { t _ { 1 } } , \cdots , \mathbf { z } _ { t _ { n _ { t } } } \}$ are drawn from two unknown distributions $\mathbb { P } _ { l }$ and $\mathbb { P } _ { t }$ . The probability measure $\mathbb { P }$ can be mapped into a reproducing kernel Hilbert space (RKHS) $\mathcal { H }$ as a element by setting,
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mu _ { \mathbb { P } } : = \mathbb { E } _ { \mathbf { z } \sim \mathbb { P } } [ \phi ( \mathbf { z } ) ] = \int _ { \mathcal { Z } } k ( \mathbf { z } , \cdot ) d \mathbb { P } = \mathbb { E } _ { \mathbf { z } \sim \mathbb { P } } [ k ( \mathbf { z } , \cdot ) ] ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where a reproducing kernel $k : \mathcal { X } \times \mathcal { X } \to \mathbb { R }$ and corresponding feature map $\phi : \mathcal { X } \to \mathcal { H }$ are defined. Let the kernel $k$ is characteristic such that the map $\mu : \mathbb { P } \to \mu _ { \mathbb { P } }$ is injective. In this case the MMD can be defined as the distance $\| \mu _ { \mathbb { P } _ { l } } - \mu _ { \mathbb { P } _ { k } } \| _ { \mathcal { H } }$ in $\mathcal { H }$ between mean embeddings and it can be used as a measure of distance between the distributions $\mathbb { P } _ { l }$ and $\mathbb { P } _ { t }$ Borgwardt et al. (2006); Gretton et al. (2012). The explicit computation of MMD can be derived by unbiased empirical estimation of mean map Gretton et al. (2012), i.e.,
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mathrm { M M D } \left( \mathbb { P } _ { l } , \mathbb { P } _ { t } \right) ^ { 2 } = \left. \mu _ { \mathbb { P } _ { l } } - \mu _ { \mathbb { P } _ { t } } \right. _ { \mathcal { H } } ^ { 2 } = \left. \frac { 1 } { n _ { l } } \sum _ { i = 1 } ^ { n _ { l } } \phi \left( \mathbf { z } _ { l _ { i } } \right) - \frac { 1 } { n _ { t } } \sum _ { j = 1 } ^ { n _ { t } } \phi \left( \mathbf { z } _ { t _ { j } } \right) \right. _ { \mathcal { H } } ^ { 2 } .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
The idea of using MMD for domain generalization has been explored in several works (e.g., Li et al.
|
| 63 |
+
(2018b); Hu et al. (2020)).
|
| 64 |
+
|
| 65 |
+
In the probabilistic framework, instead of the individual latent embeddings $\mathbf { z } _ { l _ { 1 } , \ldots }$ , we have latent probabilistic embeddings $\Pi _ { l _ { 1 } } : = p ( \mathbf { z } | \mathbf { x } _ { l _ { 1 } } , \mathbf { W } ) , . . . .$ For a source domain $D _ { l }$ , we have the associated distribution over distributions $\mathbb { P } _ { l } = \{ \Pi _ { l _ { 1 } } , \cdot \cdot \cdot , \Pi _ { l _ { n _ { l } } } \}$ . For this scenario, we propose to extend the existing point-based empirical MMD estimate to a distribution-based empirical probability MMD (P-MMD) estimate. P-MMD utilizes empirical estimation by kernels on distributions to measure the discrepancy between mixture distributions $\mathbb { P } _ { l }$ and $\mathbb { P } _ { t }$ under the probabilistic framework.
|
| 66 |
+
|
| 67 |
+
Specifically, we first represent latent probabilistic embeddings as elements in RKHS $\mathcal { H } _ { k }$ using the kernel $k$ , that we call a level-1 kernel in the sequel, e.g., $\mu _ { \Pi l _ { 1 } } : = \mathbb { E } _ { \mathbf { z } \sim \Pi _ { l _ { 1 } } } [ \phi ( \mathbf { z } ) ] = \mathbb { E } _ { \mathbf { z } \sim \Pi _ { l _ { 1 } } } [ k ( \mathbf { z } , \cdot ) ]$ , which is an analogous way to the Eq. (1). The kernel mean embedding $\mu _ { \Pi _ { l _ { 1 } } }$ can be regarded as a new feature map for a variety of tasks Yoshikawa et al. (2014). Here, to enable non-linear learning on distributions, we introduce level-2 kernel $K$ Muandet et al. (2012). Consider a level-1 kernel $\kappa$ on $\mathcal { H }$ and its reproducing kernel Hilbert space (RKHS) $\mathcal { H } _ { \kappa }$ . Define $K$ as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r } { K ( \Pi _ { l _ { i } } , \Pi _ { t _ { j } } ) = \kappa ( \mu _ { \Pi _ { l _ { i } } } , \mu _ { \Pi _ { t _ { j } } } ) = \langle \psi ( \mu _ { \Pi _ { l _ { i } } } ) , \psi ( \mu _ { \Pi _ { t _ { j } } } ) \rangle _ { \mathcal { H } _ { \kappa } } , } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $K$ and its explicit form on kernel mean embeddings $\kappa$ are p.d. kernels Berlinet $\&$ ThomasAgnan (2011). We define the probabilistic MMD (P-MMD) empirical estimation method using the level-2 kernel $K$ :
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r c l } { { \mathrm { P - M M D } ( \mathbb { P } _ { l } , \mathbb { P } _ { t } ) ^ { 2 } } } & { { = } } & { { \displaystyle \| \frac { 1 } { n _ { l } } \sum _ { i = 1 } ^ { n _ { l } } \psi ( \mu _ { \Pi _ { i } } ) - \frac { 1 } { n _ { t } } \sum _ { j = 1 } ^ { n _ { t } } \psi ( \mu _ { \Pi _ { t _ { j } } } ) \| _ { \mathcal { H } _ { \kappa } } ^ { 2 } } } \\ { { } } & { { = } } & { { \displaystyle \frac { 1 } { n _ { l } ^ { 2 } } \sum _ { i = 1 } ^ { n _ { l } } \sum _ { i ^ { \prime } = 1 } ^ { n _ { l } } K ( \Pi _ { l _ { i } } , \Pi _ { l _ { i } ^ { \prime } } ) + \frac { 1 } { n _ { t } ^ { 2 } } \sum _ { j = 1 } ^ { n _ { t } } \sum _ { j ^ { \prime } = 1 } ^ { n _ { t } } K ( \Pi _ { t _ { j } } , \Pi _ { t _ { j } ^ { \prime } } ) } } \\ { { } } & { { - } } & { { \displaystyle \frac { 2 } { n _ { l } n _ { t } } \sum _ { i = 1 } ^ { n _ { l } } \sum _ { j = 1 } ^ { n _ { t } } K ( \Pi _ { l _ { i } } , \Pi _ { t _ { j } } ) . } } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
In this work the level-1 and level-2 kernels, $k$ and $K$ , are both Gaussian RBF kernel due to its impressive performance on a limited amount of distribution data Muandet et al. (2012). Namely, K can be represented as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r c l } { \displaystyle \mathcal { K } _ { G a u } ( \Pi _ { l _ { i } } , \Pi _ { t _ { j } } ) = \kappa ( \mu _ { \Pi _ { l _ { i } } } , \mu _ { \Pi _ { i _ { j } } } ) } & { = } & { \displaystyle ( - \frac { \lambda } { 2 } \| \mu _ { \Pi _ { l _ { i } } } - \mu _ { \Pi _ { t _ { j } } } \| _ { \mathcal { H } _ { \kappa } } ^ { 2 } \Big ) } \\ & { = } & { \displaystyle \exp \bigg ( - \frac { \lambda } { 2 } ( \langle \mu _ { \Pi _ { i _ { i } } } , \mu _ { \Pi _ { i _ { i } } } \rangle _ { \mathcal { H } _ { \kappa } } ) - 2 \langle \mu _ { \Pi _ { l _ { i } } } , \mu _ { \Pi _ { t _ { j } } } \rangle _ { \mathcal { H } _ { \kappa } } + \langle \mu \Pi _ { t _ { j } } , \mu _ { \Pi _ { t _ { j } } } \rangle _ { \mathcal { H } _ { \kappa } } \bigg ) } \\ & { = } & { \displaystyle \exp ( - \frac { \lambda } { 2 } ( \frac { 1 } { m _ { l _ { i } } ^ { 2 } } \sum _ { i = 1 } ^ { m _ { l } } \sum _ { i = 1 } ^ { m _ { l } } k ( \mathbf { z } _ { i _ { i } } , \mathbf { z } _ { l _ { i } ^ { \prime } } ) - \frac { 2 } { m _ { l } m _ { l } } \sum _ { i = 1 } ^ { m _ { l } } \sum _ { j = 1 } ^ { m _ { l } } k ( \mathbf { z } _ { l _ { i } } , \mathbf { z } _ { t _ { j } } ) ) } \\ & { + } & { \displaystyle \frac { 1 } { m _ { l } ^ { 2 } } \sum _ { j = 1 } ^ { m _ { l } } \sum _ { j = 1 } ^ { m _ { l } } k ( \mathbf { z } _ { i _ { j } } , \mathbf { z } _ { t _ { j } ^ { \prime } } ) , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $m _ { l }$ and $m _ { t }$ are determined by sampling times $T$ . The kernel mean embedding using the level-1 kernel $k$ creates distributions $\mu ( \mathbb { P } _ { 1 } ) , \ldots , \mu ( \mathbb { P } _ { N } )$ represented by the samples $\{ \mu _ { \Pi _ { l _ { 1 } } } , \ldots , \mu _ { \Pi _ { l _ { n } } } \}$ for $l = 1 , \ldots , N$ respectively in the RKHS $\mathcal { H } _ { k }$ . The underlying strategy of P-MMD is to apply the classic MMD to these distributions (with respect to the kernel $\kappa$ ) . To access the effect that the minimization of P-MMD has on the original latent probability distributions across different domains we recall the following:
|
| 86 |
+
|
| 87 |
+
1 (Muandet et al. (2012)). Let . Then the distributional variance $\mathbb { P } _ { 1 } , \dots , \mathbb { P } _ { N }$ ityis di if $\begin{array} { l l } { \hat { \mathbb { P } } } & { : = } \end{array}$ $\textstyle { \frac { 1 } { N } } \sum _ { i = 1 } ^ { N } \mathbb { P } _ { i }$ $\textstyle { \frac { 1 } { N } } \sum \lVert \mu _ { \mathbb { P } i } - \mu _ { \hat { \mathbb { P } } } \rVert$ $O$ $\mathcal { f } \mathbb { P } _ { 1 } = \mathbb { P } _ { 2 } = . . . = \mathbb { P } _ { N }$ Corollary 1 (Li et al. (2018b)). The upper bound of the distributional variance can be written as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\frac { 1 } { K ^ { 2 } } \sum _ { 1 \le i , j \le K } \mathrm { M M D } ( \mathbb { P } _ { i } , \mathbb { P } _ { j } ) ^ { 2 } .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
In our setting Theorem 1 and Corollary 1 along with the fact that $k$ is a characteristic kernel imply the following
|
| 94 |
+
|
| 95 |
+
Corollary 2. $\begin{array} { r } { \frac { 1 } { K ^ { 2 } } \sum _ { 1 < i , j < K } \mathrm { P - M M D } ( \mathbb { P } _ { i } , \mathbb { P } _ { j } ) ^ { 2 } = 0 } \end{array}$ iff all moments of latent distributions $\Pi _ { l }$ associated to points of domain $\bar { D } _ { l }$ for $l = 1 , \ldots , N$ are distributed identically across domains.
|
| 96 |
+
|
| 97 |
+
Following Corollary 2 we define the following loss function:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { g l o b a l } = \frac { 1 } { K ^ { 2 } } \sum _ { 1 \le i , j \le K } \mathrm { P - M M D } ( \mathbb { P } _ { i } , \mathbb { P } _ { j } ) ^ { 2 } .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Corollary 2 implies that as 6 tends to 0 so does the distance between the distributions of means, variances and higher moments of the distributions $\Pi _ { l }$ associated to points of different domains. Remark. In the ablation study (see Appendix), we compare the P-MMD approach to simply taking the mean (i.e., first moment) of latent probabilistic embeddings $\Pi _ { l }$ i.e. taking $\Pi _ { l } \mathbf { m } _ { \Pi _ { l } } = \mathbb { E } _ { \mathbf { x } \sim \Pi _ { l } [ \mathbf { x } ] }$ , and then minimizing the associated ”vanilla” MMD. Although this scheme is more computationalefficient over our proposed method, it throws away most information about high-level statistics as discussed by (Muandet et al., 2017). We verify empirically that our approach leads to better performance across the domains. The visualized computation of P-MMD is shown in Figure 2.
|
| 104 |
+
|
| 105 |
+
Although we focus on the scenario of insufficient samples, the computational consumption from Eq. (4) and Eq. (5) may be still prohibitive as the calculation of MMD distance between distributions can scale at least quadratically with the increasing of sample size (especially for image segmentation task), i.e., $O ( n ^ { 2 } )$ in a domain. Here, by following the linear statistic theory of MMD, the unbiased estimate can be derived by drawing pairs from two domains with replacement, i.e., $\mathrm { P - M M D } ( \mathbb { P } _ { l } , \mathbb { P } _ { t } ) ^ { 2 } \approx$ $\begin{array} { r } { \frac { 2 } { n _ { l } } \sum _ { i = 1 } ^ { \frac { 2 } { n _ { l } } } \left[ K ( \Pi _ { l _ { 2 i } } , \Pi _ { l _ { 2 i + 1 } ^ { \prime } } ) + K ( \Pi _ { t _ { 2 i } } , \Pi _ { t _ { 2 i + 1 } ^ { \prime } } ) - K ( \Pi _ { l _ { 2 i } } , \Pi _ { t _ { 2 i + 1 } } ) - K ( \Pi _ { l _ { 2 i + 1 } } , \Pi _ { t _ { 2 i } } ) \right] } \end{array}$ , where assuming $n _ { l } = n _ { t }$ for simplicity. (Borgwardt et al., 2006) gives proofs about the unbiased property of the linear statistic of MMD and shows that statistic power does not be sacrificed too much.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 2: A visualized computational process for probabilistic MMD (P-MMD) on two source domains. The same color for each sample in different domains denotes the same label.
|
| 109 |
+
|
| 110 |
+
# 3.4 PROBABILISTIC CONTRASTIVE SEMANTIC ALIGNMENT
|
| 111 |
+
|
| 112 |
+
To learn domain-invariant representation from local perspective, a popular idea is to encourage positive pairs with same label closer while pulling other negative ones with different labels apart Motiian et al. (2017); Dou et al. (2019). These methods usually measure the Euclidean distance between samples in the embedding space. However, this scheme may not satisfy our probabilistic framework due to its probabilistic embeddings. To this end, we propose a probabilistic contrastive semantic alignment (P-CSA) loss that can utilize the empirical MMD to measure the discrepancy between probabilistic embeddings. The proposed P-CAS loss $\mathcal { L } _ { l o c a l }$ consists of two components, including the positive probabilistic contrastive loss and negative probabilistic contrastive loss. The former aims to minimize the distance between intra-class distributions from different domains, i.e.,
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\mathcal { L } _ { l o c a l } ^ { p o s } = \frac { 1 } { 2 } \mathrm { M M D } ( \Pi _ { n } , \Pi _ { q } ) ^ { 2 } = \frac { 1 } { 2 } \left. \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \phi \left( M _ { \Theta } ( \mathbf { z } _ { n _ { i } } ) \right) - \frac { 1 } { T } \sum _ { j = 1 } ^ { T } \phi \left( M _ { \Theta } ( \mathbf { z } _ { q _ { j } } ) \right) \right. _ { \mathcal { H } } ^ { 2 } , s . t . \mathbf { y } _ { n } = \mathbf { y } _ { q } ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $M _ { \Theta } ( \cdot )$ denotes the embedding network of metric learning, which will contribute to learn the distance between features better Dou et al. (2019). Then, by introducing a distance margin $\xi$ (can guarantee a appropriate repulsion range), the negative probabilistic contrastive loss is denoted by
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r c l } { \mathcal { L } _ { l o c a l } ^ { n e g } } & { = } & { \displaystyle \frac { 1 } { 2 } \operatorname* { m a x } [ 0 , \xi - \mathrm { M M D } ( \Pi _ { n } , \Pi _ { q } ) ^ { 2 } ] } \\ & & { = } & { \displaystyle \frac { 1 } { 2 } \operatorname* { m a x } [ 0 , \xi - \left\| \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \phi \left( M \Theta ( \mathbf { z } _ { n _ { i } } ) \right) - \frac { 1 } { T } \sum _ { j = 1 } ^ { T } \phi \left( M \Theta ( \mathbf { z } _ { q _ { j } } ) \right) \right\| _ { \mathcal { H } } ^ { 2 } ] , s . t . \mathbf { y } _ { n } \neq \mathbf { y } _ { q } . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Model Training. Our proposed framework consists of three modules, a BNN-based probabilistic extractor $Q _ { \phi }$ , a BNN-based classifier $C _ { \omega }$ , and a metric network $M _ { \Theta } ( \cdot )$ . For the $Q _ { \phi }$ , we only add a Bayesian layer with ReLU layer on the bottom of a pretrained deterministic model (e.g., ResNet18 by removing fully-connected layers) by following (Xiao et al., 2021). For the $C _ { \omega }$ , a Bayesian layer is also introduced to adapt the classification on insufficient sample better. The structure of $M _ { \Theta }$ is the same as (Dou et al., 2019). The images ${ \mathcal X } = \{ \mathbf x _ { l _ { i } } \}$ conduct $T$ stochastic forward passes on the $Q _ { \phi }$ and $C _ { \omega }$ by MC sampling to obtain probabilistic predicts $\{ \hat { y } _ { l _ { i } } ^ { j } \} _ { j = 1 } ^ { T }$ , where the outputs (i.e., probabilistic embeddings) of $Q _ { \phi }$ serve as the inputs for the calculations of $\mathcal { L } _ { g l o b a l }$ and $\mathcal { L } _ { l o c a l }$ . The final predicts $\{ \hat { y } _ { l _ { i } } ^ { j } \}$ are the expectation of $\{ \hat { y } _ { l _ { i } } ^ { j } \} _ { j = 1 } ^ { T }$ . The total objectives can be summarized as below,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { L } _ { t o t a l } = \sum _ { l , i } \mathcal { L } _ { c } ( \hat { y } _ { l _ { i } } , y _ { l _ { i } } ) + \mathrm { K L } [ q _ { \theta } ( Q _ { \phi } ) | | p ( Q _ { \phi } ) ] + \mathrm { K L } [ q _ { \theta } ( C _ { \omega } ) | | p ( C _ { \omega } ) ] + \beta _ { 1 } \mathcal { L } _ { l o c a l } + \beta _ { 2 } \mathcal { L } _ { g l o b a l } ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\mathcal { L } _ { c } ( \hat { y } _ { l _ { i } } , y _ { l _ { i } } )$ is the cross-entropy loss with ground-truth $y _ { l _ { i } }$ and its estimation $\hat { y } _ { l _ { i } }$ . The second and third terms aim to learn a variational distribution $q _ { \theta } ( \cdot )$ to approximate the Bayesian posterior distribution on the weights, while minimizing the KL divergence with its prior distribution $p ( \cdot )$ . The first three terms refer to variational Bayesian inference with ELBO Blei et al. (2017).
|
| 131 |
+
|
| 132 |
+
Table 1: Domain generalization results on the skin lesion classification task. The average value and standard deviation are reported by running each method with five times. Each column denotes a cross-domain task. For example, in the second column, we use DMF dataset denotes as the target domain and the remaining datasets as the source domains.
|
| 133 |
+
|
| 134 |
+
<table><tr><td>Method</td><td>DMF</td><td>D7P</td><td>MSK</td><td>PH2</td><td>SON</td><td>UDA</td><td>AVG</td></tr><tr><td>DeepAll</td><td>0.2492 ±0.0127</td><td>0.5680±0.0181</td><td>0.6674±0.0083</td><td>0.8000±0.0167</td><td>0.8613±0.0296</td><td>0.6264±0.0312</td><td>0.6287</td></tr><tr><td>MASF Dou et al. (2019)</td><td>0.2692±0.0146</td><td>0.5678±0.0361</td><td>0.6815±0.0122</td><td>0.7833±0.0101</td><td>0.9204±0.0227</td><td>0.6538±0.0196</td><td>0.6460</td></tr><tr><td>LDDG Li et al. (2020a)</td><td>0.2793±0.0244</td><td>0.6007±0.0187</td><td>0.6967±0.0211</td><td>0.8167±0.0209</td><td>0.9272±0.0117</td><td>0.6978±0.0182</td><td>0.6697</td></tr><tr><td>SWAD Cha et al.(2021)</td><td>0.3582 ±0.0234</td><td>0.5491 ±0.0231</td><td>0.6842 ±0.0156</td><td>0.9167 ±0.0121</td><td>0.9824 ±0.0012</td><td>0.7240 ±0.0251</td><td>0.7024</td></tr><tr><td>BDIL Xiao et al. (2021)</td><td>0.2985±0.0452</td><td>0.6204±0.0212</td><td>0.7059±0.0145</td><td>0.8967±0.0096</td><td>0.9860±0.0198</td><td>0.7219±0.0284</td><td>0.7049</td></tr><tr><td>DNA Chu et al. (2022)</td><td>0.3532 ±0.0133</td><td>0.5581 ±0.0178</td><td>0.7120 ±0.0194</td><td>0.9333 ±0.0045</td><td>0.9851 ±0.0032</td><td>0.7314 ±0.0141</td><td>0.7122</td></tr><tr><td>DSU Li et al. (2022c)</td><td>0.3830 ±0.0267</td><td>0.5739 ±0.0147</td><td>0.6935 ±0.0165</td><td>0.8833 ±0.0231</td><td>0.9841 ±0.0098</td><td>0.7201 ±0.0121</td><td>0.7063</td></tr><tr><td>Ours</td><td>0.3781±0.0136</td><td>0.6120±0.0115</td><td>0.7276 ±0.0201</td><td>0.9416±0.0103</td><td>0.9889±0.0041</td><td>0.7486 ±0.0123</td><td>0.7328</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 2: Experiment results of Epithelium Stroma Classification in Histopathological Images. Each column denotes a cross-domain task. For example, in the second column, we use IHC dataset denotes as the target domain and the remaining datasets as the source domains.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Method</td><td>IHC</td><td>NKI</td><td>VGH</td><td>Average (%)</td></tr><tr><td>DeepAll</td><td>73.29 ±0.13</td><td>70.60 ±0.15</td><td>79.56±0.11</td><td>74.48</td></tr><tr><td>MASF Dou et al. (2019)</td><td>80.45±0.10</td><td>76.10±0.11</td><td>84.44±0.12</td><td>80.33</td></tr><tr><td>SWAD Cha et al. (2021)</td><td>79.74±0.15</td><td>74.84±0.13</td><td>84.29±0.12</td><td>79.62</td></tr><tr><td>BDIL Xiao et al. (2021)</td><td>85.56±0.12</td><td>71.89±0.14</td><td>85.90±0.18</td><td>81.05</td></tr><tr><td>DNA Chu et al. (2022)</td><td>83.93±0.18</td><td>73.94±0.15</td><td>85.57±0.17</td><td>81.14</td></tr><tr><td>DSULi et al. (2022c)</td><td>81.56±0.14</td><td>72.47±0.12</td><td>83.94±0.16</td><td>79.32</td></tr><tr><td>Ours (in this paper)</td><td>88.82±0.09</td><td>76.71±0.10</td><td>86.92±0.14</td><td>84.06</td></tr></table>
|
| 139 |
+
|
| 140 |
+
# 4 EXPERIMENTS AND ANALYSES
|
| 141 |
+
|
| 142 |
+
# 4.1 SKIN LESION CLASSIFICATION
|
| 143 |
+
|
| 144 |
+
Here, we first perform the skin lesion classification task to explore the generalization performance of our proposed method. 7 public skin lesion datasets 1 are utilized, including HAM10000, UDA, SON, DMF, MSK, D7P, and PH2. There are seven classes of skin lesions. The challenges of this task refer to two aspects. 1) The diversity of samples: The lesion locations (e.g., on the leg and the thigh), patients’ characteristics (e.g., the skin age and complexion) and the imaging vendors are different among domains, significant domain shifts thus can not be ignored. 2) Insufficient samples: The acquired data not only are restricted by the total number of samples in some domains (e.g., UDA and PH2 have only 601 and 200 samples, respectively) but also suffer from the limitation of inter-class imbalance (e.g., SON dataset only has a class of lesion). We follow experimental settings in (Li et al., 2020a), where each dataset is randomly split into $50 \%$ training set, $30 \%$ test set, and $20 \%$ validate set, respectively. The pretrained ResNet18 network is used as the backbone for all methods.
|
| 145 |
+
|
| 146 |
+
Results. Some competitive domain generalization approaches are introduced for comparison, including MASF Dou et al. (2019), BDIL Xiao et al. (2021), LDDG Li et al. (2020a) SWAD Cha et al. (2021), DNA Chu et al. (2022), and DSU Li et al. (2022c). ”DeepAll” denotes the model that is trained directly without any domain generalization strategy in all subsequent tasks. We turn their hyperparameters in a wide range. Note that our proposed method, DSU, DNA and BDIL are based on SWAD framework. The accuracy results of each cross-domain task are shown in Table 1. One has some observations as following. First, all methods achieve consistent improvements compared over DeepAll model. Second, we observe that MASF and LDDG with deterministic models may not explicitly adapt to the scenario of insufficient samples. In contrast, our proposed method and other baseline methods impose respective schemes to relieve the impact of insufficient samples, which leads to obvious improvements. Benefiting from probabilistic framework as an implicit regularization, our proposed method and BDIL can learn a distribution over weights, which can handle insufficient samples flexibly. However, it can be observed that additional invariant classifier learning on BDIL may cause negative effects (see the results on DMF) on challenging data, which may be reasonable as the explicit alignment on the classifier with high error probability can lead to negative transfer (take more uncertainty). The lack of explicit domain-invariant representations for DNA and DSU may be difficult to address significant domain shifts compared with our proposed method.
|
| 147 |
+
|
| 148 |
+
Table 3: The average results of spinal cord GM segmentation on 4 domain generalization tasks.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">DeepAll</td><td rowspan="2">MASF Dou et al. (2019)</td><td rowspan="2">LDGG Li et al. (2020a)</td><td rowspan="2">KDGG</td><td rowspan="2">DSU Li et al. (2022c)</td><td rowspan="2">Ours</td></tr><tr><td>Wang et al. (2021)</td></tr><tr><td>DSC↑</td><td>0.7425</td><td>0.7710</td><td>0.7881</td><td>0.7886</td><td>0.7921</td><td>0.7957</td></tr><tr><td>CC个</td><td>-11.4</td><td>23.52</td><td>34.86</td><td>33.43</td><td>34.65</td><td>35.76</td></tr><tr><td>JI个</td><td>0.6160</td><td>0.6502</td><td>0.6667</td><td>0.6667</td><td>0.6775</td><td>0.6828</td></tr><tr><td>TPR↑</td><td>0.7667</td><td>0.7803</td><td>0.8058</td><td>0.8075</td><td>0.8225</td><td>0.8260</td></tr><tr><td>ASD</td><td>0.5265</td><td>0.5505</td><td>0.4076</td><td>0.3553</td><td>0.4362</td><td>0.3356</td></tr></table>
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 3: The loss curve of iteration on skin lesion and epothelial-stromal classficaiton tasks. (a) Global alignment loss (b) Local alignment loss.
|
| 154 |
+
|
| 155 |
+
Table 4: Ablation study on each component of our proposed method for spinal cord gray matter segmentation task (where ”site2” is as the target domain). The model on the first row denotes the basic Unet model.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Backbone (Unet)</td><td>Bayesian Layers</td><td>Local Alignment Alignment</td><td>Global</td><td>Bayesian Classifier</td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td></tr><tr><td>√</td><td>X</td><td>=</td><td>=</td><td>X</td><td>0.7223</td><td>26.21</td><td>0.5789</td><td>0.8109</td><td>0.0992</td></tr><tr><td></td><td></td><td>=</td><td></td><td></td><td>0.7934 47.19 0.6595</td><td></td><td></td><td>0.8133</td><td>30.0692</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td>0.8268 57.52</td><td></td><td>0.7067</td><td>0.8156</td><td>50.0501</td></tr><tr><td></td><td></td><td>?</td><td>X</td><td></td><td>0.8364</td><td>60.72</td><td>0.7195</td><td>0.8267</td><td>0.0486</td></tr><tr><td>ss></td><td></td><td>×</td><td></td><td></td><td>0.837160.57 0.7217</td><td></td><td></td><td>0.8152</td><td>20.0510</td></tr><tr><td></td><td></td><td>?</td><td></td><td>Xxs>>></td><td>0.848563.78 0.7389 0.8401</td><td></td><td></td><td></td><td>10.0401</td></tr></table>
|
| 158 |
+
|
| 159 |
+
# 4.2 EPITHELIUM STROMA CLASSIFICATION
|
| 160 |
+
|
| 161 |
+
The epithelium-stroma ratio can reflect the prognostic status of the tumor, especially for the breast cancer. A key step, therefore, is to recognize which tissues are epithelial or stromal in histopathological images. The obvious domain gaps can be observed from Figure 1. Meanwhile, it is much difficult to collect massive number of histopathological images from different sites due to the privacy. Here, three histopathological image datasets 2 collected from different medical institutes are used for comparison, where the NKI and VGH datasets only have 671 and 615 images, respectively. We follow the research in Qi et al. (2020) to extract epithelial or stromal patches from histopathological images, in order to balance the number of images among datasets. Then, IHC, NKI, and VGH datasets have 1342, 1230, and 1376 patches, respectively, which is still insufficient for training. We utilize the DomainBed benchmark Gulrajani & Lopez-Paz (2020) for fair comparison, where each dataset in source domain is randomly split into $80 \%$ training set, $20 \%$ validate set. The testing is on overall target domain. The pretrained ResNet18 is adopted by all methods as backbone.
|
| 162 |
+
|
| 163 |
+
Results. We compare our proposed method with recent DG models, including MASF, SWAD, BDIL, DNA, and DUS. By turning the hyperparameter of baseline methods in a wide range, the classification accuracy on each target domain (the remaining is as the source domain) is reported in Table 2. Some observations can be summarized as following. First, we observe that the type of weight averaging method (e.g., SWAD and DNA) is effective for this challenging out-of-domain task. However, due to the lack of explicit domain alignment, the obvious domain shifts may not be fully addressed via weighted ensemble learning, leading to the limitation of the performance. Second, BDIL not only adopts two-level alignments on feature extractor and classifier, but also obtains further improvements by probabilistic framework. However, one can observe that BDIL has a similar performance drop (in the skin lesion classification) on the challenging task (i.e., the NKI task). The best performance achieved by our proposed method thus shows the effectiveness of our proposed method. DSU has the poorest performance among all baseline methods, which may be reasonable as the straightforward domain randomization in feature space may not be powerful for eliminating obvious domain shifts.
|
| 164 |
+
|
| 165 |
+
# 4.3 SPINAL CORD GRAY MATTER SEGMENTATION
|
| 166 |
+
|
| 167 |
+
The spinal cord Gray Matter (GM) segmentation Challenge Dataset 3 is used here, where the acquired magnetic resonance imaging (MRI) data are collected from four healthcare centers, and acquisition manufactures and imaging protocols are variable. The challenges of insufficient sample are from two aspects. 1) The number of slices in some sites is relatively small (e.g., site1 and site2 have only 30 and 113 slices). 2) The number of target pixels is small, as GM area is only a very small area in overall slice. We follow the training protocols used in Li et al. (2020a) for all methods.
|
| 168 |
+
|
| 169 |
+
Table 5: Experiment results of PACS multi-domain classification task based on ResNet50. Each column denotes a cross-domain task. For example, in the third column, we use Art dataset denotes as the target domain and the remaining datasets as the source domains.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Method</td><td>Reference</td><td>Art</td><td>Cartoon</td><td>Photo</td><td>Sketch</td><td>Average (%)</td></tr><tr><td>RSCHuang et al. (2020) L2A-OT Zhou et al. (2020)</td><td>ECCV2020 ECCV2020</td><td>78.9 83.3</td><td>76.9 78.2</td><td>94.1 96.2</td><td>76.8 73.6</td><td>81 .7 82.8</td></tr><tr><td>MatchDG Mahajan et al. (2021) pAdaIN Nuriel et al. (2021)</td><td>ICML2020 CVPR 2021</td><td>81.2 81.7</td><td>80.4 76.6</td><td>96.8</td><td>77.2</td><td>83.9</td></tr><tr><td>MixStyle Zhou et al. (2021)</td><td></td><td></td><td></td><td>96.3</td><td>75.1</td><td>82.5</td></tr><tr><td></td><td>ICLR2021</td><td>86.8</td><td>79.0</td><td>96.6</td><td>78.5</td><td>85.2</td></tr><tr><td>SagNet Nam et al. (2021)</td><td>CVPR2021</td><td>87.4</td><td>80.7</td><td>97.1</td><td>80.0</td><td>86.3</td></tr><tr><td>SWAD Cha et al. (2021)</td><td>NeurIPS2021</td><td>89.3</td><td>83.4</td><td>97.3</td><td>82.5</td><td>88.1</td></tr><tr><td>DNA Chu et al. (2022)</td><td>ICML2022</td><td>89.8</td><td>83.4</td><td>97.7</td><td>82.6</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td>88.4</td></tr><tr><td>Bayesian</td><td>=</td><td>89.4</td><td>83.5</td><td>97.3</td><td>82.3</td><td>88.1</td></tr><tr><td>Ours</td><td></td><td>90.2</td><td>85.2</td><td>98.7</td><td>83.6</td><td>89.4</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Results. Here, four domain generalization approaches are utilized for comparison, including MASF, LDDG Li et al. (2020a), KDDG Wang et al. (2021), and DSU. To qualitatively evaluate the segmentation results, 5 complementary metrics are introduced from statistical and distance-based perspectives, respectively. The average results on four domain generalization tasks are illustrated in Table 3. The detailed evaluation results for each domain can be found in Appendix. First, the performance of segmentation results among all methods achieve improvements with an obvious margin compared with DeepAll. Second, suffering from insufficient samples in some domains, LDDG and KDDG with deterministic models may not model these uncertainties explicitly. In contrast, our proposed method and DSU can generally obtained the best and second best results.
|
| 174 |
+
|
| 175 |
+
# 4.4 ADDITIONAL RESULTS
|
| 176 |
+
|
| 177 |
+
Ablation study on each component of our proposed method. We are interested in the effectiveness of each component of our proposed method. The results can be shown in Table 4. First, we observe that better performance can be achieved by introducing probabilistic layer compared with the results that using Unet, which reflects the superiority of probabilistic models. Secondly, we observe that by either introducing local or global alignment for domain-invariant information learning, better performance can be achieved compared with the results of only using probabilistic layer, which shows the effectiveness of introduced probabilistic feature regularization term. Last but not the least, by imposing the domain-invariant learning with both local and global views, the performances are further improved, which justifies the effectiveness of our proposed method by jointly considering local and global alignment.
|
| 178 |
+
|
| 179 |
+
Effectiveness of domain-invariant loss. We are also interested in impacts of domain-invariant losses on different tasks. The results can be shown in Figure 3. As we can observe, for the skin lesion (on DMF) and epithelium-stroma (on IHC) classification tasks, the loss curves with iterations reflect the global discrepancy converges faster than local discrepancy, while the more challenging cross-domain task converges more slowly on global alignment.
|
| 180 |
+
|
| 181 |
+
Results on DG Benchmark. While our proposed method is designed for the context of insufficient data, it can also be applied to the setting of conventional DG problem generalization. Here, we introduce three DG benchmarks, namely PACS, OfficeHome and VLCS, for further comparison. Compared with some large-scale benchmarks (e.g., DomainNet and Wilds), these two datasets are more appropriate to explore the effectiveness of different DG models under the scenario of insufficient samples. We report the results on PACS in Table 5. We compare our proposed method with some stateof-the-art DG methods. To be fair, all methods adopt a same backbone, i.e., the pretrained ResNet50. ”Bayesian” model does not have any alignment compared with our model. As we can see, our proposed method outperforms recent methods, such as DNA and SWAD. Specifically, our proposed method surpasses the gradient operation-based method (e.g., RSC). Although data generation methods (e.g., MixStyle) can effectively tackle the insufficient sample problem via additional generative samples, the lack of effective domain-invariant learning may hamper the improvement of the performance.
|
| 182 |
+
|
| 183 |
+
# 5 CONCLUSION
|
| 184 |
+
|
| 185 |
+
In this work, we address the domain generalization problem in the context of insufficient data from source domains. Benefiting from the learned representation captured by probabilistic models, our proposed method can marriage the measurement on the distribution over distributions by level-2 kernel and probabilistic contrastive semantic alignment. Extensive experiments on challenging medical image tasks indicate the effectiveness of our proposed method.
|
| 186 |
+
|
| 187 |
+
# ETHICS STATEMENT
|
| 188 |
+
|
| 189 |
+
We believe that there is no ethics issue in our work. The reasons are provided as follow. First, no personal or private information exists in our adopted medical imaging data. Second, access to these medical imaging data is feasible by signing an agreement form with the provider or download datasets directly from our given website link in the main content. Third, in our submission, we focus on the problem of domain generalization instead of long-tail/imbalance data classification. We therefore follow the previous work on these medical imaging datasets.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using meta-regularization. Advances in neural information processing systems, 31, 2018.
|
| 194 |
+
|
| 195 |
+
Yogesh Balaji, Rama Chellappa, and Soheil Feizi. Normalized wasserstein for mixture distributions with applications in adversarial learning and domain adaptation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6500–6508, 2019.
|
| 196 |
+
|
| 197 |
+
Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19, 2006.
|
| 198 |
+
|
| 199 |
+
Alain Berlinet and Christine Thomas-Agnan. Reproducing kernel Hilbert spaces in probability and statistics. Springer Science & Business Media, 2011.
|
| 200 |
+
|
| 201 |
+
Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain ¨ generalization by marginal transfer learning. The Journal of Machine Learning Research, 22(1): 46–100, 2021.
|
| 202 |
+
|
| 203 |
+
David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American statistical Association, 112(518):859–877, 2017.
|
| 204 |
+
|
| 205 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In International conference on machine learning, pp. 1613–1622. PMLR, 2015.
|
| 206 |
+
|
| 207 |
+
Karsten M Borgwardt, Arthur Gretton, Malte J Rasch, Hans-Peter Kriegel, Bernhard Scholkopf, ¨ and Alex J Smola. Integrating structured biological data by kernel maximum mean discrepancy. Bioinformatics, 22(14):e49–e57, 2006.
|
| 208 |
+
|
| 209 |
+
Yuheng Bu, Shaofeng Zou, Yingbin Liang, and Venugopal V Veeravalli. Estimation of kl divergence: Optimal minimax rate. IEEE Transactions on Information Theory, 64(4):2648–2674, 2018.
|
| 210 |
+
|
| 211 |
+
Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. Advances in Neural Information Processing Systems, 34:22405–22418, 2021.
|
| 212 |
+
|
| 213 |
+
Xu Chu, Yujie Jin, Wenwu Zhu, Yasha Wang, Xin Wang, Shanghang Zhang, and Hong Mei. Dna: Domain generalization with diversified neural averaging. In International Conference on Machine Learning, pp. 4010–4034. PMLR, 2022.
|
| 214 |
+
|
| 215 |
+
Qi Dou, Daniel Coelho de Castro, Konstantinos Kamnitsas, and Ben Glocker. Domain generalization via model-agnostic learning of semantic features. Advances in Neural Information Processing Systems, 32, 2019.
|
| 216 |
+
|
| 217 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pp. 1050–1059. PMLR, 2016.
|
| 218 |
+
|
| 219 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016.
|
| 220 |
+
|
| 221 |
+
Rui Gong, Wen Li, Yuhua Chen, and Luc Van Gool. Dlow: Domain flow for adaptation and generalization. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2477–2486, 2019.
|
| 222 |
+
|
| 223 |
+
Alex Graves. Practical variational inference for neural networks. Advances in neural information processing systems, 24, 2011.
|
| 224 |
+
|
| 225 |
+
Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Scholkopf, and Alexander Smola. A ¨ kernel two-sample test. The Journal of Machine Learning Research, 13(1):723–773, 2012.
|
| 226 |
+
|
| 227 |
+
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020.
|
| 228 |
+
|
| 229 |
+
Shoubo Hu, Kun Zhang, Zhitang Chen, and Laiwan Chan. Domain generalization via multidomain discriminant analysis. In Uncertainty in Artificial Intelligence, pp. 292–302. PMLR, 2020.
|
| 230 |
+
|
| 231 |
+
Zeyi Huang, Haohan Wang, Eric P Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In European Conference on Computer Vision, pp. 124–140. Springer, 2020.
|
| 232 |
+
|
| 233 |
+
Prannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna, Yonglong Tian, Phillip Isola, Aaron Maschinot, Ce Liu, and Dilip Krishnan. Supervised contrastive learning. Advances in Neural Information Processing Systems, 33:18661–18673, 2020.
|
| 234 |
+
|
| 235 |
+
Jin Kim, Jiyoung Lee, Jungin Park, Dongbo Min, and Kwanghoon Sohn. Self-balanced learning for domain generalization. In 2021 IEEE International Conference on Image Processing (ICIP), pp. 779–783. IEEE, 2021.
|
| 236 |
+
|
| 237 |
+
Durk P Kingma, Tim Salimans, and Max Welling. Variational dropout and the local reparameterization trick. Advances in neural information processing systems, 28, 2015.
|
| 238 |
+
|
| 239 |
+
Ranganath Krishnan, Mahesh Subedar, and Omesh Tickoo. Specifying weight priors in bayesian deep neural networks with empirical bayes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 4477–4484, 2020.
|
| 240 |
+
|
| 241 |
+
Ranganath Krishnan, Pi Esposito, and Mahesh Subedar. Bayesian-torch: Bayesian neural network layers for uncertainty estimation, January 2022. URL https://doi.org/10.5281/zenodo. 5908307.
|
| 242 |
+
|
| 243 |
+
David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815–5826. PMLR, 2021.
|
| 244 |
+
|
| 245 |
+
Junghwan Lee, Cong Liu, Junyoung Kim, Zhehuan Chen, Yingcheng Sun, James R Rogers, Wendy K Chung, and Chunhua Weng. Deep learning for rare disease: A scoping review. medRxiv, 2022.
|
| 246 |
+
|
| 247 |
+
Chenxin Li, Xin Lin, Yijin Mao, Wei Lin, Qi Qi, Xinghao Ding, Yue Huang, Dong Liang, and Yizhou Yu. Domain generalization on medical imaging classification using episodic training with task augmentation. Computers in Biology and Medicine, 141:105144, 2022a.
|
| 248 |
+
|
| 249 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta-learning for domain generalization. In Proceedings of the AAAI conference on artificial intelligence, volume 32, 2018a.
|
| 250 |
+
|
| 251 |
+
Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5400–5409, 2018b.
|
| 252 |
+
|
| 253 |
+
Haoliang Li, YuFei Wang, Renjie Wan, Shiqi Wang, Tie-Qiang Li, and Alex Kot. Domain generalization for medical imaging classification with linear-dependency regularization. Advances in Neural Information Processing Systems, 33:3118–3129, 2020a.
|
| 254 |
+
|
| 255 |
+
Menghan Li, Bin Huang, and Guohui Tian. A comprehensive survey on 3d face recognition methods. Engineering Applications of Artificial Intelligence, 110:104669, 2022b.
|
| 256 |
+
|
| 257 |
+
Xiaotong Li, Yongxing Dai, Yixiao Ge, Jun Liu, Ying Shan, and LINGYU DUAN. Uncertainty modeling for out-of-distribution generalization. In International Conference on Learning Representations, 2022c. URL https://openreview.net/forum?id $= 6 .$ HN7LHyzGgC.
|
| 258 |
+
|
| 259 |
+
Xiaoxiao Li, Yufeng Gu, Nicha Dvornek, Lawrence H Staib, Pamela Ventola, and James S Duncan. Multi-site fmri analysis using privacy-preserving federated learning and domain adaptation: Abide results. Medical Image Analysis, 65:101765, 2020b.
|
| 260 |
+
|
| 261 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In Proceedings of the IEEE international conference on computer vision, pp. 2980–2988, 2017.
|
| 262 |
+
|
| 263 |
+
Quande Liu, Cheng Chen, Jing Qin, Qi Dou, and Pheng-Ann Heng. Feddg: Federated domain generalization on medical image segmentation via episodic learning in continuous frequency space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1013–1023, 2021.
|
| 264 |
+
|
| 265 |
+
Xiaofeng Liu, Chaehwa Yoo, Fangxu Xing, Hyejin Oh, Georges El Fakhri, Je-Won Kang, Jonghye Woo, et al. Deep unsupervised domain adaptation: A review of recent advances and perspectives. APSIPA Transactions on Signal and Information Processing, 11(1), 2022.
|
| 266 |
+
|
| 267 |
+
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint adaptation networks. In International conference on machine learning, pp. 2208–2217. PMLR, 2017.
|
| 268 |
+
|
| 269 |
+
Divyat Mahajan, Shruti Tople, and Amit Sharma. Domain generalization using causal matching. In International Conference on Machine Learning, pp. 7313–7324. PMLR, 2021.
|
| 270 |
+
|
| 271 |
+
Ankur Mallick, Chaitanya Dwivedi, Bhavya Kailkhura, Gauri Joshi, and T Yong-Jin Han. Deep kernels with probabilistic embeddings for small-data learning. In Uncertainty in Artificial Intelligence, pp. 918–928. PMLR, 2021.
|
| 272 |
+
|
| 273 |
+
Saeid Motiian, Marco Piccirilli, Donald A Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In Proceedings of the IEEE international conference on computer vision, pp. 5715–5725, 2017.
|
| 274 |
+
|
| 275 |
+
Muhammad F Mridha, Abu Quwsar Ohi, Md Abdul Hamid, and Muhammad Mostafa Monowar. A study on the challenges and opportunities of speech recognition for bengali language. Artificial Intelligence Review, 55(4):3431–3455, 2022.
|
| 276 |
+
|
| 277 |
+
Krikamol Muandet, Kenji Fukumizu, Francesco Dinuzzo, and Bernhard Scholkopf. Learning from ¨ distributions via support measure machines. Advances in neural information processing systems, 25, 2012.
|
| 278 |
+
|
| 279 |
+
Krikamol Muandet, Kenji Fukumizu, Bharath Sriperumbudur, Bernhard Scholkopf, et al. Kernel ¨ mean embedding of distributions: A review and beyond. Foundations and Trends® in Machine Learning, 10(1-2):1–141, 2017.
|
| 280 |
+
|
| 281 |
+
Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing domain gap by reducing style bias. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8690–8699, 2021.
|
| 282 |
+
|
| 283 |
+
Radford M Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 284 |
+
|
| 285 |
+
Oren Nuriel, Sagie Benaim, and Lior Wolf. Permuted adain: Reducing the bias towards global statistics in image classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9482–9491, 2021.
|
| 286 |
+
|
| 287 |
+
Qi Qi, Xin Lin, Chaoqi Chen, Weiping Xie, Yue Huang, Xinghao Ding, Xiaoqing Liu, and Yizhou Yu. Curriculum feature alignment domain adaptation for epithelium-stroma classification in histopathological images. IEEE Journal of Biomedical and Health Informatics, 25(4):1163–1172, 2020.
|
| 288 |
+
|
| 289 |
+
Hangwei Qian, Sinno Jialin Pan, and Chunyan Miao. Latent independent excitation for generalizable sensor-based cross-person activity recognition. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 11921–11929, 2021.
|
| 290 |
+
|
| 291 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pp. 234–241. Springer, 2015.
|
| 292 |
+
|
| 293 |
+
Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019.
|
| 294 |
+
|
| 295 |
+
Kihyuk Sohn. Improved deep metric learning with multi-class n-pair loss objective. Advances in neural information processing systems, 29, 2016.
|
| 296 |
+
|
| 297 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pp. 443–450. Springer, 2016.
|
| 298 |
+
|
| 299 |
+
Vikas Verma, Alex Lamb, Christopher Beckham, Amir Najafi, Ioannis Mitliagkas, David Lopez-Paz, and Yoshua Bengio. Manifold mixup: Better representations by interpolating hidden states. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 6438–6447. PMLR, 09–15 Jun 2019. URL https://proceedings.mlr.press/v97/ verma19a.html.
|
| 300 |
+
|
| 301 |
+
Yufei Wang, Haoliang Li, Lap-pui Chau, and Alex C Kot. Embracing the dark knowledge: Domain generalization using regularized knowledge distillation. In Proceedings of the 29th ACM International Conference on Multimedia, pp. 2595–2604, 2021.
|
| 302 |
+
|
| 303 |
+
Andrew G Wilson and Pavel Izmailov. Bayesian deep learning and a probabilistic perspective of generalization. Advances in neural information processing systems, 33:4697–4708, 2020.
|
| 304 |
+
|
| 305 |
+
Zehao Xiao, Jiayi Shen, Xiantong Zhen, Ling Shao, and Cees Snoek. A bit more bayesian: Domaininvariant learning with uncertainty. In International Conference on Machine Learning, pp. 11351– 11361. PMLR, 2021.
|
| 306 |
+
|
| 307 |
+
Xufeng Yao, Yang Bai, Xinyun Zhang, Yuechen Zhang, Qi Sun, Ran Chen, Ruiyu Li, and Bei Yu. Pcl: Proxy-based contrastive learning for domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7097–7107, 2022.
|
| 308 |
+
|
| 309 |
+
Chris Yoon, Ghassan Hamarneh, and Rafeef Garbi. Generalizable feature learning in the presence of data bias and domain class imbalance with application to skin lesion classification. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 365–373. Springer, 2019.
|
| 310 |
+
|
| 311 |
+
Yuya Yoshikawa, Tomoharu Iwata, and Hiroshi Sawada. Latent support measure machines for bag-of-words data classification. Advances in neural information processing systems, 27, 2014.
|
| 312 |
+
|
| 313 |
+
Xiangyu Yue, Yang Zhang, Sicheng Zhao, Alberto Sangiovanni-Vincentelli, Kurt Keutzer, and Boqing Gong. Domain randomization and pyramid consistency: Simulation-to-real generalization without accessing target domain data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2100–2110, 2019.
|
| 314 |
+
|
| 315 |
+
Syed Sahil Abbas Zaidi, Mohammad Samar Ansari, Asra Aslam, Nadia Kanwal, Mamoona Asghar, and Brian Lee. A survey of modern deep learning based object detection models. Digital Signal Processing, pp. 103514, 2022.
|
| 316 |
+
|
| 317 |
+
Kaiyang Zhou, Yongxin Yang, Timothy Hospedales, and Tao Xiang. Learning to generate novel domains for domain generalization. In European conference on computer vision, pp. 561–578. Springer, 2020.
|
| 318 |
+
|
| 319 |
+
Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. arXiv preprint arXiv:2104.02008, 2021.
|
| 320 |
+
|
| 321 |
+
Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022.
|
| 322 |
+
|
| 323 |
+
# A APPENDIX
|
| 324 |
+
|
| 325 |
+
# A.1 DETAILS OF BAYESIAN NEURAL NETWORK
|
| 326 |
+
|
| 327 |
+
For our proposed method, the Bayesian layer refers to the probabilistic extractor $Q _ { \phi }$ and the probabilistic classifier $C _ { \omega }$ . Here, a simple and convenient PyTorch library, namely BayesianTorch Krishnan et al. (2022), is utilized to construct the Bayesian neural network. The log evidence lower bound (ELBO) cost function, i.e.,
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\mathcal { L } : = \int q _ { \theta } l o g ( y | x , w ) d w - \mathrm { K L } [ q _ { \theta } ( w ) | p ( w ) ] ,
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
can be calculated automatically. By using BayesianTorch, arbitrary deterministic models can be converted into the Bayesian layers easily. In this paper, mean-field variational inference (MFVI) Graves (2011) is adopted, where the parameters of the model are characterized by fully factorized Gaussian distribution endowed by variational parameters $\mu$ and $\sigma$ , i.e.,
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
q _ { \theta } ( w ) : = \mathcal { N } ( w | \mu , \sigma ) .
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
By using stochastic gradient descent method with ELBO cost, the variational distribution $q _ { \theta } ( w )$ as the approximation of the posterior distribution, and corresponding parameters ( $\mu$ and $\sigma$ ) and can be learned conveniently.
|
| 340 |
+
|
| 341 |
+
For the settings of Bayesian layer, we follow the model priors with empirical Bayes using DNN (MOPED) method for the parameter settings of weights prior, each weight is sampled from the Gaussian distribution independently Krishnan et al. (2020),
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
w \sim \mathcal { N } ( w _ { \mathrm { D N N } } , \delta | w _ { \mathrm { D N N } } | ) ,
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
where $w _ { \mathrm { D N N } }$ denotes the mean of prior distribution from the maximum likelihood estimates of weights from deterministic deep neural network. $\delta$ , a hyperparameter, is set to the initial perturbation factor for the percentage of the pretrained deterministic weight values. The variational layer is modeled using reparameterization trick. The MOPED can realize better training convergence for complex models Krishnan et al. (2020), which is beneficial to our proposed method. In this paper, we follow the setting in (Krishnan et al., 2020) to set the initial perturbation factor $\delta$ for the weight to 0.1.
|
| 348 |
+
|
| 349 |
+
# A.2 EXPERIMENTAL DETAILS OF SKIN LESION CLASSIFICATION
|
| 350 |
+
|
| 351 |
+
Dataset Details. There are seven classes of skin lesions, including melanoma $( m e l )$ , melanocytic nevus $( n \nu )$ , dermato broma $( d f )$ , basal cell carcinoma $( b c c )$ benign keratosis $( b k l )$ , vascular lesion (vasc), and actinic keratosis (akiec). The 7 public skin lesion datasets suffer from an insufficient data problem from some (certain) source domains. For example, the PH2 and UDA datasets only have 200 and 601 skin lesion images, respectively. The number of images for each domain can be found in Table 9. More details of datasets can be found in Yoon et al. (2019). For inputs, all images are resized into $2 2 4 \times 2 2 4$ for all methods.
|
| 352 |
+
|
| 353 |
+
Implementation Details. The pretrained ResNet18 is introduced as the backbone for all methods. For our proposed method, the structure of Bayesian layer in probabilistic extractor $Q _ { \phi }$ is a fullyconnected based Bayesian neural network with $5 1 2 \times 5 1 2$ . Note that the DSU, BDIL, DNA, and our proposed method are constructed based on SWAD framework. The hyperparameters of SWAD follow default settings Cha et al. (2021). The DSU can be regarded as the uncertainty version of SWAD with ResNet18. The structure of Bayesian layer in probabilistic classifier $C _ { \omega }$ is also a fully-connected based Bayesian neural network with $5 1 2 \times 7$ . The construction of $C _ { \omega }$ is the same as that of $T _ { \phi }$ . Due to the class imbalance problem, the focal loss Lin et al. (2017) as the classification objective is introduced for all methods.
|
| 354 |
+
|
| 355 |
+
During training, our proposed method is optimized by Adam optimizer with $5 \times 1 0 ^ { - 5 }$ learning rate. The training steps are 2000. For each step, we randomly sample from each training source domain with 32 samples to construct the mini-batch. To evaluate the testing set, the training process is stopped according to the validation loss computed by SWAD on the validation set. The hyperparameters are also selected in a wide range on the validation set. For the probabilistic MMD, level-1 and leve-2 kernels are the Gaussian RBF kernels by following (Muandet et al., 2012). The kernel bandwidth is empirically set to 1 for all kernels. For the probabilistic CSA loss, the distance margin $\xi$ is set to 1. For the $\mathcal { L } _ { l o c a l }$ and the $\mathcal { L } _ { g l o b a l }$ , the $\beta _ { 1 }$ and $\beta _ { 2 }$ are 0.1 and 0.7, respectively. By balancing the performance and computational efficiency, $T$ , the number of Monte Carlo sampling in each Bayesian layer, is 10.
|
| 356 |
+
|
| 357 |
+
Table 6: Domain generalization results on gray matter segmentation task. For the DSC, CC, TPR, and JI, the higher the better. For the ASD, the lower the better.
|
| 358 |
+
|
| 359 |
+
<table><tr><td colspan="8">(a) DeepAll</td><td colspan="8">(b) KDDG</td></tr><tr><td>source</td><td>target</td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td><td>source</td><td>target</td><td></td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td></tr><tr><td>2,3,4</td><td>1</td><td>0.8560</td><td>65.34</td><td>0.7520</td><td>0.8746</td><td>0.0809</td><td>2,3,4</td><td>1</td><td>0.8745</td><td>70.75</td><td></td><td>0.7795</td><td>0.8949</td><td>0.0539</td></tr><tr><td>1,3,4</td><td>2</td><td>0.7323</td><td>26.21</td><td>0.5789</td><td>0.8109</td><td>0.0992</td><td>1,3,4</td><td>2</td><td></td><td>0.8229</td><td>56.71</td><td>0.6997</td><td>0.8226</td><td>0.0490</td></tr><tr><td>1,2,4</td><td>3</td><td>0.5041</td><td>-209</td><td>0.3504</td><td>0.4926</td><td>1.8661</td><td>1,2.4</td><td>3</td><td>0.5676</td><td></td><td>-63.1</td><td>0.3866</td><td>0.5904</td><td>1.2805</td></tr><tr><td>1,2.3</td><td>4</td><td>0.8775</td><td>71.92</td><td>0.7827</td><td>0.8888</td><td>0.0599</td><td>1,2,3</td><td>4</td><td>0.8894</td><td></td><td>75.06</td><td>0.8011</td><td>0.9222</td><td>0.0377</td></tr><tr><td>Average</td><td></td><td>0.7425</td><td>-11.4</td><td>0.6160</td><td>0.7667</td><td>0.5265</td><td colspan="2">Average</td><td>0.7886</td><td>34.86</td><td></td><td>0.6667</td><td>0.8075</td><td>0.3553</td></tr><tr><td colspan="10">(c) MASF</td><td colspan="7">(d) LDDG</td></tr><tr><td>source</td><td>target</td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td><td>source</td><td>target</td><td></td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td></tr><tr><td>2.3,4</td><td>1</td><td>0.8502</td><td>64.22</td><td>0.7415</td><td>0.8903</td><td>0.2274</td><td>2.3,4</td><td>1</td><td>0.8708</td><td>69.29</td><td></td><td>0.7753</td><td>0.8978</td><td>0.0411</td></tr><tr><td>1,3,4</td><td>2</td><td>0.8115</td><td>53.04</td><td>0.6844</td><td>0.8161</td><td>0.0826</td><td>1,3,4</td><td>2</td><td>0.8364</td><td>60.58</td><td></td><td>0.7199</td><td>0.8485</td><td>0.0416</td></tr><tr><td>1,2,4</td><td>3</td><td>0.5285</td><td>-99.3</td><td>0.3665</td><td>0.5155</td><td>1.8554</td><td>1,2,4</td><td>3</td><td>0.5543</td><td></td><td>-71.6</td><td>0.3889</td><td>0.5923</td><td>1.5187</td></tr><tr><td>1,2,3</td><td>4</td><td>0.8938</td><td>76.14</td><td>0.8083</td><td>0.8991</td><td>0.0366</td><td>1,2.3</td><td>4</td><td>0.8910</td><td></td><td>75.46</td><td>0.8039</td><td>0.8844</td><td>0.0289</td></tr><tr><td>Average</td><td></td><td>0.7710</td><td>23.52</td><td>0.6502</td><td>0.7803</td><td>0.5505</td><td colspan="2">Average</td><td>0.7881</td><td>33.43</td><td></td><td>0.6720</td><td>0.8058</td><td>0.4076</td></tr><tr><td colspan="10">(e)DSU</td><td colspan="7">(f) Ours</td></tr><tr><td>source</td><td>target</td><td>DSC</td><td>CC</td><td>JI</td><td>TPR</td><td>ASD</td><td>source</td><td>target</td><td>DSC</td><td>CC</td><td></td><td>JI</td><td>TPR</td><td>ASD</td></tr><tr><td>2,3,4</td><td>1</td><td>0.8739</td><td>70.32</td><td>0.7794</td><td>0.9210</td><td>0.0793</td><td>2,3,4</td><td>1</td><td>0.8786</td><td>71.57</td><td></td><td>0.7873</td><td>0.9293</td><td>0.0422</td></tr><tr><td>1,3,4</td><td>2</td><td>0.8474</td><td>63.58</td><td>0.7367</td><td>0.8502</td><td>0.0494</td><td>1,3,4</td><td>2</td><td>0.8485</td><td>63.78</td><td></td><td>0.7389</td><td>0.8401</td><td>0.0401</td></tr><tr><td>1,2,4</td><td>3</td><td>0.5574</td><td>-70.4</td><td>0.3923</td><td>0.6097</td><td>1.5049</td><td>1,2,4</td><td>3</td><td>0.5634</td><td></td><td>-68.0</td><td>0.3992</td><td>0.6103</td><td>1.2239</td></tr><tr><td>1,2,3</td><td>4</td><td>0.8897</td><td>75.10</td><td>0.8018</td><td>0.9225</td><td>0.0415</td><td>1,2.3</td><td>4</td><td>0.8921</td><td></td><td>75.69</td><td>0.8058</td><td>0.9245</td><td>0.0362</td></tr><tr><td>Average</td><td></td><td>0.7921</td><td>34.65</td><td>0.6775</td><td>0.8225</td><td>0.4362</td><td></td><td>Average</td><td></td><td>0.7957</td><td>35.76</td><td>0.6828</td><td>0.8260</td><td>0.3356</td></tr></table>
|
| 360 |
+
|
| 361 |
+
# A.3 EXPERIMENTAL DETAILS OF EPITHELIUM STROMA CLASSIFICATION
|
| 362 |
+
|
| 363 |
+
Dataset Details. There are two types of basic tissues, i.e., the epithelium and the stroma. Due to the differences of the scanner, the staining type, and the population, the color of the background and the morphological structure among different histopathological image datasets are diverse. The number of images for each domain can be found in Table 9. The extract epithelial or stromal patches are resized into $2 2 4 \times 2 2 4$ .
|
| 364 |
+
|
| 365 |
+
Implementation Details. The pretrained ResNet18 is utilized as the backbone for all methods. The basic model framework and corresponding parameters for our proposed method are similar with the settings mentioned in A.2. The DSU, BDIL, DNA, and our proposed method are constructed based on SWAD framework with DomainBed benchmark. The classification objective is the cross-entropy loss with softmax function.
|
| 366 |
+
|
| 367 |
+
During training, our proposed method is optimized by Adam optimizer with $5 \times 1 0 ^ { - 5 }$ learning rate. The training steps are 4000. The holdout fraction rate for DomainBed is set to 0.2 for all methods such that the hyperparameters can be selected in a wide range on the validation set. The $\beta _ { 1 }$ and $\beta _ { 2 }$ are 0.1 and 0.7 for the $\mathcal { L } _ { l o c a l }$ and the $\mathcal { L } _ { g l o b a l }$ , respectively. Other hyperparameters are the same as the settings mentioned in A.2.
|
| 368 |
+
|
| 369 |
+
# A.4 EXPERIMENTAL DETAILS OF SPINAL CORD GRAY MATTER SEGMENTATION
|
| 370 |
+
|
| 371 |
+
Dataset Details. The spinal cord gray matter (GM) segmentation is an emergent task that can be utilized to predict disability (as a biomarker) via evaluating the atrophy of GM area. The acquired magnetic resonance imaging (MRI) data are collected from four healthcare centers (including ”site1”, ”site2”,”site3”, and ”site4”), where acquisition manufacturers (including Philips Achieva, Siemens Trio, and Siemens Skyra) and imaging protocols (lead to the difference in the resolution of the voxel) are variable. The number of images for each domain can be found in Table 9. By following (Li et al.,
|
| 372 |
+
|
| 373 |
+
Table 7: Out-of-domain accuracies $( \% )$ on OfficeHome based on ResNet50.
|
| 374 |
+
|
| 375 |
+
<table><tr><td>Algorithm</td><td>Art</td><td>Clipart</td><td>Product</td><td>Real</td><td>Avg</td></tr><tr><td>Mixstyle Zhou et al. (2021)</td><td>51.1</td><td>53.2</td><td>68.2</td><td>69.2</td><td>60.4</td></tr><tr><td>RSC Huang et al. (2020)</td><td>60.7</td><td>51.4</td><td>74.8</td><td>75.1</td><td>65.5</td></tr><tr><td>DANN Ganin et al. (2016)</td><td>59.9</td><td>53.0</td><td>73.6</td><td>76.9</td><td>65.9</td></tr><tr><td>GroupDRO Sagawa et al. (2019)</td><td>60.4</td><td>52.7</td><td>75.0</td><td>76.0</td><td>66.0</td></tr><tr><td>MTL Blanchard et al. (2021)</td><td>61.5</td><td>52.4</td><td>74.9</td><td>76.8</td><td>66.4</td></tr><tr><td>VREx Krueger et al. (2021)</td><td>60.7</td><td>53.0</td><td>75.3</td><td>76.6</td><td>66.4</td></tr><tr><td>MLDG Balaji et al. (2018)</td><td>61.5</td><td>53.2</td><td>75.0</td><td>77.5</td><td>66.8</td></tr><tr><td>SagNet Qian et al. (2021)</td><td>63.4</td><td>54.8</td><td>75.8</td><td>78.3</td><td>68.1</td></tr><tr><td>CORAL Sun & Saenko (2016)</td><td>65.3</td><td>54.4</td><td>76.5</td><td>78.4</td><td>68.7</td></tr><tr><td>SWAD Cha et al. (2021)</td><td>66.1</td><td>57.7</td><td>78.4</td><td>80.2</td><td>70.6</td></tr><tr><td>DNA Chu et al. (2022)</td><td>67.7</td><td>57.7</td><td>78.9</td><td>80.5</td><td>71.2</td></tr><tr><td>Bayesian</td><td>67.0</td><td>58.0</td><td>79.3</td><td>80.4</td><td>71.2</td></tr><tr><td>Ours</td><td>68.2</td><td>58.9</td><td>80.2</td><td>80.7</td><td>72.0</td></tr></table>
|
| 376 |
+
|
| 377 |
+
Table 8: Out-of-domain accuracies (%) on VLCS based on ResNet50.
|
| 378 |
+
|
| 379 |
+
<table><tr><td>Algorithm</td><td>C</td><td>L ?</td><td>S</td><td>V</td><td>Ayg</td></tr><tr><td>Mixstyle Zhou et al. (2021) RSC Huang et al. (2020) DANN Ganin et al. (2016) GroupDRO Sagawa et al. (2019)</td><td>98.3 97.9 99.0 97.3 97.8</td><td>64.8 62.5 65.1 63.4 64.3 64.4</td><td>72.1 72.3 73.1 69.5 71.5 74.1</td><td>74.3 75.6 77.2 76.7 75.3 76.2</td><td>77.4 77.1 78.6 76.7 77.2 78.3</td></tr></table>
|
| 380 |
+
|
| 381 |
+
2018b), the 3D MRI data are split into 2D slices in axial view. Then, these obtained 2D slices are centered cropped to $1 6 0 \times 1 6 0$ and randomly cropped to $1 4 4 \times 1 4 4$ for training.
|
| 382 |
+
|
| 383 |
+
Implementation Details. The 2D-Unet Ronneberger et al. (2015) is leveraged as the backbone for all methods. For our proposed method, probabilistic extractor $Q _ { \phi }$ is constructed by two Bayesian-based $1 \times 1$ convolutional layers. The input and output channels in the first convolutional layer are both 64. After a ReLU layer, the input and output channels in the second convolutional laye are 64 and 1, respectively. The BayesianTorch can enable to convert ordinary convolutional layer into Bayesian convolutional neural network easily. The Bayesian neural network adopts MFVI to approximate the posterior distribution of weights. The parameters of Bayesian layer are the same as aforementioned settings. The structure of Bayesian layer in probabilistic classifier $C _ { \omega }$ is a Bayesian-based $1 \times 1$ convolutional layers. The input and output channels are 64 and 1, respectively. The construction of $C _ { \omega }$ is the same as that of $T _ { \phi }$ . Here, all methods adopt a two-stage scheme for coarse-to-fine segmentation, as used in (Li et al., 2020a). Specifically, we first conduct preliminary segmentation to obtain the spinal cord area from the original 2D slice. Then, we perform elaborative segmentation on obtained spinal cord results to derive gray matter results.
|
| 384 |
+
|
| 385 |
+
Here, the settings of most hyperparameters follow (Li et al., 2020a), where the Adam optimizer is utilized with learning rate as $1 \times 1 0 ^ { - 4 }$ , weight decay as $1 \times 1 0 ^ { - 8 }$ . We randomly select 8 slices from each source domain to construct the mini-batch. All models are trained with 200 epochs, where the learning rate will be decreased each 80 epochs with a factor of 10. Other hyperparameters such as kernel function, kernel bandwidth and distance margin are similar with the settings in skin lesion classification and epithelium-stroma classification. The segmentation can be regarded as the pixel-level classification. For the $\mathcal { L } _ { l o c a l }$ and $\mathcal { L } _ { g l o b a l }$ , we follow (Motiian et al., 2017) to randomly sample some positive and negative pairs from two domains such that the computational efficiency can be improved significantly. Here, we randomly sample 400 positive and negative pixel pairs from two domains in a mini-batch for the computation of $\mathcal { L } _ { l o c a l }$ , respective. By leveraging selected pixels of a domain in $\mathcal { L } _ { l o c a l }$ , we further utilize these pixels to calculate the $\mathcal { L } _ { g l o b a l }$ , which may induce a more accurate measurement owing to the balanced class distribution, as well as reducing computational cost. For the $\mathcal { L } _ { l o c a l }$ and $\mathcal { L } _ { g l o b a l }$ , the $\beta _ { 1 }$ and the $\beta _ { 2 }$ are set to 0.01 and 0.001.
|
| 386 |
+
|
| 387 |
+
Table 9: The details of adopted datasets
|
| 388 |
+
|
| 389 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Datasets Domains) and Corresponding Size</td><td rowspan=1 colspan=1>Number of Class</td></tr><tr><td rowspan=1 colspan=1> Skin Lesion Classification</td><td rowspan=1 colspan=1>HAM:10015: DMF:1212: D7P:1926:MSK:3551;UDA:601: PH2:200: SON:9251</td><td rowspan=1 colspan=1>7</td></tr><tr><td rowspan=1 colspan=1>Epithelium Stroma Classification</td><td rowspan=1 colspan=1>NKI: 671: IHC:1376: VGH: 615</td><td rowspan=1 colspan=1>2</td></tr><tr><td rowspan=1 colspan=1>Spnal Cord GM Segementation</td><td rowspan=1 colspan=1>site1: 30; site2: 113: site3: 246: site4: 122</td><td rowspan=1 colspan=1>2 (pixel-level)</td></tr><tr><td rowspan=1 colspan=1>PACS</td><td rowspan=1 colspan=1>Art:2048: Cartoon:2344: Photo:1670: Sketch:3929</td><td rowspan=1 colspan=1>7</td></tr><tr><td rowspan=1 colspan=1>OfficeHome</td><td rowspan=1 colspan=1>A total of around 15500 images for 4 domains(Art,Clipart,Product,and Real with around 3897 per domain)</td><td rowspan=1 colspan=1>6</td></tr><tr><td rowspan=1 colspan=1>VLCS</td><td rowspan=1 colspan=1>VOC2007 (V): 3376: LabelMe (L):2656;SUN09(S):3282: Caltech101 (C): 1415</td><td rowspan=1 colspan=1>5</td></tr></table>
|
| 390 |
+
|
| 391 |
+
Result Analysis. Dice Similarity Coefficient (DSC), Jaccard Index (JI), and Conformity Coefficient (CC) are used to measure the accuracy of obtained segmentation results. Besides, True Positive Rate (TPR) and Average Surface Distance (ASD) are introduced as complementary evaluations from statistical and distance-based perspectives. The experimental results are shown in Table 6 in details. As we can see, our proposed method can achieve best or second-best performance in all task. For average results, our proposed method and DSU roughly achieve the best and second-best performance, especially in the DSC, JI, and TPR, which may be reasonable. Specifically, DSU introduce the multivariate Gaussian distribution of feature statistics for the uncertainty of the feature. Our proposed method not only can model the uncertainty by the introduction of Bayesian neural network, but also can learn distribution-based domain-invariant representations in latent feature space.
|
| 392 |
+
|
| 393 |
+
# A.5 EXPERIMENTAL SETTINGS AND ADDITIONAL RESULTS ON BENCHMARK
|
| 394 |
+
|
| 395 |
+
Besides PACS benchmark dataset, we further validate the effectiveness of our proposed method on two popular benchmark datasets, including OfficeHome (has 15588 samples with 65 classes from four domains) and VLCS (has 10729 samples with 5 classes from four domains). The number of images for each domain can be found in Table 9. We adopt pretrained ResNet50 as the backbone for all benchmarks. The structure of the overall framework is similar with the model mentioned in lesion skin classification. Our proposed method as well as baseline methods are all based on DomainBed, where the holdout fraction (the proportion of validation set) rate for DomainBed is set to 0.2 for all methods. A domain is the target domain and the remaining domains are the source domain for training. The testing is on the overall data of a target domain.
|
| 396 |
+
|
| 397 |
+
Here, our proposed method is optimized by Adam optimizer with learning rate as $5 \times 1 0 ^ { - 5 }$ . The batch size for each source domain is 32. The training steps are set to 20000 for PACS and OfficeHome, and 2000 for VLCS. By following the SWAD framework, the training process will be stopped for our proposed method when the validation loss increases significantly. The hyperparameters are selected in a wide range on the validation set. For the $\mathcal { L } _ { l o c a l }$ and $\mathcal { L } _ { g l o b a l }$ , the $\beta _ { 1 }$ and the $\beta _ { 2 }$ are set to 0.1 and 1 for all benchmark datasets. Other hyperparameters such as kernel function, kernel bandwidth and distance margin are similar with the settings mentioned before.
|
| 398 |
+
|
| 399 |
+
The experimental results on OfficeHome and VLCS can be shown in Table 7 and Table 8. As we can see, our proposed method achieves better performance compared with state-of-the-art methods, such as SWAD and DNA. Compared with domain-invariant based approaches (e.g., DANN), our proposed method has a significant improvement due to the introduction of probabilistic framework. Meanwhile, the model, namely ”Bayesian” on Table 7 can be regarded as a probabilistic version of
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 4: The performance of our proposed model on the NKI task of Epithelium Stroma classification with different Monte Carlo samples $T$ .
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 5: The performance comparison between mean embedding method and kernel mean embedding method with different Monte Carlo samples $T$ . For each sub-figure, we use only one alignment operation. (a) Local alignment. Mean Embedding: The mean embedding operation with Euclidean distance is utilized between probabilistic embedding pairs. Kernel Mean Embedding: The kernel mean embedding with MMD distance is utilized between probabilistic embedding pairs. (b) Global alignment. Mean Embedding: The mean embedding operation with MMD distance is utilized between domains (as distributions). Kernel Mean Embedding: The kernel mean embedding with P-MMD distance is utilized between domains (as distributions over distributions).
|
| 406 |
+
|
| 407 |
+
SWAD via replacing deterministic layers with Bayesian layers. Interestingly, compared with SWAD, a significant improvement can be obtained by Bayesian model (which does not have any alignment compared with our model), which shows the effectiveness of probabilistic framework on insufficient data. Our proposed method also outperforms the data augmentation-based approach (e.g., Mixstyle).
|
| 408 |
+
|
| 409 |
+
# A.6 ADDITIONAL ANALYSIS
|
| 410 |
+
|
| 411 |
+
First, it is much important to balance the number of Monte Carlos samples and the computational efficiency. On the one hand, the property of probabilistic embeddings can be affected by the Monte Carlos sampling. On the other hand, too many Monte Carlos samples may suffer from the heavy computational cost. (Xiao et al., 2021) suggested that the distributional property and computational cost are both acceptable for the computation of the KL divergence when the number of Monte Carlos samples is chosen appropriately, the practical performance for our proposed method need to be explored. We conduct the experiments on the NKI task of Epithelium-Stromal classification with different Monte Carlo samples $T$ .
|
| 412 |
+
|
| 413 |
+
The results are shown in Figure 4. As we can see, if the number of Monte Carlo samples is too small, it is difficult to capture the property of distribution for probabilistic embeddings. As the increase of $T$ , there is an obvious improvement for our proposed method. Interestingly, the performance is gradually saturated. As a result, by balancing the number of Monte Carlos samples and the computational efficiency, the number of Monte Carlos samples $T$ in each Bayesian layer is set to 10.
|
| 414 |
+
|
| 415 |
+
Kernel Mean Embedding (level-2 kernel) v.s. Mean Embedding. Second, we explore the effect of different schemes for probabilistic embeddings. A straightforward method is first to represent probabilistic embeddings with the expectation (i.e., first moment), which is called as the Mean Embedding. Then, a probabilistic embedding can be regarded as a latent point, and the MMD can be leveraged to measure the discrepancy between distributions consisted of latent points.
|
| 416 |
+
|
| 417 |
+
For the mean embedding-based $\mathcal { L } _ { g l o b a l }$ , the computational process of this scheme for MMD distance can be formulated as
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\mathrm { M M D } ( \mathbb { P } _ { l } , \mathbb { P } _ { t } ) ^ { 2 } = \| \frac { 1 } { n _ { l } } \sum _ { i = 1 } ^ { n _ { l } } \varphi ( \mathbb { E } [ \Pi _ { l _ { i } } ] ) - \frac { 1 } { n _ { t } } \sum _ { j = 1 } ^ { n _ { t } } \varphi ( \mathbb { E } [ \Pi _ { t _ { j } } ] ) \| _ { \mathcal { H } } ^ { 2 } .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
The Eq. (13) can be further constructed a global alignment loss $\mathcal { L } _ { g l o b a l }$ . For the local alignment loss $\mathcal { L } _ { l o c a l }$ , the Euclidean distance can be used to compute the distance between latent points, which is similar with original CAS loss in (Motiian et al., 20the mean embedding-based positive contrastive loss $\mathcal { L } _ { l o c a l } ^ { p o s }$ or the positive pairs with the same label,can be represented as
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\mathcal { L } _ { l o c a l } ^ { p o s } = \frac { 1 } { 2 } \left\| \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \mathbb { E } \left[ M _ { \Theta } ( \mathbf { z } _ { n _ { i } } ) \right] ) - \frac { 1 } { T } \sum _ { j = 1 } ^ { T } \mathbb { E } \left[ M _ { \Theta } ( \mathbf { z } _ { q _ { j } } ) \right] ) \right\| _ { 2 } ^ { 2 } , s . t . \mathbf { y } _ { n } = \mathbf { y } _ { q } ,
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
where $M _ { \Theta } ( \cdot )$ denotes the embedding network of metric learning. For the negative pairs with the different labels, the negative contrastive loss is denoted by
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\mathcal { L } _ { l o c a l } ^ { n e g } = \frac { 1 } { 2 } \operatorname* { m a x } [ 0 , \boldsymbol { \xi } - \left\| \frac { 1 } { T } \sum _ { i = 1 } ^ { T } \mathbb { E } \left[ M _ { \Theta } ( \mathbf { z } _ { n _ { i } } ) \right] ) - \frac { 1 } { T } \sum _ { j = 1 } ^ { T } \mathbb { E } \left[ M _ { \Theta } ( \mathbf { z } _ { q _ { j } } ) \right] ) \right\| _ { 2 } ^ { 2 } ] , s . t . \mathbf { y } _ { n } \neq \mathbf { y } _ { q } .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
As a result, a mean embedding-based contrastive loss with the view of local alignment can be calculated as
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\mathcal { L } _ { l o c a l } = \mathcal { L } _ { l o c a l } ^ { p o s } + \mathcal { L } _ { l o c a l } ^ { n e g } .
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
Instead, we can observe from Figure 2 that our proposed method induces a level-2 kernel-based MMD with empirical estimation for probabilistic embeddings. Specifically, our proposed scheme can preserve higher moments of a probabilistic embedding via nonlinear level-1 kernel (see the fourth component in Figure 2). Moreover, by introducing a level-2 kernel, the similarities between probabilistic embeddings also can be measured based on their own moment information (see the last component in Figure 2). Benefiting from these virtues, the proposed probabilistic MMD can accurately capture the discrepancy between mixture distributions via an extended empirical MMD fashion.
|
| 442 |
+
|
| 443 |
+
Here, we validate the effectiveness of different schemes on the NKI task of Epithelium Stroma classification in each aligned view. The experimental settings are similar for different methods. The experimental results can be found in Figure 5. As we can see, our proposed method achieves consistent improvements in each alignment method with different Monte Carlo samples, which may be reasonable as the kernel mean representation can preserve many statistical components due to the injective property. Second, when the number of MC samples is 10, we can observe an obvious margin in global alignment, which refers to the computation between mixture distributions. ✿
|
| 444 |
+
|
| 445 |
+
Finally, we are also interested in the performance of the proposed method under challenging small data scenarios compared with baseline methods. As a result, we conduct two kinds of experiments with different conditions on skin lesion classification, including a fixed number of samples per class in each source domain and a fixed fraction of samples in each source domain. We choose MSK dataset as the target domain and the remaining domains as the source domains.
|
| 446 |
+
|
| 447 |
+
Table 10: Fixed number of samples per class in each source domain.
|
| 448 |
+
|
| 449 |
+
<table><tr><td>Number of sample per class for each source domain</td><td>DeepAll</td><td>DSU</td><td>BDIL</td><td>DNA?</td><td>Qurs</td></tr><tr><td>40</td><td>0.5399 ±0.0156</td><td>0.6145 ±0.0175</td><td></td><td>0.5897±0.0029 0.5412 ±0.0143 0.6368±0.0074</td><td></td></tr><tr><td>30</td><td></td><td></td><td></td><td>0.5309±0.02010.5458±0.01840.5762_±0.01010.5132±0.02290.6138±0.0291</td><td></td></tr><tr><td>20</td><td>0.5044 ±0.0129</td><td>0.5243 ±0.0143</td><td>0.5573 ±0.0011</td><td>0.5048 ±0.00870.6037±0.0121</td><td></td></tr></table>
|
| 450 |
+
|
| 451 |
+
Table 11: Fixed fraction of samples in each source domain.
|
| 452 |
+
|
| 453 |
+
<table><tr><td>Fraction of sample for each source domain</td><td>DeepAll</td><td>DSU</td><td>BDIL</td><td>DNA</td><td>Qurs</td></tr><tr><td>100%</td><td>0.6674 ±0.0312</td><td>0.6935 ±0.0121</td><td>0.7059 ±0.0284</td><td>0.7121_±0.0141</td><td>0.7276 ±0.0123</td></tr><tr><td>80%</td><td>0.6614 ±0.0123</td><td>0.6717 ±0.0029</td><td>0.6625 ±0.092</td><td>0.6591 ±0.0022</td><td>0.6975 ±0.0036</td></tr><tr><td>60%</td><td>0.6249 ±0.0122</td><td>0.6299 ±0.0114</td><td>0.6468 ±0.0106</td><td>0.6149 ±0.0112</td><td>0.6641 ±0.0114</td></tr><tr><td>40%</td><td>0.5911 ±0.0215</td><td>0.6188 ±0.0541</td><td>0.6491±0.0171</td><td>0.6065 ±0.0111</td><td>0.6579 ±0.0057</td></tr></table>
|
| 454 |
+
|
| 455 |
+
Fixed number of samples per class in each source domain. Specifically, we randomly draw T samples from each class in a source domain to represent this domain for training. Here, we set T to 20,30, and 40, respectively, in different experiments. The experimental settings are the same as the descriptions in A.2, except for the training steps as 600.
|
| 456 |
+
|
| 457 |
+
The results can be found in Table 10. As we can see, our proposed method achieved the best performance among all settings compared with all baseline methods. Meanwhile, it seems that the Bayesian-based DG approaches (e.g., our proposed method and BIDL) have better performance compared with other methods, which is reasonable as the BNN can be adaptive to the small data scenario well. Especially, our proposed method has around $5 \%$ improvements compared with the second-best method when $T$ is set to smaller, i.e., 20.
|
| 458 |
+
|
| 459 |
+
Fixed fraction of samples in each source domain. Specifically, we randomly draw $C \%$ samples from the training samples of each source domain to represent this domain for training. For example, D7P dataset has 963 training samples originally. The total number of samples for this domain is $-$ for training when $\cdot$ is set to $40 \%$ . Here, we set $C$ to $\cdot$ , $\cdot$ , and $\cdot$ , respectively, as separately different experiments. Note that $\cdot$ can not be set too small (as the number of samples in some classes of some domains is very limited.), otherwise the batch size can not be uniform. We can observe this kind of setting is challenging as the total number of samples for each domain is gradually small. The results can be found in Table 11. We can observe from Table 11 that our proposed method also achieves a relatively stable and better performance compared with baseline methods, as the decrease of fraction of samples in each source domain.
|
| 460 |
+
|
| 461 |
+
# A.7 DISCUSSIONS
|
| 462 |
+
|
| 463 |
+
In this paper, the definition of small data is based on a specific task, including the difficulty of prediction, the quality of on-hand images, the number of source domains, and so on. Small data scenarios may be a relative concept. Specifically, a small data scenario not only can represent the number of training examples is small among all source domains compared with some large volumes of datasets but also can reflect the number of training examples is relatively smaller in some (certain) domains. On the abovementioned conditions, it may be difficult to ensure reliable contrastive semantic loss with point-wise (or local) alignment and distribution-wise (or global) alignment because both of them require sufficient samples among source domains. Our proposed method aims to improve performance over the abovementioned small data scenarios, which is a significant motivation for this work.
|
parse/dev/RKiWwhocuiU/RKiWwhocuiU_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/RKiWwhocuiU/RKiWwhocuiU_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/T0GpzBQ1Fg6/T0GpzBQ1Fg6_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/bdHkMjBJG_w/bdHkMjBJG_w_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/dev/hQwb-lbM6EL/hQwb-lbM6EL.md
ADDED
|
@@ -0,0 +1,550 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INCODER: A GENERATIVE MODEL FOR CODE INFILLING AND SYNTHESIS
|
| 2 |
+
|
| 3 |
+
Daniel Fried∗♡†♢ Armen Aghajanyan∗♡ Jessy Lin Sida Wang♡ Eric Wallace♣ Freda Shi△ Ruiqi Zhong Wen-tau Yih♡ Luke Zettlemoyer♡† Mike Lewis♡ Facebook AI Research♡ University of Washington† UC Berkeley TTI-Chicago Carnegie Mellon University dfried@cs.cmu.edu, {armenag,mikelewis}@fb.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Code is seldom written in a single left-to-right pass and is instead repeatedly edited and refined. We introduce INCODER, a unified generative model that can perform program synthesis (via left-to-right generation) as well as editing (via masking and infilling). InCoder is trained to generate code files from a large corpus of permissively licensed code, where regions of code have been randomly masked and moved to the end of each file, allowing code infilling with bidirectional context. Our model is the first large generative code model that is able to infill arbitrary regions of code, which we evaluate in a zero-shot setting on challenging tasks such as type inference, comment generation, and variable re-naming. We find that the ability to condition on bidirectional context substantially improves performance on these tasks, while still performing comparably on standard program synthesis benchmarks in comparison to left-to-right only models pretrained at similar scale.
|
| 8 |
+
|
| 9 |
+
Our models and code are publicly released.1
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Large language models trained on vast repositories of code have demonstrated remarkable progress in neural program synthesis and related tasks (Chen et al., 2021a; Austin et al., 2021; Xu et al., 2022; Nijkamp et al., 2022; Chowdhery et al., 2022). However, such models generate code leftto-right, which makes them less directly applicable to many ubiquitous code editing tasks, such as fixing bugs, adding comments, or re-naming variables. We introduce INCODER, a unified model for program synthesis and editing. Like prior work, INCODER is trained to maximize the likelihood of a corpus of code. However, we adopt a causal masking objective (Aghajanyan et al., 2022a), allowing INCODER to infill blocks of code conditioned on arbitrary left and right contexts.
|
| 14 |
+
|
| 15 |
+
More specifically, we learn to infill by randomly replacing spans of code with a sentinel token and moving them to the end of the sequence (Figure 1, top). The model is trained to predict all tokens in the complete sequence in this permuted ordering. During inference, we can edit code by replacing spans with sentinel tokens, prompting the model with the new sequence, and having it generate new tokens to replace the masked spans (Figure 1, bottom). Because the model can also trivially generate without sentinel tokens, the result is a unified approach for both program synthesis (via left-to-right generation) and editing (via infilling).
|
| 16 |
+
|
| 17 |
+
We evaluate performance on a range of zero-shot code infilling tasks (Sec. 4), both new and from existing work, including challenging use cases such as type prediction, variable re-naming, comment generation, and completing missing lines of code. Zero-shot infilling with bidirectional context substantially outperforms approaches based on left-to-right-only models, and on several tasks obtains performance comparable to state-of-the-art models fine-tuned on the tasks. Ablation experiments (Sec. 5) show that this does not come at the cost of left-to-right generation ability; our causal masking model achieves similar performance to a standard language model on program synthesis benchmarks (Chen et al., 2021a; Austin et al., 2021) despite its more general training objective.
|
| 18 |
+
|
| 19 |
+
# Training
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
|
| 23 |
+
# Zero-shot Inference
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Docstring Generation
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Multi-Region Infilling
|
| 30 |
+
Figure 1: At training time (top), our causal masking objective samples one or more spans of code in training documents (in the upper left figure, a single span) and moves these spans to the end of the document, with their original location denoted by special mask sentinel tokens. An autoregressive language model is trained to produce these entire masked documents, allowing it to learn to generate insertion text conditioned on bidirectional context. At inference time (bottom), we can perform a variety of code editing and infilling tasks in a zero-shot fashion by inserting mask tokens at desired locations and allowing the model to generate code to insert there. All examples shown are real outputs from our INCODER-6.7B model, with the regions inserted by the model highlighted in orange.
|
| 31 |
+
|
| 32 |
+
# 2 INFILLING AND SYNTHESIS VIA CAUSAL MASKING
|
| 33 |
+
|
| 34 |
+
Neural models for code generation have either utilized a left-to-right (causal) autoregressive language modeling objective (Brown et al., 2020; Chen et al., 2021a) or, as BERT does, a masked language modeling objective (Devlin et al., 2019; Feng et al., 2020). Both approaches have strengths and weaknesses. Causal models only condition on context to the left of the generated tokens, thus preventing infilling, but they can autoregressively generate entire documents. On the other hand, masked language models can condition on both the left and right contexts to infill a masked region, however, their training objective is typically limited to generating only about $15 \%$ of a document. In this paper, we adopt the recently proposed causal masking objective (Aghajanyan et al., 2022a), which aims to combine the strengths of both causal and masked language models.
|
| 35 |
+
|
| 36 |
+
# 2.1 TRAINING
|
| 37 |
+
|
| 38 |
+
At training time, the causal masking procedure samples a number of spans of contiguous tokens in each document to mask (Figure 1, top left). We sample the number of spans from a Poisson distribution with a mean of one, truncated to the support [1, 256], so that there are typically a small number of spans (with a single span around $50 \%$ of the time), but the distribution has a long tail (up to 256 spans). Each span’s endpoints are sampled uniformly from the length of the document and the set of sampled spans is rejected and resampled if any spans overlap.
|
| 39 |
+
|
| 40 |
+
Once spans are sampled, each span $k$ is replaced with a special mask sentinel token, <Mask:k>. The sequence of tokens in the span is then moved to the end of the document (Figure 1, top right), with the mask sentinel token prepended and a special end-of-mask token $\mathsf { \mathrm { \tt { E O M } > } }$ token appended. In other words, when a mask token appears for the first time in the left-to-right ordering, it marks the location the span was removed from; when it appears for the second time, it marks the start of the moved span text. More formally, assume we have a document D with $N$ tokens, and we have sampled one span $\mathsf { S p a n } = \mathsf { D } _ { i : j }$ . Let Left be the left context $\mathsf { D } _ { 0 : i }$ and Right be the right context $\mathsf { D } _ { j : N }$ . Then, we maximize the log probability of the masked document:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\log P ( [ \mathsf { L e f t } ; \mathsf { \texttt { < M a s k : } } 0 > ; \mathsf { R i g h t } ; \mathsf { \texttt { < M a s k : } } 0 > ; \mathsf { \texttt { S p a n } } ; \mathsf { \texttt { < E O M > } } ] )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where ; denotes sequence concatenation. If more than one span were sampled, each would be similarly appended at the end of the document in order. As in standard left-to-right generative language modeling, we compute the probability of the sequence auto-regressively and train the model using cross-entropy loss on all tokens except the mask sentinel tokens <Mask:k>, so that the model does not generate these tokens during inference.
|
| 47 |
+
|
| 48 |
+
# 2.2 INFERENCE
|
| 49 |
+
|
| 50 |
+
During inference, the model can either be used for left-to-right generation in the standard way (by sampling autoregressively from the model, without using any special tokens), or it can insert code at arbitrary locations in an existing document by inserting a <Mask:k> tokens at the desired location(s) and continuing generation at the end of the document. Assuming for simplicity of notation that we want to insert text at only a single location, we can generate a span to insert between the location’s Left and Right context sequences by sampling tokens autoregressively from the distribution
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
P ( \cdot \mid [ \mathsf { L e f t } ; \mathsf { < M a s k : } 0 > ; \mathsf { R i g h t } ; \mathsf { < M a s k : } 0 > ] )
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
until either an ${ \tt { \tt { \tt { E 0 M } } } } >$ token is generated or a task-dependent stopping criterion is achieved.2 When applied to code, this allows us to perform tasks that benefit from the bidirectional context in a zero-shot fashion, as shown in Figure 1, bottom. For example, we can perform Python docstring generation conditioned on both the left context (function signature) and right context (function implementation). We can also infill multiple dependent regions, e.g., generate imports required by a function that the model is generating. See Section B.2 for details, including multi-region infilling.
|
| 57 |
+
|
| 58 |
+
# 3 MODELS
|
| 59 |
+
|
| 60 |
+
Our primary model is INCODER-6.7B, a 6.7B Transformer (Vaswani et al., 2017) language model. We use the same architecture as the dense 6.7B models described in Artetxe et al. (2021); the Fairseq architecture description can be found in Table 6 in the appendix. All experiments use this model unless stated otherwise (we train smaller models for comparison in Section 5).
|
| 61 |
+
|
| 62 |
+
To train our models, we collect a corpus of (1) public code with permissive, non-copyleft, opensource licenses from GitHub and GitLab and (2) StackOverflow questions, answers, and comments. Our primary focus in this paper is on the Python language, but we also include code files from 28 total languages and StackOverflow content from all available languages. We decontaminate our pre-training corpus by removing all datasets which we use in our evaluation experiments. See Section A.1 for details. Our final pre-training corpus contains a total of 159 GB of code, $5 2 \mathrm { G B }$ of it in Python, and a total of 57 GB of content from StackOverflow. See Figure 3 for size by language.
|
| 63 |
+
|
| 64 |
+
# 4 INFILLING EXPERIMENTS
|
| 65 |
+
|
| 66 |
+
Our primary evaluation is performing zero-shot infilling for a diverse set of tasks: inserting lines of code, predicting function return types, generating docstrings, renaming variables, and inserting missing code tokens. We formulate each task as filling in one or more masked-out regions of code.
|
| 67 |
+
|
| 68 |
+
To evaluate how INCODER benefits from bidirectional context when generating infills, we compare three different inference methods: the causal masking inference procedure described in Section 2, a standard left-to-right generation approach (left-to-right single), and a left-to-right generation and reranking approach (left-to-right reranking). Since our model is also able to generate left-to-right, we can compare all three inference methods using the same INCODER-6.7B model and thus avoid any confounding effects due to a change in the model. For all three inference methods, we obtain generations from the model using top- $p$ (nucleus) sampling (Holtzman et al., 2020) with $p = 0 . 9 5$ and a temperature tuned for each task and inference method using the task’s development data.
|
| 69 |
+
|
| 70 |
+
Left-to-right single. This baseline does not use the context to the right of the masked location at all. It generates a single completion for the location by conditioning on the left context and sampling tokens autoregressively from the model $P ( \cdot \mid$ Left) until a task-specific stop condition is reached (e.g., for comment generation, when a comment-ending delimiter is produced).
|
| 71 |
+
|
| 72 |
+
Left-to-right reranking. This baseline uses only the left context to propose candidates to infill the blank, but uses both the left and right contexts to choose among these candidates. Concretely, we first generate $K$ possible completions for the blank region, $\mathsf { S p a n } _ { 1 } \ldots \mathsf { S p a n } _ { K }$ following the same procedure as left-to-right single, using $K = 1 0$ unless otherwise specified. We then evaluate each candidate by substituting it into the blank and scoring the completed document. We use either total log probability of the completed document $\log P ( [ \mathsf { L e f t } ; \mathsf { S p a n } _ { k } ; \mathsf { R i g h t }$ ]) or, following Chen et al. (2021a), log probability averaged across the number of tokens in the completed document. We select between these two scoring methods for each task using performance on the task’s development data.
|
| 73 |
+
|
| 74 |
+
# 4.1 INFILLING LINES OF CODE (HUMANEVAL)
|
| 75 |
+
|
| 76 |
+
We create an infilling benchmark for complete lines of code from the HumanEval dataset (Chen et al., 2021a). This dataset provides comment descriptions of functions paired with a canonical implementation of each function and several input–output pairs that the function should pass. HumanEval was introduced as a benchmark for the synthesis of entire Python functions; we evaluate our models on this original synthesis setting in Section C.6. We use this dataset because it affords functional testing of completed code (as opposed to relying solely on an evaluation of the code surface form), which is particularly important when infilling longer regions that have more potential ways to be completed correctly. We construct two infilling tasks from the dataset, for single lines and multiple lines:
|
| 77 |
+
|
| 78 |
+
Single-line infilling. In this task, we mask out each non-blank line of code in the canonical function implementation in turn (creating $N$ examples for a function with $N$ non-blank lines). The task is to generate a single-line completion for the blank conditioned on the natural language description of the function and the code lines before and after the blank. We evaluate using (1) pass rate: the rate at which the completed function passes all of the function’s input–output pairs (i.e., analogous to the pass $@ 1$ metric from Chen et al. (2021a) and (2) exact match: percentage of times that the completed lines exactly match the masked lines in the canonical implementation. Performance is averaged across all examples generated for all programs in the dataset.
|
| 79 |
+
|
| 80 |
+
Multi-line infilling. This task is constructed in the same way as single-line infilling above but allows each masked region to contain multiple lines of code, creating $N \times ( N + 1 ) / 2$ examples for a function with $N$ non-blank lines. We again evaluate completions using pass rate and exact match, averaged across all infilling examples.
|
| 81 |
+
|
| 82 |
+
Inference details. To choose when to end the infill produced by our inference methods, we truncate the candidates generated by the left-to-right (L-R) baselines to the actual number of lines in the blanked-out region. For our causal-masked (CM) infilling method, we end the infill when the model generates the $\mathsf { \mathrm { \tt { E O M } } } \mathrm { \mathrm { > } }$ token. For the L-R single and CM infilling methods, we sample using a temperature of 0.2. For the L-R rerank method, we use a temperature of 0.8 to sample $K = 1 0$ candidates and rescore with the total log probability of the completed function.
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Method</td><td>Pass Rate</td><td>Exact Match</td></tr><tr><td>L-R single</td><td>48.2</td><td>38.7</td></tr><tr><td>L-R reranking</td><td>54.9</td><td>44.1</td></tr><tr><td>CM infilling</td><td>69.0</td><td>56.3</td></tr><tr><td>PLBART</td><td>41.6</td><td>一</td></tr><tr><td>code-cushman-001</td><td>53.1</td><td>42.0</td></tr><tr><td>code-davinci-001</td><td>63.0</td><td>56.0</td></tr></table>
|
| 85 |
+
|
| 86 |
+
<table><tr><td>Method</td><td>Pass Rate</td><td>Exact Match</td></tr><tr><td>L-R single</td><td>24.9</td><td>15.8</td></tr><tr><td>L-R reranking</td><td>28.2</td><td>17.6</td></tr><tr><td>CM infilling</td><td>38.6</td><td>20.6</td></tr><tr><td>PLBART</td><td>13.1</td><td>一</td></tr><tr><td>code-cushman-001</td><td>30.8</td><td>17.4</td></tr><tr><td>code-davinci-001</td><td>37.8</td><td>19.8</td></tr></table>
|
| 87 |
+
|
| 88 |
+
Table 1: On our single- and multi-line code infilling benchmarks that we construct from HumanEval, our causal-masked (CM) approach obtains substantial improvements over left-to-right single candidate and left-to-right reranking baselines in both function test pass rate and exact match.
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
(a) Single-line infilling. (b) Multi-line infilling.
|
| 92 |
+
Figure 2: Infilling pass rate by the fraction of the function’s lines which are provided to the right of the region that must be infilled, for single-line infilling (left) and multi-line infilling (right). Shaded regions give $9 5 \%$ confidence intervals, estimated using bootstrap resampling. Our causal-masked (CM) infilling method, blue, consistently outperforms both of the left-to-right (L-R) baselines, with larger gains as more right-sided context becomes available (the right side of both graphs).
|
| 93 |
+
|
| 94 |
+
Results. Table 1 shows the results for the single-line (left) and multi-line settings (right). In both settings, CM infilling improves substantially over the L-R single baseline and the L-R reranking baseline. Note that these results are computed by averaging over all examples, which includes masked regions at all positions in functions (including the beginning, when no left context is available, and end, when no right context is available). Figure 2 shows a finer-grained comparison, where we group examples by the fraction of lines in the canonical function which are contained in the context to the right of the infill. The CM infilling method sees larger improvements over the L-R baselines as more right-sided context becomes available (i.e., when the blanked region occurs earlier in the function).
|
| 95 |
+
|
| 96 |
+
We also compare against two alternate zero-shot methods for incorporating right-sided context: (1) an encoder-decoder code model trained with a denoising infilling objective (PLBART, Ahmad et al. 2021), and (2) templated prompting of large left-to-right generative code models (the cushman-001 and davinci-001 Codex models available through OpenAI’s API). See Section C.1 for details on these experiments.5 InCoder outperforms all models in both single-line and multi-line infilling, despite having lower performance in left-to-right generation than Codex (see Table 11), demonstrating that causal masking training benefits infilling.
|
| 97 |
+
|
| 98 |
+
<table><tr><td>Method</td><td>BLEU</td></tr><tr><td>Ours: L-R single</td><td>16.05</td></tr><tr><td>Ours: : L-R reranking Ours: :Causal-masked infilling</td><td>17.14</td></tr><tr><td></td><td>18.27</td></tr><tr><td>RoBERTa (Finetuned) CodeBERT (Finetuned)</td><td>18.14</td></tr><tr><td>PLBART (Finetuned)</td><td>19.06 19.30</td></tr><tr><td>CodeT5 (Finetuned)</td><td>20.36</td></tr></table>
|
| 99 |
+
|
| 100 |
+
Table 2: CodeXGLUE Python Docstring generation BLEU scores. Our model is evaluated in a zero-shot setting, with no fine-tuning for docstring generation, but it approaches the performance of pretrained code models that are fine-tuned on the task’s 250K examples (bottom block).
|
| 101 |
+
|
| 102 |
+
# 4.2 DOCSTRING GENERATION (CODEXGLUE)
|
| 103 |
+
|
| 104 |
+
We next evaluate documentation string (docstring) generation, where models must generate a natural language docstring that summarizes a Python code snippet. Right context may be particularly useful for docstring generation, as conditioning on the function body can allow models to generate more informative descriptions. Prior neural code generation models are fine-tuned on supervised docstring-code pairs to perform this task (e.g., Clement et al. 2020; Chen et al. 2021a; Lu et al. 2021; Ahmad et al. 2021), however we evaluate our model zero-shot, with no explicit supervision.
|
| 105 |
+
|
| 106 |
+
We use the CodeXGLUE code-to-text docstring generation task (Lu et al., 2021), which is constructed from CodeSearchNet (Husain et al., 2019), consisting of docstring-code pairs scraped from publicly available GitHub repositories. The L-R single candidate baseline is prompted with the function signature in the left context preceding the docstring. The CM infilling and L-R reranking methods also observe the right context, consisting of the function body.
|
| 107 |
+
|
| 108 |
+
We compare models following the original automatic evaluation setup for the task. In Table 2, we report smoothed 4-gram BLEU scores for all models, using the reference docstrings provided in the dataset. These references have been preprocessed to strip extraneous content (e.g., argument definitions) from the original scraped docstrings. We use greedy generation for the CM infilling and L-R single candidate generation methods and sample $K = 1 0$ candidates at temperature 0.8 with average log probability scoring for the L-R reranking method (selected by tuning on the validation set of the task). For all inference methods, we stop generation if the model generates a newline. We also include the performance of the supervised baseline from the CodeXGLUE paper: an encoderdecoder model with a CodeBERT encoder fine-tuned on $\sim 2 5 0 \mathrm { K }$ training examples from the dataset. Our zero-shot performance approaches the performance of the fine-tuned CodeBERT model.
|
| 109 |
+
|
| 110 |
+
# 4.3 RETURN TYPE PREDICTION
|
| 111 |
+
|
| 112 |
+
Predicting return type hints for Python functions is a challenging structured generation task (see Figure 1, “type inference”). We evaluate on two datasets: one we construct from CodeXGLUE and the dataset from TypeWriter OSS (Pradel et al., 2020).
|
| 113 |
+
|
| 114 |
+
CodeXGLUE. We develop a benchmark for return type prediction using the same Python CodeXGLUE dataset used in the code-to-text (docstring generation) task. We run an abstract syntax tree (AST) processor on all functions in the development and test sets of this dataset to (1) identify functions with a PEP $4 8 4 ^ { 6 }$ return type hint annotation that is not None and (2) remove all other type hints (e.g., for function arguments and variable declarations) from the function. This leaves 232 functions in the development and 469 functions in the test set.
|
| 115 |
+
|
| 116 |
+
The task is to condition on the function signature and body and predict the type hint. We compare the type hints predicted by our various methods to the annotated type hint in the original function, using exact match accuracy on the normalized type hint.7
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Left-to-right single</td><td>12.0</td></tr><tr><td>Left-to-right reranking</td><td>12.4</td></tr><tr><td>Causal-masked infilling</td><td>58.1</td></tr></table>
|
| 119 |
+
|
| 120 |
+
(a) Results on the test set of the benchmark that we construct from CodeXGLUE.
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Method</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Ours: Left-to-right single</td><td>30.8</td><td>30.8</td><td>30.8</td></tr><tr><td>Ours: :Left-to-right reranking</td><td>33.3</td><td>33.3</td><td>33.3</td></tr><tr><td>Ours: :Causal-masked infilling</td><td>59.2</td><td>59.2</td><td>59.2</td></tr><tr><td>TypeWriter (Supervised)</td><td>54.9</td><td>43.2</td><td>48.3</td></tr></table>
|
| 123 |
+
|
| 124 |
+
(b) Results on a subset of the TypeWriter’s OSS dataset (Pradel et al., 2020). We include examples from which we were able to obtain source files, successfully extract functions and types, that have non-None return type hints, and that were not included in our model’s training data.
|
| 125 |
+
|
| 126 |
+
Table 3: Results for predicting Python function return type hints on two datasets. We see substantial improvements from causal masked infilling over baseline methods using left-to-right inference.
|
| 127 |
+
|
| 128 |
+
To compare our three generation methods, we stop generation when a : is generated, which ends the type hint and signals the start of the function body. We tune inference hyperparameters on the development set, and we use a temperature of 0.2 for left-to-right-single, 0.8 for left-to-right reranking, and greedy generation for causal masked infilling. Results on the test set are given in Table 3a. Conditioning on the right context (i.e., the function body) gives some benefit in the leftto-right reranking setting, but gives a substantial improvement via our causal masked infilling.
|
| 129 |
+
|
| 130 |
+
TypeWriter OSS. Some recent work has developed supervised machine learning approaches for predicting type annotations for dynamically-typed languages including Python (Xu et al., 2016; Allamanis et al., 2020; Pradel et al., 2020) and TypeScript (Hellendoorn et al., 2018; Wei et al., 2020; Jesse et al., 2021). We compare our zero-shot model to one such approach for Python, TypeWriter (Pradel et al., 2020), which combines a neural architecture for type hint prediction with a search-based incremental type validation procedure.
|
| 131 |
+
|
| 132 |
+
To compare to the supervised TypeWriter approach, we obtain its predictions on the open-source software (OSS) dataset used in that work (Pradel et al., 2020), consisting of Python functions from GitHub. Unfortunately, we could not evaluate on their full evaluation set since much of it was included in our model’s training data. We filter to instances that were not included in our training data, for which we were able to obtain files and extract functions and types from via AST parsing, and which have non-NONE return type hints. This leaves 2,092 examples (about $1 2 \%$ of their evaluation set). We otherwise emulate their exact setup, which allows our model to condition on file imports, the function body, and the function signature to predict return type hints. We use the same inference hyperparameters as we did for CodeXGLUE type hint prediction.
|
| 133 |
+
|
| 134 |
+
We present our results in two tables: Table 3b containing metrics across non-None types, and Table 10 in the Appendix, which includes None types as well (following Pradel et al. 2020).8 We again see benefits from causal masked infilling’s ability to condition on the function body when generating return types, and find that our zero-shot model outperforms the supervised TypeWriter model.
|
| 135 |
+
|
| 136 |
+
# 4.4 VARIABLE NAME PREDICTION
|
| 137 |
+
|
| 138 |
+
Variable name prediction is a less-constrained code generation task that requires modeling bidirectional context. We again use the test set from the CodexGlue code-to-text task (docstring generation) and run an AST transform to isolate and either mask all the occurrences of the variable name (infilling) or take the left-most context from the first variable name (left-to-right mode). In the infilling setting, given that we generate the number of masks equivalent to the number of times a variable is seen, we select the most common prediction as our singular prediction. Furthermore, we only evaluate the set of variable names containing four or more characters. For our re-ranking, we consider a candidate set of 25 variables. We present our results in Table 4. We again see substantial benefits from using both left and right context: left-to-right reranking and causal-masked infilling both outperform the left-to-right single baseline (which uses only the left context). Causal-masked
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Method</td><td>Accuracy</td></tr><tr><td>Left-to-right single</td><td>18.4</td></tr><tr><td>Left-to-right reranking</td><td>23.5</td></tr><tr><td>Causal-masked infilling</td><td>30.6</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 4: Results on the variable renaming benchmark that we construct from CodeXGLUE. Our model benefits from using the right-sided context in selecting (L-R reranking and CM infilling) and proposing (CM infilling) variable names.
|
| 143 |
+
|
| 144 |
+
infilling substantially on the left-to-right reranking method, demonstrating the value of conditioning on the right context when proposing candidate completions.
|
| 145 |
+
|
| 146 |
+
# 5 ABLATION EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
For an analysis of the effects of training a model with causal masking (rather than the standard language modeling objective, as well as model size and the training data, we train several variations of our model. We compare model pass $@ 1$ scores on the HumanEval (Chen et al., 2021a) and MBPP (Austin et al., 2021) left-to-right synthesis benchmarks, with results in Table 5.
|
| 149 |
+
|
| 150 |
+
Objective. Comparing 1.3B parameter models trained on the same training data with the causal masked (CM) objective (row 2) and the standard left-to-right language modeling (LM) objective (row 3), we see that the causal-masked model obtains slightly higher performance on the HumanEval and MBPP tasks in pass $@ 1$ score. This provides further evidence that causal masking training does not hurt the model’s ability to perform standard left-to-right generation, at least to the 1.3B parameter scale, in line with the findings of Bavarian et al. (2022).
|
| 151 |
+
|
| 152 |
+
Model size. With data fixed, increasing model size consistently improves performance (comparing the 6.7B and 1.3B CM models in rows 1 and 2, and the 1.3B and 2.3B LM models in rows 3 and 6).
|
| 153 |
+
|
| 154 |
+
Effects of data. We compare models trained on our entire dataset of multiple code languages and StackOverflow (multi lang $+ \ S O$ , described in Section A.1) to data ablations that train only on Python code files and StackOverflow (Python $+ \ S O$ ) and only Python code files (Python). We find that training on multiple languages gives a slight reduction in performance on these Python evaluations. However, comparing rows 4 and 5, we see that including StackOverflow data in training substantially improves performance on both HumanEval and MBPP. This suggests that future work on generative code models for language-guided synthesis tasks should consider using StackOverflow or other corpora that mix natural language and code as training data.
|
| 155 |
+
|
| 156 |
+
# 6 QUALITATIVE EXAMPLES
|
| 157 |
+
|
| 158 |
+
We show a variety of qualitative examples from our model in Section D.2 in both the infilling and left-to-right generation modes: docstring generation, metadata conditioning, class attribute inference from class usage, comment-conditioned code editing, StackOverflow title and tag generation, and zero-shot bidirectional translation of technical jargon between Chinese and English.
|
| 159 |
+
Table 5: Ablation results, comparing model performance on the Python portion of a validation set held out from our training corpora as well as the HumanEval and MBPP benchmarks. We compare models by size (in billions of parameters), objective (causal masked, CM, versus standard left-toright language modeling, LM), training data, and total amount of compute in training (in zettaflops).
|
| 160 |
+
|
| 161 |
+
<table><tr><td>#</td><td>Size (B)</td><td>Obj.</td><td>Training Data</td><td>Data Size</td><td>Train Tokens</td><td>Train Compute</td><td>HumanEval Pass@1</td><td>MBPP Pass@1</td></tr><tr><td>1)</td><td>6.7</td><td>CM</td><td>multi lang + SO</td><td>204 GB</td><td>52B</td><td>3.0Z</td><td>15</td><td>19.4</td></tr><tr><td>2)</td><td>1.3</td><td>CM</td><td>multi lang + SO</td><td>204 GB</td><td>52B</td><td>0.6Z</td><td>8</td><td>10.9</td></tr><tr><td>3)</td><td>1.3</td><td>LM</td><td>multi lang + SO</td><td>204 GB</td><td>52B</td><td>0.6Z</td><td>6</td><td>8.9</td></tr><tr><td>4)</td><td>1.3</td><td>LM</td><td>Python + SO</td><td>104 GB</td><td>25B</td><td>0.3Z</td><td>9</td><td>9.8</td></tr><tr><td>5)</td><td>1.3</td><td>LM</td><td>Python</td><td>49 GB</td><td>11B</td><td>0.1Z</td><td>5</td><td>6.1</td></tr><tr><td>6</td><td>2.3</td><td>LM</td><td>multi lang + SO</td><td>204 GB</td><td>52B</td><td>1.1Z</td><td>9</td><td>12.7</td></tr></table>
|
| 162 |
+
|
| 163 |
+
# 7 RELATED WORK
|
| 164 |
+
|
| 165 |
+
Language Models for Code There has been a flurry of recent work on training large-scale neural language models on source code. Existing models differ in their architectural design and training objectives, e.g., decoder-only language models (Austin et al., 2021; Chen et al., 2021a; Izadi et al., 2022; Xu et al., 2022; Nijkamp et al., 2022), encoder-only masked language models (Feng et al., 2020; Kanade et al., 2020), and encoder-decoder models (Ahmad et al., 2021; Li et al., 2022; Roziere et al., 2021; Wang et al., 2021). Decoder-only language models have grown in popularity as they can perform zero-shot program synthesis by generating in a left-to-right fashion. On the other hand, InCoder is a decoder-only causally-masked language model that can infill arbitrary spans of text. This allows the model to perform program synthesis and many other code infilling tasks.
|
| 166 |
+
|
| 167 |
+
Infilling Models Many real-world applications require infilling sequences using left and right context, e.g., editing sentences (Shih et al., 2019), restoring ancient text (Assael et al., 2019), and fixing bugs in source code. Unfortunately, standard left-to-right language models cannot directly infill text, and popular masked language models are mainly trained to infill very short spans (Chan et al., 2019; Devlin et al., 2019; Raffel et al., 2020; Roziere et al., 2021). Recent work addresses this by changing model architectures, inference procedures, and training objectives (Aghajanyan et al., 2022a; Stern et al., 2019; West et al., 2021; Aghajanyan et al., 2022b). Most related to our approach is the work of Donahue et al. (2020) and CM3 (Aghajanyan et al., 2022a), who train left-to-right language models to fill in masked token segments of varying lengths; and the work of Alon et al. (2020), who train an infilling-capable, AST-structured generative model of code on a smaller scale. In addition, concurrent to our work, OpenAI developed a fill-in-the-middle (FIM) training objective similar to the causal masking objective we use, trained code models with it, and evaluated on the HumanEval infilling tasks we introduce here (Bavarian et al., 2022). Similar to our findings in Section 5, they find that the infilling capability does not adversely affect left-to-right performance. Our objective, in contrast, allows infilling multiple regions of code, and we demonstrate the benefits of infilling across a broader range of natural programming tasks.
|
| 168 |
+
|
| 169 |
+
Machine Learning for Code Assistance There is an extensive literature on using machine learning models to aid human programmers. This includes methods to infer variable types (Pradel et al., 2020; Wei et al., 2020), generate unit tests (Fraser & Arcuri, 2011), repair programs (Gupta et al., 2017; Yasunaga & Liang, 2020; Chen et al., 2021c; Yasunaga & Liang, 2021), and verify program correctness (Ryan et al., 2020). Our model can infill arbitrary spans of code, allowing it to complete many of these tasks, as well as perform standard left-to-right generation, in a single approach.
|
| 170 |
+
|
| 171 |
+
Machine Learning for Program Synthesis Program synthesis approaches directly generate programs from a specification of functionality (Gulwani et al., 2017). Such models work by taking e.g., input-output examples (Balog et al., 2017; Gulwani, 2011; Chen et al., 2021b; Bavishi et al., 2019), partial implementations (Solar-Lezama et al., 2006), or natural language descriptions (Zelle & Mooney, 1996; Yu et al., 2018; Yin et al., 2018; Kulal et al., 2019; Chen et al., 2021a) of the desired program as input. Our InCoder model differs from this past work as it can both synthesize and infill arbitrary spans of code, conditioning on natural language and partial implementations.
|
| 172 |
+
|
| 173 |
+
# 8 CONCLUSION
|
| 174 |
+
|
| 175 |
+
We demonstrated that using a causal masking objective when training a generative model of code enables strong zero-shot performance on many challenging and practical code infilling and editing tasks. The model’s additional infilling capability does not appear to harm its ability to do standard left-to-right generation: ablation and comparison experiments show that our causal-masked models have comparable performance to similarly-resourced models on standard left-to-right language-tocode synthesis benchmarks. Looking forward, we expect our model performance to continue to increase with more parameters, data, and training steps (Kaplan et al., 2020; Henighan et al., 2020). Moreover, fine-tuning would allow our models to be better able to condition on natural language instructions and other indications of human intent (Zhong et al., 2021; Wei et al., 2022; Ouyang et al., 2022). Finally, our model lays a foundation for future work on supervised infilling & editing via model fine-tuning, as well as performing iterative decoding, where the model can be used to refine its own output (Ghazvininejad et al., 2019).
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Rajas Agashe, Srinivasan Iyer, and Luke Zettlemoyer. JuICe: A large scale distantly supervised dataset for open domain context-based code generation. In Proceedings of EMNLP, 2019. URL https://aclanthology.org/D19-1546.
|
| 180 |
+
|
| 181 |
+
Armen Aghajanyan, Bernie Huang, Candace Ross, Vladimir Karpukhin, Hu Xu, Naman Goyal, Dmytro Okhonko, Mandar Joshi, Gargi Ghosh, Mike Lewis, and Luke Zettlemoyer. CM3: A causal masked multimodal model of the Internet. arXiv preprint arXiv:2201.07520, 2022a.
|
| 182 |
+
|
| 183 |
+
Armen Aghajanyan, Dmytro Okhonko, Mike Lewis, Mandar Joshi, Hu Xu, Gargi Ghosh, and Luke Zettlemoyer. HTLM: Hyper-text pre-training and prompting of language models. In ICLR, 2022b.
|
| 184 |
+
|
| 185 |
+
Wasi Uddin Ahmad, Saikat Chakraborty, Baishakhi Ray, and Kai-Wei Chang. Unified pre-training for program understanding and generation. In NAACL, 2021.
|
| 186 |
+
|
| 187 |
+
Miltiadis Allamanis. The adverse effects of code duplication in machine learning models of code. In SPLASH, 2019.
|
| 188 |
+
|
| 189 |
+
Miltiadis Allamanis, Earl T Barr, Soline Ducousso, and Zheng Gao. Typilus: Neural type hints. In PLDI, 2020.
|
| 190 |
+
|
| 191 |
+
Uri Alon, Roy Sadaka, Omer Levy, and Eran Yahav. Structural language models of code. In ICML, pp. 245–256. PMLR, 2020.
|
| 192 |
+
|
| 193 |
+
Mikel Artetxe, Shruti Bhosale, Naman Goyal, Todor Mihaylov, Myle Ott, Sam Shleifer, Xi Victoria Lin, Jingfei Du, Srinivasan Iyer, Ramakanth Pasunuru, et al. Efficient large scale language modeling with mixtures of experts. arXiv preprint arXiv:2112.10684, 2021.
|
| 194 |
+
|
| 195 |
+
Yannis M. Assael, Thea Sommerschield, and J. Prag. Restoring ancient text using deep learning: a case study on Greek epigraphy. In EMNLP, 2019.
|
| 196 |
+
|
| 197 |
+
Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie J. Cai, Michael Terry, Quoc V. Le, and Charles Sutton. Program synthesis with large language models. arXiv preprint arXiv:2108.07732, 2021.
|
| 198 |
+
|
| 199 |
+
Mandeep Baines, Shruti Bhosale, Vittorio Caggiano, Naman Goyal, Siddharth Goyal, Myle Ott, Benjamin Lefaudeux, Vitaliy Liptchinsky, Mike Rabbat, Sam Sheiffer, Anjali Sridhar, and Min Xu. FairScale: A general purpose modular PyTorch library for high performance and large scale training. https://github.com/facebookresearch/fairscale, 2021.
|
| 200 |
+
|
| 201 |
+
Matej Balog, Alexander L. Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. DeepCoder: Learning to write programs. In ICLR, 2017.
|
| 202 |
+
|
| 203 |
+
Mohammad Bavarian, Heewoo Jun, Nikolas Tezak, John Schulman, Christine McLeavey, Jerry Tworek, and Mark Chen. Efficient training of language models to fill in the middle. arXiv preprint arXiv:2207.14255, 2022.
|
| 204 |
+
|
| 205 |
+
Rohan Bavishi, Caroline Lemieux, Roy Fox, Koushik Sen, and Ion Stoica. AutoPandas: neuralbacked generators for program synthesis. PACMPL, 2019.
|
| 206 |
+
|
| 207 |
+
Sid Black, Stella Biderman, Eric Hallahan, Quentin Anthony, Leo Gao, Laurence Golding, Horace He, Connor Leahy, Kyle McDonell, Jason Phang, Michael Pieler, USVSN Sai Prashanth, Shivanshu Purohit, Laria Reynolds, Jonathan Tow, Ben Wang, and Samuel Weinbach. GPT-NeoX-20B: An open-source autoregressive language model. 2022.
|
| 208 |
+
|
| 209 |
+
Burton H Bloom. Space/time trade-offs in hash coding with allowable errors. Communications of the ACM, 1970.
|
| 210 |
+
|
| 211 |
+
Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In NeurIPS, 2020.
|
| 212 |
+
|
| 213 |
+
William Chan, Nikita Kitaev, Kelvin Guu, Mitchell Stern, and Jakob Uszkoreit. KERMIT: Generative insertion-based modeling for sequences. arXiv preprint arXiv:1906.01604, 2019.
|
| 214 |
+
|
| 215 |
+
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021a.
|
| 216 |
+
|
| 217 |
+
Xinyun Chen, Petros Maniatis, Rishabh Singh, Charles Sutton, Hanjun Dai, Max Lin, and Denny Zhou. SpreadsheetCoder: Formula prediction from semi-structured context. In ICML, 2021b.
|
| 218 |
+
|
| 219 |
+
Zimin Chen, Steve Kommrusch, Michele Tufano, Louis-Noel Pouchet, Denys Poshyvanyk, and ¨ Monperrus Martin. SequenceR: Sequence-to-sequence learning for end-to-end program repair. IEEE Transactions on Software Engineering, 2021c.
|
| 220 |
+
|
| 221 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. PaLM: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
|
| 222 |
+
|
| 223 |
+
Colin Clement, Dawn Drain, Jonathan Timcheck, Alexey Svyatkovskiy, and Neel Sundaresan. PyMT5: multi-mode translation of natural language and python code with transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9052–9065, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.728. URL https://aclanthology.org/2020. emnlp-main.728.
|
| 224 |
+
|
| 225 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 226 |
+
|
| 227 |
+
Chris Donahue, Mina Lee, and Percy Liang. Enabling language models to fill in the blanks. In ACL, 2020.
|
| 228 |
+
|
| 229 |
+
Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, et al. CodeBERT: A pre-trained model for programming and natural languages. In EMNLP Findings, 2020.
|
| 230 |
+
|
| 231 |
+
Gordon Fraser and Andrea Arcuri. EvoSuite: Automatic test suite generation for object-oriented software. In ACM SIGSOFT, 2011.
|
| 232 |
+
|
| 233 |
+
Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. The Pile: An 800GB dataset of diverse text for language modeling. arXiv preprint arXiv:2101.00027, 2020.
|
| 234 |
+
|
| 235 |
+
Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Mask-Predict: Parallel decoding of conditional masked language models. In EMNLP, 2019.
|
| 236 |
+
|
| 237 |
+
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. ACM SIGPLAN Notices, 2011.
|
| 238 |
+
|
| 239 |
+
Sumit Gulwani, Oleksandr Polozov, and Rishabh Singh. Program synthesis. In Foundations and Trends in Programming Languages, 2017.
|
| 240 |
+
|
| 241 |
+
Rahul Gupta, Soham Pal, Aditya Kanade, and Shirish Shevade. DeepFix: Fixing common C language errors by deep learning. In AAAI, 2017.
|
| 242 |
+
|
| 243 |
+
Vincent J Hellendoorn, Christian Bird, Earl T Barr, and Miltiadis Allamanis. Deep learning type inference. In ESEC/FSE 2018, 2018.
|
| 244 |
+
|
| 245 |
+
Tom Henighan, Jared Kaplan, Mor Katz, Mark Chen, Christopher Hesse, Jacob Jackson, Heewoo Jun, Tom B Brown, Prafulla Dhariwal, Scott Gray, et al. Scaling laws for autoregressive generative modeling. arXiv preprint arXiv:2010.14701, 2020.
|
| 246 |
+
|
| 247 |
+
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In ICLR, 2020.
|
| 248 |
+
|
| 249 |
+
Hamel Husain, Ho-Hsiang Wu, Tiferet Gazit, Miltiadis Allamanis, and Marc Brockschmidt. CodeSearchNet challenge: Evaluating the state of semantic code search. arXiv preprint arXiv:1909.09436, 2019.
|
| 250 |
+
|
| 251 |
+
Maliheh Izadi, Roberta Gismondi, and Georgios Gousios. CodeFill: Multi-token code completion by jointly learning from structure and naming sequences. In ICSE, 2022.
|
| 252 |
+
|
| 253 |
+
Kevin Jesse, Premkumar T. Devanbu, and Toufique Ahmed. Learning type annotation: Is big data enough? In ESEC/FSE, 2021.
|
| 254 |
+
|
| 255 |
+
Aditya Kanade, Petros Maniatis, Gogul Balakrishnan, and Kensen Shi. Learning and evaluating contextual embedding of source code. In ICML, 2020.
|
| 256 |
+
|
| 257 |
+
Nikhil Kandpal, Eric Wallace, and Colin Raffel. Deduplicating training data mitigates privacy risks in language models. arXiv preprint arXiv:2202.06539, 2022.
|
| 258 |
+
|
| 259 |
+
Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020.
|
| 260 |
+
|
| 261 |
+
Nitish Shirish Keskar, Bryan McCann, Lav R Varshney, Caiming Xiong, and Richard Socher. CTRL: A conditional transformer language model for controllable generation. arXiv preprint arXiv:1909.05858, 2019.
|
| 262 |
+
|
| 263 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 264 |
+
|
| 265 |
+
Sumith Kulal, Panupong Pasupat, Kartik Chandra, Mina Lee, Oded Padon, Alex Aiken, and Percy S Liang. SPoC: Search-based pseudocode to code. In NeurIPS, 2019.
|
| 266 |
+
|
| 267 |
+
Katherine Lee, Daphne Ippolito, Andrew Nystrom, Chiyuan Zhang, Douglas Eck, Chris CallisonBurch, and Nicholas Carlini. Deduplicating training data makes language models better. In ACL, 2022.
|
| 268 |
+
|
| 269 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. arXiv preprint arXiv:1910.13461, 2019.
|
| 270 |
+
|
| 271 |
+
Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Remi Leblond, Tom ´ Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, et al. Competition-level code generation with AlphaCode. arXiv preprint arXiv:2203.07814, 2022.
|
| 272 |
+
|
| 273 |
+
Shuai Lu, Daya Guo, Shuo Ren, Junjie Huang, Alexey Svyatkovskiy, Ambrosio Blanco, Colin Clement, Dawn Drain, Daxin Jiang, Duyu Tang, et al. CodeXGlue: A machine learning benchmark dataset for code understanding and generation. In NeurIPS, 2021.
|
| 274 |
+
|
| 275 |
+
Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. A conversational paradigm for program synthesis. arXiv preprint arXiv:2203.13474, 2022.
|
| 276 |
+
|
| 277 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. Fairseq: A fast, extensible toolkit for sequence modeling. arXiv preprint arXiv:1904.01038, 2019.
|
| 278 |
+
|
| 279 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke E. Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Francis Christiano, Jan Leike, and Ryan J. Lowe. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155, 2022.
|
| 280 |
+
|
| 281 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.
|
| 282 |
+
|
| 283 |
+
Michael Pradel, Georgios Gousios, Jason Liu, and Satish Chandra. TypeWriter: Neural type prediction with search-based validation. In ACM SIGSOFT, 2020.
|
| 284 |
+
|
| 285 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical report, OpenAI, 2019.
|
| 286 |
+
|
| 287 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. In JMLR, 2020.
|
| 288 |
+
|
| 289 |
+
Ronald Rivest. RFC1321: The MD5 message-digest algorithm, 1992.
|
| 290 |
+
|
| 291 |
+
Baptiste Roziere, Marie-Anne Lachaux, Marc Szafraniec, and Guillaume Lample. DOBF: A deobfuscation pre-training objective for programming languages. In NeurIPS, 2021.
|
| 292 |
+
|
| 293 |
+
Gabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu, and Suman Sekhar Jana. CLN2INV: Learning loop invariants with continuous logic networks. In ICLR, 2020.
|
| 294 |
+
|
| 295 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In ACL, Berlin, Germany, 2016. URL https://aclanthology.org/P16-1162.
|
| 296 |
+
|
| 297 |
+
Yong-Siang Shih, Wei-Cheng Chang, and Yiming Yang. XL-Editor: Post-editing sentences with XLNet. arXiv preprint arXiv:1910.10479, 2019.
|
| 298 |
+
|
| 299 |
+
Armando Solar-Lezama, Liviu Tancau, Rastislav Bodik, Sanjit Seshia, and Vijay Saraswat. Combinatorial sketching for finite programs. In ASPLOS, 2006.
|
| 300 |
+
|
| 301 |
+
Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion transformer: Flexible sequence generation via insertion operations. In ICML, 2019.
|
| 302 |
+
|
| 303 |
+
Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, et al. LaMDA: Language models for dialog applications. arXiv preprint arXiv:2201.08239, 2022.
|
| 304 |
+
|
| 305 |
+
Lewis Tunstall, Leandro von Werra, and Thomas Wolf. Natural Language Processing with Transformers. O’Reilly Media, Inc., 2022.
|
| 306 |
+
|
| 307 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. NeurIPS, 2017.
|
| 308 |
+
|
| 309 |
+
Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021.
|
| 310 |
+
|
| 311 |
+
Yue Wang, Weishi Wang, Shafiq Joty, and Steven CH Hoi. CodeT5: Identifier-aware unified pretrained encoder-decoder models for code understanding and generation. In EMNLP, 2021.
|
| 312 |
+
|
| 313 |
+
Jason Wei, Maarten Bosma, Vincent Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V. Le. Finetuned language models are zero-shot learners. In ICLR, 2022.
|
| 314 |
+
|
| 315 |
+
Jiayi Wei, Maruth Goyal, Greg Durrett, and Isil Dillig. LambdaNet: Probabilistic type inference using graph neural networks. In ICLR, 2020.
|
| 316 |
+
|
| 317 |
+
Peter West, Ximing Lu, Ari Holtzman, Chandra Bhagavatula, Jena Hwang, and Yejin Choi. Reflective decoding: Beyond unidirectional generation with off-the-shelf language models. In ACL, 2021.
|
| 318 |
+
|
| 319 |
+
Frank F Xu, Uri Alon, Graham Neubig, and Vincent J Hellendoorn. A systematic evaluation of large language models of code. arXiv preprint arXiv:2202.13169, 2022.
|
| 320 |
+
|
| 321 |
+
Zhaogui Xu, Xiangyu Zhang, Lin Chen, Kexin Pei, and Baowen Xu. Python probabilistic type inference with natural language support. In SIGSOFT, 2016.
|
| 322 |
+
|
| 323 |
+
Michihiro Yasunaga and Percy Liang. Graph-based, self-supervised program repair from diagnostic feedback. In ICML. PMLR, 2020.
|
| 324 |
+
|
| 325 |
+
Michihiro Yasunaga and Percy Liang. Break-it-fix-it: Unsupervised learning for program repair. In ICML, 2021.
|
| 326 |
+
|
| 327 |
+
Pengcheng Yin, Bowen Deng, Edgar Chen, Bogdan Vasilescu, and Graham Neubig. Learning to mine aligned code and natural language pairs from stack overflow. In ACM MSR, 2018.
|
| 328 |
+
|
| 329 |
+
Tao Yu, Rui Zhang, Kai-Chou Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Z Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir R. Radev. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-toSQL task. In EMNLP, 2018.
|
| 330 |
+
|
| 331 |
+
John M Zelle and Raymond J Mooney. Learning to parse database queries using inductive logic programming. In AAAI, 1996.
|
| 332 |
+
|
| 333 |
+
Rowan Zellers, Ari Holtzman, Hannah Rashkin, Yonatan Bisk, Ali Farhadi, Franziska Roesner, and Yejin Choi. Defending against neural fake news. In NeurIPS, 2019.
|
| 334 |
+
|
| 335 |
+
Ruiqi Zhong, Kristy Lee, Zheng Zhang, and Dan Klein. Adapting language models for zero-shot learning by meta-tuning on dataset and prompt collections. In EMNLP, 2021.
|
| 336 |
+
|
| 337 |
+
# A DATA
|
| 338 |
+
|
| 339 |
+
# A.1 CODE DATA
|
| 340 |
+
|
| 341 |
+
Sources. We obtained code files and repository metadata from GitHub and GitLab through the sites’ public APIs over a period ending on December 9th, 2021. We obtained approximately 670,000 public non-fork repositories which GitHub/GitLab detected as containing primarily Python, JavaScript, or Jupyter Notebook files, and with either an MIT, Apache 2.0, BSD-2, or BSD-3 clause license. We included all code from a list of 28 languages (determined by file extension) contained in these repositories.9 Since Python files can also be contained in non-majority-Python repositories, we also included all other Python and Jupyter files obtainable through the GitHub archive on BigQuery that we did not already obtain from GitHub directly.10 We preprocess Jupyter notebooks by including all text and code (with Markdown formatting removed from text cells), with cells demarcated by XML-style tags (see Section A.3).
|
| 342 |
+
|
| 343 |
+
Deduplication. Recent work has shown that deduplicating training data can improve model performance and reduce the risk of memorizing training data (Allamanis, 2019; Lee et al., 2022; Kandpal et al., 2022). Our deduplication scheme removes code files using exact match on the sequence of alphanumeric tokens in the file.11 This removed approximately $7 5 \%$ of the corpus by file size (reducing from 1 TB to 250 GB) as there are numerous duplicated repositories, library dependencies included as source files, and common boilerplate code files (e.g., for Python web frameworks). We also use regular expressions to detect email addresses in the code files and replace them with a dummy address,12 to reduce the risks of the model memorizing real email addresses or hallucinating fake ones.
|
| 344 |
+
|
| 345 |
+
Decontamination. To ensure that our code generation models can be evaluated on several current code generation benchmarks, we perform data decontamination: removing overlap between our training data and the evaluation sets of these benchmarks. We remove any repositories contained in the validation and test sets of CodeSearchNet (Husain et al., 2019), as these are used to construct validation and test sets for several of the tasks in CodeXGLUE (Lu et al., 2021).13
|
| 346 |
+
|
| 347 |
+
Filtering. Our filtering is similar to past work on generative models of code Chen et al. (2021a); Nijkamp et al. (2022); Xu et al. (2022): we remove files that contain any line longer than 3000 tokens or an average line length greater than 100 tokens, have less than $40 \%$ of their characters being alphanumeric or underscores, or appear to be automatically generated, which we determine using substring match on a small number of phrases produced by automatic code and documentation generation systems.14 Our decontamination and filtering steps together remove roughly $10 \%$ of Python files.
|
| 348 |
+
|
| 349 |
+
# A.2 STACKOVERFLOW
|
| 350 |
+
|
| 351 |
+
The second component of our corpus consists of questions, answers, and comments from StackOverflow. The Pile (Gao et al., 2020), which was used to train recent generative code models that we compare to in Section 5, also contains these questions and answers but does not contain comments. We include all questions that have at least one answer, up to ten answers with a non-negative score (sorted by score) per question, and up to five comments per question/answer. Qualitatively, we find that comments, together with the infilling ability of the model, allow our model to have some capability to do interactive code editing guided by language (see Figure 11).
|
| 352 |
+
|
| 353 |
+
# A.3 METADATA
|
| 354 |
+
|
| 355 |
+
We include some metadata on the code files and StackOverflow questions/answers directly in our training data to allow attribute-conditioned generation (Keskar et al., 2019; Zellers et al., 2019) and attribute prediction. For code file data, our attributes are the code filename, the file extension (as a proxy for language), the file source (GitHub or GitLab), and, for GitHub repositories, the number of stars binned into six buckets.15 To allow this metadata to be optional when performing leftto-right prompting of the model, we insert each attribute it the beginning of its document with a probability of $50 \%$ (allowing the model to learn metadata conditioning); otherwise, we insert it at the end of its document (allowing metadata prediction). See Figure 6a and Figure 6b for examples. For StackOverflow, our metadata attributes are the question tags for the topic (e.g., python,django) and the number of votes for each question and answer, binned in the same way as repository stars. We insert comments directly after the questions or answers they were written for. See Figure 6c for examples.
|
| 356 |
+
|
| 357 |
+
# A.4 TOKENIZATION
|
| 358 |
+
|
| 359 |
+
To increase the amount of context that our code model can condition on, the length of documents that the model can generate, and the efficiency of training and inference, we train a byte-level BPE tokenizer Sennrich et al. (2016); Radford et al. (2019). We allow tokens to extend across whitespace (excluding newline characters) so that common code idioms (e.g., import numpy as np) are represented as single tokens in the vocabulary. This substantially improves the tokenizer’s efficiency— reducing the total number of tokens required to encode our training corpus by $45 \%$ relative to the byte-level BPE tokenizer and vocabulary of GPT-2.
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
Figure 3: Code corpus composition (after deduplication and filtering) by total file size for the most common languages, as determined by file extension.
|
| 363 |
+
|
| 364 |
+
# A.5 CORPUS STATISTICS
|
| 365 |
+
|
| 366 |
+
See Figure 3 for a plot showing code corpus composition (after deduplication and filtering) by total file size for the most common languages, as determined by file extension.
|
| 367 |
+
|
| 368 |
+
# B MODEL AND INFERENCE DETAILS
|
| 369 |
+
|
| 370 |
+
B.1 MODEL
|
| 371 |
+
|
| 372 |
+
Table 6: Fairseq architecture hyperparameters for our INCODER models.
|
| 373 |
+
|
| 374 |
+
<table><tr><td>Parameter</td><td>INCODER-1.3B</td><td>INCODER-6.7B</td></tr><tr><td>-decoder-embed-dim</td><td>2048</td><td>4096</td></tr><tr><td>-decoder-output-dim</td><td>2048</td><td>4096</td></tr><tr><td>-decoder-input-dim</td><td>2048</td><td>4096</td></tr><tr><td>-decoder-ffn-embed-dim</td><td>8192</td><td>16384</td></tr><tr><td>-decoder-layers</td><td>24</td><td>32</td></tr><tr><td>-decoder-normalize-before</td><td>True</td><td>True</td></tr><tr><td>-decoder-attention-heads</td><td>32</td><td>32</td></tr><tr><td>-share-decoder-input-output-embed</td><td>True</td><td>True</td></tr><tr><td>-decoder-learned-pos</td><td>False</td><td>False</td></tr></table>
|
| 375 |
+
|
| 376 |
+
Our primary model is INCODER-6.7B, a 6.7B Transformer Vaswani et al. (2017) language model. We use the same architecture as the dense 6.7B models described in Artetxe et al. (2021); the Fairseq architecture description can be found in Table 6. INCODER-6.7B was trained on 248 V100 GPUs for
|
| 377 |
+
|
| 378 |
+

|
| 379 |
+
Figure 4: Loss curves show that perplexity is still improving after one epoch and that perplexity improves substantially with a larger model size. This suggests that increasing epochs, data size, or model size would improve performance.
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 5: Performance of INCODER-6.7B on the HumanEval left-to-right synthesis benchmark generally increases over the course of pretraining. We plot a line of best fit along with a $9 5 \%$ confidence interval via bootstrap resampling.
|
| 383 |
+
|
| 384 |
+
24 days. We perform one epoch on the training data, using each training document exactly once. Our implementation utilized the causal masking implementation (Aghajanyan et al., 2022a) available in Fairseq (Ott et al., 2019), with the underlying library being PyTorch (Paszke et al., 2019). Our perGPU batch size was 8, with a maximum token sequence length of 2048. We clip all gradient norms to 1.0 and used the Adam optimizer with $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 8$ (Kingma & Ba, 2015). For our learning rate scheduler, we use the built-in polynomial decay learning rate scheduler available in Paszke et al. (2019) with 1500 warmup updates. Fairscale was used for improving memory efficiency through fully sharding model states (Baines et al., 2021).
|
| 385 |
+
|
| 386 |
+
We compare the validation perplexity of the 6B parameter model and a smaller 1.3B parameter model (see Section 5 for details on the training of this 1.3B model) in Figure 4, showing comparable scaling laws to those reported by Aghajanyan et al. Aghajanyan et al. (2022a). Our models have also not yet saturated and would benefit from further training; we report the performance of the 6.7B model on the HumanEval Python function synthesis benchmark (Chen et al., 2021a) (see Section C.6 for a description of this benchmark) and see a consistent increase in performance over the course of training (Figure 5).
|
| 387 |
+
|
| 388 |
+
# B.2 INFERENCE DETAILS
|
| 389 |
+
|
| 390 |
+
In practice, to generate a single infill we sample from the distribution $\begin{array} { r l } { P ( \cdot } & { { } \ l } \end{array}$ [Left; <Mask: $\varnothing >$ ; Right; <Mask: $\uparrow >$ ; $\angle M a s k : 0 > ]$ ), where we insert an artificial $\angle M a s k : 1 >$ token. Not inserting <Mask: $\uparrow >$ gives an implicit size hint to the model that the <Mask: $\varnothing >$ token should be expanded to fill the rest of the 2048 token context window. Instead, inserting a <Mask: $\uparrow >$ token indicates to the model that some amount of the document is omitted after the right context. We found that including this substantially improved the ability of the model to predict $\tt { < E O M > }$ appropriately when generating an infill for <Mask: $\varnothing >$ . See Aghajanyan et al. (2022a) for more.
|
| 391 |
+
|
| 392 |
+
More generally, when inserting at multiple locations, we condition on the document with multiple mask sentinel tokens inserted and a final mask token appended. For example, to insert at two locations we use [A; <Mask: $\varnothing >$ ; C; <Mask: $\uparrow >$ ; E; <Mask:2>]) and infill the masks in order, appending the appropriate <Mask:k> sentinel tokens to signal the start of generation for the next span, i.e., the completed document for two insertion locations is represented by [A; <Mask: $\varnothing >$ ; C; <Mask:1>; E; <Mask: $^ { 2 > }$ ; <Mask: $0 >$ ; B; <EOM>; <Mask:1>; D; $\angle E O M > ]$ , where regions B and D have been infilled.
|
| 393 |
+
|
| 394 |
+
# C EXPERIMENTAL DETAILS AND SUPPLEMENTARY RESULTS
|
| 395 |
+
|
| 396 |
+
# C.1 INFILLING COMPARISONS
|
| 397 |
+
|
| 398 |
+
We describe our adaptation of models from prior work to the zero-shot infilling setting, for the experiments described in Section 4.
|
| 399 |
+
|
| 400 |
+
Encoder-decoder (PLBART). We use PLBART-Large (Ahmad et al., 2021), an encoder-decoder model trained on code (including 220GB of Python) using a BART (Lewis et al., 2019) masked denoising objective. We pre- and post-process each HumanEval infilling example as needed for PLBART: we represent each example as a stream of space-separated tokens (as identified by Python’s built-in lexer) with newlines and indentations replaced by control characters, and use a <mask> token to represent the line to be infilled. We extract the infilled region from the output by searching for the longest suffix of the left context contained in the output, and (as in our left-to-right baselines) take the ground-truth number of lines following this left context suffix as the infill.
|
| 401 |
+
|
| 402 |
+
Left-to-right with templated prompting (Codex). We perform zero-shot prompting on the Codex code-cushman-001 and code-davinci-001 OpenAI API models using the following template:
|
| 403 |
+
|
| 404 |
+
[code before the infill mask] <INFILL> [code after the infill mask] # Complete the above code by replacing the <INFILL> tag. [code before the infill mask]
|
| 405 |
+
|
| 406 |
+
We take [code after the infill mask] as the indicator of completion.
|
| 407 |
+
|
| 408 |
+
# C.2 CODE CLOZE (CODEXGLUE)
|
| 409 |
+
|
| 410 |
+
CodeXGLUE cloze is created from CodeSearchNet to evaluate CodeBERT and consists of a short natural language description followed by code in several programming languages. We evaluate on the max/min subtask, where the model has to decide if the given mask should be filled with either max or min. Since there are only two options in this task, we can closely compare the causal-masked infilling and left-to-right setups by scoring both options and selecting the sequence with the highest likelihood.
|
| 411 |
+
|
| 412 |
+
Table 7 contains the main results. Using the causal-masked infill format with a single token (containing min/max) as the masked region (CM infill-token) performs better than using just the left context, but not as well as scoring the entire sequence left to right. Masking a larger region (CM infill-region), containing the left prefix and 10 right-side tokens in the masked region, performs comparably to scoring the whole sequence. Infill region length and tokenization can affect the performance, see C.3 for more details and more comparisons.
|
| 413 |
+
|
| 414 |
+
Table 7: Accuracy on the CodeXGLUE max/min cloze task. We compare four different inference methods. Left-to-right single: scoring with left-to-right ordering using only the left context and the completion (containing max or min); Left-to-right reranking: scoring with left-to-right ordering using the left context, completion, and right context; CM infill-token: causal masking scoring, using only a single token (containing max or min) as the infill, CM infill-region: causal masking scoring that additionally contains 10 tokens from the right side context.
|
| 415 |
+
|
| 416 |
+
<table><tr><td>Method</td><td>Python</td><td> JavaScript</td><td>Ruby</td><td>Go</td><td>Java</td><td>PHP</td></tr><tr><td>Left-to-right single</td><td>76.9</td><td>77.6</td><td>65.8</td><td>70.4</td><td>74.1</td><td>77.1</td></tr><tr><td>Left-to-right reranking</td><td>87.9</td><td>90.1</td><td>76.3</td><td>92.8</td><td>91.7</td><td>90.4</td></tr><tr><td>CM infill-token</td><td>81.8</td><td>73.9</td><td>81.6</td><td>95.4</td><td>77.6</td><td>87.0</td></tr><tr><td>CM infill-region</td><td>86.2</td><td>91.2</td><td>78.9</td><td>94.7</td><td>89.8</td><td>91.4</td></tr><tr><td>CodeBERT</td><td>82.2</td><td>86.4</td><td>86.8</td><td>90.8</td><td>90.5</td><td>88.2</td></tr></table>
|
| 417 |
+
|
| 418 |
+
Note that comparing the scores of the sequences, which differ in their infills, with the left-to-right setup is more computationally expensive than with the CM infilling setup, as the Transformer intermediate activations can be cached and shared across identical sequence prefixes, and in the CM infill setup all sequence differences occur at the ends.
|
| 419 |
+
|
| 420 |
+
C.3 CLOZE AND SINGLE TOKEN INFILL DETAILS
|
| 421 |
+
Table 8: Accuracy on CodeXGLUE cloze max/min. Left: scoring using only the left context, Leftright: score the whole program, Infill: score the infilling sequence, -region: include left context and 10 tokens from the right. -break: break tokenization on the infilled token. Codex : version code-davinci-001 of OpenAI’s Codex model, as accessed through their API. Information on the training data for this model is unclear, and it may contain portions of CodeSearchNet (which contains this task’s evaluation set).
|
| 422 |
+
|
| 423 |
+
<table><tr><td></td><td>Python</td><td>Javascript</td><td>Ruby</td><td>Go</td><td>Java</td><td>PHP</td></tr><tr><td>Left-break</td><td>72.4</td><td>72.1</td><td>68.4</td><td>71.7</td><td>74.1</td><td>76.9</td></tr><tr><td>Left-token</td><td>76.9</td><td>77.6</td><td>65.8</td><td>70.4</td><td>74.1</td><td>77.1</td></tr><tr><td>Left-region</td><td>84.2</td><td>88.6</td><td>73.7</td><td>85.5</td><td>87.6</td><td>87.0</td></tr><tr><td>Left-right-break</td><td>77.9</td><td>79.4</td><td>63.2</td><td>89.5</td><td>82.0</td><td>85.3</td></tr><tr><td>Left-right</td><td>87.9</td><td>90.1</td><td>76.3</td><td>92.8</td><td>91.7</td><td>90.4</td></tr><tr><td>Infill-break</td><td>79.1</td><td>83.1</td><td>84.2</td><td>90.1</td><td>84.0</td><td>85.3</td></tr><tr><td>Infill-token</td><td>81.8</td><td>73.9</td><td>81.6</td><td>95.4</td><td>77.6</td><td>87.0</td></tr><tr><td>Infill-region</td><td>86.2</td><td>91.2</td><td>78.9</td><td>94.7</td><td>89.8</td><td>91.4</td></tr><tr><td>CodeBERT</td><td>82.2</td><td>86.4</td><td>86.8</td><td>90.8</td><td>90.5</td><td>88.2</td></tr><tr><td>Codex*</td><td>93.6</td><td>93.4</td><td>94.7</td><td>99.3</td><td>95.0</td><td>94.3</td></tr></table>
|
| 424 |
+
|
| 425 |
+
As shown in Table 8, breaking tokenization (-break) on infill decreases the performance using all scoring methods. For example, whereas Math.max( was a single token in the full sequence, the sequence is broken into Math., max, and ( for infilling. Infilling with the original tokenization increases the performance slightly, but does not match full left-right scoring. We suspect this is because the model was not trained on infilling single tokens, unlike CodeBERT. A way to fix this is to include a larger region on the left and a few more tokens on the right. This will only slightly increase the scoring complexity. To show that our model uses the right context, we compare it with scoring the left-only model. More precisely, the sequences being scored are
|
| 426 |
+
|
| 427 |
+
Left-to-right single: [Left; Token] Left-to-right reranking: [Left; Token; Right] Infill-token: [Left; <Mask:0>; Right; <Mask:1>; <Mask:0>; Token; <EOSS>] Left-region: [Left; Token; Right[:10]] Infill-region: [ <Mask: $\varnothing >$ ; Right[10:]; <Mask:1>; <Mask:0>; Left; Token; Right[:10]; <EOSS>]
|
| 428 |
+
|
| 429 |
+
# C.4 COMPARISON TO OPENAI’S CODE API
|
| 430 |
+
|
| 431 |
+
We evaluate OpenAI’s proprietary code-davinci-002 system, accessed through their API, on our single-line HumanEval infilling task, with results given in Table 9, There is limited public information about this system, including on its training data or procedure (although Bavarian et al. 2022 describes their FIM objective as early research that helps power the model), how it performs infills, or whether any postprocessing is done on model outputs, but we report its performance to help gauge the difficulty of our new task. For both code-davinci-002 and our INCODER-6.7B model, conditioning on right-sided context improves performance, with the most substantial improvements from infilling.
|
| 432 |
+
|
| 433 |
+
<table><tr><td>Model</td><td>Inference</td><td>Pass Rate</td><td>Exact Match</td></tr><tr><td>INCODER-6.7B</td><td>Left-to-right single</td><td>48.2</td><td>38.7</td></tr><tr><td>INCODER-6.7B</td><td>Left-to-right reranking</td><td>54.9</td><td>44.1</td></tr><tr><td>INCODER-6.7B</td><td>Infilling</td><td>69.0</td><td>56.3</td></tr><tr><td>code-davinci-002</td><td>Left-to-right single</td><td>63.7</td><td>48.4</td></tr><tr><td>code-davinci-002</td><td>Left-to-right reranking</td><td>71.8</td><td>52.0</td></tr><tr><td>code-davinci-002</td><td>Infilling</td><td>87.4</td><td>69.6</td></tr></table>
|
| 434 |
+
|
| 435 |
+
Table 9: We evaluate OpenAI’s proprietary code-davinci-002 system, accessed through their API, on our single-line HumanEval infilling task. Although no information is currently public about this system, its training data or procedure, how it performs infills, or whether any postprocessing is done on model outputs, we report its performance to help gauge the difficulty of our new task. For both code-davinci-002 and our INCODER-6.7B model, conditioning on right-sided context improves performance, with the most substantial improvements from infilling.
|
| 436 |
+
|
| 437 |
+
# C.5 ADDITIONAL TYPE HINT PREDICTION SETTING
|
| 438 |
+
|
| 439 |
+
Our results in Section 4.3 filtered out functions from the TypeWriter prediction set which had a return type hint of None, as these type hints are are overrepresented in the dataset in compared to naturally-occurring code, due to the filtering process used to construct it. For a closer comparison to the setting used in the original TypeWriter paper, we present results including these functions in Table 10. Given TypeWriter’s static analysis capabilities, and the overrepresentation of None types in this evaluation set, we add a simple post-processing step (return checks) that predicts None if the function does not have any non-trivial return statements, which captures some of the effect of TypeWriter’s analysis capabilities. In all settings, our zero-shot infill approach outperforms the left-to-right baselines, and obtains performance comparable to the supervised TypeWriter approach when return checks are used.
|
| 440 |
+
|
| 441 |
+
<table><tr><td>Method</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Ours: Left-to-right single</td><td>20.0</td><td>20.0</td><td>20.0</td></tr><tr><td>Ours: Left-to-right rerank</td><td>24.2</td><td>24.2</td><td>24.2</td></tr><tr><td>Ours: Infill</td><td>46.8</td><td>46.8</td><td>46.8</td></tr><tr><td>Ours: Left-to-right single + Return checks</td><td>63.2</td><td>63.2</td><td>63.2</td></tr><tr><td>Ours: Left-to-right rerank + Return checks</td><td>64.3</td><td>64.3</td><td>64.3</td></tr><tr><td>Ours: Infill + Return checks</td><td>76.7</td><td>76.7</td><td>76.7</td></tr><tr><td>TypeWriter (Supervised)</td><td>78.8</td><td>69.9</td><td>74.1</td></tr></table>
|
| 442 |
+
|
| 443 |
+
Table 10: Return type hint prediction results on the $2 5 \%$ subset of TypeWriter’s OSS dataset where were able to obtain source files, extract functions and types from, and that were not contained in our model’s training set. Given an overrepresentation of functions with None in this dataset, and the static analysis capabilities of TypeWriter, we also give results using a simple post-processing step that predicts None if the function does not have any non-trivial return statements.
|
| 444 |
+
|
| 445 |
+
# C.6 COMPARISON TO LEFT-TO-RIGHT GENERATIVE MODELS ON CODE SYNTHESIS
|
| 446 |
+
|
| 447 |
+
We compare to past published work on generative code models on the HumanEval (Chen et al., 2021a) and MBPP (Austin et al., 2021) benchmarks, which require models to condition on natural language descriptions (docstrings) to produce Python programs (typically a single function), and evaluates overall functional accuracy (pass rate) across examples using several test cases for each program.
|
| 448 |
+
|
| 449 |
+
We evaluate our INCODER-6.7B model in zero-shot evaluation on both of these benchmarks. For HumanEval, we follow past work by prompting with function signatures and docstring descriptions, sample 200 candidate program completions, and compute pass $@ 1$ , pass $@ 1 0$ , and pass $@ 1 0 0$ using the unbiased sampling estimator of Chen et al. (Chen et al., 2021a). For MBPP, which
|
| 450 |
+
|
| 451 |
+
<table><tr><td rowspan="2">Model</td><td>Size (B)</td><td>Python Code (GB)</td><td>Other Code (GB)</td><td>Other</td><td>Code License</td><td rowspan="2">Infill?</td><td>HE @1</td><td>HE @10</td><td>HE</td><td>MBPP @1</td></tr><tr><td></td><td></td><td></td><td>(GB)</td><td></td><td></td><td></td><td></td><td>@100</td></tr><tr><td>Released</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CodeParrot (Tunstall et al.,2022)</td><td>1.5</td><td>50</td><td>None</td><td>None</td><td></td><td></td><td>4.0</td><td>8.7</td><td>17.9</td><td></td></tr><tr><td>PolyCoder (Xu et al.,2022)</td><td>2.7</td><td>16</td><td>238</td><td>None</td><td></td><td></td><td>5.6</td><td>9.8</td><td>17.7</td><td></td></tr><tr><td>GPT-J(Wang & Komatsuzaki,2021; Chen et al.,2021a)</td><td>6</td><td>6</td><td>90</td><td>730</td><td></td><td></td><td>11.6</td><td>15.7</td><td>27.7</td><td></td></tr><tr><td>INCODER-6.7B</td><td>6.7</td><td>52</td><td>107</td><td>57</td><td>Permissive</td><td>√</td><td>15.2</td><td>27.8</td><td>47.0</td><td>19.4</td></tr><tr><td>GPT-NeoX (Black et al., 2022)</td><td>20</td><td>6</td><td>90</td><td>730</td><td></td><td></td><td>15.4</td><td>25.6</td><td>41.2</td><td></td></tr><tr><td>CodeGen-Multi (Nijkamp et al.,2022)</td><td>6.1</td><td>62</td><td>375</td><td>1200</td><td></td><td></td><td>18.2</td><td>28.7</td><td>44.9</td><td></td></tr><tr><td>CodeGen-Mono (Nijkamp et al.,2022)</td><td>6.1</td><td>279</td><td>375</td><td>1200</td><td></td><td></td><td>26.1</td><td>42.3</td><td>65.8</td><td></td></tr><tr><td>CodeGen-Mono (Nijkamp et al.,2022)</td><td>16.1</td><td>279</td><td>375</td><td>1200</td><td></td><td></td><td>29.3</td><td>49.9</td><td>75.0</td><td></td></tr><tr><td>Unreleased</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LaMDA (Austin et al.,2021; Thoppilan</td><td>137</td><td>None</td><td>None</td><td>???</td><td></td><td></td><td>14.0</td><td></td><td>47.3</td><td>14.8</td></tr><tr><td>et al.,2022; Chowdhery et al.,2022) AlphaCode (Li et al.,2022)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Codex-2.5B (Chen et al.,2021a)</td><td>1.1</td><td>54</td><td>660</td><td>None</td><td></td><td></td><td>17.1</td><td>28.2 35.4</td><td>45.3</td><td></td></tr><tr><td></td><td>2.5</td><td>180</td><td>None None</td><td>> 570</td><td></td><td></td><td>21.4</td><td></td><td>59.5</td><td></td></tr><tr><td>Codex-12B (Chen et al.,2021a)</td><td>12</td><td>180</td><td></td><td>> 570</td><td></td><td></td><td>28.8 36.0</td><td>46.8</td><td>72.3 88.4</td><td></td></tr><tr><td>PaLM-Coder (Chowdhery et al.,2022)</td><td>540</td><td>~20</td><td>~200</td><td>~4000</td><td>Permissive</td><td></td><td></td><td>一</td><td></td><td>47.0</td></tr></table>
|
| 452 |
+
|
| 453 |
+
Table 11: A comparison of our INCODER-6.7B model to published code generation systems using pass rates $@ \ K$ candidates sampled on the HumanEval and MBPP benchmarks. All models are decoder-only transformer models. A “Permissive” code license indicates models trained on only open-source repositories with non-copyleft licenses. The GPT-J, GPT-NeoX, and CodeGen models are pre-trained on The Pile (Gao et al., 2020), which contains a portion of GitHub code without any license filtering, including 6 GB of Python. Although the LaMDA model does not train on code repositories, its training corpus includes $\sim 1 8 \mathrm { ~ B ~ }$ tokens of code from web documents. The total file size of the LaMDA corpus was not reported, but it contains $2 . 8 \mathrm { ~ T ~ }$ tokens total. We estimate the corpus size for PaLM using the reported size of the code data and the token counts per section of the corpus.
|
| 454 |
+
|
| 455 |
+
does not include function signatures, we prompt only with the docstring description and compute pass $@ 1$ (Chowdhery et al., 2022) using a single candidate.16 We use top-p sampling with $p = 0 . 9 5$ , with a temperature of 0.2 for pass $@ 1$ and 0.8 for pass $@ 1 0$ and pass $@ 1 0 0$ .
|
| 456 |
+
|
| 457 |
+
We compare our INCODER-6.7B model to models from past work (which have all been left-toright only) in Table 11, giving the model size and training data summary statistics as reported (or estimated, in cases when a paper only reports token counts, as tokenizer efficiencies vary) in these papers.While differences in details of the Transformer model architectures, datasets, and training procedures across papers and experimental setups make a rigorous comparison impossible, we note that our model achieves roughly comparable performance on the HumanEval metrics to CodeGenMulti (Nijkamp et al., 2022), which is also a $\sim 6 \mathrm { B }$ parameter model trained on roughly the same amount of Python code, as well as AlphaCode’s 1.1B decoder-only model (Li et al., 2022) which also uses a similar amount of Python training data.
|
| 458 |
+
|
| 459 |
+
# D EXAMPLES
|
| 460 |
+
|
| 461 |
+
# D.1 METADATA EXAMPLES
|
| 462 |
+
|
| 463 |
+

|
| 464 |
+
|
| 465 |
+
(a) Metadata for code includes the file extension, source (github or gitlab), filename, and binned number of stars for GitHub repositories (in logarithmically-sized bins numbered 0 to 5, see Section A.3).
|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
|
| 469 |
+
(b) In addition to the standard metadata used for all other code files, Jupyter Notebook metadata includes the kernel type (in this instance, Python) as well as the type of the cells in the notebook (either code or text).
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
|
| 473 |
+
(c) Metadata attributes for StackOverflow include question tags and discretized scores of questions and answers.
|
| 474 |
+
|
| 475 |
+
Figure 6: Examples of metadata attributes included in the training data to allow attribute-conditioned generation and attribute prediction. To allow both generation and prediction, attributes are randomly included either at the beginning of the document or at the end (with probability 0.5 each). Attributes occur in random order to allow arbitrary orderings at inference time.
|
| 476 |
+
|
| 477 |
+
# D.2 EXAMPLE MODEL OUTPUTS
|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
|
| 481 |
+
(a) Reference docstring: Returns a snowflake.connection object.
|
| 482 |
+
Model docstring: Establishes a connection to the Snowflake cluster. (b) Reference docstring: Format text with color or other effects into ANSI escaped string.
|
| 483 |
+
Model docstring: Prints a string with ANSI color codes.
|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
|
| 487 |
+
Figure 7: Example docstring generations for the CodeXGLUE code-to-text dataset. Captions for each example give the reference human-written docstring and the output from our INCODER-6.7B model with causal-masked infilling. The model generates docstrings zero-shot by inserting text between the """ comment delimiters.
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 8: Meta-data conditioning on file extensions for Python (left) and Shell (right) allows completing the same text comment as either a Python script or a pipelined bash command, respectively. Regions highlighted in orange are left-to-right generations from our INCODER-6.7B model.
|
| 491 |
+
|
| 492 |
+

|
| 493 |
+
Figure 9: Given the beginning of a class definition and right-sided context of the class being used, the model is able to infer plausible attribute names for the class (e.g., “Eren” is likely to be a name, 18 is age, “Male” is the gender.) The region highlighted in orange is an infill generation from our INCODER-6.7B model.
|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
Figure 10: By inserting a comment (# use a Huber loss) in the code and replacing the line after with a mask token, a user can prompt the model to in-fill a region of code with a contextuallyappropriate replacement. Lines in orange are in-fill generations from our INCODER-6.7B model.
|
| 497 |
+
|
| 498 |
+
´» Generate ansµer cond¼t¼oned on quest¼on
|
| 499 |
+
|
| 500 |
+
I need to write a Python function called \`snake_to_camel\`. Here's a description:
|
| 501 |
+
"Write a function to convert a snake case string to a camel case string."
|
| 502 |
+
<| q tags=python |>
|
| 503 |
+
<| a |>
|
| 504 |
+
You can use str.title:
|
| 505 |
+
<code>
|
| 506 |
+
>>> 'my_snake_case'.title()
|
| 507 |
+
'MySnakeCase'
|
| 508 |
+
</code>
|
| 509 |
+
</ a tags=python dscor $a = 3$ |>
|
| 510 |
+
|
| 511 |
+
# 2. Add comment
|
| 512 |
+
|
| 513 |
+
I need to write a Python function called \`snake_to_camel\`. Here's a description: "Write a function to convert a snake case string to a camel case string." <| q tags ${ } , = { }$ python |>
|
| 514 |
+
<| a |>
|
| 515 |
+
You can use str.title:
|
| 516 |
+
<code>
|
| 517 |
+
>>> 'my_snake_case'.title()
|
| 518 |
+
'MySnakeCase'
|
| 519 |
+
</code>
|
| 520 |
+
</ a tags ${ } _ { , } = { }$ python dscore $^ { \cdot = 3 }$ |>
|
| 521 |
+
<| c |>
|
| 522 |
+
Close, but you need to replace the underscores with an empty string.
|
| 523 |
+
<|/ c |>
|
| 524 |
+
<| c |>
|
| 525 |
+
Thanks, edited!
|
| 526 |
+
<|/ c |>
|
| 527 |
+
|
| 528 |
+
# 3. Regenerate ¼nfill cond¼t¼oned on comment
|
| 529 |
+
|
| 530 |
+
I need to write a Python function called \`snake_to_camel\`. Here's a description: "Write a function to convert a snake case string to a camel case string." <| q tags $; =$ python |>
|
| 531 |
+
<| a |>
|
| 532 |
+
<code>
|
| 533 |
+
def snake_to_camel(name):
|
| 534 |
+
return ''.join(x.title() for x in name.split('_'))
|
| 535 |
+
</code>
|
| 536 |
+
$< /$ a tag ${ \sf S } ^ { \sf = }$ python dscor $e = 3$ |>
|
| 537 |
+
<| c |>
|
| 538 |
+
Close, but you need to replace the underscores with an empty string.
|
| 539 |
+
<|/ c |>
|
| 540 |
+
<| c |>
|
| 541 |
+
Thanks, edited!
|
| 542 |
+
<|/ c |>
|
| 543 |
+
|
| 544 |
+
Figure 11: Pretraining on StackOverflow, and our model’s infilling capability, allows it to perform zero-shot interactive refinement of a function. In the first example, the model has generated the orange region conditioned on the user description. In the second example, the user has added a comment specifying a refinement to the function, and selected the text for the model to replace. In the third example, the orange region has been infilled by the model.
|
| 545 |
+
|
| 546 |
+

|
| 547 |
+
Figure 12: Question tag and title prediction from the text of a StackOverflow question. Regions highlighted in orange are infill generations from our INCODER-6.7B model.
|
| 548 |
+
|
| 549 |
+

|
| 550 |
+
Figure 13: Zero-shot bidirectional technical jargon translation between Chinese and English. Regions in orange are infill generations from our INCODER-6.7B model.
|
parse/dev/hQwb-lbM6EL/hQwb-lbM6EL_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|