TL;DR
Researchers have developed LATTE-WordSeg-Lite, a lightweight Thai word segmenter that runs 23 times faster than the popular DeepCut model on a single CPU thread. By distilling a massive 635M-parameter GPU model into a tiny 1.17M-parameter student, the authors achieved high accuracy across multiple levels of word granularity (compounds, words, and morphemes) while introducing a new, reproducible benchmarking protocol for the Thai NLP community.
What Problem Does This Paper Address?
Thai is a "scriptio continua" language, meaning it is written without spaces between words. This makes word segmentation—the process of identifying where one word ends and the next begins—a critical first step for almost all downstream NLP tasks, from part-of-speech tagging to machine translation.
However, two major hurdles exist:
- Granularity Mismatch: Different Thai corpora use different definitions of a "word." Some treat compounds as single units, while others break them down into individual morphemes. Most existing tools only support one convention.
- The Speed-Accuracy Trade-off: High-accuracy models like the original LATTE (Lattice ATTentive Encoding) are massive GPU-based transformers that are too slow and expensive for many production environments. Conversely, fast CPU-based tools often lag in accuracy.
- Benchmarking Chaos: Published scores for Thai segmenters are notoriously difficult to compare because researchers use different data splits, files, and scoring protocols.
Methods
The authors employ knowledge distillation to bridge the gap between heavy GPU models and efficient CPU deployment.
- Teacher Models: They trained two large LATTE models (based on XLM-RoBERTa-large) that use a "lattice" approach. A lattice represents a text as a graph where nodes are characters and edges represent every possible dictionary word that matches the text.
- Student Model (LATTE-WordSeg-Lite): The student is a compact 1.17M-parameter network consisting of character embeddings, convolutions, and a two-layer BiLSTM.
- Lattice Features: Instead of the student processing the full graph, it receives the lattice information as a simple 13-bit feature vector per character. These bits indicate if a dictionary word starts, ends, or covers a character, effectively giving the tiny model "hints" from a dictionary.
- Multi-Granularity Output: The model is trained to predict three different segmentation units simultaneously: long (compounds), short (standard words), and minimal (morphemes).
Datasets
The authors rebuilt seven test sets from "pinned" (specific, versioned) sources to ensure reproducibility:
- Treebanks: TUD and PUD (Universal Dependencies).
- Social Media: WS160 and VISTEC.
- General/Technical: BEST (four genres), ORCHID (technical papers), and khm (instructional text).
They also used 69.1 million characters of raw text (Thai Wikipedia, etc.) for the distillation process, ensuring that the training data only included commercially-friendly licenses.
Key Insights and Ideas
- Lattices as Features: One of the most effective "aha" moments was realizing that a small model doesn't need to compute complex graph attentions if you provide the dictionary matches as simple input features. These "lattice bits" added significant accuracy (up to 1.3 points on some sets) with negligible computational cost.
- Distillation is "Free" Accuracy: The student model often matched or even slightly exceeded the performance of the teacher's raw labels. This suggests that the distillation process helps the model generalize better than training on small, gold-standard datasets alone.
- Conventions Matter More Than Models: The paper highlights that a system's performance drops drastically if it's tested against a different segmentation convention than the one it was trained on. By predicting three granularities at once, LATTE-WordSeg-Lite remains flexible across different tasks.
Key Results
- Speed: LATTE-WordSeg-Lite segments approximately 60,000 to 105,000 characters per second on a single CPU thread. This is 23x faster than DeepCut and significantly faster than other neural competitors like AttaCut.
- Accuracy: It scores higher than DeepCut on five out of seven test sets. On the "short" word unit (the most common convention), it achieved a mean F1 score of 85.65% across all seven benchmarks, the highest average in the study.
- Efficiency: The model is released as a tiny 3 MB ONNX graph, making it ideal for edge devices or high-throughput CPU servers.
Limitations and Future Work
- Domain Coverage: The current benchmarks cover encyclopedic, news, and social media text, but do not yet include specialized domains like transcribed speech.
- Protocol Artifacts: The authors' scoring protocol requires spaces to be treated as word boundaries. While this standardizes evaluation, it can split tokens that were originally intended to be joined in some source corpora.
- Future Directions: The authors suggest that future work could explore even smaller models or further refine the dictionary features to handle out-of-vocabulary words more gracefully.
Summary updated