Introduction
Standard sequence-to-sequence (seq2seq) models, particularly those based on the Transformer architecture, typically rely on a rigid left-to-right (L2R) decoding order. While effective for many tasks, this unidirectional constraint can be suboptimal. Errors made early in a sequence often "snowball," leading to cascading failures. This is especially evident in morphological inflection—the process of transforming a base lemma (e.g., walk) into a specific grammatical form (e.g., walked). Because languages employ various affixation strategies (prefixes, suffixes, or both), a fixed decoding direction often fails to respect the natural structural boundaries of a word.
This paper introduces a novel bidirectional framework that enables "outside-in" decoding. By allowing the model to generate tokens from either end of the sequence or join them in the middle, the proposed approach achieves state-of-the-art performance across multiple morphological benchmarks.
Proposed Framework: Outside-In Decoding
The core innovation is a decoding process that starts from both the beginning ($) and the end (#) of a word. At each step, the model dynamically decides whether to append a token to the current prefix, prepend a token to the current suffix, or join the two segments to complete the word.
Key Technical Components
- Dynamic Programming for Marginalization: A word of length $N$ has $2^N$ possible generation orderings. To handle this complexity, the authors developed an $O(|y|^2)$ dynamic programming algorithm to marginalize out the latent ordering variable during training, making the calculation of total likelihood feasible.
- Training Objectives: Two primary loss functions were explored: Cross-Entropy (xH), which treats all valid orderings as equally likely to ensure robustness, and Maximum Marginal Likelihood (MML), which allows the model to learn and favor the most linguistically plausible generation orders.
- Architecture: The system utilizes a character-level Transformer. The decoder receives the current prefix and suffix, separated by special tokens that predict the next action (join, order, or specific token).
Experimental Results
The framework was evaluated on the SIGMORPHON 2022 and 2023 Shared Tasks, covering dozens of languages across diverse families. The bidirectional model established new benchmarks, outperforming previous systems by 2.7 points on the 2023 task and 4.7 points on the 2022 task. The most effective variant, xH-Rerank, utilizes beam search to generate candidates and then reranks them based on their marginal probability.
Robustness to Sequence Length
One of the most significant advantages of bidirectional decoding is its performance on long sequences. By allowing the model to generate the most certain parts of a word first—regardless of their position—it effectively mitigates the "snowballing" effect seen in unidirectional models.
As shown in the figure above, the performance gap between the bidirectional model and the baseline widens significantly for words exceeding 16 characters, demonstrating the framework's superior handling of complex morphological structures.
Discussion and Future Work
Beyond raw accuracy, the model demonstrates an emergent ability to learn morpheme boundaries. Under the MML objective, the model often naturally splits words at their stem-affix boundaries (e.g., generating walk from the left and ed from the right).
However, the framework currently faces a computational bottleneck. Because the decoder lacks a causal mask (it must observe both the prefix and suffix), hidden states must be recomputed at each step, leading to an $O(|y|^4)$ training runtime. Future research will focus on developing more efficient architectures to scale this "outside-in" approach to broader tasks like machine translation or abstractive summarization.
Summary updated