Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representations

Jonathan Herzig, Peter Shaw, Ming-Wei Chang, Kelvin Guu, Panupong Pasupat +1 more
4/15/2021
73 citations
cs.CL

Official code: google-research/language (1,828 stars, Python, Apache-2.0, last commit 2026-04-21).

Abstract

Sequence-to-sequence (seq2seq) models are prevalent in semantic parsing, but have been found to struggle at out-of-distribution compositional generalization. While specialized model architectures and pre-training of seq2seq models have been proposed to address this issue, the former often comes at the cost of generality and the latter only shows limited success.

Show full abstract

In this paper, we study the impact of intermediate representations on compositional generalization in pre-trained seq2seq models, without changing the model architecture at all, and identify key aspects for designing effective representations. Instead of training to directly map natural language to an executable form, we map to a reversible or lossy intermediate representation that has stronger structural correspondence with natural language. The combination of our proposed intermediate representations and pre-trained models is surprisingly effective, where the best combinations obtain a new state-of-the-art on CFQ (+14.8 accuracy points) and on the template-splits of three text-to-SQL datasets (+15.0 to +19.4 accuracy points). This work highlights that intermediate representations provide an important and potentially overlooked degree of freedom for improving the compositional generalization abilities of pre-trained seq2seq models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Shared repository for open-sourced projects from the Google AI Language team.

1,828363Python, Jupyter NotebookOct 16, 20187 months agoApache-2.0
machine-learningnatural-language-processingresearch

Similar Papers

Cite this paper

@article{herzig2021unlocking,
  title  = {Unlocking Compositional Generalization in Pre-trained Models Using Intermediate Representations},
  author = {Jonathan Herzig and Peter Shaw and Ming-Wei Chang and Kelvin Guu and Panupong Pasupat and Yuan Zhang},
  year   = {2021},
  eprint = {2104.07478},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.07478}
}

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/2104.07478.svg)](https://codeofpaper.com/paper/2104.07478)

Discussion