Diverse Demonstrations Improve In-context Compositional Generalization

Itay Levy, Ben Bogin, Jonathan Berant


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. 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.
Anthology ID:
2023.acl-long.78
Volume:
Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anna Rogers, Jordan Boyd-Graber, Naoaki Okazaki
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
1401–1422
Language:
URL:
https://aclanthology.org/2023.acl-long.78
DOI:
10.18653/v1/2023.acl-long.78
Bibkey:
Cite (ACL):
Itay Levy, Ben Bogin, and Jonathan Berant. 2023. Diverse Demonstrations Improve In-context Compositional Generalization. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1401–1422, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
Diverse Demonstrations Improve In-context Compositional Generalization (Levy et al., ACL 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.acl-long.78.pdf
Video:
 https://aclanthology.org/2023.acl-long.78.mp4