Diverse Demonstrations Improve In-context Compositional Generalization

Itay Levy, Ben Bogin, Jonathan Berant
12/13/2022
cs.CL

Official code: itayle/diverse-demonstrations (13 stars, Python, last commit 2023-07-07).

Abstract

In-context learning has shown great success in i.i.d semantic parsing splits, where the training and test sets are drawn from the same distribution. In this setup, models are typically prompted with demonstrations that are similar to the input utterance.

Show full abstract

However, in the setup of compositional generalization, where models are tested on outputs with structures that are absent from the training set, selecting similar demonstrations is insufficient, as often no example will be similar enough to the input. In this work, we propose a method to select diverse demonstrations that aims to collectively cover all of the structures required in the output program, in order to encourage the model to generalize to new structures from these demonstrations. We empirically show that combining diverse demonstrations with in-context learning substantially improves performance across three compositional generalization semantic parsing datasets in the pure in-context learning setup and when combined with finetuning.

View on arXivView PDF

Code Implementations(1)

Diverse Demonstrations Improve In-context Compositional Generalization

131Python, JsonnetDec 12, 20223 years ago
compositional-generalizationin-context-learningnlpretrieval-augmentedsemantic-parsing

Similar Papers

Cite this paper

@article{levy2022diverse,
  title  = {Diverse Demonstrations Improve In-context Compositional Generalization},
  author = {Itay Levy and Ben Bogin and Jonathan Berant},
  year   = {2022},
  eprint = {2212.06800},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2212.06800}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2212.06800.svg)](https://codeofpaper.com/paper/2212.06800)

Discussion