Structured Reordering for Modeling Latent Alignments in Sequence Transduction

bailin wang, Mirella Lapata, Ivan Titov

Abstract

Systematic generalization—the ability to understand novel combinations of known concepts—remains a significant challenge for standard sequence-to-sequence models. This paper introduces ReMoto (Reordered-then-Monotone alignments), a framework that explicitly models word reordering as a latent tree structure using separable permutations. By decoupling the reordering process from monotonic alignment, ReMoto learns to decompose and recombine language segments in a manner analogous to human compositional reasoning. Experimental results on benchmarks like Arithmetic and SCAN-SP demonstrate that ReMoto significantly outperforms standard neural architectures, particularly on out-of-distribution "length" splits where traditional models often fail completely.

Introduction

While deep learning has revolutionized Natural Language Processing (NLP), standard sequence-to-sequence (seq2seq) models often struggle with a "memorization" problem. They excel at identifying patterns within the training distribution but frequently fail to generalize systematically. For example, a model trained on "the length of the Colorado river" and "the longest river" may fail to parse "the length of the longest river" if that specific combination was not encountered during training. Humans avoid this pitfall by understanding underlying compositional rules. This research aims to bridge the gap between neural models and grammar-like compositional logic by treating word alignment as a structured, latent variable.

Methodology: The ReMoto Framework

The authors propose a "reorder-first, align-later" framework called ReMoto. This approach decomposes the transduction process into two distinct stages:

  1. Structured Reordering: The model first permutes the input sequence so that its segments align with the order of the target output. To maintain computational efficiency, the model is restricted to separable permutations. These permutations are representable as binary "permutation trees," where each node either maintains the order of its children ("Straight") or reverses them ("Inverted").
  2. Monotonic Alignment: Following reordering, the model utilizes a Synchronous Softmax-based Neural Transducer (SSNT) to align the reordered input to the output in a simple, left-to-right (monotonic) fashion.
The ReMoto framework: Structured Reordering followed by Monotonic Decoding.

A key technical innovation is the development of a novel Dynamic Programming (DP) algorithm that enables exact marginal and MAP inference over the space of possible trees. By employing a continuous relaxation via the Gumbel-Softmax trick, the entire system remains end-to-end differentiable and trainable via standard gradient descent.

Experimental Evaluation

ReMoto was evaluated on several benchmarks designed to test systematic generalization:

  • Arithmetic: Converting infix expressions to postfix. A "Length" (LEN) split was used to test if models trained on short expressions could handle significantly longer ones.
  • SCAN-SP: A semantic parsing variant of the SCAN benchmark, mapping commands to action sequences.
  • GeoQuery: A classic semantic parsing dataset mapping natural language to database queries, tested across English, Chinese, and German.
  • Machine Translation: Small-scale tasks including English-to-Japanese and Chinese-to-English.

Results and Discussion

The performance of ReMoto on length splits was particularly noteworthy. In the Arithmetic task, standard Seq2Seq models achieved 0% accuracy on longer expressions, whereas ReMoto reached approximately 86.9%. Similarly, on SCAN-SP, ReMoto achieved 100% accuracy on the length split, compared to just 13.9% for a standard Seq2Seq baseline and 57.7% for an LSTM-based tagging model.

Performance comparison on Arithmetic and SCAN-SP datasets across IID and Length (LEN) splits.

The study also revealed that sharing parameters between the alignment (syntax) and representation (semantics) modules actually hindered generalization. Keeping these components separate allowed the model to learn reordering logic independently of lexical meaning. Furthermore, the authors addressed "posterior collapse" by updating the reordering module more frequently during the early stages of training.

Conclusion

ReMoto demonstrates that explicitly modeling latent structural alignments can significantly enhance the systematic generalization of neural sequence models. While the $O(n^3)$ complexity of the DP algorithm and the token-level nature of the monotonic decoder present opportunities for future optimization, the framework's success on out-of-distribution tasks highlights the potential of combining neural representations with structured, grammar-inspired inductive biases.

Summary updated

BibTeX
@inproceedings{wang2021structured,
  author = {bailin wang and Mirella Lapata and Ivan Titov},
  title = {{Structured Reordering for Modeling Latent Alignments in Sequence Transduction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=X2Cxixkcpx},
}
Figure