Unsupervised Morphological Tree Tokenizer

Qingyang Zhu, Xiang Hu, Pengyu Ji, Wei Wu, Kewei Tu

Presented at the Findings of ACL 2025, this research introduces TreeTok, a novel unsupervised tokenizer that shifts away from purely statistical subword merging toward a linguistically-informed, hierarchical structure. By modeling words as trees rather than flat sequences, TreeTok achieves superior alignment with human morphology and improves performance in downstream natural language processing tasks.

The Fragmentation Problem in Modern LLMs

Most Large Language Models (LLMs) rely on subword tokenization methods like Byte Pair Encoding (BPE) or WordPiece. These methods are "greedy" and purely statistical, merging the most frequent character sequences until a target vocabulary size is reached.

However, these statistical merges often ignore linguistic reality. For example, BPE might split the word "windsurfing" into semantically meaningless fragments like wind/sur/fing. These "junk" tokens carry no independent meaning and disrupt the model's ability to learn the relationships between core morphemes like "wind," "surf," and the suffix "-ing."

Figure 1: Comparison of BPE and TreeTok on the word "windsurfing," illustrating how TreeTok preserves meaningful sub-units through hierarchical parsing.

Methodology: Tree-Based Composition

TreeTok addresses fragmentation through a two-part system: a deep composition model and a top-down tokenization algorithm.

1. The Composition Model

Unlike standard models that process sequences linearly, TreeTok builds a binary parse tree for every word. It utilizes a CKY-like encoder, optimized for linear complexity, to determine the optimal points to merge characters into subwords.

2. MorphOverriding

A critical innovation in this work is MorphOverriding. Standard neural parsers often assume the meaning of a whole is strictly the sum of its parts. However, in linguistics, a morpheme like "wind" is atomic; its meaning is not derived from the combination of "w + i + n + d." MorphOverriding allows the model to identify potential morphemes from a heuristic vocabulary and "override" the composition process with a learned embedding, respecting the atomic nature of these units.

3. Dual Training Objectives

The model is trained using two distinct losses:

  • Intra-word (Auto-encoding): The model predicts masked morphemes within a word based on surrounding characters.
  • Inter-word (Auto-regression): The model uses induced word representations to predict the subsequent word in a sentence, forcing the tokenizer to capture contextually relevant structures (e.g., recognizing that "asking" should be ask + ing based on grammatical context).

Experimental Results

The researchers evaluated TreeTok against standard tokenizers using the Morpho Challenge 2010 and a custom Compound Dataset.

Table 1: Morphological and compound accuracy across different tokenization methods, showing TreeTok's significant performance lead.

As shown in the results, TreeTok significantly outperformed BPE, WordPiece, and Unigram:

  • Morphological Accuracy: TreeTok achieved 37.9% accuracy on the Morpho dataset, nearly doubling BPE’s 19.5%.
  • Efficiency: TreeTok produced the shortest average token length (25.99 tokens per sentence vs. BPE's 26.58), indicating better compression and semantic density.
  • Downstream Performance: In English-to-German translation (WMT14), TreeTok achieved a BLEU score of 26.68, surpassing BPE's 26.55, suggesting that morphological alignment directly benefits machine translation.

Conclusion and Future Work

TreeTok demonstrates that incorporating hierarchical linguistic structure into tokenization can resolve the semantic fragmentation inherent in statistical methods. While the computational overhead of parsing trees is higher than simple frequency counting (1.98ms vs 0.02ms per token), the authors mitigate this by using a cache for the most frequent words, making the real-world inference speed negligible. Future research will explore applying this tree-aware approach to morphologically rich languages like Turkish or Finnish and integrating it directly into the pre-training phase of large-scale language models.

Summary updated

BibTeX
@inproceedings{zhu2025unsupervised,
  author = {Qingyang Zhu and Xiang Hu and Pengyu Ji and Wei Wu and Kewei Tu},
  title = {{Unsupervised Morphological Tree Tokenizer}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure