Simple and effective data augmentation for compositional generalization

Yuekun Yao, Alexander Koller

Abstract

Data augmentation for semantic parsing is highly effective for compositional generalization—the ability to understand complex sentences after seeing only simple ones—provided the sampling distribution is chosen correctly. This research demonstrates that sampling meaning representations (MRs) from a uniform distribution performs nearly as well as an oracle view of the test set, significantly outperforming traditional methods that sample from the training distribution.

Introduction: The Challenge of Compositional Generalization

Modern neural models, such as T5 or BART, excel at mapping natural language to meaning when test data mirrors training data. However, they frequently fail at compositional generalization. For instance, a model trained on "The cat chased the dog" and "The bird flew" may struggle to parse "The cat that the bird saw chased the dog."

The core issue is a distribution shift: training sets are often "shallow" or simple, while test sets are designed to be "deep" or complex. Traditional data augmentation techniques that generate data based on the training distribution merely reinforce the model's existing limitations.

Methodology

The authors propose a streamlined two-step pipeline for data augmentation:

  1. Grammar-based Sampling: A Context-Free Grammar (CFG) is defined for the formal meaning representations (MRs) of a dataset.
  2. Backtranslation: A model is trained to translate these formal MRs back into natural language.
Overview of the data augmentation pipeline comparing different sampling distributions.

The investigation centers on the probability distribution used to sample MRs. Three approaches are compared:

  • $P_{train}$: Probabilities estimated from the training set.
  • $P_{test}$: Probabilities estimated from the test set (an "upper bound" oracle).
  • $P_{uniform}$: Every rule in the grammar is assigned equal weight.

By employing $P_{uniform}$, the system naturally generates a diverse array of complex, recursive structures that are mathematically possible but rarely seen in the training data.

Comparison between synchronous grammar and the proposed MR grammar with backtranslation.

Unlike previous methods requiring complex "synchronous grammars" to maintain alignment between language and meaning, this approach only requires a grammar for the MR side, leveraging backtranslation to generate the corresponding natural language.

Evaluation and Results

The approach was evaluated on four benchmarks: COGS, CFQ, GeoQuery, and SCAN.

  • COGS: The baseline T5 model scored 91.0%. Augmentation with $P_{train}$ yielded 92.9%, while $P_{uniform}$ reached 95.9%, approaching the oracle $P_{test}$ (99.3%).
  • GeoQuery: On the "length" split, $P_{uniform}$ achieved 60.4% execution accuracy, slightly outperforming the oracle $P_{test}$ (60.1%) and significantly exceeding the baseline (50.5%).
  • SCAN: On the "length" split, both $P_{uniform}$ and $P_{test}$ achieved 60.5% accuracy, compared to just 8.1% for $P_{train}$ augmentation.

Key Insights

  • The Training Distribution Bottleneck: Sampling from $P_{train}$ fails to produce the "unseen local structures" (e.g., deep recursion) necessary for compositional generalization.
  • Uniformity as a Proxy for Complexity: A uniform grammar does not favor simple structures, resulting in a higher volume of complex, deep structures by default.
  • Perplexity Analysis: $P_{uniform}$ assigns much lower perplexity to test-set MRs than $P_{train}$, making difficult test cases more predictable for the model.

Conclusion and Future Work

While effective, the method requires a CFG for the meaning representation, which may involve manual effort for new domains. Additionally, the backtranslation model—trained on simple data—can produce noisy natural language for complex MRs, though parsers appear robust to this noise. Future research should explore these techniques on more naturalistic datasets.

Summary updated

BibTeX
@inproceedings{yao2024simple,
  author = {Yuekun Yao and Alexander Koller},
  title = {{Simple and effective data augmentation for compositional generalization}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.25},
}
Figure