# A Comprehensive Analysis of Various Tokenizers for Arabic Large Language Models
## 5 Results
Moreover, no significant differences were observed between the MSA and DA types. For the TC task, Table 4 shows that BERT-BBPE achieved a slightly better accuracy score than the other two models. This advantage is due to its better compression rate, which requires fewer tokens when tokenizing specific texts compared to the WordPiece and SentencePiece tokenizers. We will further demonstrate this at the end of this section. This feature is particularly significant, as the input text for the topic classification task often exceeds the maximum allowed sequence length of 128 tokens. However, all three models achieved nearly the same F1, with a score of 86.63%. For the Tc task, Table 5 shows that BERT-SP outperformed the other two models on the majority of tasks by achieving the highest accuracy score on four out of seven tasks and the highest F1 score on five tasks. Additionally, the model achieved the highest overall average F1 score at 75.34%, thus significantly outperforming the other two models. However, the low average accuracy score is due to the poor performance on the ArSarcasmV2 task, which heavily affected the overall average accuracy. \begin{table}
\begin{tabular}{l c c c c c c c c c c} \hline \hline  & & \multicolumn{2}{c}{**BERT-WP**} & \multicolumn{2}{c}{**BERT-SP**} & \multicolumn{2}{c}{**BERT-BBPE**} & & \\ \hline
**Dataset** & **Type** & **Acc.** & **F1** & **Acc.** & **F1** & **Acc.** & **F1** & **Train Size** & **Validation Size** & **\#Labels** \\ \hline SANAD (AlKhaleej) & MSA & **98.60** & **98.60** & 98.57 & 98.57 & **98.60** & **98.60** & 36 K & 9.1 K & 7 \\ OSAC (CNN) & MSA & 94.87 & **94.38** & **94.97** & 94.27 & **94.97** & 94.32 & 4.05 K & 1.01 K & 6 \\ MNADv2 & MSA & 80.98 & 73.43 & 81.06 & 73.13 & **81.62** & **74.61** & 855 K & 213 K & 20 \\ ANTCorpv1.1 & MSA & **84.30** & 80.12 & 82.88 & **80.51** & **84.30** & 78.95 & 8.12 K & 2.03 K & 9 \\ \hline Avg & & 89.68 & **86.63** & 89.37 & 86.62 & **89.87** & 86.62 & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of BERT models using different tokenizers: WordPiece (BERT-WP), SentencePiece (BERT-SP), and Bytee-level BPE (BERT-BBPE) for the TC task. \begin{table}
\begin{tabular}{l l l l l l l l l l l} \hline \hline  & & \multicolumn{3}{c}{**BERT-WP**} & \multicolumn{3}{c}{**BERT-SP**} & \multicolumn{3}{c}{**BERT-BBPE**} & \\ \hline
**Dataset** & **Type** & **Acc.** & **F1** & **Acc.** & **F1** & **Acc.** & **F1** & **Train Size** & **Validation Size** & **\#Labels** \\ \hline Mawqif (sentiment) & DA & 71.46 & **69.82** & **71.61** & 68.96 & 71.32 & 68.49 & 2.8 K & 0.7 K & 3 \\ ArSarcasmV2 (sentiment) & DA & **68.23** & **63.92** & 67.83 & 63.80 & 66.70 & 62.72 & 12.54 K & 3 K & 3 \\ HARD (balanced) & MSA + DA & 89.04 & **86.84** & **89.10** & 86.81 & 89.04 & **86.84** & 84.55 K & 21.14 K & 2 \\ HARD (unbalanced) & MSA + DA & **90.44** & 85.55 & 90.42 & **85.65** & 90.30 & 85.52 & 327.64 K & 81.91 K & 3 \\ ASTD & MSA + DA & 74.27 & 55.68 & **75.42** & **57.40** & 75.22 & 56.43 & 8 K & 2 K & 4 \\ BRAD & MSA & **52.90** & **51.79** & 52.73 & 51.71 & 52.55 & 51.62 & 408.47 K & 102.12 K & 5 \\ \hline Avg & & & 74.39 & 68.93 & **74.51** & **69.05** & 74.18 & 68.60 & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of BERT models using different tokenizers: WordPiece (BERT-WP), SentencePiece (BERT-SP), and Bytee-level BPE (BERT-BBPE) for the SA task.