arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2410.20771cs.CLcs.AIcs.LG
收藏

MrT5:用于高效字节级语言模型的动态Token合并

MrT5: Dynamic Token Merging for Efficient Byte-level Language Models

Stanford University(斯坦福大学)

Julie Kallini, Shikhar Murty, Christopher D. Manning, Christopher Potts, Róbert Csordás

AI总结:

MrT5通过在ByT5编码器中引入动态token删除门机制,将已删除token的关键信息合并至紧凑序列中,在保持下游任务准确率的同时将序列长度减少高达75%,有效提升了字节级模型的推理效率。

摘要:

依赖子词分词的模型存在显著缺陷,例如对拼写错误等字符级噪声敏感,以及在不同语言和文字系统间压缩率不一致。尽管像 ByT5 这样的字符或字节级模型试图解决这些问题,但它们并未得到广泛采用——在不分词的情况下处理原始字节流会导致序列长度显著增加,使得训练和推理效率低下。本研究引入了 MrT5(MergeT5),这是 ByT5 的一个更高效变体,它在其编码器中集成了 token 删除机制,以动态缩短输入序列长度。在经过固定数量的编码器层处理后,一个学习到的删除门决定哪些 token 将被移除,哪些将被保留以供后续层使用。MrT5 利用剩余 token 的上下文信息,有效地将已删除 token 中的关键信息“合并”到一个更紧凑的序列中。在持续预训练实验中,我们发现 MrT5 能够以 bits-per-byte 衡量的性能影响最小的情况下,在推理运行时间上取得显著提升。此外,在多语言训练中,MrT5 能够适应每种语言的拼写特征,学习特定语言的压缩率。此外,MrT5 在 XNLI、TyDi QA 和字符级任务等下游评估中表现出与 ByT5 相当的准确率,同时将序列长度减少了高达 75%。我们的方法为现有字节级模型的实际局限性提供了一种解决方案。

英文摘要:

Models that rely on subword tokenization have significant drawbacks, such as sensitivity to character-level noise like spelling errors and inconsistent compression rates across different languages and scripts. While character- or byte-level models like ByT5 attempt to address these concerns, they have not gained widespread adoption -- processing raw byte streams without tokenization results in significantly longer sequence lengths, making training and inference inefficient. This work introduces MrT5 (MergeT5), a more efficient variant of ByT5 that integrates a token deletion mechanism in its encoder to dynamically shorten the input sequence length. After processing through a fixed number of encoder layers, a learned delete gate determines which tokens are to be removed and which are to be retained for subsequent layers. MrT5 effectively "merges" critical information from deleted tokens into a more compact sequence, leveraging contextual information from the remaining tokens. In continued pre-training experiments, we find that MrT5 can achieve significant gains in inference runtime with minimal effect on performance, as measured by bits-per-byte. Additionally, with multilingual training, MrT5 adapts to the orthographic characteristics of each language, learning language-specific compression rates. Furthermore, MrT5 shows comparable accuracy to ByT5 on downstream evaluations such as XNLI, TyDi QA, and character-level tasks while reducing sequence lengths by up to 75%. Our approach presents a solution to the practical limitations of existing byte-level models.

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

↑