---
title: "Constrained Language Models Yield Few-Shot Semantic Parsers"
description: "The paper shows how rewriting requests in controlled English and enforcing a grammar can build semantic parsers from few labeled examples."
canonical: "https://research.elamur.ai/free/en/papers/shin-2021-constrained-language-models-yield-few/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/shin-2021-constrained-language-models-yield-few/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Constrained Language Models Yield Few-Shot Semantic Parsers

# Constrained Language Models Yield Few-Shot Semantic Parsers

Paper · 2021 · Richard Shin, Christopher Lin, Sam Thomson et al.

**Authors:** [Richard Shin](https://md.research.elamur.ai/free/en/authors/richard-shin/), Christopher Lin, [Sam Thomson](https://md.research.elamur.ai/free/en/authors/sam-thomson/), [Charles Chen](https://md.research.elamur.ai/free/en/authors/charles-chen/), [Subhro Roy](https://md.research.elamur.ai/free/en/authors/subhro-roy/), [Emmanouil Antonios Platanios](https://md.research.elamur.ai/free/en/authors/emmanouil-antonios-platanios/), [Adam Pauls](https://md.research.elamur.ai/free/en/authors/adam-pauls/), [Dan Klein](https://md.research.elamur.ai/free/en/authors/dan-klein/), [Jason Eisner](https://md.research.elamur.ai/free/en/authors/jason-eisner/) and [Benjamin Van Durme](https://md.research.elamur.ai/free/en/authors/benjamin-van-durme/) · **Year:** 2021 · **Venue:** Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**132** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3156012351|W3212368093|W6910370394|W6947946701) · [Cited by **106** papers in our library of the 163,136 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/shin-2021-constrained-language-models-yield-few/cited-by/) · [Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing](https://aclanthology.org/volumes/2021.emnlp-main/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.emnlp-main.608/)
- [PDF](https://aclanthology.org/2021.emnlp-main.608.pdf)
- [DOI 10.18653/v1/2021.emnlp-main.608](https://doi.org/10.18653/v1/2021.emnlp-main.608)
- [arXiv 2104.08768](https://arxiv.org/abs/2104.08768)
- [OpenAlex](https://openalex.org/W3156012351)

Citations: OpenAlex, 2026-10-14.

## Summary

A calendar request can be easy to understand and still be hard to turn into a program. Someone asking how long a regular meeting lasts expects an answer about duration, while the calendar system needs a precise instruction specifying which meeting to find and which property to retrieve. [Semantic parsing](https://md.research.elamur.ai/free/en/concepts/semantic-parsing/) is the task of turning a request like this into a structured representation of its meaning. The authors ask how to build a parser for a new application when there are few examples of requests paired with their correct interpretations. A pretrained [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) can draw on familiar English constructions, but the application’s own program notation may have been scarce in its pretraining data.

The authors give the generator a target that looks more like the language it already knows. It rewrites a user’s request as a *canonical utterance*, a phrase in a restricted variety of English. A synchronous [context-free grammar](https://md.research.elamur.ai/free/en/concepts/context-free-grammar/) pairs these phrases with expressions in the application’s formal language. The grammar also guides generation. At each step, it eliminates continuations that would leave the system unable to finish a legal phrase. Once the generator has found a complete phrase, the system uses the grammar to recover the corresponding formal representation. The most complex case, SMCalFlow, also needs heuristics to settle ambiguities and reconstruct information left implicit in the English.

The main prototyping experiments use at most 1,000 labeled examples per task setting. For [few-shot learning](https://md.research.elamur.ai/free/en/concepts/few-shot-learning/) with the 175-billion-parameter GPT-3, the authors choose demonstrations afresh for each request. GPT-3 itself scores how likely the request is given each candidate example’s input, and the resulting prompt must leave room for the answer within a 2,048-token budget. The authors also use [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) to adapt GPT-2 XL and BART with the same examples. Across Overnight, Break, and SMCalFlow, the comparisons favor English-like targets and show further gains from restricting generation. On the Overnight Calendar evaluation, the constrained canonical GPT-3 system using 200 training examples reaches a denotation accuracy@5 of 0.98. This measures how frequently a candidate among the first 5 returns the expected database answer.

On SMCalFlow, the constrained canonical approach also beats VACSP in the low-data comparison, with earlier dialogue turns withheld from both systems. Its advantage diminishes as the training set grows. Examples from Overnight and Break show what the two design choices can change. The grammar prevents a fluent but unsupported paraphrase from becoming the output, while an English-like target can preserve a distinction such as negation or equality that a direct formal prediction loses. The authors release their code and grammars. They present the approach as a way to get a parser working early enough for people to start reviewing and correcting its suggestions.

## Deep dive: Constrained Language Models Yield Few-Shot Semantic Parsers

The paper shows how rewriting requests in controlled English and enforcing a grammar can build semantic parsers from few labeled examples. · about 40 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### An unfamiliar output language

A semantic parser makes a decision about what a person’s words mean in a particular application. The decision can involve which entity the person refers to, what operation should be performed, and how several conditions fit together. A database query needs to specify those choices in the form its executor understands. A calendar program may also need to name intermediate operations that a speaker would normally leave implicit. Even when the user’s request is simple, the correct output can contain information about how the application carries it out.

The authors focus on the stage at which an application already has a way to represent such decisions but has little annotated data showing how users express them. A small sample might establish that people ask when an event starts or how long it lasts. It may give little evidence about how they combine those requests with filters, qualifiers, or descriptions of particular events. The required program strings depend on the application’s vocabulary and conventions. The paper argues that this makes them a difficult target for a generator pretrained largely on naturally occurring text. Useful knowledge about the words in a request and the ability to write the application’s program are separate requirements.

Prompting gave the authors a starting point. Earlier work had cast tasks as text continuations, with a description or demonstrations followed by a new input. A demonstration establishes what the input looks like and what kind of text should follow it. The method is easiest to see when the target is itself ordinary text, as in the translation example the paper discusses. A custom semantic parser can also be presented as a continuation task, but a demonstration now has to teach the generator both the interpretation and the output notation. The paper’s proposal changes what each demonstration asks the generator to learn. [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://md.research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/) and [Language Models are Few-Shot Learners](https://md.research.elamur.ai/free/en/papers/brown-2020-language-models-few-shot-learners/)

#### Paraphrases as a route to meaning

The idea of using canonical phrases in a semantic parser precedes this paper. In earlier work described by the authors, a canonical phrase gives a readable expression to a possible formal interpretation. A system can propose several database queries, render each one in controlled language, and judge how closely each rendering matches what the user said. This puts the task of comparing meanings into a form where a component can work with pairs of utterances. The search still needs a source of candidate interpretations before that comparison can select one. [Semantic Parsing via Paraphrasing](https://md.research.elamur.ai/free/en/papers/berant-2014-semantic-parsing-paraphrasing/)

Other systems discussed in the paper used a grammar to build candidate phrases and their meanings together. A score comparing the evolving phrase with the user’s request helped discard candidates during generation. In some systems the grammar built candidates from smaller constituents, and in others it expanded from larger structures downward. The work here starts its search with the user’s request in the input to the pretrained generator. The generator proposes how to continue the answer from left to right, while the grammar checks the partial output. This change assigns the question of what wording is probable to the generator and the question of what wording is legal to the grammar.

The distinction matters because a legal canonical utterance is a member of a defined language. A phrase can mean the right thing to a human reader and still fall outside that language. A parser built around canonical phrases needs to know when a generated answer has that problem. By checking prefixes as they are produced, the authors give the search a chance to pursue another expression before all of its effort goes into a phrase the converter cannot use. The user can still speak in ordinary English. The restrictions apply to the system’s rewrite.

#### What supervision a prototype can use

The paper describes earlier efforts that used grammars to make training data. A grammar could enumerate legal formal expressions and give each of them a canonical wording. People could then rewrite the canonical wording as something they might actually say. Overnight was built in this way. The paper also describes work using automated paraphrasing and filtering to obtain synthetic requests, as well as approaches that derived a grammar from existing examples. In those approaches, an important job of the grammar was to expand the material available for training.

In this paper, the grammar does work when the parser is being used. Once the system has a small set of labeled requests and a specification of the output language, the same specification can repeatedly rule out invalid continuations for new requests. This is a different use of domain knowledge from generating a corpus and asking a learner to absorb its regularities. The authors also distinguish their focus on small supervised datasets from concurrent work on paraphrasing for unsupervised parsing. They treat a modest collection of examples from a domain expert as a reasonable starting resource.

There were precedents for constraining output directly. The paper describes search techniques developed to require or exclude particular phrases, grammar restrictions in task-oriented speech recognition, and semantic parsers whose decoders generate formal output under syntax or type constraints. It also describes prior neural parsers that used pretrained components or introduced intermediate representations whose structure follows the input more closely. These strands establish the comparison the paper has to make. A grammar can help a system write a valid program directly, and pretraining can help a system write a paraphrase. The question is what happens when the same parser is given both the English-like language to write in and a grammar to keep its search within that language. [A Syntactic Neural Model for General-Purpose Code Generation](https://md.research.elamur.ai/free/en/papers/yin-2017-syntactic-neural-model-general-purpose/) and [Language to Logical Form with Neural Attention](https://md.research.elamur.ai/free/en/papers/dong-2016-language-logical-form-neural-attention/)

#### Why return several candidates?

The proposed application is an early parser that can help acquire better annotations. A candidate can be useful to a reviewer even if the system initially ranks it below a plausible alternative. If the intended analysis appears near the top, the reviewer has something concrete to select or correct. If it is absent, the reviewer needs another way to supply it. The paper therefore considers how often the correct interpretation appears anywhere within a shortlist alongside the usual evaluation of the leading answer.

These questions serve different purposes. The leading answer is what a parser acting by itself would normally use. The shortlist asks whether the search has found something a person could recognize as correct. The authors use this distinction to connect an experimental score to the job they want a prototype to do. The prototype is valuable at an earlier stage than a system expected to execute every interpretation without review.

### The method, step by step

#### Follow a request through the parser

Consider a user who wants the duration of a recurring meeting. An example in the prompt might show how a request about that same meeting becomes a short canonical phrase naming its start time. A separate example might show the phrasing for a request about its date. Those demonstrations establish how the application names meeting properties and how to present the answer. To parse the new request, the generator needs to select the phrase for duration and carry over the meeting description. The formal conversion can then associate that choice with the operation the application understands.

The paper uses three symbols to keep the roles of the strings distinct.

```
u ↦ c ↦ m
```

Here `u` is an unrestricted user utterance, `c` is its canonical rendering, and `m` is the task’s formal meaning representation. Each `↦` denotes a mapping. The first mapping predicts an interpretation from the user’s words. The second recovers a formal expression from the canonical phrasing, with additional choices where that phrasing admits more than one analysis.

Canonical English has a specific job. It needs phrases that the application can translate and that the generator can plausibly produce from the user’s request. Fluency alone is too broad a criterion. Several ordinary ways of describing a meeting property might make equal sense to a person, but the grammar may admit only one of them. Conversely, a canonical phrase can sound stilted while still making its meaning easier to predict because the important relation appears as words rather than as a symbol or a function name.

From a user request to a formal interpretation The steps in order.

The generation and legality steps in the diagram repeat as the answer grows. The experiments also use a direct route to the formal representation. In that route, the target strings are programs or structured forms, so their constraints govern the search and there is no canonical phrase to translate. Keeping this route in the experimental design lets the authors ask whether canonical English contributes beyond the benefit of restricting output.

#### Score text one token at a time

The generator works with [tokens](https://md.research.elamur.ai/free/en/concepts/tokenization/), the units into which its tokenizer divides text. A token can represent less than a word. An autoregressive generator assigns a probability to the next token using the text before it. Repeating the operation gives probabilities for longer sequences. The paper writes the sequence probability as a product.

```
p(s) = ∏ᵢ₌₁ⁿ p(wᵢ ∣ w₁, …, wᵢ₋₁)
```

Here `p` denotes an estimated probability and `s` is the sequence made up of tokens `w₁` through `wₙ`. The index `i` identifies the token being scored, and `n` is the sequence length. `∏` means to multiply the terms from the first token through the last. The bar `∣` means “given,” so each term scores `wᵢ` conditional on the preceding tokens. The ellipsis stands for the intervening tokens, and `i−1` indexes the token immediately before position `i`. At the first position the sequence itself supplies no preceding tokens.

During generation, previously written text can include an instruction, demonstrations, the user’s request, and the answer prefix built so far. The next-token probabilities favor some continuations over others. They are the raw material for search. The legality check has access to the prefix and the chosen output language. It can determine that a proposed token is impossible in that language even when the generator would otherwise give it a high score.

#### Choose the demonstrations for each request

In the GPT-3 experiments, the authors leave the pretrained parameters in place and adapt the input. The pool contains utterances paired with their labeled targets. A target can be the canonical rendering for a rewriting experiment or the formal representation for a direct prediction experiment. Each prompt presents examples of the chosen mapping, then supplies the new utterance at the position where a continuation is due.

A useful demonstration depends on the request. Two users asking about the same meeting may share enough vocabulary to make one example relevant to the other. A question about an unrelated event may still help if it asks about the same property or uses a similar construction. The authors operationalize relevance by reusing GPT-3 to score the new input after each candidate example’s input.

```
p(u ∣ uᵢ)
```

Here `p` is the probability assigned by GPT-3, `u` is the complete new utterance, and `uᵢ` is the utterance from candidate example `i`. The conditional bar `∣` indicates that `uᵢ` supplies the preceding context. The example’s target does not enter this relevance score. After selection, the prompt displays both the utterance and its target so the generator can see the mapping it is meant to imitate.

The authors rank the whole candidate pool for the new request and take examples from the top. They denote the intended number to include by `P`. In Overnight and Break, they select up to `P = 20` examples for each evaluation input. How many actually fit depends on the length of the examples, the new request, and the room reserved for the answer. The API used for GPT-3 has a combined limit of 2,048 sub-word tokens. The authors give the example of allowing 40 tokens for generation, which leaves 2,008 for the prompt. This limit applies to the assembled text and is distinct from the size of the pool that the ranking step searches.

The paper reports that the authors also considered S-RoBERTa and LASER to estimate relevance during development. They saw too little difference to justify bringing those additional components into the system. The use of GPT-3 for retrieval and generation therefore means that one system supplies both probabilities. The two calls ask different questions. Retrieval scores the user’s input in the context of a candidate input, while generation scores possible targets after the assembled demonstrations and the user’s request.

#### Learn the same mapping by fine-tuning

The other route uses labeled pairs to update a pretrained generator before evaluation. The authors use GPT-2 XL and [BART](https://md.research.elamur.ai/free/en/papers/lewis-2020-bart-denoising-sequence-sequence-pre/). For each training pair the input is the user utterance and the expected output is the chosen target. At inference time the request can be presented by itself. The examples that would have served as candidates for GPT-3’s prompt instead supply the fine-tuning data, so the two routes make different uses of the same labeled material.

GPT-2 XL continues text autoregressively. BART has an encoder that reads the input in both directions and a decoder that writes the answer autoregressively. BART’s pretraining includes reconstructing text from a corrupted version. The authors suggest that this experience could be helpful for paraphrasing, where the output needs to preserve content while changing its wording. The GPT-3 API available for the experiments did not support fine-tuning. The authors tried leaving GPT-2 unmodified and giving it few-shot prompts, but the performance they saw led them to concentrate its experiments on fine-tuning.

BART-large has 406 million parameters and GPT-2 XL has 1.5 billion parameters. Both fine-tuning runs use a causal language-modeling loss, which rewards assigning probability to the intended next token in the target. The reported schedule runs for 20,000 steps. The learning rate rises linearly over the first 1000 steps, then is multiplied by 0.999 at each scheduled reduction. The authors try reduction intervals of 2, 4, 6, and 8 steps. They choose the schedule and maximum learning rate using development-set performance. The appendix also specifies a batch size of 32 and a gradient norm clip of 10. These settings describe the training route. The grammar is applied when searching for outputs from the resulting generator.

#### Check continuations during search

The authors call the set of legal next tokens `nextTokens(s)`. Here `s` is the output prefix, and `nextTokens` is supplied by the particular task and target format. To qualify, an extension must remain a possible beginning of a string licensed by that format. A prefix can pass the test while still needing more text to become a complete output. Balanced parentheses make the distinction concrete. A prefix can contain an unfinished group, but a completed answer with the same unfinished group cannot pass.

The search uses a length-normalized version of beam search. A beam keeps several promising partial answers so that the system can continue exploring alternatives. At each step the generator supplies scores for extensions. The task’s legality check filters them, and the search uses the scores to decide which surviving extensions to carry forward. Length normalization is part of how the search compares hypotheses whose lengths differ. The paper identifies the search as length-normalized without specifying a new scoring formula for it.

Putting the check inside the loop matters. Filtering completed outputs would allow invalid paths to compete for space throughout the search. By testing extensions early, the parser can devote its limited beam to paths that still have legal completions. This improves the conditions under which a correct interpretation can survive, while its rank still depends on the scores. If two allowed phrases say different things about the meeting, the grammar may license both. The system still needs to identify which one the user intended.

#### Pair the grammar’s two languages

A context-free grammar builds strings by expanding categories. A category such as `Shape` is a *nonterminal*, a symbol standing for material that can still be expanded. A word or character that appears in the resulting string is a *terminal*. A rule specifies how a category can be expanded without regard to the symbols around it. The familiar tree picture comes from applying a rule to the starting category, then applying rules to the child categories until the leaves supply all the terminal text.

```
G = (V, Σ, R, v₀)
```

Here `G` names the grammar, `V` is its set of nonterminals, `Σ` is its terminal vocabulary, `R` is its set of expansion rules, and `v₀` is the starting nonterminal in `V`. The parentheses group the components and the equals sign defines `G`. The subscript on `v₀` identifies the distinguished starting category.

```
v → σ₀ v₁ σ₁ … vₙ σₙ
```

Here `v` is the nonterminal being expanded, and `→` introduces one permitted replacement. The `v` symbols indexed from `1` through `n` mark the nonterminal occurrences on the right. The `σ` symbols stand for the intervening terminal material, including the material before the first category and after the last. Writing them next to one another indicates concatenation, and `…` continues the same pattern through the final indexed occurrence. A rule may also yield terminal text without requiring any child expansion.

A synchronous grammar gives each rule two coordinated expansions. One specifies what appears in the canonical phrase and the other what appears in the formal representation. The two can use different terminal text because they are writing different languages. Their nonterminal occurrences are paired, so the expansion chosen for one occurrence makes a corresponding choice on the other side.

```
v → ⟨σ₀ v₁ σ₁ … vₙ σₙ, τ₀ v₁ τ₁ … vₙ τₙ⟩
```

Here `v` is the shared category and `→` introduces its paired expansion. The angle brackets and the comma enclose and separate the two sides. The `σ` material belongs to the canonical side and the `τ` material to the formal side. The `v₁` through `vₙ` occurrences are the paired slots, `n` counts those slots, and the subscripts indicate position. Juxtaposition concatenates the pieces and `…` fills in the intermediate positions. The displayed rule keeps the slots in the same order on both sides. A grammar can also pair slots that appear in different orders.

A parser can use the canonical side to find a derivation tree for a completed phrase. Reading that tree using the other side’s rules yields a formal string. In the opposite direction, a program can supply the tree whose canonical reading becomes a target for a labeled example. The grammar defines what pairs are possible. Whether translation is deterministic depends on whether the input on a particular side has a unique analysis and whether earlier transformations have retained the information needed to reconstruct it.

The appendix shows how to obtain rules when the domain is defined by typed functions. The authors first assign each function an English template with a place for each argument.

```
f(a₁ᶠ : T₁ᶠ, …, aₙᶠ : Tₙᶠ) → Tᶠ
```

Here `f` is a function in the domain’s set `F`. The superscript `ᶠ` associates each name or type with that function. For argument position `i`, `aᵢᶠ` is the argument name and `Tᵢᶠ` is its type. The colon associates a name with its type. Parentheses enclose the arguments, commas separate them, and `…` continues the list through argument `n`. The arrow points to the return type `Tᶠ`. Constants can be treated as functions with no arguments and written without the argument parentheses.

```
E(f) = σ₀ᶠ a₁ᶠ σ₁ᶠ … aₙᶠ σₙᶠ
```

Here `E(f)` is the English template defined for function `f`. Each `aᵢᶠ` is the slot for one named argument, `n` is the number of slots, and each `σᵢᶠ` is a piece of fixed English that may be empty. The superscript ties the material to this function, the subscripts give its position, and juxtaposition places the pieces in order. The ellipsis continues the sequence through the last slot and its following text.

```
Tᶠ → ⟨σ₀ᶠ T₁ᶠ σ₁ᶠ … Tₙᶠ σₙᶠ, f(T₁ᶠ, …, Tₙᶠ)⟩
```

Here the return type `Tᶠ` becomes the nonterminal on the left, and the arrow supplies the corresponding synchronous rule. The angle brackets contain the canonical and formal expansions, with a comma between them. In the canonical expansion, the `σ` pieces give the fixed text and the indexed `T` symbols mark positions where phrases of the appropriate argument types must appear. On the formal side, `f` is written with calls or expressions of those same types in its argument positions. Parentheses delimit those arguments, commas separate them, and each ellipsis continues its side through slot `n`. The superscript indicates that both sides come from the same function.

In the paper’s colored-shape example, a purchase operation takes a colored shape. A color operation in turn takes a plain shape, and a square is rendered in English as a box. The English construction for buying a green box can thus be analyzed as a purchase containing a color operation containing a square. The formal rendition is `buy(toGreen(square))`. The type categories make each combination explicit. They allow the grammar to encode which expressions may fill another expression’s slots while giving the canonical rendering a vocabulary that resembles the request.

#### Implement the legality check for each task

Overnight already releases pairs of canonical phrases and formal queries generated from a grammar up to a fixed derivation depth. The authors put the strings for the chosen target into a *trie*, a tree of shared prefixes. Following a prefix through the trie reaches a node whose outgoing branches indicate the extensions available there. This makes the runtime check a lookup in a precomputed inventory. For formal queries, belonging to that inventory also enforces the typing embodied in its generation. The same lookup confines generation to the enumerated portion of the grammar.

Break starts with a question decomposition meaning representation, or QDMR. It expresses a question as a sequence of steps, with references that let later steps use earlier results. The authors recast it as a single line of controlled English through an invertible transformation. The canonical constraint draws vocabulary from the input question, permitted inflections, and an established list of function words. Parentheses are available to organize the expression, and they have to balance when it is complete. This is a lighter specification than Overnight’s finite inventory. It permits the search to assemble new strings from the available material while placing limits on what that assembly can contain.

SMCalFlow uses a grammar the authors construct for the case study. They can take either side of its synchronous rules to obtain an ordinary context-free grammar for the corresponding target language. As generation proceeds, an incremental Earley parser keeps track of rule expansions that remain possible given the prefix. `nextTokens` checks whether a proposed extension leaves viable parser states. This obtains the allowed continuations from the grammar during search, without the need to list all candidate strings in advance.

A grammar literal and a generator token need not have the same boundaries. An English template might contain a word that the tokenizer splits across tokens, and different pretrained systems can split the same text differently. The authors handle the interface by treating the grammar’s terminals as individual characters for this check. They advance the parser through the characters of a proposed token and keep the token if possibilities remain after it has been consumed. The generator continues to score its own tokens in the normal way. The character-level work belongs to the grammar check and preserves the likelihood the generator assigns using its preferred tokenization.

#### Convert SMCalFlow programs in both directions

SMCalFlow programs make the conversion more involved than the colored-shape example suggests. They combine operations, include function arguments with distinct types, and may reuse a computed expression in several places. The authors reconstruct the function type signatures because the dataset release does not supply them. They then build the synchronous grammar over a modified program language.

```
m ↦ m′ ↦ c
```

Here `m` is the original SMCalFlow program, `m′` is the intermediate program, and `c` is the canonical phrase obtained through the grammar. The prime distinguishes the intermediate representation from the dataset’s original one. The first arrow applies program transformations and the second renders the result in controlled English. The authors use this deterministic direction to make canonical targets from existing program annotations.

```
c ↦ m′ ↦ m
```

The same symbols name the phrase, intermediate program, and original-format program in the reverse direction. The first arrow uses the synchronous grammar to analyze the phrase and produce an intermediate program. The second reconstructs the original representation. There can be choices at both steps, since the phrase can have more than one analysis and the intermediate program can omit details of the original references.

One transformation combines common program fragments into macros. A macro is a named shorthand for a larger expression whose expansion is known. Deleting an event, for instance, can require accessing its identifier and passing it through several operations. If each of those operations contributes its own words, the generated phrase can sound as though the user wants to delete the identifier. The authors introduce a macro whose English template describes deleting the event. Expanding the macro restores the underlying fragment on the way back to the original notation. They define 15 such functions to make canonical English more fluent.

Another transformation handles repeated uses of a stored expression, called *reentrancies* in the appendix. The authors inline the binding at its first use in a postorder traversal, which visits the children of an expression before the expression itself. They replace subsequent uses with a typed reference to another computation in the current turn. On the way back, the reconstruction looks for the first expression with the requested type in postorder and uses it to rebuild the binding. Type information survives this transformation, while the exact identity of the original reference can be lost. When several expressions have the required type, the reconstruction can choose the wrong one.

Canonical ambiguity needs a further step. A phrase can leave it unclear which meeting is associated with a person or where a time modifier attaches. There are also conversions between types that add no English text at all. If a rule can convert a person into a recipient and another rule can convert a recipient into a person, the same name can acquire arbitrarily many invisible layers of analysis. The authors put a bound on recursive rule expansion so that the set of analyses to consider is finite.

To find where to apply the bound, they build a graph whose nodes are nonterminals. There is a directed edge when a rule for one category uses another category. They greedily choose a set of nodes covering the cycles. They then make `D` indexed copies of each category and rule. The allowed copy of a child is determined as follows.

```
d(vᵢ) = vᵢᵈ⁺¹ if vᵢ ∈ 𝒩, otherwise vᵢᵈ
```

Here `vᵢ` is a child nonterminal at position `i` and `𝒩` is the chosen set of cycle-covering categories. The symbol `∈` denotes membership. The index `d` identifies the current rule copy, and `d(vᵢ)` denotes the child copy to use. Superscript `d+1` advances the copy index by one for a member of the chosen set, while superscript `d` retains it for any other child. With only `D` copies, repeated passages through a covered cycle eventually exhaust the available indices. The authors set `D = 10`, which covers the examples they use.

The parser converts each remaining analysis into a candidate program and uses heuristics to discard implausible ones. For instance, it can reject a repeated `Yield` or a program that contains the event-creation preparation operation without the corresponding commit operation. In describing how they handle this ambiguity, the authors say their heuristics identify the correct parse in 90% of cases. That number concerns resolving analyses from canonical text. It measures a different stage from predicting the right text from a user request.

#### Build small sets with functional coverage

For SMCalFlow the authors want a small set that resembles one assembled deliberately by a domain developer. They first count the function signatures used in the annotated programs. They exclude examples containing functions that occur fewer than 10 times in the training data, applying this filter across the dataset partitions used for stratification. The paper describes some rare cases as possible annotation or migration artifacts and notes that including them would make coverage hard to achieve in such small sets. After filtering, the authors seek a sample containing at least one example of each remaining function.

They express the selection as a mixed-integer optimization problem. Each example is either selected or excluded. The objective provides a random preference over otherwise feasible selections.

```
maximize over x: xᵀc
```

Here `x` is a vector of selection indicators with one entry per candidate example, and superscript `ᵀ` denotes its transpose. Each entry is `1` for an included example and `0` for an excluded one. The vector `c` contains random weights drawn from a standard Gaussian distribution. It has the same length as `x` and is unrelated to the earlier symbol for canonical text. The product sums the random weights of the included examples. Maximizing this sum selects a sample subject to the size and coverage constraints.

```
xᵀ𝟙 = s
```

Here `xᵀ` is the transposed selection vector, `𝟙` is a vector of ones of the same length, and `s` is the desired sample size. Their product counts all selected examples, and the equality requires that count to be exactly the target size.

```
xᵀH ≥ k
```

Here `H` is a binary matrix whose rows are candidate examples and whose columns are the remaining functions. An entry is `1` if the example in that row uses the function in that column, and `0` otherwise. Multiplying by the transposed selection vector `xᵀ` counts, for each function, how many selected examples contain it. The inequality `≥` applies to each count. The threshold `k` is the required minimum, set to `1` in the experiments. A single example can contribute to the coverage of several functions.

The procedure gives the authors a way to distinguish the number of examples from the range of capabilities those examples illustrate. A small uniform sample might miss a function entirely. A stratified sample makes some evidence for each retained function available to the learner, although it can still offer little evidence about how the function appears in different requests or combinations.

### Experiments and results

#### What counts as a correct parse?

The case studies share a question about how the parser gets to an answer, but they differ in what they count as success. Overnight executes the predicted query and compares its answer with the expected database result. Break normalizes the predicted decomposition and checks it against the normalized reference. SMCalFlow evaluates the recovered program in the original dataset representation. In each case the canonical form is part of the route to the answer. Evaluation happens after the system has returned to the benchmark’s target.

The experiments also ask how the answer changes as the reader considers more candidates. In accuracy at `K`, `K` is the number of ranked outputs considered. An input contributes a success if at least one of those candidates satisfies the dataset’s correctness criterion. Overnight therefore uses the expected database answer to decide whether a shortlisted candidate counts, while Break uses normalized exact match. A larger cutoff can expose a correct interpretation scored below a plausible rival. The metric measures candidate availability under the benchmark’s scoring rule, which is the property the authors want in a parser that will offer suggestions to an annotator.

#### Overnight database queries

Overnight contains 13,682 examples across eight domains. Its builders started with pairs of formal queries and canonical phrases, then paid crowdworkers to produce more natural utterances for them. The study can use the existing grammar-generated inventory separately from the subset of natural requests selected as training examples. That setup gives the parser detailed knowledge of the legal output space while restricting how many annotated examples of user wording it sees.

For every domain, the authors randomly select 200 examples from training partitions ranging from 640–3,535 examples. They also test GPT-3 in a smaller setting with 20 examples. For constrained generation they use a beam size of 10. In the main unconstrained GPT-3 setting, decoding is greedy with a temperature of 0.0, so the system follows its highest-scoring continuation until it reaches a newline. The authors also run unconstrained beam search in Calendar, where they compare the resulting shortlist curves with the constrained conditions. They use greedy search for the unconstrained results with GPT-2 XL and BART.

The original formal answers are Lisp-like expressions. For direct formal generation, the authors remove a redundant namespace prefix from the target strings. Denotation accuracy checks whether executing the resulting query returns the expected answer. A query can receive credit even if it arrives at that result with an expression different from the annotated one. The benchmark thus asks whether the prediction behaves correctly on the database used for evaluation.

The main low-data comparison is with Cao and colleagues’ dual-learning parser, rerun using the same 200 training examples per domain. The appendix explains that Overnight lacks an official development split. To make the comparison, the authors randomly sample examples outside the selected training subset to form a development set one-fifth the size of the original training set. That gives the baseline an early-stopping signal while preserving the specified training examples for learning. They also raise the maximum training duration from 100 to 200 epochs and select the checkpoint with the best development performance.

Among the systems using 200 examples per domain, GPT-3 with the authors’ method gives the strongest full-test results. The fine-tuned BART and GPT-2 XL systems also perform well, and BART does better than GPT-2 XL in the paper’s comparison. The authors say their results on Calendar, Housing, and Restaurants are comparable to those of the stronger previous approach, even though they use only one-seventh to one-thirteenth as much training data. The paper also provides comparisons to earlier systems using all available labeled training examples and to AutoQA, whose training used >400,000 synthetic utterances. Those comparisons put the few-shot results in context. The rerun of the dual-learning parser is the comparison in which the labeled training inputs are held fixed.

Calendar gives the paper’s clearest numerical illustration of candidate coverage. For GPT-3 Constrained Canonical with 200 training examples, denotation accuracy@5 is 0.98 on the Calendar evaluation. The authors report that it stays at 0.98 for the larger evaluated cutoffs. They inspected the 2 remaining cases and judged both to be annotation mistakes.

GPT-3 Constrained Canonical on Overnight Calendar by denotation accuracy cutoff The constrained canonical system reaches its reported plateau at the earlier cutoff.

**The numbers**

| System or setting | denotation accuracy |
| --- | --- |
| Cutoff K = 5 (this paper) | 0.98 |
| Larger evaluated cutoffs | 0.98 |

The chart compares cutoffs for the same system. In the Calendar beam-search experiment, the authors also vary the output representation, the legality constraint, and the number of training examples. A cutoff curve makes it possible to see whether a condition helps the first prediction, whether a correct query appears lower down, and whether inspecting additional candidates eventually stops recovering more benchmark answers. Where the paper marks results from randomly reduced evaluation sets because of GPT-3’s computational cost, those comparisons have that narrower scope.

#### Break question decompositions

Break brings together questions from multiple language understanding tasks. Some began as semantic parsing problems, others as reading comprehension or questions about images. The study’s common target is the decomposition. For a question asking whether two collections have equal size, a decomposition can identify the collections, count their members, and compare the counts. References between steps let those intermediate results be reused. The target expresses how to answer the question, while the benchmark evaluates the decomposition itself. [Spider](https://md.research.elamur.ai/free/en/papers/yu-2018-spider-large-scale-human-labeled/), [HotpotQA](https://md.research.elamur.ai/free/en/papers/yang-2018-hotpotqa-dataset-diverse-explainable-multi/), and [CLEVR](https://md.research.elamur.ai/free/en/papers/johnson-2016-clevr-diagnostic-dataset-compositional-language/)

The underlying annotations permit words or inflections drawn from the question, a list of 66 pre-defined function words, and references to earlier results. Break has 44,321 training examples, 7,760 development examples, and 8,069 test examples. The study draws uniform training subsets of 25, 100, 200, and 1,000 examples. GPT-3 can draw up to 20 demonstrations from whichever pool the condition allows. Thus enlarging the pool can make different demonstrations available to retrieve even when the maximum number displayed in the prompt stays the same.

Break’s main reported metric is normalized exact match, or NEM. Normalization puts the predicted and reference QDMRs into a standard form before their strings are compared. Producing one of the paper’s canonical English variants is therefore an intermediate step. The system still has to translate it back and obtain the reference decomposition under the benchmark’s normalization. The authors report that the leaderboard’s four metrics showed consistent relative trends in these experiments, and they concentrate their discussion on NEM.

Constrained Canonical gives competitive accuracy in the low-data settings. The paper reports gains of 7–11% in absolute NEM accuracy from adding constraints in its Break comparisons. The results table distinguishes leaderboard entries, fine-tuned systems, and conditions evaluated on a random validation sample. It also includes the standard BART Unconstrained Meaning baseline. That baseline learns from the same number of examples and writes the original meaning representation directly. The authors report that their alternative methods outperform it. Constrained canonical decoding improves steadily across the sampled training sizes from 25 to 1,000.

The Break shortlist figure uses GPT-3 with 200 training examples. On a sample from Break, it compares NEM at different cutoffs for constrained canonical prediction and constrained direct meaning prediction. Both conditions use a legality check, so the comparison asks how the choice of target affects the chance that the correct decomposition makes it into the returned candidates. The authors describe the resulting pattern as consistent with the Overnight shortlist analysis.

#### SMCalFlow executable programs

SMCalFlow pairs dialogue turns with executable programs about events, weather, places, and people. The programs can combine API calls, express conditions, and refer to results from earlier turns. The paper lists 133,821 training examples for the dataset as defined. In the parser experiments, the input contains the current utterance without earlier dialogue turns. This gives the experiments a common input setup across the case studies, while some of SMCalFlow’s programs can still require context that the system never sees.

The authors stratify a primary training sample of 300 examples to give its small set broad functional coverage. They use a uniform sample of 100 examples and a stratified sample of 150 examples from validation to assist with grammar development and hyper-parameter selection. Some GPT-3 conditions use a separate evaluation sample of 200 examples drawn uniformly from validation. The beam size is 10. The table marks the results evaluated on a random validation sample, so those settings should be read with their evaluation split in mind.

The experiments score the original formal meanings. A canonical prediction must survive both the synchronous conversion and reconstruction of the original program before it can count as correct. The authors report the same relative pattern as in Overnight and Break. English-like targets help, decoding constraints help, and the proposed approach outperforms BART Unconstrained Meaning in the low-data comparison. The shortlist figure tracks accuracy as the cutoff grows for several systems on SMCalFlow, where a candidate must still pass through the conversions before it can be credited.

The authors also compare BART Constrained Canonical with VACSP, the value-agnostic conversational parser they identify as the stronger prior system for SMCalFlow. They consider stratified training sets of 1k, 10k, and 50k, as well as the full training condition described in that comparison as roughly 120k. Both systems are evaluated without dialogue history. The constrained canonical BART system leads in the low-data regime. With more examples, the benefit of its setup becomes less pronounced. The paper reads this as evidence for prototyping with limited supervision and observes that VACSP scores lower here than in its original, contextual evaluation.

### What the ablations show

#### Search restrictions and target wording both matter

The experimental comparisons vary two decisions. One is what the system is asked to write, either the canonical phrase or the task’s original formal expression. The other is whether the system checks each continuation against the target language. Comparing constrained and unconstrained search while keeping the target fixed addresses the contribution of the legality check. Comparing canonical and formal targets while keeping the decoding condition fixed addresses the contribution of the representation. The low-data results generally favor using both.

Care is needed in attributing the gains. In parts of Overnight, the constrained system uses a beam while its unconstrained comparison uses greedy search. A beam can maintain alternatives that greedy generation would discard, even in the absence of a grammar. The Calendar shortlist experiment uses beam search for all the target and constraint conditions, making it particularly informative for the decoding comparison. Even there, a switch in output representation entails different strings to generate and different admissibility rules. The paper compares practical versions of the two routes.

One Calendar example shows a specific effect of the grammar. The request combines a condition about importance with a condition about duration. Unconstrained generation produces a plausible phrase that explicitly calls importance a label. That wording falls outside the available canonical forms. Constrained generation uses an approved construction that expresses importance directly and still retains the duration condition. The repair is local in the wording, but it determines whether the converter can recover the intended formal query. This is the kind of error an incremental legality check is equipped to prevent.

#### What changes when the target is English-like?

The qualitative examples also include comparisons where both settings use constraints. In one Overnight request the user wants meetings that Alice did not attend. The constrained canonical response preserves the negation. The direct formal prediction uses equality where the intended test was inequality and also adds a condition about importance. It can pass the formal checks because the resulting expression is well formed. The authors suggest that preserving the word *not* may be easier for that generator than choosing the corresponding formal operator in the right place.

A Break example isolates a different semantic choice. The question compares the numbers of matte and metallic objects using *as many*. The constrained canonical prediction represents the comparison as equality between counts. Constrained prediction of the original QDMR uses a greater-than comparison. Both operations are meaningful and can be expressed legally. The example suggests that the English-like target gives the generator a way to carry the comparison in the question into the answer with less change in expression.

These cases illustrate why the two interventions can help independently. The importance example fails at the boundary between ordinary language and the converter’s accepted wording. The negation and count examples fail through a choice among meaningful legal predicates. A constraint addresses the first kind of problem directly. Changes to the target can affect the second kind by altering how explicitly the relevant distinction appears in the sequence being generated. The authors present the examples as clues about the mechanism, alongside the aggregate comparisons.

#### How much do more examples help?

Overnight’s smaller GPT-3 runs use 20 training examples in place of 200. The paper describes a modest decline in accuracy in general and points out that some domains do not follow that pattern. A small demonstration pool may still cover enough of the relevant constructions for some domains. The study reports results by domain, so a tendency across the benchmark should not be read as the same effect on every task. Break gives a different pattern: constrained canonical performance rises steadily across its tested training sizes.

SMCalFlow extends the comparison to much larger training sets. The low-data lead over VACSP shrinks as more labeled programs become available. This is consistent with the authors’ motivation for supplying domain rules explicitly when a learner has little opportunity to infer them from examples. The training-size comparison varies whole systems. It does not assign an independent share of the diminishing advantage to the pretrained decoder, to the grammar, or to the canonical representation. The paper raises the possibility of comparing a grammar used for decoding with the same grammar used to supply examples for pretraining.

The comparison between the fine-tuned generators brings another set of differences. BART performs better than GPT-2 XL on Overnight despite its smaller parameter count. The paper suggests BART’s denoising pretraining as a possible explanation. The comparison also changes the architecture and pretraining setup, so that ordering is evidence about the systems tested. It leaves open how much of the result is attributable to the denoising objective on its own.

#### How much disagreement is genuinely a parsing error?

The authors inspect 18 errors made by their best system on the Calendar subset. They judge 8 to be actual mistakes by the parser and 7 to be annotation mistakes on requests the parser understood correctly. The remaining 3 concern the strictness of an inequality. In the paper’s example, a request uses ordinary wording about meetings beginning after stated times. The annotation includes meetings beginning exactly at the boundary, while the prediction uses a strict comparison. That distinction affects the formal query, even though speakers and annotators may resolve the wording differently.

The shortlist analysis has a related result. At the reported Calendar plateau, the authors find that the remaining marked failures come from annotations they judge incorrect. The review separates errors of candidate search from questions about what the benchmark treats as the intended interpretation. The measured accuracy still reflects the reference data. Error inspection gives a more specific account of what additional supervision or a different search might be able to improve.

### Limitations

#### Limits the authors identify

The paper targets an initial parser for a domain with little labeled data. Its authors expect that systems trained with large task-specific datasets can reach stronger performance, and the SMCalFlow comparison shows the low-data advantage diminishing as training grows. The human review scenario motivates reporting shortlist accuracy. The paper measures whether a correct candidate is present and leaves the effects of real annotator interaction for future work. Time to review a suggestion, ease of inspecting it, and the quality of corrections would require a study with people doing the work.

The authors explicitly identify omitted dialogue history as a handicap on SMCalFlow. Earlier turns can supply referents or actions needed to interpret the current request. The study compares both parsers under the same omission, which helps with the question it asks about small training sets. The design limits comparison with previously published performance on the conversational task. The authors suggest that a future prompt-based system could incorporate dialogue history.

SMCalFlow also shows the limits of canonicalization. The authors describe the work of reconstructing type signatures and writing templates for an existing, complex program language. Some compositions produce awkward phrases, and more readable templates can leave aspects of interpretation implicit. Macros recover fluency for recurrent patterns. They add domain-specific choices about what to treat as a single unit. Ambiguity and shared references require heuristics even after generation has succeeded.

The authors identify concrete ways in which those heuristics can fail. A canonical phrase may have multiple derivations with different formal meanings. A typed reference can point to the wrong earlier expression during reconstruction if the first candidate of the right type differs from the original binding. The recursion bound works for the examples the paper uses. Its evidence is tied to that set of programs, and the authors report high but imperfect recovery when resolving analyses. The results thus include the cost of converting back into the original representation.

Computational cost affects some of the experimental comparisons. The authors limit unconstrained GPT-3 beam search on Overnight to Calendar and use smaller random evaluation samples for some GPT-3 runs. Prompting also has a finite context budget, so more demonstrations in the available pool do not translate directly into more examples seen on a request. These are specific conditions of the reported GPT-3 experiments.

#### Limits of the evidence from the setup

The few-shot claim concerns labeled examples of how users phrase requests. It rests on additional knowledge about the domain’s output. Overnight supplies a ready-made inventory of canonical forms and their queries. Break provides a restricted decomposition language that can be recast by a reversible transformation. SMCalFlow requires a new grammar and intermediate notation, with validation examples used in development. The experiments show what a small set of labeled pairs can do given those resources. They leave the effort of constructing comparable resources for a new application unmeasured.

Coverage also differs from validity. A trie can recognize the forms in the depth-limited inventory it stores. A grammar can recognize strings allowed by its rules. A vocabulary and parentheses check can recognize the properties it encodes. Each kind of constraint can eliminate some invalid predictions, and each has a different boundary. A well-formed sequence can still pick the wrong operation, omit a condition, or compose the right pieces into the wrong interpretation. If the desired form lies outside the supported language, the constraint can exclude it regardless of how clearly the user expressed it.

SMCalFlow’s stratified training sets illustrate a particular approach to working with few annotations. The selection uses function labels from a large annotated corpus and guarantees coverage of the functions retained after filtering. This is a reasonable simulation of deliberate example collection by someone who knows the application. The result is most directly applicable to that coverage regime. A small dataset sampled from incoming requests can contain different mixtures of functions, and the study gives no corresponding guarantee for rare functions excluded from the sampling procedure.

The comparisons across tasks use different scoring rules. A query can return the correct denotation on the Overnight database even when some aspect of the program differs from the intended semantics. Break normalization accepts variations handled by its canonicalization and can reject other decompositions whose equivalence falls outside that process. Scoring the original program on SMCalFlow makes reconstruction part of the measured task. The common directional results support the approach across these settings, while the absolute scores refer to different notions of correctness.

Finally, all of the case studies start with English inputs. The English surface form of the intermediate language is central to the design tested here. The experiments support an approach that exploits the generator’s familiarity with that language under the tasks studied. They leave language transfer and the choice of an appropriate canonical language for other settings open. The evaluation likewise leaves everyday deployment conditions, such as sustained corrections to the grammar and changes in the application’s supported operations, outside the measured scope.

### What came after

#### Demonstration selection became a subject of its own

The paper’s GPT-3 system retrieves demonstrations anew for each request using the probability of that request given a training utterance. [Learning To Retrieve Prompts for In-Context Learning](https://md.research.elamur.ai/free/en/papers/rubin-2021-learning-retrieve-prompts-context-learning/) addresses prompt retrieval as a learning problem. The connection is the choice of which examples enter the prompt. In the semantic parsing paper, that choice helps a generator infer what kind of rewrite or formal output a particular input calls for. A study focused on learning retrieval puts that choice itself at the center of the task.

Other citing work examines the same broad decision in different applications. [In-Context Learning for Few-Shot Dialogue State Tracking](https://md.research.elamur.ai/free/en/papers/hu-2022-context-learning-few-shot-dialogue/) brings example-based prompting to dialogue state tracking. Its subject connects few-shot prompting with structured interpretation in dialogue, an area the original paper studies through isolated SMCalFlow turns. [GPT-RE](https://md.research.elamur.ai/free/en/papers/wan-2023-gpt-re-context-learning-relation/) examines in-context learning for relation extraction. That setting shares the need to express a decision drawn from natural text in a task-defined form. The relationship here is through the use of demonstrations for structured prediction. The citations alone establish no reuse of the original grammar or prompt-ranking rule.

#### Few-shot parsing was examined with different pretraining and inputs

[Few-Shot Semantic Parsing with Language Models Trained on Code](https://md.research.elamur.ai/free/en/papers/shin-2022-few-shot-semantic-parsing-language/) returns to the original task with generators pretrained on code. The change bears directly on the original motivation for canonical English. A target’s suitability depends in part on what kind of text the generator has learned to produce. Code pretraining makes the relationship between familiar notation and useful output representations a question to investigate within few-shot parsing itself.

[Zero and Few-shot Semantic Parsing with Ambiguous Inputs](https://md.research.elamur.ai/free/en/papers/stengel-eskin-2023-zero-few-shot-semantic-parsing/) focuses on ambiguity in what users say. In the original paper, ambiguity appears both when converting a canonical phrase and when judging whether a reference captured a user’s intent. Several legal interpretations can survive a grammar constraint. The later work’s focus brings that uncertainty in the input to the foreground, where the issue is how a parser handles multiple plausible meanings under limited supervision.

#### Output structure and legality became separate objects of study

[UnifiedSKG](https://md.research.elamur.ai/free/en/papers/xie-2022-unifiedskg-unifying-multi-tasking-structured/) studies structured knowledge grounding in a unified, multitask text-to-text setting. It shares the broader move of expressing structured tasks as text inputs and outputs. The original paper studies the choice of output wording within particular semantic parsing tasks. The later work’s stated scope shifts attention towards what can be shared across structured tasks when they are presented in a common form.

[JSONSchemaBench](https://md.research.elamur.ai/free/en/papers/geng-2025-jsonschemabench-rigorous-benchmark-structured-outputs/) makes structured output a benchmark subject. A JSON schema and a controlled English grammar specify different kinds of output, but both offer a way to ask whether a generator respects a defined set of admissible strings. That question is distinct from whether a particular admissible string means what the user intended. The semantic parsing experiments make the distinction concrete through the separation between `nextTokens` and benchmark accuracy.

[Prefix Parsing is Just Parsing](https://md.research.elamur.ai/free/en/papers/pasti-2026-prefix-parsing-is-just-parsing/) addresses the parsing problem at the center of incremental legality checks. In the semantic parser, a partially generated string has to be tested for possible continuation before a complete answer exists. The later work’s subject connects to that operation whatever the application’s output language. Across these citing works, the documented connections concern prompt retrieval, structured prediction, ambiguity, and the treatment of valid prefixes. Each was already a distinct decision in the original parser, where demonstrations guide interpretation and the grammar determines which proposed expressions remain available to search.

## Cite

Cite as Richard Shin, Christopher Lin, Sam Thomson, Charles Chen, Subhro Roy, Emmanouil Antonios Platanios, Adam Pauls, Dan Klein, Jason Eisner and Benjamin Van Durme. 2021. Constrained Language Models Yield Few-Shot Semantic Parsers. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2021.emnlp-main.608](https://doi.org/10.18653/v1/2021.emnlp-main.608) · [arXiv 2104.08768](https://arxiv.org/abs/2104.08768)

```bibtex
@inproceedings{shin2021constrained,
  title = {{Constrained Language Models Yield Few-Shot Semantic Parsers}},
  author = {Richard Shin, Christopher Lin, Sam Thomson, Charles Chen, Subhro Roy, Emmanouil Antonios Platanios, Adam Pauls, Dan Klein, Jason Eisner and Benjamin {Van Durme}},
  booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing},
  year = {2021},
  doi = {10.18653/v1/2021.emnlp-main.608},
  eprint = {2104.08768},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2021.emnlp-main.608}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
