{'fraction_non_alphanumeric': 0.04989829254761758, 'fraction_numerical': 0.011865869444615668, 'mean_word_length': 4.265152129817444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Interactive Learning from Activity Description

We present a novel interactive learning protocol that enables training request-fulfilling agents by verbally describing their activities. Unlike imitation learning (IL), our protocol allows the teaching agent to provide feedback in a language that is most appropriate for them. Compared with reward in reinforcement learning (RL), the description feedback is richer and allows for improved sample complexity. We develop a probabilistic framework and an algorithm that practically implements our protocol. Empirical results in two challenging request-fulfilling problems demonstrate the strengths of our approach: compared with RL baselines, it is more sample-efficient; compared with IL baselines, it achieves competitive success rates without requiring the teaching agent to be able to demonstrate the desired behavior using the learning agent's actions. Apart from empirical evaluation, we also provide theoretical guarantees for our algorithm under certain assumptions about the teacher and the environment.


Introduction
The goal of a request-fulfilling agent is to map a given request in a situated environment to an execution that accomplishes the intent of the request (Winograd, 1972;Chen & Mooney, 2011;Tellex et al., 2012;Artzi et al., 2013;Misra et al., 2017;Anderson et al., 2018;Chen et al., 2019;Nguyen et al., 2019;Nguyen & Daumé III, 2019;Gaddy & Klein, 2019). Request-fulfilling agents have been typically trained using non-verbal interactive learning protocols such as imitation learning (IL) which assumes labeled executions as feedback (Mei et al., 2016;Anderson et al., 2018;Yao et al., 2020), or reinforcement learning (RL) which uses scalar rewards as feedback (Chaplot et al., 2018;Hermann et al., 2017). These protocols are suitable for training agents Figure 1. A real example of training an agent to fulfill a navigation request in a 3D environment (Anderson et al., 2018) using ADEL, our implementation of the ILIAD protocol. The agent receives a request "Enter the house..." which implies the path. Initially, it wanders far from the goal because it does not understand language. Its execution ( ) is described as "Walk through the living room...". To ground language, the agent learns to generate the path conditioned on the description. After a number of interactions, its execution ( ) is closer to the optimal path. As this process iterates, the agent learns to ground diverse descriptions to executions and can execute requests more precisely.
with pre-collected datasets or in simulators, but they do not lend themselves easily to training by human teachers that only possess domain knowledge, but might not be able to precisely define the reward function, or provide direct demonstrations. To enable training by such teachers, we introduce a verbal interactive learning protocol called ILIAD: Interactive Learning from Activity Description, where feedback is limited to descriptions of activities, in a language that is appropriate for a given teacher (e.g., a natural language for humans). Figure 1 illustrates an example of training an agent using the ILIAD protocol. Learning proceeds in episodes of interaction between a learning agent and a teacher. In each episode, the agent is presented with a request, provided in the teacher's description language, and takes a sequence of actions in the environment to execute it. After an execution is completed, the teacher provides the agent with a description of the execution, in the same description language. The agent then uses this feedback to update its policy. Table 1. Trade-offs between the learning effort of the agent and the teacher in three learning protocols. Each protocol employs a different medium for the teacher to convey feedback. If a medium is not natural to the teacher (e.g., IL-style demonstration), it must learn to express feedback using that medium (teacher communicationlearning effort). For example, in IL, to provide demonstrations, the teacher must learn to control the agent to accomplish tasks. Similarly, if a medium is not natural to the agent (e.g., human language), it needs to learn to interpret feedback (agent communicationlearning effort). The agent also learns tasks from information decoded from feedback (agent task-learning effort). The qualitative claims about the "agent learning effort" column summarize our empirical findings about the learning efficiency of algorithms that implement these protocols ( The agent receives no other feedback such as ground-truth demonstration (Mei et al., 2016), scalar reward (Hermann et al., 2017), or constraint (Miryoosefi et al., 2019). Essentially, ILIAD presents a setting where task learning is enabled by grounded language learning: the agent improves its request-fulfilling capability by exploring the description language and learning to ground the language to executions. This aspect distinguish ILIAD from IL or RL, where task learning is made possible by imitating actions or maximizing rewards.
The ILIAD protocol leaves two open problems: (a) the exploration problem: how to generate executions that elicit useful descriptions from the teacher and (b) the grounding problem: how to effectively ground descriptions to executions. We develop an algorithm named ADEL: Activity-Description Explorative Learner that offers practical solutions to these problems. For (a), we devise a semi-supervised execution sampling scheme that efficiently explores the description language space. For (b), we employ maximum likelihood to learn a mapping from descriptions to executions. We show that our algorithm can be viewed as density estimation, and prove its convergence in the contextual bandit setting (Langford & Zhang, 2008b), i.e., when the task horizon is 1.
Our paper does not argue for the primacy of one learning protocol over the others. In fact, an important point we raise is that there are multiple, possibly competing metrics for comparing learning protocols. We focus on highlighting the complementary advantages of ILIAD against IL and RL (Table 1). In all of these protocols, the agent and the teacher establish a communication channel that allows the teacher to encode feedback and send it to the agent. At one extreme, IL uses demonstration, an agent-specific medium, to encode feedback, thus placing the burden of establishing the communication channel entirely on the teacher. Concretely, in standard interactive IL (e.g., Ross et al., 2011), a demonstration can contain only actions in the agent's action space. Therefore, this protocol implicitly assumes that the teacher must be familiar with the agent's control interface.
In practice, non-experts may have to spend substantial effort in order to learn to control an agent. 1 In these settings, the agent usually learns from relatively few demonstrations because it does not have to learn to interpret feedback, and the feedback directly specifies the desired behavior. At another extreme, we have RL and ILIAD, where the teacher provides feedback via agent-agnostic media (reward and language, respectively). RL eliminates the agent communicationlearning effort by hard-coding the semantics of scalar rewards into the learning algorithm. 2 But the trade-off of using such limited feedback is that the task-learning effort of the agent increases; state-of-the-art RL algorithms are notorious for their high sample complexity (Hermann et al., 2017;Chaplot et al., 2018;Chevalier-Boisvert et al., 2019). By employing a natural and expressive medium like natural language, ILIAD offers a compromise between RL and IL: it can be more sample-efficient than RL while not requiring the teacher to master the agent's control interface as IL does.
Overall, no protocol is superior in all metrics and the choice of protocol depends on users' preferences.
We empirically evaluate ADEL against IL and RL baselines on two tasks: vision-language navigation (Anderson et al., 2018), and word-modification via regular expressions (Andreas et al., 2018). Our results show that ADEL significantly outperforms RL baselines in terms of both sample efficiency and quality of the learnt policies. Also, ADEL's success rate is competitive with those of the IL baselines on the navigation task and is lower by 4% on the word modification task. It takes approximately 5-9 times more training episodes than the IL baselines to reach comparable success rates, which is quite respectable considering that the algorithm has to search in an exponentially large space for the ground-truth executions whereas the IL baselines are given these executions. Therefore, ADEL can be a preferred algorithm whenever annotating executions with correct (agent) actions is not feasible or is substantially more expensive than describing executions in some description language. For example, in the word-modification task, ADEL teaches the agent without requiring a teacher with 1 Third-person or observational IL (Stadie et al., 2017;Sun et al., 2019) allows the teacher to demonstrate tasks with their action space. However, this framework is non-interactive because the agent imitates pre-collected demonstrations and does not interact with a teacher. We consider interactive IL (Ross et al., 2011), which is shown to be more effective than non-interactive counterparts.
2 By design, RL algorithms understand that higher reward value implies better performance. knowledge about regular expressions. We believe the capability of non-experts to provide feedback will make ADEL and more generally the ILIAD protocol a strong contender in many scenarios. The code of our experiments is available at https:// github.com/ khanhptnk/ iliad.

ILIAD: Interactive Learning from Activity Description
Environment. We borrow our terminology from the reinforcement learning (RL) literature (Sutton & Barto, 2018). We consider an agent acting in an environment with state space S, action space A, and transition function T : S × A → ∆(S), where ∆(S) denotes the space of all probability distributions over S. Let R = {R : S × A → [0, 1]} be a set of reward functions. A task in the environment is defined by a tuple (R, s 1 , d ), where R ∈ R is the task's reward function, s 1 ∈ S is the start state, and d ∈ D is the task's (language) request. Here, D is the set of all nonempty strings generated from a finite vocabulary. The agent only has access to the start state and the task request; the reward function is only used for evaluation. For example, in robot navigation, a task is given by a start location, a task request like "go to the kitchen", and a reward function that measures the distance from a current location to the kitchen.
Execution Episode. At the beginning of an episode, a task q = (R, s 1 , d ) is sampled from a task distribution P (q). The agent starts in s 1 and is presented with d but does not observe R or any rewards generated by it. The agent maintains a request-conditioned policy π θ : S × D → ∆(A) with parameters θ, which takes in a state s ∈ S and a request d ∈ D, and outputs a probability distribution over A. Using this policy, it can generate an execution e = (s 1 ,â 1 , s 2 , · · · , s H ,â H ), where H is the task horizon (the time limit),â i ∼ π θ (· | s i , d ) and s i+1 ∼ T (· | s i ,â i ) for every i. Throughout the paper, we will use the notation e ∼ P π (· | s 1 , d) to denote sampling an execution e by following policy π given a start state s 1 and a request d. The objective of the agent is to find a policy π with maximum value, where we define the policy value V (π) as: ILIAD protocol. Alg 1 describes the ILIAD protocol for training a request-fulfilling agent. It consists of a series of N training episodes. Each episode starts with sampling a task q = (R, s 1 , d ) from P . The agent then generates an executionê given s 1 , d , and its policy π θ (line 4). The feedback mechanism in ILIAD is provided by a teacher that can describe executions in a description language. The teacher is modeled by a fixed distribution P T : (S × A) H → ∆(D), where (S × A) H is the space over H-step executions. After Algorithm 1 ILIAD protocol. Details of line 4 and line 6 are left to specific implementations.
1: Initialize agent policy π θ : S × D → ∆(A) 2: for n = 1, 2, · · · , N do 3: World samples a task q = (R, s1, d ) ∼ P (·) 4: Agent generates an executionê given s1, d , and π θ 5: Teacher generates a descriptiond ∼ PT (· |ê) 6: Agent uses (d ,ê,d) to update π θ return π θ generatingê, the agent sends it to the teacher and receives a description ofê, which is a sampled ∼ P T (· |ê) (line 5). Finally, the agent uses the triplet (d ,ê,d) to update its policy for the next round (line 6). Crucially, the agent never receives any other feedback, including rewards, demonstrations, constraints, or direct knowledge of the latent reward function. Any algorithm implementing the ILIAD protocol has to decide how to generate executions (the exploration problem, line 4) and how to update the agent policy (the grounding problem, line 6). The protocol does not provide any constraints for these decisions.
Consistency of the teacher. In order for the agent to learn to execute requests by grounding the description language, we require that the description language is similar to the request language. Formally, we define the ground-truth joint distribution over tasks and executions as follows P (e, R, s 1 , d) = P π (e | s 1 , d) P (R, s 1 , d) (2) where π is an optimal policy that maximizes Eq 1. From this joint distribution, we derive the ground-truth executionconditioned distribution over requests P (d | e). This distribution specifies the probability that a request d can serve as a valid description of an execution e.
We expect that if the teacher's distribution P T (d | e) is close to P (d | e) then grounding the description language to executions will help with request fulfilling. In that case, the agent can treat a description of an execution as a request that is fulfilled by that execution. Therefore, the descriptionexecution pairs (d,ê) can be used as supervised-learning examples for the request-fulfilling problem.
The learning process can be sped up if the agent is able to exploit the compositionality of language. For example, if a request is "turn right, walk to the kitchen" and the agent's execution is described as "turn right, walk to the bedroom", the agent may not have successfully fulfilled the task but it can learn what "turn right" and "walk to" mean through the description. Later, it may learn to recognize "kitchen" through a description like "go to the kitchen" and compose that knowledge with its understanding of "walk to" to better execute "walk to the kitchen".
Algorithm 2 Simple algorithm for learning an agent's policy with access to the true marginal P (e | s1) and teacher PT (d | e).

ADEL: Learning from Activity Describers via Semi-Supervised Exploration
We frame the ILIAD problem as a density-estimation problem: given that we can effectively draw samples from the distribution P (s 1 , d) and a teacher P T (d | e), how do we learn a policy π θ such that P π θ (e | s 1 , d) is close to P (e | s 1 , d)? Here, P (e | s 1 , d) = P π (e | s 1 , d) is the ground-truth request-fulfilling distribution obtained from the joint distribution defined in Eq 2.
If s 1 is not the start state of e, then P (e | s 1 , d) = 0. Otherwise, by applying Bayes' rule, and noting that s 1 is included in e, we have: ≈ P (e | s 1 )P T (d | e).
As seen from the equation, the only missing piece required for estimating P (e | s 1 , d) is the marginal 3 P (e | s 1 ). Alg 2 presents a simple method for learning an agent policy if we have access to this marginal. It is easy to show that the pairs (ê,d) in the algorithm are approximately drawn from the joint distribution P (e, d | s 1 ) and thus can be directly used to estimate the conditional P (e | s 1 , d).
Unfortunately, P (e | s 1 ) is unknown in our setting. We present our main algorithm ADEL (Alg 3) which simultaneously estimates P (e | s 1 ) and P (e | s 1 , d) through interactions with the teacher. In this algorithm, we assume access to an approximate marginal P πω (e | s 1 ) defined by an explorative policy π ω (a | s). This policy can be learned from a dataset of unlabeled executions or be defined as a program that synthesizes executions. In many applications, reasonable unlabeled executions can be cheaply constructed using knowledge about the structure of the execution. For example, in robot navigation, valid executions are collisionfree and non-looping; in semantic parsing, predicted parses should follow the syntax of the semantic language.
Algorithm 3 ADEL: our implementation of the ILIAD protocol.
1: Input: teacher PT (d | e), approximate marginal Pπ ω (e | s1), mixing weight λ ∈ [0, 1], annealing rate β ∈ (0, 1) 2: Initialize π θ : S × D → ∆(A) and B = ∅ 3: for n = 1, 2, · · · , N do 4: World samples a task q = (R, s1, d ) ∼ P (·) 5: Agent generatesê ∼P(· | s1, d ) (see Eq 4) 6: Teacher generates a descriptiond ∼ PT (· |ê) 7: B ← B ∪ (ê,d) 8: Update agent policy: whereâs is the action taken by the agent in state s 9: Anneal mixing weight: λ ← λ · β 10: return π θ After constructing the approximate marginal P πω (e | s 1 ), we could substitute it for the true marginal in Alg 2. However, using a fixed approximation of the marginal may lead to sample inefficiency when there is a mismatch between the approximate marginal and the true marginal. For example, in the robot navigation example, if most human requests specify the kitchen as the destination, the agent should focus on generating executions that end in the kitchen to obtain descriptions that are similar to those requests. If instead, a uniform approximate marginal is used to generate executions, the agent obtains a lot of irrelevant descriptions.
ADEL minimizes potential marginal mismatch by iteratively using the estimate of the marginal P (e | s 1 ) to improve the estimate of the conditional P (e | s 1 , d) and vice versa. Initially, we set P πω (e | s 1 ) as the marginal over executions. In each episode, we mix this distribution with P π θ (e | s 1 , d), the current estimate of the conditional, to obtain an improved estimate of the marginal (line 5). Formally, given a start state s 1 and a request d , we sample an executionê from the following distribution: where λ ∈ [0, 1] is a mixing weight that is annealed to zero over the course of training. Each component of the mixture in Eq 4 is essential in different learning stages. Mixing with P πω accelerates convergence at the early stage of learning. Later, when π θ improves, P π θ skewsP towards executions whose descriptions are closer to the requests, closing the gap with P (e | s 1 ). In line 6-8, similar to Alg 2, we leverage the (improved) marginal estimate and the teacher to draw samples (ê,d) and use them to re-estimate P π θ .
Theoretical Analysis. We analyze an epoch-based variant of ADEL and show that under certain assumptions, it converges to a near-optimal policy. In this variant, we run the algorithm in epochs, where the agent policy is only updated at the end of an epoch. In each epoch, we collect a fresh batch of examples {(ê,d)} as in ADEL (line 4-7), and use them to perform a batch update (line 8). We provide a sketch of our theoretical results here and defer the full details to Appendix A.
We consider the case of H = 1 where an execution e = (s 1 , a) consists of the start state s 1 and a single action a taken by the agent. This setting while restrictive captures the non-trivial class of contextual bandit problems (Langford & Zhang, 2008b). Sequential decision-making problems where the agent makes decisions solely based on the start state can be reduced to this setting by treating a sequence of decisions as a single action (Kreutzer et al., 2017;Nguyen et al., 2017a). We focus on the convergence of the iterations of epochs, and assume that the maximum likelihood estimation problem in each epoch can be solved optimally. We also ablate the teacher learning difficulty by assuming access to a perfectly consistent teacher, i.e., P T (d | e) = P (d | e).
We make two crucial assumptions. Firstly, we make a standard realizability assumption to ensure that our policy class is expressive enough to accommodate the optimal solution of the maximum likelihood estimation. Secondly, we assume that for every start state s 1 , the teacher distribution's matrix P (d | e s1 ) over descriptions and executions e s1 starting with s 1 , has a non-zero minimum singular value σ min (s 1 ). Intuitively, this assumption implies that descriptions are rich enough to help in deciphering actions. Under these assumptions, we prove the following result: Theorem 1 (Main Result). Let P n (e | s 1 ) be the marginal distribution in the n th epoch. Then for any t ∈ N and any start state s 1 we have: Theorem 1 shows that the running average of the estimated marginal distribution converges to the true marginal distribution. The error bound depends logarithmically on the size of action space, and therefore, suitable for problems with exponentially large action space. As argued before, access to the true marginal can be used to easily learn a near-optimal policy. For brevity, we defer the proof and other details to Appendix A. Hence, our results show that under certain conditions, we can expect convergence to the optimal policy. We leave the question of sample complexity and addressing more general settings for future work.

Experimental Setup
In this section, we present a general method for simulating an execution-describing teacher using a pre-collected dataset ( § 4.1). Then we describe setups of the two problems we conduct experiments on: vision-language navigation ( §4.2) and word modification ( §4.3). Details about the data, the model architecture, training hyperparameters, and how the teacher is simulated in each problem are in the Appendix.
We emphasize that the ILIAD protocol or the ADEL algorithm do not propose learning a teacher. Similar to IL and RL, ILIAD operates with a fixed, black-box teacher that is given in the environment. Our experiments specifically simulate human teachers that train request-fulfilling agents by talking to them (using descriptions). We use labeled executions only to learn approximate models of human teachers.

Simulating Teachers
ILIAD assumes access to a teacher P T (d | e) that can describe agent executions in a description language. For our experimental purposes, employing human teachers is expensive and irreproducible, thus we simulate them using pre-collected datasets. We assume availability of a dataset n } M j=1 contains M human-generated requests that are fulfilled by execution e n . Each of the two experimented problems is accompanied by data that is partitioned into training/validation/test splits. We use the training split as B sim and use the other two splits for validation and testing, respectively. Our agents do not have direct access to B sim . From an agent's perspective, it communicates with a black-box teacher that can return descriptions of its executions; it does not know how the teacher is implemented.
Each ILIAD episode (Alg 1) requires providing a request d at the beginning and a descriptiond of an executionê. The request d is chosen by first uniformly randomly selecting an example (D n , e n ) from B sim , and then uniformly sampling a request d (j) n from D n . The descriptiond is generated as follows. We first gather all the pairs (d (j) n , e n ) from B sim and train an RNN-based conditional language modelP T (d | e) via standard maximum log-likelihood. We can then generate a description of an executionê by greedily decoding 4 this model conditioned onê:d greedy = greedy P T (· |ê) . However, given limited training data, this model may not generate sufficiently high-quality descriptions. We apply two techniques to improve the quality of the descriptions. First, we provide the agent with the human-generated requests in B sim when the executions are near optimal. Let perf (ê, e ) 5 be a performance metric that evaluates an agent's executionê against a ground-truth e (higher is better). An executionê is near optimal if perf (ê, e ) ≥ τ , where τ is a constant threshold. Second, we apply prag-matic inference (Andreas & Klein, 2016;Fried et al., 2018a), leveraging the fact that the teacher has access to the environment's simulator and can simulate executions of descriptions. The final description given to the agent iŝ where Unif(D) is a uniform distribution over elements of D, e n is the ground-truth execution associated with D n , D prag contains descriptions generated using pragmatic inference (which we will describe next), and ∅ is the empty string.
Improved Descriptions with Pragmatic Inference. Pragmatic inference emulates the teacher's ability to mentally simulate task execution. Suppose the teacher has its own execution policy π T (a | s, d), which is learned using the pairs e n , d (j) n of B sim , and access to a simulator of the environment. A pragmatic execution-describing teacher is defined as P prag For this teacher, the more likely that a request d causes it to generate an execution e, the more likely that it describes e as d.
In our problems, constructing the pragmatic teacher's distribution explicitly is not feasible because we would have to compute a normalizing constant that sums over all possible descriptions. Instead, we follow Andreas et al. (2018), generating a set of candidate descriptions and using P π T (e | s 1 , d) to re-rank those candidates. Concretely, for every executionê where perf (ê, e n ) < τ , we use the learned language modelP T to generate a set of candi- . This set consists of the greedily decoded descriptiond greedy = greedy P T (· |ê) and K descriptionsd (k) sample ∼P T (· | e). To construct D prag , we select descriptions in D cand from which π T generates executions that are similar enough toê: where e d = greedy (P π T (· | s 1 , d)) and s 1 is the start state ofê.

Vision-Language Navigation (NAV)
Problem and Environment. An agent executes natural language requests (given in English) by navigating to locations in environments that photo-realistically emulate residential buildings (Anderson et al., 2018). The agent successfully fulfills a request if its final location is within three meters of the intended goal location. Navigation in an environment is framed as traversing in a graph where each node represents a location and each edge connects two nearby unobstructed locations. A state s of an agent represents its location and the direction it is facing. In the beginning, the agent starts in state s 1 and receives a navigation request d . At every time step, the agent is not given the true state s but only receives an observation o, which is a real-world RGB image capturing the panoramic view at its current location.
Agent Policy. The agent maintains a policy π θ (a | o, d) that takes in a current observation o and a request d, and outputs an action a ∈ V adj , where V adj denotes the set of locations that are adjacent to the agent's current location according to the environment graph. A special <stop> action is taken when the agent wants to terminate an episode or when it has taken H actions.
Simulated Teacher. We simulate a teacher that does not know how to control the navigation agent and thus cannot provide demonstrations. However, the teacher can verbally describe navigation paths taken by the agent. We follow §4.1, constructing a teacher P T (d | e) that outputs language descriptions given executions e = (o 1 , a 1 , · · · , o H ).

Word Modification (REGEX)
Problem. A human gives an agent a natural language request (in English) d asking it to modify the characters of a word w inp . The agent must execute the request and outputs a wordŵ out . It successfully fulfills the request ifŵ out exactly matches the expected output w out . For example, given an input word embolden and a request "replace all n with c", the expected output word is emboldec. We train an agent that solves this problem via a semantic parsing approach. Given w inp and d , the agent generates a regular expression a 1:H = (â 1 , · · · ,â H ), which is a sequence of characters. It then uses a regular expression compiler to apply the regular expression onto the input word to produce an output word w out = compile w inp ,â 1:H .
Agent Policy and Environment. The agent maintains a policy π θ (a | s, d) that takes in a state s and a request d, and outputs a distribution over characters a ∈ V regex , where V regex is the regular expression (character) vocabulary. A special <stop> action is taken when the agent wants to stop generating the regular expression or when the regular expression exceeds the length limit H. We set the initial state s 1 = w inp , ∅ , where ∅ is the empty string. A next state is determined as follows whereŵ out = compile w inp ,â 1:t .
Simulated Teacher. We simulate a teacher that does not have knowledge about regular expressions. Hence, instead of receiving full executions, which include regular expressionsâ 1:H predicted by the agent, the teacher generates descriptions given only pairs (w inp j ,ŵ out j ) of an input word w inp j and the corresponding output generated by the agent w out j . In addition, to reduce ambiguity, the teacher requires multiple word pairs generate a description. This issue is better illustrated in the following example. Suppose the agent generates the pair embolden → emboldec by predicting a regular expression that corresponds to the description "replace all n with c". However, because the teacher does not observe the agent's regular expression (and cannot understand the expression even if it does), it can also describe the pair as "replace the last letter with c". Giving such a description to the agent would be problematic because the description does not correspond to the predicted regular expression. Observing multiple word pairs increases the chance that the teacher's description matches the agent's regular expression (e.g. adding now → cow help clarify that "replace all n with c" should be generated). In the end, the teacher is a model P T d {w inp j ,ŵ out j } J j=1 that takes as input J word pairs. To generate J word pairs, in every episode, in addition to the episode's input word, we sample J − 1 more words from the dictionary and execute the episode's request on the J words. We do not use any regular expression data in constructing the teacher. To train the teacher's policy π T for pragmatic inference ( §4.1), we use a dataset that consists of tuples D n , (w inp n , w out n ) which are not annotated with ground-truth regular expressions. π T directly generates an output word instead of predicting a regular expression like the agent policy π θ .

Baselines and Evaluation Metrics
We compare interactive learning settings that employ different teaching media: • Learning from activity description (ILIAD): the teacher returns a language descriptiond. • Imitation learning (IL): the teacher demonstrates the correct actions in the states that the agent visited, returning e = (s 1 , a 1 , · · · , a H , s H ), where s i are the states in the agent's execution and a i are the optimal actions in those states. • Reinforcement learning (RL): the teacher provides a scalar reward that evaluates the agent's execution. We consider a special case when rewards are provided only at the end of an episode. Because such feedback is cheap to collect (e.g., star ratings) (Nguyen et al., 2017b;Kreutzer et al., 2018;, this setting is suitable for large-scale applications. We experiment with both binary reward that indicates task success, and continuous reward that measures normalized distance to the goal (see Appendix D).
We use ADEL in the ILIAD setting, DAgger (Ross et al., 2011) in IL, and REINFORCE 6 (Williams, 1992) in RL. We report the success rates of these algorithms, which are the fractions of held-out (validation or test) examples on which the agent successfully fulfills its requests. All agents are initialized with random parameters.

Results
We compare the learning algorithms on not only success rate, but also the effort expended by the teacher. While task success rate is straightforward to compute, teacher effort is hard to quantify because it depends on many factors: the type of knowledge required to teach a task, the cognitive and physical ability of a teacher, etc. For example, in REGEX, providing demonstrations in forms of regular expressions may be easy for a computer science student, but could be challenging for someone who is unfamiliar with programming. In NAV, controlling a robot may not be viable for an individual with motor impairment, whereas generating language descriptions may infeasible for someone with a verbal-communication disorder. Because it is not possible cover all teacher demographics, our goal is to quantitatively compare the learning algorithms on learning effectiveness and efficiency, and qualitatively compare them on the teacher effort to learn to express feedback using the protocol's communication medium. Our overall findings (Table 1) highlight the strengths and weaknesses of each learning algorithm and can potentially aid practitioners in selecting algorithms that best suit their applications. Table 2. Main results. We report means and standard deviations of success rates (%) over five runs with different random seeds. RL-Binary and RL-Cont refer to the RL settings with binary and continuous rewards, respectively. Sample complexity is the number of training episodes (or number of teacher responses) required to reach a validation success rate of at least c. Note that the teaching efforts are not comparable across the learning settings: providing a demonstration can be more or less tedious than providing a language description depending on various characteristics of the teacher. Hence, even though ADEL requires more episodes to reach the same performance as DAgger, we do not draw any conclusions about the primacy of one algorithm over the other in terms of teaching effort.
Main results. Our main results are in Table 2. Overall, results in both problems match our expectations. The IL baseline achieves the highest success rates (on average, 35.6% on NAV and 92.5% on REGEX). This framework is most effective because the feedback directly specifies ground-truth actions. The RL baseline is unable to reach competitive success rates. Especially, in REGEX, the RL agent cannot learn the syntax of the regular expressions and completely fails at test time. This shows that the reward feedback is not sufficiently informative to guide the agent to explore efficiently in this problem. ADEL's success rates are slightly lower than those of IL (3-4% lower than) but are substantially higher than those of RL (+9.8% on NAV and +88.1% on REGEX compared to the best RL results).
To measure learning efficiency, we report the number of training episodes required to reach a substantially high success rate (30% for NAV and 85% for REGEX). We observe that all algorithms require hundreds of thousands of episodes to attain those success rates. The RL agents cannot learn effectively even after collecting more than 1M responses from the teachers. ADEL attains reasonable success rates using 5-9 times more responses than IL. This is a decent efficiency considering that ADEL needs to find the ground-truth executions in exponentially large search spaces, while IL directly communicates these executions to the agents. As ADEL lacks access to ground-truth executions, its average training returns are 2-4 times lower than those of IL (Figure 2).
Ablation. We study the effects of mixing with the approximate marginal (P πω ) in ADEL (Table 3). First of all, we observe that learning cannot take off without using the approximate marginal (λ = 0). On the other hand, using only the approximate marginal to generate executions (λ = 1) degrades performance, in terms of both success rate and Table 3. Effects of mixing execution policies in ADEL.

Vision-language navigation
88.0 608K sample efficiency. This effect is more visible on REGEX where the success rate drops by 33% (compared to a 3% drop in NAV), indicating that the gap between the approximate marginal and the true marginal is larger in REGEX than in NAV. This matches our expectation as the set of unlabeled executions that we generate to learn π ω in REGEX covers a smaller portion of the problem's execution space than that in NAV. Finally, mixing the approximate marginal and the agent-estimated conditional (λ = 0.5) gives the best results.

Related Work
Learning from Language Feedback. Frameworks for learning from language-based communication have been previously proposed. Common approaches include: reduction to reinforcement learning (Goldwasser & Roth, 2014;MacGlashan et al., 2015;Ling & Fidler, 2017;Goyal et al., 2019;Fu et al., 2019;Sumers et al., 2020), learning to ground language to actions (Chen & Mooney, 2011;Misra et al., 2014;Bisk et al., 2016;Liu et al., 2016;Wang et al., 2016;Li et al., 2017;2020a;, or devising EM-based algo-rithms to parse language into logical forms (Matuszek et al., 2012;Labutov et al., 2018). The first approach may discard useful learning signals from language feedback and inherits the limitations of RL algorithms. The second requires extra effort from the teacher to provide demonstrations. The third approach has to bootstrap the language parser with labeled executions. ADEL enables learning from a specific type of language feedback (language description) without reducing it to reward, requiring demonstrations, or assuming access to labeled executions.
Description Feedback in Reinforcement Learning. Recently, several papers have proposed using language description feedback in the context of reinforcement learning (Jiang et al., 2019;Chan et al., 2019;Colas et al., 2020;Cideron et al., 2020). These frameworks can be viewed as extensions of hindsight experience replay (HER; Andrychowicz et al., 2017) to language goal generation. While the teacher in ILIAD can be considered as a language goal generator, an important distinction between ILIAD and these frameworks is that ILIAD models a completely reward-free setting. Unlike in HER, the agent in ILIAD does not have access to a reward function that it can use to compute the reward of any tuple of state, action, and goal. With the feedback coming solely from language descriptions, ILIAD is designed so that task learning relies only on extracting information from language. Moreover, unlike reward, the description language in ILIAD does not contain information that explicitly encourages or discourages actions of the agent. The formalism and theoretical studies of ILIAD presented in this work are based on a probabilistic formalism and do not involve reward maximization.
Description Feedback in Vision-Language Navigation. Several papers (Fried et al., 2018b;Tan et al., 2019) apply back-translation to vision-language navigation (Anderson et al., 2018). While also operating with an output-to-input translator, back-translation is a single-round, offline process, whereas ILIAD is an iterative, online process. Zhou & Small (2021) study a test-time scenario that is similar to ILIAD but requires labeled demonstrations to learn the execution describer and to initialize the agent. The teacher in ILIAD is more general: it can be automated (i.e., learned from labeled data), but it can also be a human. Our experiments emulate applications where non-expert humans teach agents new tasks by only giving them verbal feedback. We use labeled demonstrations to simulate human teachers, but it is part of the experimental setup, not part of our proposed protocol and algorithm. Our agent does not have access to labeled demonstrations; it is initialized with random parameters and is trained with only language-description feedback. Last but not the least, we provide theoretical guarantees for ADEL, while these works only present empirical studies.
Connection to Pragmatic Reasoning. Another related line of research is work on the rational speech act (RSA) or pragmatic reasoning (Grice, 1975;Golland et al., 2010;Monroe & Potts, 2015;Goodman & Frank, 2016;Andreas & Klein, 2016;Fried et al., 2018a), which is also concerned with transferring information via language. It is important to point out that RSA is a mental reasoning model whereas ILIAD is an interactive protocol. In RSA, a speaker (or a listener) constructs a pragmatic message-encoding (or decoding) scheme by building an internal model of a listener (or a speaker). Importantly, during that process, one agent never interacts with the other. In contrast, the ILIAD agent learns through interaction with a teacher. In addition, RSA focuses on encoding (or decoding) a single message while ILIAD defines a process consisting of multiple rounds of message exchanging. We employ pragmatic inference to improve the quality of the simulated teachers but in our context, the technique is used to set up the experiments and is not concerned about communication between the teacher and the agent.
Connection to Emergent Language. Finally, our work also fundamentally differs from work on (RL-based) emergent language (Foerster et al., 2016;Lazaridou et al., 2017;Havrylov & Titov, 2017;Das et al., 2017;Evtimova et al., 2018;Kottur et al., 2017) in that we assume the teacher speaks a fixed, well-formed language, whereas in these works the teacher begins with no language capability and learns a language over the course of training.

Conclusion
The communication protocol of a learning framework places natural boundaries on the learning efficiency of any algorithm that instantiates the framework. In this work, we illustrate the benefits of designing learning algorithms based on a natural, descriptive communication medium like human language. Employing such expressive protocols leads to ample room for improving learning algorithms. Exploiting compositionality of language to improve sample efficiency, and learning with diverse types of feedback are interesting areas of future work. Extending the theoretical analyses of ADEL to more general settings is also an exciting open problem. Chan, H., Wu, Y., Kiros, J., Fidler, S., and Ba, J. Actrce: Augmenting experience via teacher's advice for multi-goal reinforcement learning. arXiv preprint arXiv:1902.04546, 2019.
Chen, D. L. and Mooney, R. J. Learning to interpret natural language navigation instructions from observations. In Association for the Advancement of Artificial Intelligence, 2011.
Chen, H., Suhr, A., Misra, D., and Artzi, Y. Touchdown: Natural language navigation and spatial reasoning in visual street environments.  Magalhaes, G. I., Jain, V., Ku, A., Ie, E., and Baldridge, J. General evaluation for instruction conditioned navigation using dynamic time warping. In Proceedings of Advances in Neural Information Processing Systems, 2019.
Matuszek, C., FitzGerald, N., Zettlemoyer, L., Bo, L., and Fox, D. A joint model of language and perception for grounded attribute learning. Zhou, L. and Small, K. Inverse reinforcement learning with natural language goals. In AAAI, 2021.

∆(U) Space of all distributions over a set U unf(U)
Denotes the uniform distribution over a set U . p p-norm D KL (Q 1 (x | y) || Q 2 (x | y)) KL-divergence between two distributions Q 1 (· | y) and Q 2 (· | y) over a countable set X . Formally, Parameters of agent's policy. Belongs to the set Θ. π θ (a | s, d) Agent's policy denoting the probability of action a given state s, description d, and parameters θ.

Appendix: Interactive Learning from Activity Description
The appendix is organized as follows: • Statement and proof of theoretical guarantees for ADEL (Appendix A); • Settings of the two problems we conduct experiments on (Appendix B); • A practical implementation of the ADEL algorithm that we use for experimentation (Appendix C); • Training details including model architecture and hyperparameters (Appendix D); • Qualitative examples (Appendix E).
We provide a list of notations in Table 4 on page 14.

A. Theoretical Analysis of ADEL
In this section, we provide a theoretical justification for an epoch-version of ADEL for the case of H = 1. We prove consistency results showing ADEL learns a near-optimal policy, and we also derive the convergence rate under the assumption that we perform maximum likelihood estimation optimally and the teacher is consistent. We call a teacher model P T (d | e) to be consistent if for every execution e and description d we have P T (d | e) = P (d | e). Recall that the conditional distribution P (d | e) is derived from the joint distribution defined in Equation 2. We will use superscript to denote all probability distributions that are derived from this joint distribution.
We start by writing the epoch-version of ADEL in Algorithm 4 for an arbitrary value of H. The epoch version of ADEL runs an outer loop of epochs (line 3-10). The agent model is updated only at the end of an epoch. In the inner loop (line 5-9), the agent samples a batch using the teacher model and the agent model. This is used to update the model at the end of the epoch.
At the start of the n th epoch, our sampling scheme in line 6-9 defines a procedure to sample (ê,d) from a distribution D n that remains fixed over this whole epoch. To define D n , we first define P n (e) = E (R,d,s1)∼P (q) [P n (e | s 1 , d)] where we use the shorthand P n (e | s 1 , d) to refer to P π θn (e | s 1 , d). Note thatê ∼ P n (e) in line 7. Asd ∼ P (d |ê), therefore, we arrive at the following form of D n : D n (ê,d) = P (d |ê)P n (ê).
We will derive our theoretical guarantees for H = 1. This setting is known as the contextual bandit setting (Langford & Zhang, 2008a), and while simpler than general reinforcement learning setting, it captures a large non-trivial class of problems. In this case, an execution e = [s 1 , a 1 ] can be described by the start state s 1 and a single action a 1 ∈ A taken by the agent. Since there is a single state and action in any execution, therefore, for cleaner notations we will drop the subscript and simply write s, a instead of s 1 , a 1 . For convenience, we also define a few extra notations. Firstly, we define the marginal distribution D n (s,d) = a ∈A D n ([s, a ], d). Secondly, let P (s) be the marginal distribution over start state s given by E (R,d,s1)∼P (q) [1{s 1 = s}]. We state some useful relations between these probability distributions in the next lemma.
Algorithm 4 EPOCHADEL: Epoch Version of ADEL. We assume the teacher is consistent, i.e., PT (d | e) = P (d | e) for every (d, e).

8:
Teacher generates descriptiond ∼ P (· |ê) 9: B ← B ∪ ê,d 10: Update agent policy using batch updates: where a s is the action taken by the agent in state s in executionê. return π θ Lemma 2. For any n ∈ N, we have: Proof. We first compute the marginal distribution a ∈A P n (e := [s, a ]) over s: Next we compute the conditional distribution P n (a | s) as shown: This also proves P n ([s, a]) = P (s)P n (a | s). ln π θ (a | s,d).
Here J n (θ) is the empirical objective whose expectation over draws of batches is given by: As this is negative of the cross entropy loss, the Bayes optimal value would be achieved for π θ (a | s, d) = D n (a | s, d) for all a ∈ A and every (s, d) ∈ suppD n (s, d). We next state the form of this Bayes optimal model and then state our key realizability assumption.
Lemma 3. Fix n ∈ N. For every (s, d) ∈ suppD n (s, d) the value of the Bayes optimal model D n (a | s, d) at the end of the n th epoch is given by: Proof. The Bayes optimal model is given by D n (a | s, d) for every (s, d) ∈ suppD n (s, d). We compute this using Bayes' theorem.
The last equality above uses Lemma 2.
In order to learn the Bayes optimal model, we need our policy class to be expressive enough to contain this model. We formally state this realizability assumption below.
Assumption 1 (Realizability). For every θ ∈ Θ, there exists θ ∈ Θ such that for every start state s, description d we have: We can use the realizability assumption along with convergence guarantees for log-loss to state the following result: Theorem 4 (Theorem 21 of (Agarwal et al., 2020)). Fix m ∈ N and δ ∈ (0, 1). Let {(d (i) , e (i) = [s (i) , a (i) ]} m i=1 be i.i.d draws from D n (e, d) and let θ n+1 be the solution to the optimization problem in line 10 of the n th epoch of EPOCHADEL. Then with probability at least 1 − δ we have: where C > 0 is a universal constant.
Please see Agarwal et al. (2020) for a proof. Lemma 4 implies that assuming realizability, as M → ∞, our learned solution converges to the Bayes optimal model pointwise on the support over D n (s, d). Since we are only interested in consistency, we will assume M → ∞ and assume P n+1 (a | s, d) = D n (a | s, d) for every (s, d) ∈ suppD n (s, d). We will refer to this as optimally performing the maximum likelihood estimation at n th epoch. If the learned policy is given by P n+1 (a | s, d) = D n (a | s, d), then the next Lemma states the relationship between the marginal distribution P n+1 (a | s) for the next time epoch and marginal P n (a | s) for this epoch.
Lemma 5 (Inductive Relation Between Marginals). For any n ∈ N, if we optimally perform the maximum likelihood estimation at the n th epoch of EPOCHADEL, then for all start states s, the marginal distribution P n+1 (a | s) for the (n + 1) th epoch is given by: .

Interactive Learning from Activity Description
Proof. The proof is completed as follows: where the first step uses Lemma 2 and the second step uses P n+1 (a | s, d) = D n (a | s, d) (optimally solving maximum likelihood) and the form of D n from Lemma 3.

A.1. Proof of Convergence for Marginal Distribution
Our previous analysis associates a probability distribution P n (a | s, d) and P n (a | s) with the n th epoch of EPOCHADEL. For any n ∈ N, the n th epoch of EPOCHADEL can be viewed as a transformation of P n (a | s, d) → P n+1 (a | s, d) and P n (a | s) → P n+1 (a | s). In this section, we show that under certain conditions, the running average of the marginal distributions P n (a | d) converges to the optimal marginal distribution P (a | d). We then discuss how this can be used to learn the optimal policy P (a | s, d).
We use a potential function approach to measure the progress of each epoch. Specifically, we will use KL-divergence as our choice of potential function. The next lemma bounds the change in potential after a single iteration.
[Potential Difference Lemma] For any n ∈ N and start state s, we define the following distribution over descriptions P n (d | s) := a ∈A P (d | [s, a])P n (a | s). Then for every start state s we have: Proof. The change in potential from the start of n th epoch to its end is given by: Using Lemma 5 and the definition of P n (d | s) we get: .
Taking logarithms and applying Jensen's inequality gives: Taking expectations of both sides with respect to P (a | s) gives us: where the last step uses the definition of P n (d | s). The proof is completed by combining the above result with Equation 12.
The P s matrix. For a fixed start state s, we define P s as the matrix whose entries are P (d | [s, a]). The columns of this matrix range over actions, and the rows range over descriptions. We denote the minimum singular value of the description matrix P s by σ min (s).
We state our next assumption that the minimum singular value of P s matrix is non-zero.
Assumption 2 (Minimum Singular Value is Non-Zero). For every start state s, we assume σ min (s) > 0.
Intuitively, this assumption states that there is enough information in the descriptions for the agent to decipher probabilities over actions from learning probabilities over descriptions. More formally, we are trying to decipher P (a | s) using access to two distributions: P (d | s) which generates the initial requests, and the teacher model P (d | [s, a]) which is used to describe an execution e = [s, a]. This can result in an underspecified problem. The only constraints these two distributions place on P (a | s) is that a∈A P (d | [s, a])P (a | s) = P (d | s). This means all we know is that P (a | s) belongs to the following set of solutions of the previous linear systems of equation: As P (a | s) belongs to this set hence this set is nonempty. However, if we also assume that σ min (s) > 0 then the above set has a unique solution. Recall that singular values are square root of eigenvalues of P s P s , and so σ min (s) > 0 implies that the matrix P s P s is invertible. 7 This means, we can find the unique solution of the linear systems of equation by multiplying both sides by (P s P s ) −1 P s . Hence, Assumption 2 makes it possible for us to find P (a | s) using just the information we have. Note that we cannot solve the linear system of equations directly since the description space and action space can be extremely large. Hence, we use an oracle based solution via reduction to supervised learning.
The next theorem shows that the running average of learned probabilities P n (a | s) converges to the optimal marginal distribution P (a | s) at a rate determined by the inverse square root of the number of epochs of ADEL, the minimum singular value of the matrix P s , and the KL-divergence between optimal marginal and initial value. Theorem 7.
[Rate of Convergence for Marginal] For any t ∈ N we have: and if P 1 (a | s, d) is a uniform distribution for every s and d, then Proof. We start with Lemma 6 and bound the right hand side as shown: where the second step uses Pinsker's inequality. The third step uses the property of p-norms, specifically, ν 2 ≤ ν 1 for all ν. The fourth step, uses the definition of P (d | s) = a ∈A P(d | s, a )P (a | s)) and P n (d | s) = a ∈A P(d | s, a )P n (a | s). We interpret the notation P (a | s) as a vector over actions whose value is the probability P (a | s). Therefore, P s P (a | s) represents a matrix-vector multiplication. Finally, the last step, uses Ax 2 ≥ σ min (A) x 2 for any vector x and matrix A of compatible shape such that Ax is defined, where σ min (A) is the smallest singular value of A.
Summing over n from n = 1 to t and rearranging the terms we get: Recall that a matrix of the form A A always have non-negative eigenvalues.

Interactive Learning from Activity Description
As the left hand-side is positive we get: t n=1 P (a | s) − P n (a | s) 2 2 ≤ 2 σ min (s) 2 D KL (P (a | s) || P 1 (a | s)).
Dividing by t and applying Jensen's inequality (specifically, E[X 2 ] ≥ E[|X|] 2 ) we get: Using the triangle inequality, the left hand side can be bounded as: Combining the previous two equations proves the main result. Finally, note that if P 1 (a | s, d) = 1 /|A| for every value of s, d, and a, then P 1 (a | s) is also a uniform distribution over actions. The initial KL-divergence is then bounded by ln |A| as shown below: where the second step uses the fact that entropy of a distribution is non-negative. This completes the proof.

A.2. Proof of Convergence to Near-Optimal Policy
Finally, we discuss how to learn P (a | s, d) once we learn P (a | s). Since we only derive convergence of running average of P n (a | s) to P (a | s), therefore, we cannot expect P n (a | s, d) to converge to P (a | s, d). Instead, we will show that if we perform line 4-10 in Algorithm 4 using the running average of policies, then the learned Bayes optimal policy will converge to the near-optimal policy. The simplest way to accomplish this with Algorithm 4 is to perform the block of code in line 4-10 twice, once when taking actions according to P n (a | s, d), and once when taking actions according to running average policyP n (a | s, d) = 1 n n t=1P t (a | s, d). This will give us two Bayes optimal policy in 10 one each for the current policy P n (a | s, d) and the running average policyP n (a | s, d). We use the former for roll-in in the future and the latter for evaluation on held-out test set.
For convenience, we first define an operator that denotes mapping of one agent policy to another.
W operator. Let P(a | s, d) be an agent policy used to generate data in any epoch of EPOCHADEL (line 5-9). We define the W operator as the mapping to the Bayes optimal policy for the optimization problem solved by EPOCHADEL in line 10 which we denote by (W P). Under the realizability assumption (Assumption 1), the agent learns the W P policy when M → ∞. Using Lemma 2 and Lemma 3, we can verify that: We first show that our operator is smooth around P (a | s).
Lemma 8 (Smoothness of W ). For any start state s and description d ∈ supp P (d | s), there exists a finite constant K s such that: W P(a | s, d) − W P (a | s, d) 1 ≤ K s P(a | s) − P (a | s) 1 .
Proof. We define P(d | s) = a ∈A P (d | s, a )P(a | s). Then from the definition of operator W we have: , (using the definition of P(d | s)) Note that the policy will only be called on a given pair of (s, d) if and only if P (d | s) > 0, hence, the constant is bounded. We define K s = max d 2 P (d|s) where maximum is taken over all descriptions d ∈ supp P (d | s).
Theorem 9 (Convergence to Near Optimal Policy). Fix t ∈ N, and letP t (a | s, d) = 1 t t n=1 P n (a | s, d) be the average of the agent's policy across epochs. Then for every start state s and description d ∈ supp P (d | s) we have: Proof. LetP t (a | s) = d P (d | s)P t (a | s, d). Then it is easy to see thatP t (a | s) = 1 t t n=1 P n (a | s). From Theorem 7 we have lim t→∞ P t (a | s) − P (a | s) 2 = 0. As A is finite dimensional, therefore, · 2 and · 1 are equivalent, i.e., convergence in one also implies convergence in the other. This implies, lim t→∞ P t (a | s) − P (a | s) 1 = 0.
From Lemma 8 we have: This shows lim t→∞ (WP t )(a | s, d) = (W P )(a | s, d). Lastly, we show that the optimal policy P (a | s, d) is a fixed point of W : This completes the proof. Figure 3 illustrates the two problems that we conduct experiments on.

B.1. Vision-Language Navigation
Environment Simulator and Data. We use the Matterport3D simulator and the Room-to-Room dataset 8 developed by Anderson et al. (2018). The simulator photo-realistically emulates the first-person view of a person walking in a house. The dataset contains tuples of human-generated English navigation requests annotated with ground-truth paths in the (a) Vision-language navigation (NAV): a (robot) agent fulfills a navigational natural-language request in a photo-realistic simulated house. Locations in the house are connected as a graph. In each time step, the agent receives a photo of the panoramic view at its current location (due to space limit, here we only show part of a view). Given the view and the language request, the agent chooses an adjacent location to go to. On average, each house has about 117 locations.
(b) Word modification (REGEX): an agent is given an input word and a natural-language request that asks it to modify the word. The agent outputs a regular expression that follows our specific syntax. The regular expression is executed by the Python's re.sub() method to generate an output word. environments. To evaluate on the test set, the authors require submitting predictions to an evaluation site 9 , which limits the number of submissions to five. As our goal is not to establish state-of-the-art results on this task, but to compare performance of multiple learning frameworks, we re-split the data into 4,315 simulation, 2,100 validation, and 2,349 test data points. The simulation split, which is used to simulate the teacher, contains three requests per data point (i.e. |D n | = 3). The validation and test splits each contains only one request per data point. On average, each request includes 2.5 sentences and 26 words. The word vocabulary size is 904 and the average number of optimal actions required to reach the goal is 6.
Simulated Teacher. We use SDTW (Magalhaes et al., 2019) as the perf metric and set the threshold τ = 0.5. The SDTW metric re-weights success rate by the shortest (order-preserving) alignment distance between a predicted path and a ground-truth path, offering more fine-grained evaluation of navigation paths.
Approximate marginal P πω (e | s 1 ). The approximate marginal is a function that takes in a start location s 1 and randomly samples a shortest path on the environment graph that starts at s 1 and has (unweighted) length between 2 and 6.

B.2. Word Modification
Regular Expression Compiler. We use Python 3.7's re.sub(pattern, replace, string) method as the regular expression compiler. The method replaces every substring of string that matches a regular expression pattern with the string replace. A regular expression predicted by our agentâ 1:H has the form "pattern@replace", where pattern and replace are strings and @ is the at-sign character. For example, given the word embolden and the request "replace all n with c", the agent should ideally generate the regular expression "()(n)()@c". We then split the regular expression by the character @ into a string pattern = "()(n)()" and a string replace = "c". We execute the Python's command re.sub('()(n)()', 'c', 'embolden') to obtain the output word emboldec.
Data. We use the data collected by Andreas et al. (2018). The authors presented crowd-workers with pairs of input and output words where the output words are generated by applying regular expressions onto the input words. Workers are asked to write English requests that describe the change from the input words to the output words. From the human-generated requests, the authors extracted 1,917 request templates. For example, a template has the form add an AFTER to the start of words beginning with BEFORE, where AFTER and BEFORE can be replaced with latin characters to form a request. Each request template is annotated with a regular expression template that it describes. Since the original dataset is not designed to  Table 5. Effects of annealing the mixing weight λ. When annealed, the mixing weight is updated as λ ← max(λmin, λ · β), where the annealing rate β = 0.5 and the minimum mixing rate λmin = 0.1. Initially, λ is set to be 0.5. All results are on validation data. Sample complexity is the number of training episodes required to reach a success rate of at least c (c = 30% in NAV, and c = 85% in REGEX).
(if generated by π ω ) or completely request-guided (if generated by π θ ). As a machine learning-based model that learns from a mixture of data generated by π ω and π θ , the policy π β can generalize and generate executions that are partially request-agnostic.
Effects of the Annealing Mixing Weight. We do not anneal the mixing weight λ in our experiments. Table 5 shows the effects of annealing the mixing weight with various settings. We find that annealing improves the sample complexity of the agents, i.e. they reach a substantially high success rate in less training episodes. But overall, not annealing yields slightly higher final success rates.

D. Training details
Reinforcement learning's continuous reward. In REGEX, the continuous reward function is where w out is the ground-truth output word,ŵ out is the predicted output word, editdistance(.,.) is the string edit distance computed by the Python's editdistance module.
In NAV, the continuous reward function is shortest (s 1 , s g ) − shortest (s H , s g ) shortest (s 1 , s g ) where s 1 is the start location, s g is the goal location, s H is the agent's final location, and shortest(., .) is the shortest-path distance between two locations (according to the environment's navigation graph).
Model architecture. Figure 4 and Figure 5 illustrate the architectures of the models that we train in the two problems, respectively. For each problem, we describe the architectures of the student policy π θ (a | s, d) and the teacher's language modelP(d | e). All models are encoder-decoder models but the NAV models use Transformer as the recurrent module while REGEX models use LSTM.
Hyperparameters. Model and training hyperparameters are provided in Table 6. Each model is trained on a single NVIDIA V100 GPU, GTX 1080, or Titan X. Training with the ADEL algorithm takes about 19 hours for NAV and 14 hours for REGEX on a machine with an Intel i7-4790K 4.00GHz CPU and a Titan X GPU.

Bathroom
Dining room (b) Figure 6. Qualitative examples in the NAV problem. The black texts (no underlines) are the initial requests d generated by humans. The paths are the ground-truth paths implied by the requests. and are some paths are taken by the agent during training. Here, we only show two paths per example. The red texts are descriptionsd generated by the teacher's learned (conditional) language modelP(d | e). We show the bird-eye views of the environments for better visualization, but the agent only has access to the first-person panoramic views at its locations.