# UnifiedCut: A Simple and Efficient Neural Model for Thai, Burmese and Khmer Word Segmentation
## 4 Experiments
### Hyperparameter Study  
Several important hyperparameters are present in our model, such as the choice of n-grams as input, the embedding dimension of n-grams, the length of the context window, the number of encoder layers, and the number of heads in multi-head attention. We studied the impact of these parameters on model performance while keeping other hyperparameters at their default values. The hyperparameter study experiment results on the BEST2010 dataset are shown in Figure 2.  
Figure 1(a) illustrates how different n-gram embedding dimensions affect model performance and size when using various n-gram sequences as input. The results show that models using n-gram (1, 2, 3) consistently achieve better performance across embedding dimensions compared to those using n-gram (1, 2) though at the cost of increased model size. The figure also indicates that both very small and very large embedding dimensions can adversely impact performance. The optimal setting is achieved with n-gram (1, 2, 3) and an embedding dimension of 32, resulting in the best performance and a model size of 0.5 M parameters.  
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Algorithm** & **Features** & **F1-Score** & \(R_{\text{OOV}}\) \\ \hline CRF & Chr (W = 3), Trigram (W = 3) & 0.96 \(\pm\) 0.18 & 0.44 \\ MaxEnt & Trigram (W = 4) & 0.94 \(\pm\) 0.22 & 0.41 \\ PythiaNLP & - & 0.96 \(\pm\) 0.22 & 0.45 \\ SSG & - & 0.97 \(\pm\) 0.12 & 0.61 \\ \hline UnifiedCut & Unigram (W = 21) & **0.98**\(\pm\) 0.02 & **0.78** \\ \hline \hline \end{tabular}
\end{table}
Table 6: Syllable segmentation performance comparison in Thai.  
Figure 2: Hyperparameter study of UnifiedCut.  
Context window length is another important parameter impacting model performance. Figure 2b illustrates the effect of varying context window sizes, from 13 to 29, on model accuracy. The results show that our model performs well without needing an excessively long context; a window size of around 20 characters achieves optimal results. Generally, a longer context window improves model precision, but an overly long context can reduce recall. Additionally, longer contexts increase the number of model parameters, as indicated in the figure, where model size grows linearly with context length.  
In general, multi-layer encoders help improve a model's learning capacity. Figure 2c shows the performance and size of UnifiedCut with different numbers of encoder layers. The results indicate that the two-layer encoder performs slightly better than the one-layer encoder; however, as the number of layers increases, model performance declines significantly, while the model size grows linearly with additional layers. Therefore, UnifiedCut does not require a deep encoder. Given that the performance difference between one and two layers is minimal, with only a 0.001 increase in F1 score, and the one-layer encoder is more time-efficient, we selected the one-layer encoder as the default.  
Another key hyperparameter we examine is the number of attention heads. By using multiple heads, the model can capture segmentation features from various perspectives within an input sequence. As shown in Figure 2d, choosing an appropriate number of attention heads significantly enhances model performance, primarily by improving recall. In our experiments, setting the head number to 8 produced the best segmentation results.