Learning Transductions and Alignments with RNN Seq2seq Models
Zhengxiang Wang
TL;DR
The paper addresses whether RNN sequence-to-sequence models can learn core string transductions and generalize beyond training data. Using controlled experiments on four tasks ($f_A$–$f_D$) with SRNN, GRU, and LSTM variants, with and without attention, it demonstrates that models tend to memorize in-distribution mappings and struggle to generalize to unseen lengths; attention improves learning efficiency and test performance but does not eradicate out-of-distribution gaps, especially for the hardest task ($f_D$). It also reveals task-complexity hierarchies that differ between attention-less and attentional models and shows counting abilities vary by architecture. Overall, the work provides a formal-language-theory perspective on neural transductions and highlights limitations and directions for future architectures and benchmarks to better probe alignment, counting, and generalization in sequence models, with code and data publicly available.
Abstract
The paper studies the capabilities of Recurrent-Neural-Network sequence to sequence (RNN seq2seq) models in learning four transduction tasks: identity, reversal, total reduplication, and quadratic copying. These transductions are traditionally well studied under finite state transducers and attributed with increasing complexity. We find that RNN seq2seq models are only able to approximate a mapping that fits the training or in-distribution data, instead of learning the underlying functions. Although attention makes learning more efficient and robust, it does not overcome the out-of-distribution generalization limitation. We establish a novel complexity hierarchy for learning the four tasks for attention-less RNN seq2seq models, which may be understood in terms of the complexity hierarchy of formal languages, instead of string transductions. RNN variants also play a role in the results. In particular, we show that Simple RNN seq2seq models cannot count the input length.
