LATTE-WordSeg-Lite: Multi-Granularity Thai Word Segmentation on a CPU, with a Reproducible Benchmark

Thodsaporn Chay-intr, Kobkrit Viriyayudhakorn, Thanaruk TheeramunkongarXiv 2026 · arXiv

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:

  1. 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.
  2. 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.
  3. 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).
Figure 3: How LATTE-WordSeg-Lite is made. A grey bar is a line of text, and the coloured bars under it are its words in one unit. Each corpus is annotated in one unit. The teachers label raw text with all three units, here the phrase of Figure 1, and the student learns from these labels. Sections 3.1 to 3.4 take the four steps in turn.

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.
Example of multi-granularity: The same phrase can be segmented into compounds, words, or morphemes depending on the required unit.

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.
Figure 2: Accuracy against speed on one CPU thread (§5), with LATTE-WordSeg-Lite at its default unit, short. khammoon segments morphemes, and six of the seven sets count words. The LATTE teacher, a GPU model, is placed at its speed on the same CPU thread.

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

Abstract

Large language models read Thai through subword tokens, without a word segmenter. Yet Thai treebanks, speech metrics and morphological resources are built on words, often at several granularities, and word boundaries resolve ambiguities that subword tokens leave open. LATTE (Lattice ATTentive Encoding) reads a text at several granularities at once, through a lattice of dictionary words, but it is a large GPU model. We distil it into LATTE-WordSeg-Lite, a CPU segmenter of 1.17M parameters that keeps the lattice as features. It outputs compounds, words and morphemes in one pass, and learns only from annotated data and text whose licences allow commercial use. To compare it with other tools, published Thai scores do not suffice, as they come from different files, splits and scorers. We therefore rebuild seven test sets from pinned sources and score twelve systems under one protocol. With the unit that fits each test set, LATTE-WordSeg-Lite scores above DeepCut on five sets, four of them from corpora that its teachers learnt from. Called line by line on one CPU thread, it runs 23 times as fast as DeepCut. We release the model, the benchmark scripts and all predictions.
BibTeX
@misc{chayintr2026latte,
  author = {Thodsaporn Chay-intr and Kobkrit Viriyayudhakorn and Thanaruk Theeramunkong},
  title = {{LATTE-WordSeg-Lite: Multi-Granularity Thai Word Segmentation on a CPU, with a Reproducible Benchmark}},
  year = {2026},
  eprint = {2611.21300},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.21300},
}
Figure