Elamur Research

Naturalizing a Programming Language via Interactive Learning

Paper · 2017 · Sida I. Wang, Samuel Ginn, Percy Liang et al.

Summary

A command can be easy to say and hard to specify. Someone building a scene might ask for a palm tree, while the computer needs to know which blocks to place, in what order, and where. The same gap appears in tasks such as querying a database or manipulating text. A programming language lets people specify intricate operations, but its notation can make ordinary requests laborious. The authors propose an interactive process they call naturalization. The system begins with a precise programming language and lets users extend it with expressions they would prefer to use. The original commands remain available throughout.

Voxelurn, the authors’ block-building environment, starts with Dependency-based Action Language, or DAL. Users can select positions, act on the selection, and combine operations with loops and conditionals. To teach Voxelurn a new expression, a user gives it a definition made of commands the system can already interpret. The body can itself contain expressions learned from earlier definitions. This lets users introduce anything from a shortcut for changing the selection to a name for an entire construction. A user writes concrete values in a definition, and the system tries to infer which pieces should become arguments. Its semantic parser turns commands into executable programs, presents possible outcomes for ambiguous inputs, and learns from the outcome the user chooses.

In the study, 70 Amazon Mechanical Turk workers passed a qualification task and 42 participated in free building. The workers built 230 structures and taught a shared system over 3 days. At the end, expressions from the induced language accounted for 72.9% of accepted utterances over the whole run and 85.9% of the final 10,000 accepted utterances. Participants used shorthand, alternative phrasing, and names for larger constructions. The study also found cases where the system inferred the wrong arguments or failed to segment a crucial part of a command. Among the learned preferences, the strongest positive weights favored isolate, a way to work on one part of a scene while keeping the surrounding voxels out of the operation.

Voxelurn shows how a community can build up a useful command language while using it for an actual task. A definition gives the system a recipe, which can resolve questions that would be difficult to answer from the finished object alone. The acceptance figures measure how often participants used learned expressions among commands they chose to execute. The work establishes that these expressions became central to building in Voxelurn and leaves open how well the approach transfers to other domains. The authors make the code, data, and experiments available on CodaLab and provide a Voxelurn demo.

Deep dive: Naturalizing a Programming Language via Interactive Learning

Naturalizing a Programming Language via Interactive Learning shows how Voxelurn users teach a shared system new commands by defining them with familiar ones. · about 37 minutes to read

The problem and its context

Getting from a request to an operation

The paper concerns tasks where a computer can carry out an instruction precisely once it has an executable description. A database query specifies which records to retrieve. A text manipulation specifies what to change and where. In a block-building environment, a construction specifies the placement, color, and arrangement of voxels. Those tasks still leave the interface with a difficult job. A person may describe an operation at a level of detail or in a form that the system cannot yet interpret.

Programming addresses the precision problem by requiring a person to express the operation in a formal language. That provides control, including the ability to combine simple steps into elaborate procedures. A person assembling a row can express a repetition and can specify the action to repeat. The cost is that every step must follow the language’s syntax. Even when the intended operation is familiar, writing it may involve remembering notation that adds little to the way the person thinks about the task.

Semantic parsing approaches the problem from the other direction. It takes an expression a person produces and tries to map it to a formal representation the computer can use. The paper situates Voxelurn alongside work on database queries, including induc­ive logic programming for learning query parses and learning from question–answer pairs on Freebase. It also cites work on mapping instructions to actions and on compositional parsing over semi-structured tables. These examples show different places where a natural-language expression can be paired with an executable interpretation or evidence about its result. Learning to Parse Database Queries Using Inductive Logic Programming, Semantic Parsing on Freebase, Weakly Supervised Learning of Semantic Parsers, Compositional Semantic Parsing on Semi-Structured Tables.

The authors identify a mismatch between the expressive reach of programming and the flexibility offered by the natural-language interfaces they discuss. They describe a common design choice in semantic parsing in which researchers start with the language people use and design the representation and action space to accommodate it. Naturalization holds the action space fixed and lets the available language develop through use. The system already has ways to apply a color, change a selection, or repeat an action. Over time, users can give those operations and combinations of operations names that suit their work.

This also gives the interface a way to handle syntax that admits several readings. The authors point to programming languages with English-like wording as examples of how surface resemblance alone leaves the demand for exact syntax intact. Voxelurn allows a phrase to have competing analyses and gives the user a way to indicate the intended one. The ambiguity matters only insofar as it can be resolved without imposing too much work on the person entering the command. The authors build on semantic-parsing work that accommodates variation in how an utterance maps to a formal representation. Online Learning of Relaxed CCG Grammars.

What interactive teaching has to supply

The most direct predecessor in the paper asked users to teach a system through choices among candidate outcomes. That kind of feedback is useful when there are few plausible alternatives. A selected result tells the system what the user wanted on that occasion. The predecessor began without a programming language and learned a private language for each participant. Voxelurn carries over the ability to learn from choices and adds a shared core language and explicit definitions. Learning Language Games through Interaction.

Choice alone has a practical limit in a construction task. The authors illustrate it with the space needed for a palm tree. Allowing 10 possible colors in a 3×3×4 box gives 10³⁶ distinct outcomes in their rough accounting, and different programs can yield the same outcome. A person who already knows how to construct the tree can communicate far more by giving a sequence of instructions than by looking for the right tree in a set of guesses.

Even a demonstration of the finished object can leave open which steps the system should reuse or which dimensions should vary. A definition makes some of that structure explicit. If the user describes a surface as a repetition of columns, repetition and columns are part of the teaching signal. The system still has to work out how the surface’s dimensions correspond to those of the columns, but it has a specific construction to analyze.

The paper also discusses earlier systems that learn from instructions or conversations and begin with a stock of slot-filling commands. Such a command provides an action with fields for information the user supplies. The paper’s starting point is a language with general ways to compose operations, including loops and scopes. A person can teach a command that uses one of those capabilities, and another person can later put the learned command inside a larger definition.

Sharing changes who bears the cost of teaching. Early users must know enough of the formal language to get work done and explain a phrase that the system cannot interpret. A later user can draw on the actions those people have already defined. The language can also contain several expressions for the same operation or several uses of the same expression. That makes the problem partly one of grammar, which determines what interpretations are available, and partly one of ranking, which determines which interpretations a particular user sees.

The method, step by step

The world and the language it starts with

A Voxelurn scene consists of voxels, or blocks at positions in a grid. The relations row, col, and height describe position, and color describes appearance. The domain contributes add and move actions and a direction relation. The scene also has a selection, a set of positions that serves as an argument to many commands. The authors describe the general setup in terms of objects and their relations, with calendar events or spreadsheet cells as examples of what those objects could represent in another application.

The selection is how a sequence of DAL commands can keep working on the same part of a scene without repeatedly naming a variable. For instance, a user can select red voxels, add yellow ones above them, and remove the red ones. Each step uses the selection or acts in relation to it. A more complex program can apply an action repeatedly, make it conditional, or work through a set. The grammar distinguishes actions, relations, and sets of values, which lets the parser track what kind of expression belongs in each part of a command.

For sets, DAL uses lambda dependency-based compositional semantics, abbreviated lambda DCS. A relation connects an object to a value, and an expression can follow that relation in either direction. A color condition can retrieve the voxels with a given color. Starting with the voxels in a particular row and following the color relation in reverse yields their colors. The result can feed another operation. The paper gives an expression that takes the colors found in row 1, includes yellow among the acceptable colors, and finds voxels with any of those colors. The intermediate sets are conveyed by the nesting of the expression. DAL also supplies set operations such as intersection, union, and complement.

Users can add syntax and concepts around this core, while its existing expressions keep their meanings. The authors report that allowing redefinition made ambiguity spread. A basic term for red could acquire several color readings, which would then multiply the possible readings of larger commands that contained it. Keeping the core fixed gives the user a dependable way to specify an action when a learned expression is ambiguous or has yet to be taught.

What changes inside a command

Scoping governs how an action sees the surrounding scene and which changes persist when it finishes. Consider a definition that uses the selection to find a feature of a small object. One use of the definition may expect the updated selection to be available afterwards. Another use may treat those selection changes as temporary. A third may require the action to act as though the selected object were the only one in the scene.

The paper treats an action as a transition with two inputs and two outputs.

A : (v, s) ↦ (v′, s′)

Here A is the action, v is the starting set of voxels, and s is the starting selection. The arrow ↦ denotes the transition. The primes mark the voxel set v′ and selection s′ produced by the action. In this part of the paper, s is just the selection. The parsing account later uses the same letter for the entire state.

The ordinary bracket form [A] preserves both outputs of the transition. A form enclosed in braces can use the selection during execution and restore it afterward.

{A} : (v, s) ↦ (v′, s)

The braces tell DAL to keep the changed voxel set v′ and return the original selection s. The action A still sees the initial world v and selection s, so its internal steps can work with voxels anywhere in that world. The form is useful when the selection is serving as scratch space inside the action.

The isolate form changes the view of the world given to the enclosed action as well as what gets restored afterwards.

isolate [A] : (v, s) ↦ (v″, s), using A on (s, s)

Here isolate gives A a restricted world based on the selection and uses s as the initial selection within it. In the paper’s notation, the input (s, s) puts the selection in both positions. The final voxel set v″ contains the voxels produced inside that view and the original voxels at positions left empty by the action’s result. At an occupied position the result takes precedence. The returned selection is the original s. Consequently, a command to select everything inside an isolated action can refer to the object being worked on, such as a palm tree, without selecting every voxel in the scene.

When an expression leaves the scope implicit, Voxelurn generates readings for all 3 choices. This puts a programming distinction into the set of decisions the system can learn from use. It also means that a head with the right words and the right construction can still give rise to several interpretations if those interpretations differ in which parts of the scene they affect.

What the user does

A person starts by typing the command they want to use. The system tries to parse it, executes candidate programs to obtain possible outcomes, and offers those outcomes for selection. Choosing an outcome performs the action and supplies feedback. If the system cannot parse the command, or if the person wants none of the proposed results, the interface asks for a definition. The expression being taught is the head. The commands that explain how to carry it out are the body.

A definition can also begin with an operation the person has already carried out. The user executes a sequence of commands and then supplies a name for that sequence. Either way, the final teaching example connects the new wording to a body that can be parsed. If a body command is itself unfamiliar, it can receive a definition of its own. If it has several interpretations, the person chooses one before the system uses it to learn the head. For instance, a phrase about moving forward can mean moving the selection or moving a voxel. A definite choice at that point keeps both readings from propagating into the new rule.

How Voxelurn learns a command during building

The steps in order.

How Voxelurn learns a command during buildingStep 1: Read the user's command1. Read the user's commandStep 2: Parse candidates and show their effects2. Parse candidates and show their effectsStep 3: Execute an accepted choice or request a definition3. Execute an accepted choice or request a definitionStep 4: Resolve the commands in the definition body4. Resolve the commands in the definition bodyStep 5: Match head spans against body derivations5. Match head spans against body derivationsStep 6: Turn selected matches into grammar arguments6. Turn selected matches into grammar argumentsStep 7: Rank interpretations as users choose outcomes7. Rank interpretations as users choose outcomes

The body connects what the user means on this occasion to something the system already understands. A phrase ending in times 3 can be explained with DAL’s repeat construction. A name for an entire object can be explained with a sequence of lower-level construction steps. When those steps have names of their own, the definition can refer to them directly. A palm-tree definition can therefore have the structure of a tree of definitions, where earlier work is reusable at several levels.

The examples also establish why learning a definition involves more than storing it verbatim. A definition with a number in the head and the same number in the body might be intended to work with other values. Conversely, a named object can be useful as a fixed construction, with some details always built the same way. The system looks for evidence about which pieces of the head correspond to parts of the body and could be substituted in a future command.

How the system represents an interpretation

For each reading of a command, Voxelurn has a derivation. This is a tree that records how the grammar assembled that interpretation. Each node describes a span of the input, the rule applied there, the category produced by that rule, and the child derivations the rule combined. Part of the tree may identify a color or a direction. A larger part may take those pieces and build an action. The derivation matters both for interpreting the current command and for deciding what can be abstracted when the command appears in a definition.

z = prog(d)

Here d is a derivation and prog extracts its executable program z. Different derivations can support equivalent programs or have the same visible effect. The experiment’s outcome-based feedback can therefore leave some uncertainty about which derivation the user intended.

s′ = exec(s, z)

Here s is the current state, including both the scene’s voxels and its selection. The function exec runs the program z in that state, and s′ is the resulting state. This is the outcome, also called the denotation in the paper, that connects the formal program to what the person can inspect.

The parser organizes candidate derivations in a chart. A chart cell is associated with a span specified by its start and end indices. To analyze a longer span, the parser can combine derivations for smaller spans using a grammar rule. It scores the results and keeps the top K derivations in the relevant list, where K is the search cutoff. This pruning is part of the interaction design. As users add definitions, more rules can apply, while the list still has to be manageable enough for people to inspect the proposed effects. The grammar initially contains the DAL rules. It stores rules in a trie keyed by their right-hand sides, so matching can share work across rules with common prefixes.

A scoring function orders the alternatives and assigns a conditional probability to each derivation.

pθ(d ∣ x, u) ∝ exp(θᵀφ(d, x, u))

In this expression, pθ is the probability distribution with parameters θ, d is a derivation, x is the input utterance, and u identifies its user. The bar ∣ reads as “given.” The vector φ(d, x, u) records features of a derivation in that context, and θ is a vector of weights with the same dimension, denoted by p in the paper. The superscript ᵀ marks the transpose used to form their dot product. The function exp turns the score into a positive quantity. The symbol ∝ expresses proportionality because those quantities must be normalized to obtain probabilities.

The features describe rules, people, words, and scopes. Some identify the exact rule or distinguish a core rule from one learned from a user. Others record whether a rule has been used again, whether someone besides its author has used it, and whether the current speaker wrote it. Author features let the system learn a preference associated with a rule’s source. A separate set associates an author with a particular current user. This gives people access to the same grammar while allowing preferred interpretations to differ.

Span features combine a derivation’s category with words at its boundaries and with nearby words just outside them. A fragment that could play several grammatical roles may be a better fit for one of them given the words around it. The scoping features register which interpretation the parser chose. There are 3 indicators shared across the community and 3 for each user. That gives the ranking both a general preference and a way to account for a person whose commands tend to use the selection or the wider scene differently.

Learning from an accepted result

An accepted outcome says what should happen in the current scene. It may leave the exact program unresolved. If several candidate derivations lead to the selected state, the update rewards their collective probability. This is the weaker form of supervision in the interaction. The user can teach the system which result was wanted by choosing it, while supplying a definition adds information about the construction that produces the result.

−log ∑[d : exec(s, prog(d)) = s′] pθ(d ∣ x, u) + λ·reg(θ)

The summation ∑ ranges over derivations d whose programs, obtained by prog, produce the chosen state s′ when exec runs them on the current state s. The term pθ(d ∣ x, u) is the probability assigned to each such derivation for utterance x and user u. The negative logarithm −log makes the loss smaller when more probability goes to readings that produce the accepted result. The term reg(θ) penalizes the parameter vector, λ controls the strength of the penalty, and the centered dot denotes multiplication. The experiment uses L1 regularization.

The authors use AdaGrad to update the weights online as choices arrive. A person using the system therefore encounters a grammar that can acquire new rules during the study and a ranking that can change with successive outcomes. Those changes solve different problems. A definition can make a previously unavailable interpretation possible. A choice can raise the priority of interpretations that produce the preferred effect.

Finding the arguments in a definition

The grammar induction procedure starts with a head that the system may understand only in fragments. It also has a fully resolved body. The body’s utterances form a sequence.

X = [x₁, …, xₙ]

Here X denotes the body, while each x with a subscript is one body utterance. The indices run from the first utterance x₁ to the last xₙ, and n is the number of utterances. The resolved body has a derivation that the paper denotes by d_X. The user may have picked specific readings of the body utterances to establish it.

Suppose a user puts times 3 after an action and defines the phrase by applying repeat to that action. The partial parses of the head may recognize individual pieces such as the number, color, and direction. The complete action in the head may also be recognizable. If those pieces have corresponding programs in the body, they are candidates for the arguments of a rule. The system finds them by comparing programs attached to derivations.

M = {d ∈ chart(x) : ∃ d′ ∈ desc(d_X) with prog(d) = prog(d′)}

M is the set of eligible matches. The expression chart(x) denotes the partial derivations retained for the head x, and desc(d_X) denotes the descendants of the body derivation d_X. The symbol ∈ denotes membership and ∃ means there is at least one such derivation. A head derivation d passes the test when some body descendant d′ yields the same program under prog. Equality here concerns the program representation. Two fragments happen to have the same effect in the present scene for reasons that need not hold in another scene.

One possible rule abstracts just the recognizable values. In the repetition example, this produces a rule for the familiar action with freely supplied values for its color, direction, and count.

A → add C D times N : λ C D N. repeat N [add C D]

The A on the left is the output category for actions, → points to the pattern the rule recognizes, and the colon separates that pattern from its meaning. C, D, and N stand for a color, a direction, and a number. The literal words add and times stay in the input pattern. The binder λ, followed by the argument names and a period, introduces the values that the right-hand program will receive. On the right, repeat uses N as its count and applies the bracketed add action with the matched C and D.

A broader rule can substitute an entire action and preserve the repetition scheme.

A → A times N : λ A N. repeat N [A]

The leftmost A again identifies the output category. The A in the input pattern is a slot for a phrase that parses as an action, and N is a slot for a number. The binder λ introduces both arguments. The right-hand A then denotes the matched action, which repeat runs the matched number of times. The arrows, colon, period, and brackets play the same roles as in the preceding rule. This version can apply when the repeated action differs substantially from the example the user taught.

A broader substitution can also miss how parts of a definition are related. In the paper’s example of adding a red voxel on the left and another at the current position, the color is shared by the two additions. Treating the first full addition as an action slot can leave the second addition tied to the original color. Treating the shorter fragment for adding red as a general action slot can also admit substitutions that have the wrong relation to the direction supplied in the head. Keeping separate arguments for the color and the direction preserves the particular dependency in this example. The fact that a fragment is long, or occurs repeatedly in a body, does not by itself make it a sensible parameter.

Choosing a compatible set of arguments

A possible abstraction for one span can overlap with a possible abstraction for another. The system cannot simultaneously substitute the entire action in the repetition example and treat its interior color word as an independent argument of the same rule. It calls a non-overlapping set of matches a packing. A packing is maximal when no other match can be added without an overlap. Several different packings may be maximal, because a large span can prevent a set of smaller spans from being chosen.

P*ₗ = arg max[P ∈ packings(M)] ∑[d ∈ P] score(d)

Here P*ₗ denotes the selected packing for the full head, whose length is L. The subscript ₗ stands for that full length. P ranges over packings(M), the maximal packings of the matches in M. The sum adds the current parsing score score(d) of each derivation d in the packing. The operator arg max returns a packing with the greatest total score. Maximality constrains which packings can compete. The score determines which of those packings supplies the arguments.

The computation works from left to right with dynamic programming. It keeps the best maximal packing P*ᵢ for a prefix ending at boundary i. The empty prefix has the empty packing.

P*₀ = ∅

The subscript ₀ denotes the starting boundary, the star marks the best packing at that boundary, and ∅ is the empty set. A span in the head has a start index and an exclusive end index. Those indices let the algorithm combine a derivation ending at the current boundary with a packing that stops before its span.

dᵢ = arg max[d ∈ M, end(d) = i] score({d} ∪ P*₍start(d)₎)

Here dᵢ is the match chosen to end at position i, if there is such a match. The function end(d) gives the exclusive end of candidate d and start(d) gives its beginning. Braces make {d} a set containing that derivation. The union ∪ combines it with the best prefix packing P*₍start(d)₎. The function score on a packing sums the scores of its members. The algorithm tries each match in M with the required end and takes one whose combination scores highest.

Dᵢ = {dᵢ} ∪ P*₍start(dᵢ)₎

Dᵢ is the best maximal packing with a match ending exactly at i, where such a packing exists. It consists of the chosen match dᵢ and the prefix packing up to that match’s start. The earlier packing ends at or before that start, so its derivations can be included without overlapping the new match.

An optimal maximal packing of a prefix may end before the last boundary of that prefix. A candidate that ends too early can leave space for another match, however. The algorithm finds a boundary that excludes such candidates.

s(i) = max[d ∈ M, end(d) ≤ i] start(d)

The term s(i) is the latest start position of any match whose end is at or before i. The operator max takes the largest such start, and ≤ allows a match that finishes exactly at the boundary. The letter s here names a function of positions. If a packing ends at or before s(i), a match starting there can still be placed in the prefix, so that packing is ineligible as a maximal solution.

P*ᵢ = arg max[D ∈ {D₍s(i)+1₎, D₍s(i)+2₎, …, Dᵢ}] score(D)

Here P*ᵢ is the best maximal packing for the prefix through i. The possible D are the available packings whose last match ends after s(i) and at or before i. The subscripts s(i)+1 and s(i)+2 begin the sequence of permitted boundaries, and the ellipsis continues it through i. The expression chooses the D with the highest summed score. At the end of the utterance this yields the full-head packing.

The extraction procedure walks the chosen matches in head order. A match’s span becomes a category slot in the rule’s input, while the corresponding program in the body is replaced by a reference to the rule’s argument. The paper gives the notation for that substitution separately.

f[t / s]

Here f is the expression being modified, s is the part to replace, and t is its replacement. The slash indicates replacement in the direction specified by the notation. The procedure takes care with names bound inside the expression so that a replacement keeps the intended meaning. The resulting rule connects what a future utterance supplies in the slot to where that value is used inside the program.

The system also uses a simple packing restricted to primitive values, which in Voxelurn include colors, numbers, and directions. A packing that takes larger spans can support useful rules like repeating an arbitrary action, and it can also introduce mistaken generalizations like the one in the two-addition example. With further feedback, derivations that use unsuccessful rules can lose weight. A later induction step can then choose a different packing even if the same definition is supplied again.

When the head contains an unfamiliar word

The matching procedure so far depends on partial parses in the head. If the head is move up and the body is move top, the system can parse top in the body but may have no reading for up in the head. A comparison of existing programs then lacks the match required to recognize the new wording as a direction.

For such cases, the authors use alignment between the two utterances. The system considers spans of the body that already correspond to derivations. When a body span aligns with a head span, the system copies the body derivation into the head chart at the corresponding positions. In the example, this gives the otherwise unfamiliar up span access to the direction reading of top. The packing and rule extraction procedure can then use that reading as evidence.

The exclusion heuristic looks for a case where the rest of the wording already matches and only 1 pair of short spans remains. Those spans can contain 1 or 2 tokens. The projectivity heuristic uses two shared derivations to infer an alignment for a larger phrase. It considers an ancestor that contains both descendants in the body tree and aligns that ancestor to the corresponding span of the head. The evidence comes from where those shared pieces occur and how they fit together in the parsed body.

Alignment is restricted to definitions with a single body utterance, and the wording must agree closely. The paper requires all but 1 or 2 tokens to align in each direction. A short reformulation gives the procedure a plausible local correspondence. A head naming a monster and a body describing its construction can have a meaningful connection through the whole program while offering little word-by-word evidence. Restricting alignment protects the candidate list from extra readings based on such weak correspondences.

Experiments and results

Building with a shared grammar

The study recruited workers through Amazon Mechanical Turk. The qualification task asked participants to recreate a fixed target exactly. This gave the study a pool of workers with some experience applying the core language to obtain a specified result. The next task let qualified participants build a structure of their choice in 30 minutes. The authors use that arrangement to represent a setting where an initial group invests effort in learning the base language, giving the system a chance to acquire expressions that can help subsequent users.

Of the workers, 70 passed qualification, and 42 took part in the final free-building experiment. The paper reports 230 structures. Participants were teaching one system, which meant that a grammar rule induced from one person’s definition could be available to another person. This shared setting is central to the result. The study follows a developing language and the users who help create it, with each person’s choices potentially influenced by definitions already in circulation.

The study records several kinds of interaction. There were over 103,000 queries, covering 5,388 distinct token types. The paper separately reports 64,075 tried utterances and 36,589 accepted utterances, where acceptance means an action was performed. These totals refer to different parts of the interaction. In particular, acceptance concerns utterances for which users chose an outcome. The total volume of queries includes activity beyond that set, and the paper’s main percentages use accepted utterances as their denominator.

Participants supplied 2,495 definitions whose bodies contained over 15,000 utterances. The reported average was 6.5 body utterances per definition head, and the longest body had 96. This records how much procedural material people supplied when teaching the system. Some definitions gave a new wording for an existing operation, while a longer body could specify a sizable construction in terms of steps the system could already execute.

From those definitions the system induced 2,817 grammar rules. The starting grammar had less than 100 core rules. The gap between a count of definitions and a count of induced rules also matters for understanding the method. A definition is a teaching event. A rule is one way to express the resulting relationship between wording and action, and the extraction procedure can receive different packings from that event. Across all queries, the paper reports 8.73 parses per utterance on average, with 1 as the starting count for core language. These were parse alternatives, a measure distinct from the number of construction outcomes people ultimately accepted.

How much the learned language was used

The core language provides the starting reference for the analysis. There is also a classification within the evolving system. An utterance can be covered by the core grammar, covered by the induced grammar, or remain unparsable. The authors first track these categories across utterances over time. That view shows what the system can parse as its grammar develops. They then look specifically at accepted utterances to check that the increased use of learned wording is visible in commands people actually carry out.

By the end, induced utterances accounted for 72.9% of all accepted utterances. For the final 10,000 accepted utterances, the figure was 85.9%. An utterance the parser cannot interpret cannot enter this accepted set. Within it, the core and induced categories account for the outcomes counted by the paper’s analysis. The two percentages describe overlapping views of the same experiment. The whole-run figure includes the start, when users had only the core syntax available.

Induced-language share across accepted-utterance windows in Voxelurn

The learned grammar accounted for a larger share of accepted commands in the final window.

Induced-language share across accepted-utterance windows in VoxelurnAll accepted utterances: 72.9All accepted utterances72.9Final 10,000 accepted utterances (this paper): 85.9Final 10,000 accepted utterances (thispaper)85.9
The numbers
System or settingaccepted utterances in induced language %
All accepted utterances72.9
Final 10,000 accepted utterances (this paper)85.9

The paper’s plots also report the trajectory for the 5 heaviest users alongside that of the community. The aggregate measures use across the shared system, where prolific participants can contribute many events. Breaking out the heaviest users lets a reader see how adoption can vary among participants. The headline percentages remain measures of utterances. They describe how frequently a certain kind of command was accepted and cannot be read as proportions of workers who preferred it.

The study’s comparison is with the continuing use of DAL within that shared environment. The paper presents the initial core and the growing induced grammar as ways people could express executable commands in the same world. It does not report a separate group assigned to build without naturalization, or a head-to-head score against another system. The central result is about uptake while people build, which the time series and accepted-utterance counts measure directly.

What people taught the system

The learned language covered different needs. For frequent navigation, users wanted short forms for moving the selection. A single character or a short word could stand in for a longer DAL phrase. One person used an expression that coupled down and right with a conjunction, leaving a previously understood sequence to supply the execution order. Such examples show that a more convenient language can contain compact shorthand as well as wording that resembles everyday English.

Other definitions operated at the level of named objects. The paper gives a dancer as an example of a high-level construction that can be invoked without arguments. The definition of an object can refer to earlier learned commands for its component steps. The usefulness in this case comes from giving a repeatable piece of work a name. Introducing dimension or color slots can be valuable for a family of objects, while a fixed construction serves when the user wants the same object each time.

The authors track expressiveness using the ratio of program length to utterance length. In their learning curves, the executable descriptions grow longer relative to the commands people type. This is consistent with users giving short names to larger constructions and calling those names in later work. The ratio captures how much formal description an utterance stands for by this measure. It is also sensitive to abreviations for familiar operations, so the authors’ examples help show which kinds of reuse lie behind it.

Why participants built and taught

The experiment gave people incentives for both construction and contribution to the shared language. A leaderboard ranked structures using recency and upvotes. Across 3 days, the experiment offered daily prize categories. The first day encouraged bridges, houses, or animals. Towers, monsters, and flowers came next. The final categories were ships, dancers, and castles. These categories gave workers targets to consider while leaving the free-building task open to other designs.

The study also counted citations for rules. When another user employed a rule in an accepted utterance, the rule and its author received credit. The leaderboard displayed frequently cited definitions, and the study paid bonuses to top contributors using an h-index. The teaching incentive thus depended on reuse by other people in actual commands. An author could introduce many names for private use, but that alone would provide no citations under the study’s rule.

The authors report that around 20% of the constructions fell outside the prize categories. They also observed complex definitions that attracted few citations. Those observations matter for reading the task traces. Participants sometimes built structures outside the targets set by the prizes and sometimes taught concepts without much subsequent use by other workers. The study thereby records both sharing and individual use of the evolving grammar. The code, data, and experiments are available on CodaLab, along with a separate interactive demonstration of Voxelurn.

What the ablations show

The paper reports no formal ablation study. Its evidence comes from comparisons between views of the interaction logs, examples of successful and unsuccessful generalization, and inspection of the learned weights. Each addresses a different question about how the system behaved as people used it.

Parse coverage and accepted use

The comparison between all utterances and accepted utterances addresses a simple alternative reading of the adoption curve. The growing grammar could parse more unfamiliar language while offering interpretations that people seldom wanted. Counting an utterance only after a user accepts an outcome makes the measure depend on an action the person was willing to perform. The high use of induced language under that restriction shows that learned expressions played a substantial role in executed building commands.

Acceptance remains a conditional measure. It leaves out failed attempts and does not specify whether a person recovered by trying something else. The comparison therefore establishes use of the induced grammar among executed commands and allows the separate coverage plot to describe a broader set of inputs. Those views complement one another because a useful construction command and a difficult turn can both appear in the same session.

The program-to-utterance length analysis also complements the adoption result. Frequent short navigation expressions could make the learned grammar popular even if people continued to construct objects one low-level operation at a time. The paper documents high-level definitions and observes an increase in the length of programs relative to their utterances. Together those observations support the interpretation that users came to invoke more elaborate operations with concise commands. The ratio alone leaves the contribution of the different forms of compression open.

Which generalizations hold up

The paper’s examples compare ways to find arguments. In the repetition definition, both extracting primitive values and abstracting a whole action produce plausible rules. In the example with two placements, maximizing the amount of body text covered or choosing the longest recognized head span yields the wrong abstraction. These examples show why locating a match and selecting an argument are separate decisions. A candidate can be recognizable in both head and body while still obscuring information the program must keep tied together.

Failures observed in the study put this distinction in practical terms. A white tower description that specified height and width did not supply the matches needed between the head and body. The intended dimensions therefore could not be generalized by the matching procedure. A different definition, for a black frame with compactly written dimensions, failed at tokenization. In the tower case, the problem was correspondence between expressions. In the frame case, deciding where the input’s units began and ended was already a problem. Reranking available rules addresses only failures for which a suitable candidate exists.

The paper illustrates the value of the alignment extension with an unfamiliar synonym in a near-paraphrase. That example shows how an argument reading can enter the chart when direct matching would find no analysis for the word. The study gives no measured comparison of the system with and without alignment, or of how frequently the primitive and higher-scoring packings generalize correctly. The mechanism and examples establish what sort of evidence the heuristics can use, while their contribution to the aggregate adoption figures remains unresolved.

What the weights reveal

With L1 regularization, the fitted ranking retained 1713 features with non-zero weights. The author feature with the most negative weight belonged to a user who defined many very short expressions consisting of a single token. Pairings of authors and users acquired large weights in both directions. These patterns show that the learned ranking can treat a person’s contribution differently across users. A positive or negative coefficient is a property of that fitted ranking and gives no independent measurement of the quality of the definitions themselves.

Among scope choices, isolate received the strongest positive weights overall and for many individual participants. This fits the role of isolation in composing object definitions. The same command can operate inside a selected construction without involving nearby objects. The weights indicate a learned preference expressed in the full system. They do not measure the effect of taking isolation away or the share of completed structures that required it.

The 2 highest-scoring induced rules were associated with an instruction to add a red row to the right using a supplied count and an instruction to move the selection left using a count. These examples sit at a different scale from a command naming a whole object. They show that the ranking can give prominence to reusable building and navigation expressions alongside the large constructions visible in the study. A rule’s score describes its place in the ranking and differs from a count of how many users adopted it.

Limitations

Limits identified by the authors

The authors present Voxelurn as a demonstration in a voxel setting and identify other domains and a full programming language as future tests. DAL is a purpose-built starting point whose selection mechanism and set expressions fit the environment. The study gives evidence that such a core can support naturalization under these conditions. It leaves open how people would learn a different core and how far the same grammar induction procedure could accommodate the commands they would want to teach there.

The authors also identify paraphrasing and implicit arguments as continuing problems. The alignment procedure handles some close wording changes and requires a near match between the head and a single-utterance body. A reformulation that changes much of the wording lies beyond the evidence that heuristic uses. Implicit arguments raise a related difficulty. Users can expect an instruction to recover information they leave unsaid, while the induction algorithm primarily looks for parts of the new wording that can be connected to parts of the body. The persistent selection helps in Voxelurn by supplying a conventional default, and other kinds of implied information are left for future work.

The paper expressly notes that the inferred rule can generalize incorrectly. The system gets to see a concrete pairing of a head and a body. Different abstractions of that same pairing may all fit the example and behave differently when a later user changes a value. Scores can down-weight bad rules when people encounter and reject poor interpretations. The initial generalization still depends on which partial derivations the parser discovers, which correspondences are available, and which of their combinations scores best.

The authors place particular weight on keeping candidate generation precise because people have to interact with the outputs. A procedure that accepts weak alignments can multiply readings and increase the effort needed to find the intended action. Their conservative alignment rule reflects that design constraint. As its scope narrows, a user must sometimes supply fuller definitions or use an expression the system already handles. That exchange between what is proposed and what is missed is part of the reported method.

Limits visible in the study design

The study does not isolate a causal effect for any one ingredient. Participants used the core, taught definitions, accepted candidates, and shared the grammar under the same general conditions. The workload and the language could both change as the experiment progressed. The higher induced share late in the run establishes a change in the composition of accepted commands. A separate comparison would be needed to estimate how much of that change depended on argument extraction, shared access, automatic scoping, or the opportunity to choose outcomes.

The reported metrics also measure behavior inside the system more directly than the effort of using it. A high induced share can coexist with failed parses, several attempts at an expression, or time spent teaching a definition. A longer program behind a short command shows compression of the executable description, while the user may have made an earlier investment to construct and teach the command. The study does not assign that investment across later uses or compare total effort with writing the same structures directly in DAL. The findings establish reuse and practical expressive reach in this setting, with no measured productivity advantage over a core-only workflow.

The participant pool was shaped by qualification and by the free-building incentives. Workers who entered the latter task had already shown that they could use the core language to meet a fixed target. The experiment therefore gives less evidence about unaided entry for people with no prior practice. The out-of-category constructions and rarely cited concepts show behavior beyond the most direct incentive targets. They cannot establish how the same community would have developed its grammar in the absence of the leaderboard and bonuses, because that comparison was not part of the experiment.

Finally, both grammar learning and ranking take place against the current scene and current participants. An accepted state can reward several programs that happen to produce the same result there. A program with a different effect in a new scene might receive credit because its effect was equivalent on that turn. Definitions constrain this ambiguity by giving executable steps, but a successful use still leaves open whether scope, argument choices, and side effects will behave as expected across scenes. The aggregate counts do not measure that kind of generalization on a held-out set of commands or worlds.

What came after

Language for acting in constructed worlds

Several later papers that cite Voxelurn study language alongside actions in environments with a concrete state. Their titles identify the task or setting and provide a basis for relating it to naturalization. A citation establishes that the later work refers to Voxelurn. The particular relationship can range from a shared problem setting to a closer interest in interactive learning, and the task descriptions alone do not establish that the authors adopted DAL, definition-based induction, or the Voxelurn interaction procedure.

Learning Interpretable Spatial Operations in a Rich 3D Blocks World focuses on learning spatial operations in a closely related kind of setting. Voxelurn can explain a command’s effect by tracing it to actions on positions and sets of voxels. The citing work’s title places interpretability at the level of the spatial operations being learned. The connection is the need to relate an expression to a spatial action with a describable effect. Voxelurn’s use of a shared grammar and the blocks-world work’s focus on interpretable operations are distinct contributions at that intersection. Learning Interpretable Spatial Operations in a Rich 3D Blocks World.

Collaborative Dialogue in Minecraft places collaboration through dialogue in a construction environment. Voxelurn’s participants collaborate by contributing to a common language over many independent building sessions. A study framed around collaborative dialogue brings the linguistic exchange itself into the construction task. The common issue is how words guide action in a changing spatial environment. In Voxelurn, explicit definitions and choices connect words to that environment. In the Minecraft work, the stated object of study is the dialogue associated with collaboration. Collaborative Dialogue in Minecraft.

CoDraw uses collaborative drawing to investigate grounded, goal-driven communication. This changes the shared activity from arranging voxels to drawing while retaining the link between communication and a concrete task. Voxelurn shows how a compact expression can stand for a procedure with a visible result. CoDraw’s framing makes the joint goal of the communicators part of the problem. The similarity lies in using the artifact and the activity around it to give language practical meaning. CoDraw.

Learning to Speak and Act in a Fantasy Text Adventure Game puts both speech and action inside a game. The move to a text adventure gives another context for studying what participants can say and do in a world. Voxelurn mainly uses language to request executable changes, with definitions giving the system a way to learn new requests. The adventure work’s framing names speaking and acting as concerns in their own right. It is a continuation of interest in linking language and action in structured environments, with a different task setting. Learning to Speak and Act in a Fantasy Text Adventure Game.

Adaptation, interaction, and abstraction

Continual Adaptation for Efficient Machine Communication shares the concern that communication can become more efficient through experience. Voxelurn makes that change visible in a growing stock of expressions and in the rising share of accepted commands that use them. Its definitions let a short expression carry meaning accumulated through earlier interaction. The later paper’s stated focus is the continual adaptation of machine communication, a broader formulation of the question of what participants should retain from earlier exchanges. Continual Adaptation for Efficient Machine Communication.

An Imitation Game for Learning Semantic Parsers from User Interaction is the closest match in its stated learning objective. Both papers put user interaction inside the process of learning how to map expressions to formal interpretations. Voxelurn’s feedback has identifiable forms. It asks for a chosen result or for a definition with a resolved body. The later work frames interactive parser learning as an imitation game. The relation between the two is methodological at the level of the learning setup, where the interaction can supply supervision as people use the system. An Imitation Game for Learning Semantic Parsers from User Interaction.

Draw Me a Flower turns towards how linguistic abstractions are processed and grounded. That question appears in Voxelurn when a user gives a whole object a name or when the system has to infer which parts of a construction should vary. An expression can refer to a complete artifact at one level and to its components at another. The flower work’s title makes abstraction itself the focus. The connection is especially direct for Voxelurn’s named objects, where a brief description can be linked to detailed operations even though those operations are absent from its wording. Draw Me a Flower.

Pragmatics in Language Grounding places grounded language in a wider discussion of phenomena, tasks, and approaches. Voxelurn presents a case where a person’s likely interpretation can depend on their preferences and the grammar their community has developed. Its treatment of implicit scope also illustrates how the same words can leave different effects available for selection. A work framed around pragmatics and grounding can situate these choices alongside other ways an utterance acquires meaning in use. The cited task gives that broader discussion a concrete case in which users can actively change the language available for future interactions. Pragmatics in Language Grounding.

Cite

Cite as Sida I. Wang, Samuel Ginn, Percy Liang and Christopher D. Manning. 2017. Naturalizing a Programming Language via Interactive Learning. Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/p17-1086 · arXiv 1704.06956

@inproceedings{wang2017naturalizing,
  title = {{Naturalizing a Programming Language via Interactive Learning}},
  author = {Sida I. Wang, Samuel Ginn, Percy Liang and Christopher D. Manning},
  booktitle = {Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  year = {2017},
  doi = {10.18653/v1/p17-1086},
  eprint = {1704.06956},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/p17-1086}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/wang-2017-naturalizing-programming-language-interactive-learning/

References

19 references, from the paper's own bibliography.

  1. Y. Artzi and L. Zettlemoyer. 2011. Bootstrapping semantic parsers from conversations. In Empirical Methods in Natural Language Processing (EMNLP). pages 421–432. OpenAlex ↗ · Scholar ↗
  2. Y. Artzi and L. Zettlemoyer. 2013. Weakly supervised learning of semantic parsers for mapping instructions to actions. Transactions of the Association for Computational Linguistics (TACL) 1:49–62. our card
  3. A. Azaria, J. Krishnamurthy, and T. M. Mitchell. 2016. Instructable intelligent personal agent. In Association for the Advancement of Artificial Intelligence (AAAI). pages 2681–2689. OpenAlex ↗ · Scholar ↗
  4. J. Berant, A. Chou, R. Frostig, and P. Liang. 2013. Semantic parsing on Freebase from question-answer pairs. In Empirical Methods in Natural Language Processing (EMNLP). our card
  5. G. Campagna, R. Ramesh, S. Xu, M. Fischer, and M. S. Lam. 2017. Almond: The architecture of an open, crowdsourced, privacy-preserving, programmable virtual assistant. In World Wide Web (WWW). pages 341–350. OpenAlex ↗ · Scholar ↗
  6. J. Duchi, E. Hazan, and Y. Singer. 2010. Adaptive subgradient methods for online learning and stochastic optimization. In Conference on Learning Theory (COLT). OpenAlex ↗ · Scholar ↗
  7. S. Gulwani and M. Marron. 2014. NLyze: interactive programming by natural language for spreadsheet data analysis and manipulation. In International Conference on Management of Data, SIGMOD. pages 803–814. OpenAlex ↗ · Scholar ↗
  8. R. Jia, L. Heck, D. Hakkani-Tür, and G. Nikolov. 2017. Learning concepts through conversations in spoken dialogue systems. In International Conference on Acoustics, Speech, and Signal Processing (ICASSP). OpenAlex ↗ · Scholar ↗
  9. N. Kushman and R. Barzilay. 2013. Using semantic unification to generate regular expressions from natural language. In Human Language Technology and North American Association for Computational Linguistics (HLT/NAACL). pages 826–836. OpenAlex ↗ · Scholar ↗
  10. T. Kwiatkowski, L. Zettlemoyer, S. Goldwater, and M. Steedman. 2010. Inducing probabilistic CCG grammars from logical form with higher-order unification. In Empirical Methods in Natural Language Processing (EMNLP). pages 1223–1233. our card
  11. P. Liang. 2013. Lambda dependency-based compositional semantics. arXiv preprint arXiv:1309.4408 . OpenAlex ↗ · Scholar ↗
  12. P. Liang. 2016. Learning executable semantic parsers for natural language understanding. Communications of the ACM 59. OpenAlex ↗ · Scholar ↗
  13. P. Liang, M. I. Jordan, and D. Klein. 2011. Learning dependency-based compositional semantics. In Association for Computational Linguistics (ACL). pages 590–599. OpenAlex ↗ · Scholar ↗
  14. P. Pasupat and P. Liang. 2015. Compositional semantic parsing on semi-structured tables. In Association for Computational Linguistics (ACL). our card
  15. S. Tellex, T. Kollar, S. Dickerson, M. R. Walter, A. G. Banerjee, S. J. Teller, and N. Roy. 2011. Understanding natural language commands for robotic navigation and mobile manipulation. In Association for the Advancement of Artificial Intelligence (AAAI). OpenAlex ↗ · Scholar ↗
  16. S. I. Wang, P. Liang, and C. Manning. 2016. Learning language games through interaction. In Association for Computational Linguistics (ACL). our card
  17. M. Zelle and R. J. Mooney. 1996. Learning to parse database queries using inductive logic programming. In Association for the Advancement of Artificial Intelligence (AAAI). pages 1050–1055. our card
  18. L. S. Zettlemoyer and M. Collins. 2005. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Uncertainty in Artificial Intelligence (UAI). pages 658–666. our card
  19. L. S. Zettlemoyer and M. Collins. 2007. Online learning of relaxed CCG grammars for parsing to logical form. In Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP/CoNLL). pages 678–687. our card