Compositional Generalization without Trees using Multiset Tagging and Latent Permutations

Matthias Lindemann, Alexander Koller, Ivan Titov

Modern Natural Language Processing (NLP) models are remarkably adept at pattern recognition but frequently stumble when required to combine known concepts in novel ways—a capability known as compositional generalization. For instance, a model might understand "A knew B" and "B knew C" but fail to parse a sentence with multiple levels of recursion ("Paul said that Mary knew that Jim slept") if such depth was absent from its training data.

Presented at ACL 2023, this research introduces a novel "tag-and-permute" framework that achieves state-of-the-art compositional generalization without the computational overhead or domain-specific requirements of traditional tree-based models.

The Challenge: Beyond Sequence-to-Sequence

Standard sequence-to-sequence (seq2seq) models, including Transformers and LSTMs, often struggle with "unseen compositions." While tree-based models (like Synchronous Context-Free Grammars) provide a strong inductive bias for such structures, they are notoriously difficult to train and scale. This paper explores whether structural generalization can be achieved without explicit tree structures.

The Tag-and-Permute Approach

The proposed model decomposes semantic parsing into two end-to-end trainable stages:

  1. Multiset Tagging: Instead of predicting an ordered sequence, the model predicts a "multiset" (a set allowing duplicates) of output tokens for each input word. For example, the word "slept" might be tagged with {sleep, agent, x1}. This step decouples the semantic content from its eventual position in the output string.
  2. Latent Permutations: The model then determines the optimal sequence by solving a "jump" problem—deciding which token should follow the current one.
The Tag-and-Permute architecture decomposes the parsing process into content prediction (Tag) and sequence ordering (Permute).

To handle the NP-hard nature of finding the best permutation, the authors formulate it as a regularized linear program. By employing Bregman’s method (a generalization of the Sinkhorn algorithm), they create a differentiable layer that allows the model to learn these "jumps" directly via backpropagation on a GPU.

Experimental Results

The model was evaluated across four diverse benchmarks, demonstrating significant improvements over standard architectures:

  • COGS Benchmark: On tasks involving deep recursion (CP and PP recursion), where standard seq2seq models typically fail (scoring near 0%), this model achieved 79–85% accuracy.
  • ATIS Length Split: When trained on short sequences and tested on long ones, the model achieved 41.39% accuracy, more than doubling the performance of a fine-tuned BART-base model (19.03%).
Results on the ATIS dataset show the proposed model significantly outperforming standard Transformer and BART baselines on the challenging length split.
  • Okapi: The model established new state-of-the-art results on length splits across Calendar, Document, and Email domains, proving its robustness on noisy, real-world data.

Key Insights

The success of this approach suggests that explicit tree structures are not strictly necessary for handling recursion. By decoupling content and order, the model learns robust, reusable logical fragments that generalize far better to complex or long sentences. Furthermore, the use of differentiable combinatorics provides a powerful, efficient tool for tasks requiring complex reordering.

Limitations

While effective for semantic parsing, the model currently assumes that token predictions for individual words are independent, which may not hold for tasks like translation or summarization. Additionally, the $O(n^3)$ complexity of the permutation solver remains a bottleneck for very long sequences exceeding 100 tokens.

Reference: Lindemann, M., Koller, A., & Titov, I. (2023). Compositional Generalization without Trees using Multiset Tagging and Latent Permutations. Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics.

Summary updated

BibTeX
@inproceedings{lindemann2023compositional,
  author = {Matthias Lindemann and Alexander Koller and Ivan Titov},
  title = {{Compositional Generalization without Trees using Multiset Tagging and Latent Permutations}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.810},
}
Figure