arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.22071cs.CLcs.LG
收藏

优先正确字节:UTF-16如何助力多语言边界预测

The Right Byte First: How UTF-16 Helps Multilingual Boundary Prediction

Samsung Research(三星研究院)

Hyunsik Kim

AI总结:

该研究提出通用字节级编码(UBE),通过UTF-16低字节在前的编码方式提升多语言边界预测性能,实验显示其在17种婆罗米文字上的字素边界错误率仅0.06%,且在韩语、中文等语言中错误率大幅降低。

摘要:

许多分层字节级语言模型使用学习得到的边界预测器将字节分组为补丁,该预测器对下一个码点的视图取决于编码和前瞻。在UTF-8中,许多文字的码点占3个字节:24位中的8位标记长度和延续,第一个字节仅携带4个高位码点位。在相同的左上下文后,扩展字素簇的标记和下一个起始字母可共享其第一个字节。通用字节级编码(UBE)保留UTF-8的1字节和2字节编码,但将这些码点写为两个UTF-16字节(低字节在前),因此其第一个符号携带8个低位码点位,可区分此类延续。我们在匹配的FineWeb-2文本上训练小型因果预测器,并在UTF-8、UBE和UBE的等长大端变体下于FLORES-200上评估。在1符号前瞻下,13种婆罗米文字的17种语言中,码点边界处的平衡字素边界错误率:UTF-8为8.76%,大端变体为8.62%,UBE为0.06%。当目标保留父分词器在字素边界处的子词切分,相同前瞻下UBE相对于UTF-8的平均错误率降低:韩语72.91%,中文35.29%,另外8种文字为67.32%-99.55%。在主Unicode块适配单个256码点页的7种文字中,大端变体与UTF-8的差距在3.0%以内,因此增益源于字节顺序而非长度。韩语和中文中,UBE的平均错误率仅在25%和37.5%的训练后就低于UTF-8的最终平均错误率。因此,哪个字节在前会影响字节级边界预测器所需的前瞻量。

英文摘要:

Many hierarchical byte-level language models group bytes into patches using a learned boundary predictor whose view of the next codepoint depends on encoding and lookahead. In UTF-8, codepoints of many scripts take three bytes: 8 of 24 bits mark length and continuation, and the first byte carries only 4 high codepoint bits. After the same left context, a mark extending a grapheme cluster and a letter starting the next can thus share their first byte. Universal Byte-Level Encoding (UBE) keeps one- and two-byte UTF-8 encodings but writes these codepoints as two UTF-16 bytes, low byte first, so its first symbol carries 8 low codepoint bits that can distinguish such continuations. We train small causal predictors on matched FineWeb-2 text and evaluate on FLORES-200 under UTF-8, UBE, and UBE's same-length big-endian variant. At one-symbol lookahead, balanced grapheme-boundary error at codepoint boundaries across 17 languages in 13 Brahmic scripts is 8.76% with UTF-8, 8.62% with the big-endian variant, and 0.06% with UBE. When the target instead retains a parent tokenizer's subword cuts at grapheme boundaries, UBE lowers the mean error relative to UTF-8 at the same lookahead by 72.91% in Korean, 35.29% in Chinese, and 67.32-99.55% in eight more scripts. In the seven of them whose main Unicode block fits on one 256-codepoint page, the big-endian variant stays within 3.0% of UTF-8, so the gain follows byte order, not length. In Korean and Chinese, UBE's mean error falls below UTF-8's final mean error after only 25% and 37.5% of training. Which byte comes first thus affects how much lookahead a byte-level boundary predictor needs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑