Can Constructions "SCAN" Compositionality ?

Ganesh Katrapati, Manish ShrivastavaarXiv 2025 · DOI

Abstract

Standard Sequence-to-Sequence (Seq2Seq) models, including Transformers, often struggle with systematic generalization—the ability to interpret novel combinations of known components. This paper demonstrates that preprocessing training data into "pseudo-constructions" (variable-slot templates) allows vanilla Transformers to achieve significant accuracy gains on the challenging SCAN benchmark. By mining these templates in an unsupervised manner, the proposed method bridges the gap between neural architectures and compositional reasoning without requiring specialized model modifications.

Introduction

While modern AI models excel at pattern recognition, they notoriously fail at compositionality. In human language, understanding "run" and "twice" implies an immediate understanding of "run twice." However, models trained on the SCAN dataset—which maps navigation commands to action sequences—often crash when encountering unseen combinations, such as "jump twice" if "jump" was only seen in isolation. Previous attempts to solve this have relied on complex architectural changes or massive data augmentation. This research explores whether teaching models to recognize linguistic "constructions" through data preprocessing can solve this fundamental limitation.

Methodology

Inspired by Construction Grammar (CxG), the authors view language as a collection of pairings between form and meaning, ranging from specific words to abstract templates with open slots (e.g., "the [Noun]er the [Noun]er"). They implement an unsupervised pipeline to mine pseudo-constructions:

  1. Candidate Extraction: Spans of up to 4 tokens are extracted from training data, and templates are created by replacing words with slots (e.g., look _ left).
  2. Alignment Distance: A "misalignment score" is calculated to ensure templates are functional. A good template should have a consistent mapping to target action sequences regardless of the slot filler.
  3. Beam Decoding: Training and test sentences are segmented into the highest-scoring sequence of these pseudo-constructions using beam search.
  4. Training: A standard Transformer (JoeyNMT) is trained on this segmented data, where the model processes tokens representing templates and their fillers rather than raw text.

Experimental Setup

The approach was evaluated on the SCAN dataset, focusing on two difficult "out-of-distribution" splits:

  • ADD JUMP: The model sees "jump" only as a single command during training but must execute it in complex compositions (e.g., "jump around right") at test time.
  • AROUND RIGHT: The model sees "around" and "right" in various contexts but must generalize to the specific "around right" combination.

Key Results and Discussion

The pseudo-construction approach yielded dramatic improvements over baseline Transformers. In the ADD JUMP split, accuracy reached 47.8%, a significant leap from the near-zero performance of standard models. In the AROUND RIGHT split, accuracy reached 20.7%, representing a major advancement for one of the benchmark's most difficult tasks.

Accuracy vs. Samples per Sentence Type on SCAN Splits

Data Efficiency and Scaling

A critical insight from the study is the method's data efficiency. As shown in the performance metrics below, the model achieves competitive results with very few samples per sentence type ($k$). For instance, in the ADD JUMP split, the model reached ~40% accuracy using only 39% of the training data ($k=10$). This suggests that once a construction is learned, the model does not require exhaustive repetition to master the pattern.

Detailed performance metrics across different data splits and sample sizes

Conclusion

This research highlights that systematic generalization may be more a matter of data representation than model architecture. By exposing the template-like nature of language during preprocessing, vanilla Transformers can effectively learn compositional rules.

However, the authors note limitations such as semantic blurring, where the unsupervised mining process might mask critical words (e.g., confusing "turn" and "walk"), leading to errors. Future work will focus on more robust construction mining and testing the approach on natural, non-synthetic datasets.

Summary updated

BibTeX
@misc{katrapati2025can,
  author = {Ganesh Katrapati and Manish Shrivastava},
  title = {{Can Constructions "SCAN" Compositionality ?}},
  year = {2025},
  eprint = {2509.20074},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.20074},
}
Figure