SubMerge: Merging Equivalent Subword Tokenizations for Subword Regularized Models in Neural Machine Translation

Haiyue Song, Francois Meyer, Raj Dabre, Hideki Tanaka, Chenhui Chu, Sadao KurohashiEAMT (1) 2024

TL;DR

Subword regularization improves Neural Machine Translation (NMT) by training models on multiple diverse segmentations of the same text. However, standard decoding algorithms discard this benefit during inference by selecting only a single tokenization path. To bridge this gap, the authors introduce SubMerge, a nested beam search algorithm that aggregates probability mass across equivalent subword sequences, significantly improving next-word probability estimation and translation quality—especially in low-resource scenarios.

What Problem Does This Paper Address?

Modern NMT systems rely on subword tokenization (like Byte-Pair Encoding or BPE) to handle rare words without inflating vocabulary sizes. To make models more robust, researchers often use subword regularization (e.g., BPE-dropout) during training. This technique randomly splits words into different subword combinations (for example, splitting the word "watching" into _watch + ing or _wat + ching), acting as a powerful form of data augmentation.

The catch happens during inference. Standard decoding algorithms (like beam search) only look at individual subword paths. If a model spreads its probability mass across three different tokenizations of "watching," a completely different word with a slightly higher single-path probability (like _watched) might mistakenly win out. This training-inference discrepancy leads to inaccurate word probability estimations and degrades translation quality.

Training vs. Inference discrepancy in subword regularized models

Methods

The authors propose SubMerge, a nested beam search decoding algorithm designed to recover the probability mass split across different tokenizations:

  • Outer Beam Search: Operates at the word level. It treats whole words as the minimal units of generation, completely abstracting away the subword tokenization details.
  • Inner Beam Search: Operates at the subword level but is strictly constrained within the boundaries of a single word. It explores the subword space to find the $n$-best tokenizations for the next word candidate.
  • Subword Merging: SubMerge detokenizes the paths found by the inner beam search. If multiple distinct subword sequences compose the exact same word, it sums their probabilities together. The outer beam search then uses this aggregated marginal likelihood to choose the best word sequence.
Overview of the SubMerge nested beam search algorithm

Datasets

The algorithm was evaluated across six machine translation benchmarks, capturing a wide range of data scales:

  • WMT'22 Livonian–English (Liv–En): Extremely low-resource (~1.1k sentences).
  • Asian Language Treebank (ALT): A low-resource multi-way parallel dataset (evaluating English to/from Filipino, Indonesian, Japanese, Malay, Vietnamese, and Simplified Chinese).
  • IWSLT'15 Vietnamese–English (Vi–En): ~133k sentences.
  • WMT'16 Romanian–English (Ro–En): ~612k sentences.
  • WMT'15 Finnish–English (Fi–En): ~1.8M sentences.
  • WMT'14 German–English (De–En): High-resource (~4.5M sentences).

Key Insights and Ideas

  • The Power of Marginalization: Summing probabilities over equivalent paths dramatically reduces word perplexity (often by more than half). This proves that subword-regularized models learn highly accurate word probabilities, but standard decoding algorithms are simply blind to them.
  • Morphology and Segmentation Matter: The performance gains are directly tied to how heavily a language gets segmented. Languages with higher average subwords per word (like Filipino) saw much larger BLEU improvements (+0.9) than languages with lower segmentation rates like Japanese (+0.2).
  • Exclusively for Regularized Models: SubMerge provides virtually no translation quality benefit for standard, deterministic BPE models. Because deterministic models concentrate almost all their probability mass onto a single tokenization path anyway, there is little split probability left to merge.

Key Results

  • Perplexity Drop: Word perplexity dropped drastically across the board. For instance, on WMT'15 En→Fi, perplexity plummeted from 22.52 (standard beam search) to 7.81 (SubMerge).
  • Translation Quality Gains: SubMerge consistently outperformed standard beam search in low-resource setups, yielding an average BLEU improvement of 0.6 (and up to +1.4 BLEU for ALT Id→En). In medium/high-resource setups, the average BLEU gain was 0.3.
  • Data Efficiency: In an extreme low-resource simulation using only 1k sentences of ALT Fil→En data, SubMerge achieved a massive +3.4 BLEU improvement over standard beam search, highlighting its potential for domain adaptation with limited data.

Limitations and Future Work

  • Computational Overhead: SubMerge increases the theoretical time complexity from $O(T \cdot K^2)$ to $O(T \cdot K^3)$, where $T$ is sentence length and $K$ is beam size. In practice, the current implementation runs about 5.5 times slower than standard beam search.
  • No Batch Processing: The current implementation processes sentences one by one, limiting its throughput on modern GPU clusters.
  • Format Dependency: The code relies on SentencePiece's specific word-boundary token structure (_), meaning it requires minor modifications to work with other tokenization formats (like @@).
  • Future Directions: The authors suggest exploring how to integrate standard generation techniques like length penalties into this nested structure, and extending the method to less constrained generation tasks like open-ended question answering.

Summary updated

BibTeX
@inproceedings{song2024submerge,
  author = {Haiyue Song and Francois Meyer and Raj Dabre and Hideki Tanaka and Chenhui Chu and Sadao Kurohashi},
  title = {{SubMerge: Merging Equivalent Subword Tokenizations for Subword Regularized Models in Neural Machine Translation}},
  booktitle = {EAMT (1)},
  year = {2024},
  url = {https://openreview.net/forum?id=OsPf4GJ8VZ},
}
Figure