Compositional Semantic Parsing with Large Language Models

Humans can reason compositionally when presented with new tasks. Previous research shows that appropriate prompting techniques enable large language models (LLMs) to solve artificial compositional generalization tasks such as SCAN. In this work, we identify additional challenges in more realistic semantic parsing tasks with larger vocabulary and refine these prompting techniques to address them. Our best method is based on least-to-most prompting: it decomposes the problem using prompting-based syntactic parsing, then uses this decomposition to select appropriate exemplars and to sequentially generate the semantic parse. This method allows us to set a new state of the art for CFQ while requiring only 1% of the training data used by traditional approaches. Due to the general nature of our approach, we expect similar efforts will lead to new results in other tasks and domains, especially for knowledge-intensive applications.

[1]  J. Dean,et al.  Emergent Abilities of Large Language Models , 2022, ArXiv.

[2]  Weizhu Chen,et al.  On the Advance of Making Language Models Better Reasoners , 2022, ArXiv.

[3]  Kristina Toutanova,et al.  Evaluating the Impact of Model Scale for Compositional Generalization in Semantic Parsing , 2022, ArXiv.

[4]  S. Gu,et al.  Large Language Models are Zero-Shot Reasoners , 2022, ArXiv.

[5]  D. Schuurmans,et al.  Least-to-Most Prompting Enables Complex Reasoning in Large Language Models , 2022, International Conference on Learning Representations.

[6]  Haoming Jiang,et al.  SeqZero: Few-shot Compositional Semantic Parsing with Sequential Prompts and Zero-shot Models , 2022, NAACL-HLT.

[7]  Xinyun Chen,et al.  Measuring and Improving Compositional Generalization in Text-to-SQL via Component Alignment , 2022, NAACL-HLT.

[8]  Sida I. Wang,et al.  Natural Language to Code Translation with Execution , 2022, ArXiv.

[9]  Andrew M. Dai,et al.  PaLM: Scaling Language Modeling with Pathways , 2022, J. Mach. Learn. Res..

[10]  S. Levine,et al.  Do As I Can, Not As I Say: Grounding Language in Robotic Affordances , 2022, CoRL.

[11]  Noah D. Goodman,et al.  STaR: Bootstrapping Reasoning With Reasoning , 2022, 2203.14465.

[12]  D. Schuurmans,et al.  Self-Consistency Improves Chain of Thought Reasoning in Language Models , 2022, ArXiv.

[13]  Ryan J. Lowe,et al.  Training language models to follow instructions with human feedback , 2022, NeurIPS.

[14]  Dale Schuurmans,et al.  Chain of Thought Prompting Elicits Reasoning in Large Language Models , 2022, ArXiv.

[15]  Benjamin Van Durme,et al.  Few-Shot Semantic Parsing with Language Models Trained on Code , 2021, NAACL.

[16]  Pawel Krzysztof Nowak,et al.  Improving Compositional Generalization with Latent Structure and Data Augmentation , 2021, NAACL.

[17]  Dawn Song,et al.  Grounded Graph Decoding Improves Compositional Generalization in Question Answering , 2021, EMNLP.

[18]  Yoon Kim,et al.  Sequence-to-Sequence Learning with Latent Neural Grammars , 2021, NeurIPS.

[19]  Dongmei Zhang,et al.  Learning Algebraic Recombination for Compositional Generalization , 2021, FINDINGS.

[20]  Kenny Smith,et al.  Meta-Learning to Compositionally Generalize , 2021, ACL.

[21]  Jacob Andreas,et al.  Lexicon Learning for Few Shot Sequence Modeling , 2021, ACL.

[22]  Jacob Andreas,et al.  Compositional Generalization for Neural Semantic Parsing via Span-level Supervised Attention , 2021, NAACL.

[23]  Dan Klein,et al.  Constrained Language Models Yield Few-Shot Semantic Parsers , 2021, EMNLP.

[24]  Ming-Wei Chang,et al.  Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representations , 2021, ArXiv.

[25]  Colin Raffel,et al.  Extracting Training Data from Large Language Models , 2020, USENIX Security Symposium.

[26]  Ming-Wei Chang,et al.  Compositional Generalization and Natural Language Variation: Can a Semantic Parsing Approach Handle Both? , 2020, ACL.

[27]  Jacob Andreas,et al.  Learning to Recombine and Resample Data for Compositional Generalization , 2020, ICLR.

[28]  Jonathan Berant,et al.  Span-based Semantic Parsing for Compositional Generalization , 2020, ACL.

[29]  László Dezsö,et al.  Universal Grammar , 1981, Certainty in Action.

[30]  Dongmei Zhang,et al.  Hierarchical Poset Decoding for Compositional Generalization in Language , 2020, NeurIPS.

[31]  Tal Linzen,et al.  COGS: A Compositional Generalization Challenge Based on Semantic Interpretation , 2020, EMNLP.

[32]  Chen Liang,et al.  Compositional Generalization via Neural-Symbolic Stack Machines , 2020, NeurIPS.

[33]  Marc van Zee,et al.  Compositional Generalization in Semantic Parsing: Pre-training vs. Specialized Architectures , 2020, ArXiv.

[34]  Qian Liu,et al.  Compositional Generalization by Learning Analytical Expressions , 2020, NeurIPS.

[35]  Mark Chen,et al.  Language Models are Few-Shot Learners , 2020, NeurIPS.

[36]  David Lopez-Paz,et al.  Permutation Equivariant Models for Compositional Generalization in Language , 2020, ICLR.

[37]  Armando Solar-Lezama,et al.  Learning Compositional Rules via Neural Program Synthesis , 2020, NeurIPS.

[38]  B. Lake,et al.  A Benchmark for Systematic Generalization in Grounded Language Understanding , 2020, NeurIPS.

[39]  Xiao Wang,et al.  Measuring Compositional Generalization: A Comprehensive Method on Realistic Data , 2019, ICLR.

[40]  Ankur P. Parikh,et al.  Thieves on Sesame Street! Model Extraction of BERT-based APIs , 2019, ICLR.

[41]  Jacob Andreas,et al.  Good-Enough Compositional Data Augmentation , 2019, ACL.

[42]  Yoshua Bengio,et al.  CLOSURE: Assessing Systematic Generalization of CLEVR Models , 2019, ViGIL@NeurIPS.

[43]  Liang Zhao,et al.  Compositional Generalization for Primitive Substitutions , 2019, EMNLP.

[44]  Matthew Lamm,et al.  Compositional Generalization in Image Captioning , 2019, CoNLL.

[45]  Brenden M. Lake,et al.  Compositional generalization through meta sequence-to-sequence learning , 2019, NeurIPS.

[46]  Yoshua Bengio,et al.  Compositional generalization in a deep seq2seq model by separating syntax and semantics , 2019, ArXiv.

[47]  Marco Baroni,et al.  Rearranging the Familiar: Testing Compositional Generalization in Recurrent Networks , 2018, BlackboxNLP@EMNLP.

[48]  Marco Baroni,et al.  Generalization without Systematicity: On the Compositional Skills of Sequence-to-Sequence Recurrent Networks , 2017, ICML.

[49]  Li Fei-Fei,et al.  CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning , 2016, 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR).

[50]  Joshua B. Tenenbaum,et al.  Building machines that learn and think like people , 2016, Behavioral and Brain Sciences.

[51]  Raymond J. Mooney,et al.  Learning Synchronous Grammars for Semantic Parsing with Lambda Calculus , 2007, ACL.

[52]  Ernest Lepore,et al.  The compositionality papers , 2002 .

[53]  Stuart M. Shieber,et al.  An Introduction to Unification-Based Approaches to Grammar , 1986, CSLI Lecture Notes.