Inducing Systematicity in Transformers by Attending to Structurally Quantized Embeddings
Yichen Jiang, Xiang Zhou, Mohit Bansal
Abstract
Transformers generalize to novel compositions of structures and entities after being trained on a complex dataset, but easily overfit on datasets of insufficient complexity. We observe that when the training set is sufficiently complex, the model encodes structurally equivalent sentences using a systematic attention pattern. Inspired by this observation, we propose SQ-Transformer (Structurally Quantized) that explicitly encourages systematicity in the embeddings and attention layers even with lowcomplexity data. At the embedding level, we introduce Structure-oriented Vector Quantization (SoVQ) to cluster word embeddings into several classes of structurally equivalent entities. At the attention level, we devise the Systematic Attention Layer (SAL) and an alternative, Systematically Regularized Layer (SRL) that operate on the quantized word embeddings so that sentences of the same structure are encoded with invariant or similar attention patterns. Empirically, we show SQ-Transformer achieves stronger compositional generalization than the vanilla Transformer on multiple low-complexity semantic parsing and machine translation datasets. In our analysis, we show SoVQ indeed learns a syntactically clustered embedding space, and SAL/SRL induces generalizable attention patterns, altogether leading to improved systematicity. 1
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f0009392-7a84-4052-8ce8-ff448efdba29Builds on23
- Zero-Shot Text-to-Image GenerationAditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray et al.ICML 2021 · 6,356 citations
- Measuring Compositional Generalization: A Comprehensive Method on Realistic DataDaniel Keysers, Nathanael Schärli, Nathan Scales, Hylke Buisman et al.ICLR 2020 · 401 citations
- COGS: A Compositional Generalization Challenge Based on Semantic InterpretationNajoung Kim, Tal LinzenEMNLP 2020 · 149 citations
- Permutation Equivariant Models for Compositional Generalization in LanguageJonathan Gordon, David Lopez-Paz, Marco Baroni, Diane BouchacourtICLR 2020 · 112 citations
- Compositional Generalization in Unsupervised Compositional Representation Learning: A Study on Disentanglement and Emergent LanguageZhenlin Xu, Marc Niethammer, Colin RaffelNeurIPS 2022 · 59 citations
Related papers
- Consistency Regularization Training for Compositional GeneralizationYongjing Yin, Jiali Zeng, Yafu Li, Fandong Meng et al.ACL 2023 · 5 citations
- Strengthening Structural Inductive Biases by Pre-training to Perform Syntactic TransformationsMatthias Lindemann, Alexander Koller, Ivan TitovEMNLP 2024
- *-CFQ: Analyzing the Scalability of Machine Learning on a Compositional TaskDmitry Tsarkov, Tibor Tihon, Nathan Scales, Nikola Momchev et al.AAAI 2021 · 10 citations
- Making Transformers Solve Compositional TasksSantiago Ontañón, Joshua Ainslie, Zachary Fisher, Vaclav CvicekACL 2022 · 87 citations
- SiT: Symmetry-invariant Transformers for Generalisation in Reinforcement LearningMatthias Weissenbacher, Rishabh Agarwal, Yoshinobu KawaharaICML 2024 · 3 citations
