Weakly Supervised Learning of Semantic Parsers for Mapping Instructions to Actions

The context in which language is used provides a strong signal for learning to recover its meaning. In this paper, we show it can be used within a grounded CCG semantic parsing approach that learns a joint model of meaning and context for interpreting and executing natural language instructions, using various types of weak supervision. The joint nature provides crucial benefits by allowing situated cues, such as the set of visible objects, to directly influence learning. It also enables algorithms that learn while executing instructions, for example by trying to replicate human actions. Experiments on a benchmark navigational dataset demonstrate strong performance under differing forms of supervision, including correctly executing 60% more instruction sets relative to the previous state of the art.


Introduction
The context in which natural language is used provides a strong signal to reason about its meaning. However, using such a signal to automatically learn to understand unrestricted natural language remains a challenging, unsolved problem.
For example, consider the instructions in Figure 1. Correct interpretation requires us to solve many subproblems, such as resolving all referring expressions to specific objects in the environment (including, "the corner" or "the third intersection"), disambiguating word sense based on context (e.g., "the chair" could refer to a chair or sofa), and finding executable action sequences that satisfy stated constraints (such as "twice" or "to face the blue hall"). move forward twice to the chair λa.move(a) ∧ dir(a, f orward) ∧ len(a, 2) ∧ to(a, ιx.chair(x)) at the corner turn left to face the blue hall λa.pre(a, ιx.corner(x)) ∧ turn(a) ∧ dir(a, lef t) ∧ post(a, f ront(you, ιx.blue(x) ∧ hall(x))) move to the chair in the third intersection λa.move(a) ∧ to(a, ιx.sof a(x)) ∧ intersect(order(λy.junction(y), f rontdist, 3), x) Figure 1: A sample navigation instruction set, paired with lambda-calculus meaning representations.
We must also understand implicit requests, for example from the phrase "at the corner," that describe goals to be achieved without specifying the specific steps. Finally, to do all of this robustly without prohibitive engineering effort, we need grounded learning approaches that jointly reason about meaning and context to learn directly from their interplay, with as little human intervention as possible. Although many of these challenges have been studied separately, as we will review in Section 3, this paper represents, to the best of our knowledge, the first attempt at a comprehensive model that addresses them all. Our approach induces a weighted Combinatory Categorial Grammar (CCG), including both the parameters of the linear model and a CCG lexicon. To model complex instructional language, we introduce a new semantic modeling approach that can represent a number of key linguistic constructs that are common in spatial and instructional language. To learn from indirect supervision, we define the notion of a validation function, for example that tests the state of the agent after interpreting an instruction. We then show how this function can be used to drive online learning. For that purpose, we adapt the loss-sensitive Perceptron algorithm (Singh-Miller & Collins, 2007;Artzi & Zettlemoyer, 2011) to use a validation function and coarse-to-fine inference for lexical induction.
The joint nature of this approach provides crucial benefits in that it allows situated cues, such as the set of visible objects, to directly influence parsing and learning. It also enables the model to be learned while executing instructions, for example by trying to replicate actions taken by humans. In particular, we show that, given only a small seed lexicon and a task-specific executor, we can induce high quality models for interpreting complex instructions.
We evaluate the method on a benchmark navigational instructions dataset (MacMahon et al., 2006;Chen & Mooney, 2011). Our joint approach successfully completes 60% more instruction sets relative to the previous state of the art. We also report experiments that vary supervision type, finding that observing the final position of an instruction execution is nearly as informative as observing the entire path. Finally, we present improved results on a new version of the MacMahon et al. (2006) corpus, which we filtered to include only executable instructions paired with correct traces.

Technical Overview
Task Let S be the set of possible environment states and A be the set of possible actions. Given a start state s ∈ S and a natural language instruction x, we aim to generate a sequence of actions a = a 1 , . . . , a n , with each a i ∈ A, that performs the steps described in x.
For example, in the navigation domain (MacMahon et al., 2006), S is a set of positions on a map. Each state s = (x, y, o) is a triple, where x and y are integer grid coordinates and o ∈ {0, 90, 180, 270} is an orientation. Figure 2 shows an example map with 36 states; the ones we use in our experiments contain an average of 141. The space of possible actions A is {LEFT, RIGHT, MOVE, NULL}. Actions change the state of the world according to a transition function T : A × S → S. In our navigation example, moving forward can change the x or y coordinates while turning changes the orientation o.
Model To map instructions to actions, we jointly reason about linguistic meaning and action execu-tion. We use a weighted CCG grammar to rank possible meanings z for each instruction x. Section 6 defines how to design such grammars for instructional language. Each logical form z is mapped to a sequence of actions a with a deterministic executor, as described in Section 7. The final grounded CCG model, detailed in Section 6.3, jointly constructs and scores z and a, allowing for robust situated reasoning during semantic interpretation.
Learning We assume access to a training set containing n examples {(x i , s i , V i ) : i = 1 . . . n}, each containing a natural language sentence x i , a start state s i , and a validation function V i . The validation function V i : A → {0, 1} maps an action sequence a ∈ A to 1 if it's correct according to available supervision, or 0 otherwise. This training data contains no direct evidence about the logical form z i for each x i , or the grounded CCG analysis used to construct z i . We model all these choices as latent variables. We experiment with two validation functions. The first, V D ( a), has access to an observable demonstration of the execution a i , a given a is valid iff a = a i . The second, V S i ( a), only encodes the final state s i of the execution of x, therefore a is valid iff its final state is s i . Since numerous logical forms often execute identically, both functions provide highly ambiguous supervision.
Evaluation We evaluate task completion for single instructions on a test set {(x i , s i , s i ) : i = 1 . . . n}, where s i is the final state of an oracle agent following the execution of x i starting at state s i . We will also report accuracies for correctly interpreting instruction sequences x, where a single error can cause the entire sequence to fail. Finally, we report accuracy on recovering correct logical forms z i on a manually annotated subset of the test set.

Related Work
Our learning is inspired by the reinforcement learning (RL) approach of Branavan et al. (2009), and related methods (Vogel & Jurafsky, 2010), but uses latent variable model updates within a semantic parser. Branavan et al. (2010) extended their RL approach to model high-level instructions, which correspond to implicit actions in our domain. Wei et al. (2009) and Kollar et al. (2010) used shallow linguistic representations for instructions. Recently, Tellex et al. (2011) used a graphical model semantics representation to learn from instructions paired with demonstrations. In contrast, we model significantly more complex linguistic phenomena than these approaches, as required for the navigation domain.
Other research has adopted expressive meaning representations, with differing learning approaches. Matuszek et al. (2010 describe supervised algorithms that learn semantic parsers for navigation instructions. Chen andMooney (2011), Chen (2012) and Kim and Mooney (2012) present state-of-theart algorithms for the navigation task, by training a supervised semantic parser from automatically induced labels. Our work differs in the use of joint learning and inference approaches.
Supervised approaches for learning semantic parsers have received significant attention, e.g. Kate and Mooney (2006), Wong and Mooney (2007), Muresan (2011) and Kwiatkowski et al. (2010Kwiatkowski et al. ( , 2012. The algorithms we develop in this paper combine ideas from previous supervised CCG learning work (Zettlemoyer & Collins, 2005, 2007Kwiatkowski et al., 2011), as we describe in Section 4. Recently, various alternative forms of supervision were introduced. Clarke et al. (2010),  and Liang et al. (2011) describe approaches for learning semantic parsers from sentences paired with responses, Krishnamurthy and Mitchell (2012) describe using distant supervision, Artzi and Zettlemoyer (2011) use weak supervision from conversational logs and  present work on unsupervised learning. We discuss various forms of supervision that complement these approaches. There has also been work on learning for semantic analysis tasks from grounded data, including event streams (Liang et al., 2009;Chen et al., 2010) and language paired with visual perception .

Background
We use a weighted linear CCG grammar for semantic parsing, as briefly reviewed in this section.

Combinatory Categorial Grammars (CCGs)
CCGs are a linguistically-motivated formalism for modeling a wide range of language phenomena (Steedman, 1996(Steedman, , 2000. A CCG is defined by a lexicon and a set of combinators. The lexicon contains entries that pair words or phrases with categories. For example, the lexical entry chair N : λx.chair(x) for the word "chair" in the parse in Figure 4 pairs it with a category that has syntactic type N and meaning λx.chair(x). Figure 4 shows how a CCG parse builds a logical form for a complete sentence in our example navigation domain. Starting from lexical entries, each intermediate parse node, including syntax and semantics, is constructed with one of a small set of CCG combinators (Steedman, 1996(Steedman, , 2000. We use the application, composition and coordination combinators, and three others described in Section 6.3.

Factored CCG Lexicons
Recently, Kwiatkowski et al. (2011) introduced a factored CCG lexicon representation. Each lexical item is composed of a lexeme and a template. For example, the entry chair N : λx.chair(x) would be constructed by combining the lexeme chair [chair], which contains a word paired with logical constants, with the template λv.[N : λx.v(x)], that defines the rest of the category by abstracting over logical constants. This approach allows the reuse of common syntactic structures through a small set of templates. Section 8 describes how we learn such lexical entries.
Weighted Linear CCGs A weighted linear CCG (Clark & Curran, 2007) ranks the space of possible parses under the grammar, and is closely related to several other approaches (Lafferty et al., 2001;Collins, 2004;Taskar et al., 2004). Let x be a sentence, y be a CCG parse, and GEN(x; Λ) be the set of all possible CCG parses for x given the lexicon Λ. Define φ(x, y) ∈ R d to be a d-dimensional feature-vector representation and θ ∈ R d to be a parameter vector. The optimal parse for sentence x is and the final output logical form z is the λ-calculus expression at the root of y * (x). Section 7.2 describes how we efficiently compute an approximation to y * (x) within the joint interpretation and execution model.
Supervised learning with GENLEX Previous work (Zettlemoyer & Collins, 2005) introduced a function GENLEX(x, z) to map a sentence x and its meaning z to a large set of potential lexical entries. These entries are generated by rules that consider the logical form z and guess potential CCG categories. For example, the rule p → N : λx.p(x) introduces categories commonly used to model certain types of nouns. This rule would, for example, introduce the category N : λx.chair(x) for any logical form z that contains the constant chair. GENLEX uses a small set of such rules to generate categories that are paired with all possible substrings in x, to create a large set of lexical entries. The complete learning algorithm then simultaneously selects a small subset of these entries and estimates parameter values θ. In Section 8, we will introduce a new way of using GENLEX to learn from different signals that, crucially, do not require a labeled logical form z.

Spatial Environment Modeling
We will execute instructions in an environment, see Section 2, which has a set of positions. A position is a triple (x, y, o), where x and y are horizontal and vertical coordinates, and o ∈ O = {0, 90, 180, 270} is an orientation. A position also includes properties indicating the object it contains, its floor pattern and its wallpaper. For example, the square at (4, 3) in Figure 2 has four positions, one per orientation. Because instructional language refers to objects and other structures in an environment, we introduce the notion of a position set. For example, in Figure 2, represents the blue floor. Both sets contain all orientations for each (x, y) pair, thereby representing properties of regions. Position sets can have many properties. For example, E, in addition to being a chair, is also an intersection because it overlaps with the neighboring halls A and B. The set of possible entities includes all position sets and a few additional entries. For example, set C = {(4, 3, 90)} in Figure 2 represents the agent's position.

Modeling Instructional Language
We aim to design a semantic representation that is learnable, models grounded phenomena such as spa- λx.in f ront of (you, x) Figure 2: Schematic diagram of a map environment and example of semantics of spatial phrases.
tial relations and object reference, and is executable. Our semantic representation combines ideas from Carpenter (1997) and Neo-Davidsonian event semantics (Parsons, 1990) in a simply typed λcalculus. There are four basic types: (1) entities e that are objects in the world, (2) events ev that specify actions in the world, (3) truth values t, and (4) meta-entities m, such as numbers or directions. We also allow functional types, which are defined by input and output types. For example, e, t is the type of function from entities to truth values.

Spatial Language Modeling
Nouns and Noun Phrases Noun phrases are paired with e-type constants that name specific entities and nouns are mapped to e, t -type expressions that define a property. For example, the noun "chair" ( (Figure 2b) is {A, B}. Also, the noun phrase "you" (Figure 2d), which names the agent, is represented by the constant you with denotation C, the agent's position.
Determiners Noun phrases can also be formed by combining nouns with determiners that pick out specific objects in the world. We consider both definite reference, which names contextually unique objects, and indefinites, which are less constrained.
The definite article is paired with a logical expression ι of type e, t , e , 1 which will name a single object in the world. For example, the phrase "the chair" in Figure 2c will be represented by ιx.chair(x) which will denote the appropriate chair. However, computing this denotation is challenging when there is perceptual ambiguity, for positions where multiple chairs are visible. We adopt a simple heuristic approach that ranks referents based on a combination of their distance from the agent and whether they are in front of it. For our example, from position C our agent would pick the chair E in front of it as the denotation. The approach differs from previous, non-grounded models that fail to name objects when faced with such ambiguity (e.g., Carpenter (1997), Heim and Kratzer (1998)).
To model the meaning of indefinite articles, we depart from the Frege-Montague tradition of using existential quantifiers (Lewis, 1970;Montague, 1973;Barwise & Cooper, 1981), and instead introduce a new quantifier A that, like ι, has type e, t , e . For example, the phrase "a chair" would be paired with Ax.chair(x) which denotes an arbitrary entry from the set of chairs in the world. Computing the denotation for such expressions in a world will require picking a specific object, without further restrictions. This approach is closely related to Steedman's generalized Skolem terms (2011). 2

Meta Entities
We use m-typed terms to represent non-physical entities, such as numbers (1, 2, etc.) and directions (lef t, right, etc.) whose denotations are fixed. The ability to refer to directions allows us to manipulate position sets. For example, the phrase "your left" is mapped to the logical expression orient(you, lef t), which denotes the position set containing the position to the left of the agent.
Prepositions and Adjectives Noun phrases with modifiers, such as adjectives and prepositional phrases are e, t -type expressions that implement set intersection with logical conjunctions. For example in Figure 2, the phrase "blue hall" is paired with λx.hall(x) ∧ blue(x) with denotation {B} and the phrase "chair in the intersection" is paired with λx.chair(x) ∧ intersect(ιy.junction(y), x) with denotation {E}. Intuitively, the adjective "blue" introduces the constant blue and "in the" adds a intersect. We will describe the full details of how these expressions are constructed in Section 6.3.

Spatial Relations
The semantic representation allows more complex reasoning over position sets and the relations between them. For example, the binary relation in f ront of (Figure 2g) tests if the first argument is in front of the second from the point of view of the agent. Additional relations are used to model set intersection, relative direction, relative distance, and relative position by distance.

Modeling Instructions
To model actions in the world, we adopt Neo-Davidsonian event semantics (Davidson, 1967;Parsons, 1990), which treats events as ev-type primitive objects. Such an approach allows for a compact lexicon where adverbial modifiers introduce predicates, which are linked by a shared event argument.
Instructional language is characterized by heavy usage of imperatives, which we model as functions from events to truth values. 3 For example, an imperative such as "move" would have the meaning λa.move(a), which defines a set of events that match the specified constraints. Here, this set would include all events that involve moving actions.
The denotation of ev-type terms is a sequence of n instances of the same action. In this way, an event defines a function ev : s → s , where s is the start state and s the end state. For example, the denotation of λa.move(a) is the set of move action sequences { MOVE 1 , . . . , MOVE n : n ≥ 1}. Although performing actions often require performing additional ones (e.g., the agent might have to turn before being able to move), we treat such actions as implicit (Section 7.1), and don't model them explicitly within the logical form.
Predicates such as move (seen above) and turn are introduced by verbs. Events can also be modified by adverbials, which are intersective, much like prepositional phrases. For example in the imperative, logical form (LF) pair: Imp.: move from the sofa to the chair LF: λa.move(a) ∧ to(a, ιx.chair(x)) ∧ f rom(a, ιy.sof a(y)) Each adverbial phrase provides a constraint, and changing their order will not change the LF.

Parsing Instructional Language with CCG
To compose logical expressions from sentences we use CCG, as described in Section 4. Figures 3 and 4 present a sample of lexical entries and how they are combined, as we will describe in this section. The basic syntactic categories are N (noun), N P (noun phrase), S (sentence), P P (prepositional phrase), AP (adverbial phrase), ADJ (adjective) and C (a special category for coordinators).
Type Raising To compactly model syntactic variations, we follow Carpenter (1997), who argues for polymorphic typing. We include the more simple, or lower type, entry in the lexicon and introduce typeraising rules to reconstruct the other when necessary at parse time. We use four rules: where the first three are for prepositional, adjectival and adverbial modifications, and the fourth models the fact that adverbials are often topicalized. 4 Figures 3 and 4 show parses that use type-raising rules.
Indefinites As discussed in Section 6.1, we use a new syntactic analysis for indefinites, follow-4 Using type-raising rules can be particularly useful when learning from sparse data. For example, it will no longer be necessary to learn three lexical entries for each adverbial phrase (with syntax AP , S\S, and S/S).  ing Steedman (2011). Previous approaches would build parses such as with a lamp P P/N P P P \(P P/N P )/N N λx.λy.intersect(x, y) λf.λg.λy.∃x.g( where "a" has the relatively complex syntactic category P P \(P P/N P )/N and where similar entries would be needed to quantify over different types of verbs (e.g., S\(S/N P )/N ) and adverbials (e.g., AP \(AP/N P )/N ). Instead, we include a single lexical entry a N P/N : λf.Ax.f (x) which can be used to construct the correct meaning in all cases.

Joint Parsing and Execution
Our inference includes an execution component and a parser. The parser maps sentences to logical forms, and incorporates the grounded execution model. We first discuss how to execute logical forms, and then describe the joint model for execution and parsing.

Executing Logical Expressions
Dynamic Models In spatial environments, such as the ones in our task, the agent's ability to observe the world depends on its current state. Taking this aspect of spatial environments into account is challenging, but crucial for correct evaluation.
To represent the agent's point of view, for each state s ∈ S, as defined in Section 2, let M s be the state-dependent logical model.

Figure 4: A CCG parse showing adverbial phrases and topicalization.
A T : V T → s∈S D M s,T be the assignment function, which maps variables to domain objects.
For each model M s the domain D Ms,ev is a set of action sequences { a 1 , ..., a n : n ≥ 1}. Each a defines a sequences of states s i , as defined in Section 6.2, and associated models M s i . The key challenge for execution is that modifiers of the event will need to be evaluated under different models from this sequence. For example, consider the sentence in Figure 4. To correctly execute, the pre literal, introduced by the "facing" phrase, it must be evaluated in the model M s 0 for the initial state s 0 . Similarly, the literal including post requires the final model M s n+1 . Such state dependent predicates, including pre and post, are called stateful. The list of stateful predicates is pre-defined and includes event modifiers, as well the ι quantifier, which is evaluated under M s 0 , since definite determiners are assumed to name objects visible from the start position. In general, a logical expression is traversed depth first and the model is updated every time a stateful predicate is reached. For example, the two e-type you constants in Figure 4 will be evaluated under different models: the one within the pre literal under M s 0 , and the one inside the post literal under M s n+1 .
Evaluation Given a logical expression l, we can compute the interpretation I Ms 0 ,T (l) by recursively mapping each subexpression to an entry on the appropriate model M .
To reflect the changing state of the agent during evaluation, we define the function update( a, pred). Given an action sequence a and a stateful predicate pred, update returns a model M s , where s is the state under which the literal containing pred should be interpreted, either the initial state or one visited while executing a. For example, given the predicate post and the action sequence a 1 , . . . , a n , update( a 1 , . . . , a n , post) = M s n+1 , where s n+1 the state of the agent following action a n . By convention, we place the event variable as the first argument in literals that include one.
Given a T -type logical expression l and a starting state s 0 , we compute its interpretation I Ms 0 ,T (l) recursively, following these three base cases: • If l is a λ operator of type T 1 , T 2 binding variable v and body b, where i is the interpretation I Ms,T 2 (b) computed under a variable assignment function extended to map A T 2 (v) = o.
• If l is a literal c(c 1 , . . . , c n ) with n arguments where c has type P and each c i has type P i , I Ms,T (l) is computed by first interpreting the predicate c to the function f = I Ms,T (c). In most cases, I Ms,T (l) = f (I Ms,P 1 (c 1 ), . . . , I Ms,Pn (c n )). However, if c is a stateful predicate, such as pre or post, we instead first retrieve the appropriate new model M s = update(I Ms,P 1 (c 1 ), c), where c 1 is the event argument and I Ms,P 1 (c 1 ) is its interpretation. Then, the final results is I Ms,T (l) = f (I M s ,P 1 (c 1 ), . . . , I M s ,Pn (c n )). • If l is a T -type constant or variable, I Ms,T (l).
The worst case complexity of the process is exponential in the number of bound variables. Although in practice we observed tractable evaluation in the majority of development cases we considered, a more comprehensive and tractable evaluation procedure is an issue that we leave for future work. Implicit Actions Instructional language rarely specifies every action required for execution, see MacMahon (2007) for a detailed discussion in the maps domain. For example, the sentence in Figure 4 can be said even if the agent is not facing a blue hallway, with the clear implicit request that it should turn to face such a hallway before moving. To allow our agent to perform implicit actions, we extend the domain of ev-type variables by allowing the agent to prefix up to k I action sequences before each explicit event. For example, in the agent's position in Figure 2 (set C), the set of possible events includes MOVE I , MOVE I , RIGHT I , MOVE , which contains two implicit sequences (marked by I).
Resolving Action Ambiguity Logical forms often fail to determine a unique action sequences, due to instruction ambiguity. For example, consider the instruction "go forward" and the agent state as specified in Figure 2 (set C). The instruction, which maps to λa.move(a) ∧ f orward(a), evaluates to the set containing MOVE , MOVE, MOVE and MOVE, MOVE, MOVE , as well as five other sequences that have implicit prefixes followed by explicit MOVE actions. To resolve such ambiguity, we prefer shorter actions without implicit actions. In the example above, we will select MOVE , which includes a single action and no implicit actions.

Joint Inference
We incorporate the execution procedure described above with a linear weighted CCG parser, as described in Section 4, to create a joint model of parsing and execution. Specifically, we execute logical forms in the current state and observe the result of their execution. For example, the word "chair" can be used to refer to different types of objects, including chairs, sofas, and barstools, in the maps domains. Our CCG grammar would include a lexical item for each meaning, but execution might fail depending on the presence of objects in the world, influencing the final parse output. Similarly, allowing implicit actions provides robustness when resolving these and other ambiguities. For example, an instruction with the precondition phrase "from the chair" might require additional actions to reach the position with the named object.
To allow such joint reasoning we define an ex-ecution e to include a parse tree e y and trace e a , and define our feature function to be Φ(x i , s i , e), where x i is an instruction and s i is the start state. This approach allows joint dependencies: the state of the world influences how the agent interprets words, phrases and even complete sentences, while language understanding determines actions. Finally, to execute sequences of instructions, we execute each starting from the end state of the previous one, using a beam of size k s . Figure 5 presents the complete learning algorithm. Our approach is online, considering each example in turn and performing two steps: expanding the lexicon and updating parameters. The algorithm assumes access to a training set {(x i , s i , V i ) : i = 1 . . . n}, where each example includes an instruction x i , starting state s i and a validation function V i , as defined in Section 2. In addition the algorithm takes a seed lexicon Λ 0 . The output is a joint model, that includes a lexicon Λ and parameters θ.

Learning
Coarse Lexical Generation To generate potential lexical entries we use the function GEN LEX(x, s, V; Λ, θ), where x is an instruction, s is a state and V is a validation function. Λ is the current lexicon and θ is a parameter vector. In GEN LEX we use coarse logical constants, as described below, to efficiently prune the set of potential lexical entries. This set is then pruned further using more precise inference in Step 1.
To compute GEN LEX, we initially generate a large set of lexical entries and then prune most of them. The full set is generated by taking the cross product of a set of templates, computed by factoring out all templates in the seed lexicon Λ 0 , and all logical constants. For example, if Λ 0 has a lexical item with the category AP/N P : λx.λa.to(a, x) we would create entries w AP/N P : λx.λa.p(a, x) for every phrase w in x and all constants p with the same type as to. 5 In our development work, this approach often generated nearly 100k entries per sentence. To ease Inputs: Training set {(xi, si, Vi) : i = 1 . . . n} where xi is a sentence, si is a state and Vi is a validation function, as described in Section 2. Initial lexicon Λ0. Number of iterations T . Margin γ. Beam size k for lexicon generation. Definitions: Let an execution e include a parse tree e y and a trace e a . GEN(x, s; Λ) is the set of all possible executions for the instruction x and state s, given the lexicon Λ. LEX(y) is the set of lexical entries used in the parse tree y.

Algorithm:
Initialize θ using Λ0 , Λ ← Λ0 For t = 1 . . . T, i = 1 . . . n : Step 1: (Lexical generation) a. Set λG ← GEN LEX(xi, si, Vi; Λ, θ), λ ← Λ ∪ λG b. Let E be the k highest scoring executions from GEN (xi, si; λ) which use at most one entry from λG c. Select lexical entries from the highest scoring valid parses: λi ← e∈M AXV i (E;θ) LEX(e y ) d. Update lexicon: Λ ← Λ ∪ λi Step 2: (Update parameters) a. Set Gi ← M AXVi(GEN (xi, si; Λ); θ) and Bi ← {e|e ∈ GEN (xi, si; Λ) ∧ Vi(e a ) = 1} b. Construct sets of margin violating good and bad parses: Apply the additive update: the cost of parsing at this scale, we developed a coarse-to-fine two-pass parsing approach that limits the number of new entries considered. The algorithm first parses with coarse lexical entries that abstract the identities of the logical constants in their logical forms, thereby greatly reducing the search space. It then uses the highest scoring coarse parses to constrain the lexical entries for a final, fine parse.
Formally, we construct the coarse lexicon λ a by replacing all constants of the same type with a single newly created, temporary constant. We then parse to create a set of trees A, such that each y ∈ A 1. is a parse for sentence x, given the world state s with the combined lexicon Λ ∪ λ a , 2. scored higher than e y by at least a margin of δ L , where e y is the tree of e, the highest scoring execution of x, at position s under the current model, s.t. V(e a ) = 1, 3. contains at most one entry from λ a .
Finally, from each entry l ∈ {l|l ∈ λ a ∧ l ∈ y ∧ y ∈ A}, we create multiple lexical entries by replacing all temporary constants with all possible appropriately typed constants from the original set. GEN LEX returns all these lexical entries, which will be used to form our final fine-level analysis.
Step 1: Lexical Induction To expand our model's lexicon, we use GEN LEX to generate candidate lexical entries and then further refine this set by parsing with the current model.
Step 1(a) in Figure 5 uses GEN LEX to create a temporary set of potential lexical entries λ G . Steps (b-d) select a small subset of these lexical entries to add to the current lexicon Λ: we find the k-best executions under the model, which use at most one entry from λ G , find the entries used in the best valid executions and add them to the current lexicon.
Step 2: Parameter Update We use a variant of a loss-driven perceptron (Singh-Miller & Collins, 2007;Artzi & Zettlemoyer, 2011) for parameter updates. However, instead of taking advantage of a loss function we use a validation signal. In step (a) we collect the highest scoring valid parses and all invalid parses. Then, in step (b) we construct the set R i of valid analyses and E i of invalid ones, such that their model scores are not separated by a margin δ scaled by the number of wrong features (Taskar et al., 2003). Finally, step (f) applies the update.

Discussion
The algorithm uses the validation signal to drive both lexical induction and parameter updates. Unlike previous work (Zettlemoyer & Collins, 2005& Collins, , 2007Artzi & Zettlemoyer, 2011), we have no access to a set of logical constants, either through the the labeled logical form or the weak supervision signal, to guide the GEN LEX procedure. Therefore, to avoid over-generating lexical entries, thereby making parsing and learning intractable, we leverage typing for coarse parsing to prune the generated set. By allowing a single  new entry per parse, we create a conservative, cascading effect, whereas a lexical entry that is introduced opens the way for many other sentence to be parsed and introduce new lexical entries. Furthermore, grounded features improve parse selection, thereby generating higher quality lexical entries.

Experimental Setup
Data For evaluation, we use the navigation task from MacMahon et al. (2006), which includes three environments and the SAIL corpus of instructions and follower traces. Chen and Mooney (2011) segmented the data, aligned traces to instructions, and merged traces created by different subjects. The corpus includes raw sentences, without any form of linguistic annotation. The original collection process (MacMahon et al., 2006) created many uninterpretable instructions and incorrect traces. To focus on the learning and interpretation tasks, we also created a new dataset that includes only accurate instructions labeled with a single, correct execution trace. From this oracle corpus, we randomly sampled 164 instruction sequences (816 sentences) for evaluation, leaving 337 (1863 sentences) for training. This simple effort will allow us to measure the effects of noise on the learning approach and provides a resource for building more accurate algorithms. Table 1 compares the two sets.

Features and Parser Following Zettlemoyer and
Collins (2005), we use a CKY parser with a beam of k. To boost recall, we adopt a two-pass strategy, which allows for word skipping if the initial parse fails. We use features that indicate usage of lexical entries, templates, lexemes and type-raising rules, as described in Section 6.3, and repetitions in logical coordinations. Finally, during joint parsing, we consider only parses executable at s i as complete.
Seed Lexicon To construct our seed lexicon we labeled 12 instruction sequences with 141 lexical en-  tries. The sequences were randomly selected from the training set, so as to include two sequences for each participant in the original experiment. Figures 3 and 4 include a sample of our seed lexicon.

Initialization and Parameters
We set the weight of each template indicator feature to the number of times it is used in the seed lexicon and each repetition feature to -10. Learning parameters were tuned using cross-validation on the training set: the margin δ is set to 1, the GEN LEX margin δ L is set to 2, we use 6 iterations (8 for experiments on SAIL) and take the 250 top parses during lexical generation (step 1, Figure 5). For parameter update (step 2, Figure 5) we use a parser with a beam of 100. GEN LEX generates lexical entries for token sequences up to length 4. k s , the instruction sequence execution beam, is set to 10. Finally, k I is set to 2, allowing up to two implicit action sequences per explicit one.
Evaluation Metrics To evaluate single instructions x, we compare the agent's end state to a labeled state s , as described in Section 2. We use a similar method to evaluate the execution of instruction sequences x, but disregard the orientation, since end goals in MacMahon et al. (2006) are defined without orientation. When evaluating logical forms we measure exact match accuracy.

Results
We repeated each experiment five times, shuffling the training set between runs. For the development cross-validation runs, we also shuffled the folds. As our learning approach is online, this allows us to account for performance variations arising from training set ordering. We report mean accuracy and standard deviation across all runs (and all folds).  Table 3: Cross-validation accuracy and standard deviation for the SAIL corpus. Table 2 shows accuracy for 5-fold crossvalidation on the oracle training data. We first varied the validation signal by providing the complete action sequence or the final state only, as described in Section 2. Although the final state signal is weaker, the results are similar. The relatively large difference between single sentence and sequence performance is due to (1) cascading errors in the more difficult task of sequential execution, and (2) corpus repetitions, where simple sentences are common (e.g., "turn left"). Next, we disabled the system's ability to introduce implicit actions, which was especially harmful to the full sequence performance. Finally, ablating the joint execution decreases performance, showing the benefit of the joint model. Table 3 lists cross validation results on the SAIL corpus. To compare to previous work (Chen & Mooney, 2011), we report cross-validation results over the three maps. The approach was able to correctly execute 60% more sequences then the previous state of the art (Kim & Mooney, 2012). We also outperform the results of Chen (2012), which used 30% more training data. 6 Using the weaker validation signal creates a marginal decrease in performance. However, we still outperform all previous work, despite using weaker supervision. Interestingly, these increases were achieved with a relatively simple executor, while previous work used MARCO (MacMahon et al., 2006), which supports sophisticated recovery strategies.
Finally, we evaluate our approach on the held out test set for the oracle corpus (Table 4). In contrast to experiments on the Chen and Mooney (2011) corpus, we use a held out set for evaluation. Due to this discrepancy, all development was done on the training set only. The increase in accuracy over learning with the original corpus demonstrates the significant impact of noise on our performance. In addition to 6 This additional training data isn't publicly available.  execution results, we also report exact match logical form (LF) accuracy results. For this purpose, we annotated 18 instruction sequences (105 sentences) with logical forms. The gap between execution and LF accuracy can be attributed to the complexity of the linguistic representation and redundancy in instructions. These results provide a new baseline for studying learning from cleaner supervision.

Discussion
We showed how to do grounded learning of a CCG semantic parser that includes a joint model of meaning and context for executing natural language instructions. The joint nature allows situated cues to directly influence parsing and also enables algorithms that learn while executing instructions. This style of algorithm, especially when using the weaker end state validation, is closely related to reinforcement learning approaches (Branavan et al., 2009(Branavan et al., , 2010. However, we differ on optimization and objective function, where we aim for minimal loss. We expect many RL techniques to be useful to scale to more complex environments, including sampling actions and using an exploration strategy. We also designed a semantic representation to closely match the linguistic structure of instructional language, combining ideas from many semantic theories, including, for example, Neo-Davidsonian events (Parsons, 1990). This approach allowed us to learn a compact and executable grammar that generalized well. We expect, in future work, that such modeling can be reused for more general language. Zettlemoyer, L., & Collins, M. (2005). Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Proceedings of the Conference on Uncertainty in Artificial Intelligence.
Zettlemoyer, L., & Collins, M. (2007). Online learning of relaxed CCG grammars for parsing to logical form. In Proceedings of the Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning.