From Paraphrasing to Semantic Parsing: Unsupervised Semantic Parsing via Synchronous Semantic Decoding (2021)

Abstract: Semantic parsing is challenging due to the structure gap and the semantic gap between utterances and logical forms. In this paper, we propose an unsupervised semantic parsing method - Synchronous Semantic Decoding (SSD), which can simultaneously resolve the semantic gap and the structure gap by jointly leveraging paraphrasing and grammar-constrained decoding. Specifically, we reformulate semantic parsing as a constrained paraphrasing problem: given an utterance, our model synchronously generates its canonical utterancel and meaning representation. During synchronously decoding: the utterance paraphrasing is constrained by the structure of the logical form, therefore the canonical utterance can be paraphrased controlledly; the semantic decoding is guided by the semantics of the canonical utterance, therefore its logical form can be generated unsupervisedly. Experimental results show that SSD is a promising approach and can achieve state-of-the-art unsupervised semantic parsing performance on multiple datasets.

## introduction semantic parsing aims to translate natural language utterances to their formal meaning representations, such as lambda calculus @xcite , funql @xcite , and sql queries. currently, most neural semantic parsers @xcite @xcite dicated by gray lines), our method generates canonical utterance and logical form synchronously. the semantic gap and the structure gap are simultaneously resolved by jointly leveraging paraphrasing and grammar-constrained decoding. thus, our synchronous decoding employs both the semantic and the structure constraints to solve unsupervised semantic parsing. semantic parsing is a challenging task due to the structure gap and the semantic gap between natural language utterances and logical forms. for structure gap, because utterances are usually word sequences and logical forms are usually trees/graphs constrained by specific grammars, a semantic parser needs to learn the complex structure transformation rules between them. for semantic gap, because the flexibility of natural languages, the same meaning can be expressed using very different utterances, a semantic parser needs be able to map various expressions to their semantic form. to address the structure gap and the semantic gap, current semantic parsers usually rely on a large amount of labeled data, often resulting in data bottleneck problem. previous studies have found that the structure gap and the semantic gap can be alleviated by leveraging external resources, therefore the reliance on data can be reduced. for structure gap, previous studies found that constrained decoding can effectively constrain the output structure by injecting grammars of logical forms and facts in knowledge bases during inference. for example, the grammar-based neural semantic parsers @xcite and the constrained decoding algorithm @xcite . for semantic gap, previous studies have found that paraphrasing is an effective technique for resolving the diversity of natural expressions. using paraphrasing, semantic parsers can handle the different expressions of the same meaning, therefore can reduce the requirement of labeled data. for example, supervised methods @xcite use the paraphrasing scores between canonical utterances and sentences to re-rank logical forms; two-stage @xcite rewrites utterances to canonical utterances which can be easily parsed. the main drawback of these studies is that they use constrained decoding and paraphrasing independently and separately, therefore they can only alleviate either semantic gap or structure gap. in this paper, we propose an unsupervised semantic parsing method -synchronous semantic decoding (ssd), which can simultaneously resolve the structure gap and the semantic gap by jointly leveraging paraphrasing and grammarconstrained decoding. specifically, we model semantic parsing as a constrained paraphrasing task: given an utterance, we synchronously decode its canonical utterance and its logical form using a general paraphrase model, where the canonical utterance and the logical form share the same underlying structure. based on the synchronous decoding, the canonical utterance generation can be constrained by the structure of logical form, and the logical form generation can be guided by the semantics of canonical form. by modeling the interdependency between canonical utterance and logical form, and exploiting them through synchronous decoding, our method can perform effective unsupervised semantic parsing using only pretrained general paraphrasing model -no annotated data for semantic parsing is needed. we conduct experiments on geo and overnight. experimental results show that our method is promising, which can achieve competitive unsupervised semantic parsing performance, and can be further improved with external resources. the main contributions of this paper are: ## model overview we now present overview of our synchronous semantic decoding algorithm, which can jointly leverage paraphrasing and grammar-constrained decoding for unsupervised semantic parsing. given an utterance, ssd reformulates semantic parsing as a constrained paraphrasing problem, and synchronously generates its canonical utterance and logical form. for example in fig. 2 , given "how many rivers run through texas", ssd generates "what is the number of river traverse state0" as its canonical form and answer(count(river(traverse 2( state0)))) as its logical form. during synchronous decoding: the utterance paraphrase generation is constrained by the grammar of logical forms, therefore the canonical utterance can be generated controlledly; the logical form is generated synchronously with the canonical utterance via synchronous grammar. logical form generation is controlled by the semantic constraints from paraphrasing and structure constraints from grammars and database schemas. therefore the logical form can be generated unsupervisedly. to this end, ssd needs to address two challenges. firstly, we need to design paraphrasingbased decoding algorithms which can effectively impose grammar constraints on inference. secondly, current paraphrasing models are trained on natural language sentences, which are different from the unnatural canonical utterances. therefore ssd needs to resolve this style bias for effective canonical utterance generation. figure 2: overview of our approach. the sentence is paraphrased to canonical utterance and parsed to logical form synchronously. when decoding "traverse", the paraphrase model tends to generate the words such as "run", "flow", "traverse" to preserve semantics. and synchronous grammar limits the next words of the canonical utterance to follow the candidate production rules. then it is easy to discard "run" and "flow", and select the most likely word "traverse" with its production rule from the candidates. in this parper, we propose rule-level and word-level inference methods to decode words and production rules synchronously. ## synchronous semantic decoding given an utterance x, we turn semantic parsing into a constrained paraphrasing task. concretely, we use synchronous context-free grammar as our synchronous grammar, which provides a one-to-one mapping from a logical form y to its canonical utterance c y . the parsing task ŷ = arg max @xmath0. instead of directly parsing utterance into its logical form, ssd generates its canonical utterance and obtains its logical form based on the one-to-one mapping relation. in following we first introduce the grammar constraints in decoding, and then present two inference algorithms for generating paraphrases under the grammar constraints. ## adaptive fine-tuning the above decoding algorithms only rely on a paraphrase generation model , which generates canonical utterance and logical form synchronously for semantic parsing. we can directly use general paraphrase generation models such as gpt-2 @xcite , t5 @xcite for ssd. however, as described in above, there exists a style bias between natural language sentences and canonical utterances, which hurts the performance of unsupervised semantic par-ing. in this section, we describe how to alleviate this bias via adaptive fine-tuning. given a text generation model, after pretraining it using paraphrase corpus, we fine-tune it using synthesized sentence, canonical utterance pairs. previous studies have shown that the pretraining on synthesized data can significantly improve the performance of semantic parsing @xcite @xcite . specifically, we design three data synthesis algorithms: 1) cus we sample cus from scfgs, and preserve executable ones. as we do not have the paired sentences, we only fine-tune the language model of the plms on cus. ## utterance reranking adaptive fine-tuning resolves the style bias problem by fitting a better paraphrase model. in this section, we propose an utterance reranking algorithm to further alleviate the style bias by reranking and selecting the best canonical form. given the utterance x and top-n parsing results (y n , c n ), @xmath1, 2, ..., n , we rerank all candidates by focusing on semantic similarities between x and c n , so that canonical utterances can be effectively selected. reranking for semantic parsing has been exploited in many previous studies @xcite . these works employ reranking for canonical utterances selection. differently, our re-ranker does not need labeled data. formally, we measure two similarities between x and c n and the final reranking score is calculated by: reconstruction score the reconstruction score measures the coherence and adequacy of the canonical utterances, using the probability of reproducing the original input sentence x from c with the trained paraphrasing model: association score the association score measures whether x and c contain words that are likely to be paraphrases. we calculate it as: overnight this is a multi-domain dataset, which contains natural language paraphrases paired with lambda dcs logical forms across eight domains. we use the same train/test splits as @xcite . geo(funql) this is a semantic parsing benchmark about u.s. geography @xcite using the variable-free semantic representation funql @xcite . we extend the funql grammar to scfg for this dataset. we follow the standard 600/280 train/test splits. geogranno this is another version of geo @xcite , in which lambda dcs logical forms paired with canonical utterances are produced from scfg. instead of paraphrasing sentences, crowd workers are required to select the correct canonical utterance from candidate list. we follow the split (train/valid/test 487/59/278) in original paper. ## conclusions we propose an unsupervised semantic parsing method -synchronous semantic decoding, which leverages paraphrasing and grammar-constrained decoding to simultaneously resolve the semantic gap and the structure gap. specifically, we design two synchronous semantic decoding algorithms for paraphrasing under grammar constraints, and exploit adaptive fine-tuning and utterance reranking to alleviate the style bias in semantic parsing. experimental results show that our approach can achieve competitive performance in unsupervised settings. with adaptive fine-tuning (case 3), our model can generate the utterances focusing more on semantics to alleviate the style bias.