让大模型自由换分词器,降低训练成本同时提升压缩效率。
Achieving Tokenizer Flexibility in Language Models through Heuristic Adaptation and Supertoken Learning
- 用混合启发式方法初始化新分词器的词元嵌入,避免大规模重训。
- 新提出的超词元(Supertoken)使文本压缩率显著提升,减少碎片化。
- 零样本测试中,分词迁移效果优于现有方法,性能提升至少2倍。
预训练语言模型常受限于固定的分词方案,导致多语言或专业场景下效率低下、性能受限。传统解决方法需巨大计算资源。虽有基于启发式初始化的分词器替换方法可减轻负担,但通常仍需大量残差微调,且难以完全保留语义细节或解决压缩效率问题。本文提出两项创新:一是无需模型依赖的 Tokenadapt 分词器移植方法;二是面向多词超词元(Supertoken)的预分词学习机制,以增强压缩并减少碎片化。Tokenadapt 通过结合局部子词分解估计与全局语义相似词(top-k)的混合启发式,初始化新词元嵌入,有效保留语义并大幅减少重训需求。实验验证表明,该方法在多种基础模型和新训练分词器上均显著优于 ReTok 与 TransTokenizer 等基线。零样本困惑度结果表明,TokenAdapt 的混合初始化始终带来更低的困惑度比值,整体困惑度比相较 ReTok 显著降低,平均改善至少 2 倍。
原文摘要 · Abstract (English)
Pretrained language models (LLMs) are often constrained by their fixed tokenization schemes, leading to inefficiencies and performance limitations, particularly for multilingual or specialized applications. This tokenizer lock-in presents significant challenges. standard methods to overcome this often require prohibitive computational resources. Although tokenizer replacement with heuristic initialization aims to reduce this burden, existing methods often require exhaustive residual fine-tuning and still may not fully preserve semantic nuances or adequately address the underlying compression inefficiencies. Our framework introduces two innovations: first, Tokenadapt, a model-agnostic tokenizer transplantation method, and second, novel pre-tokenization learning for multi-word Supertokens to enhance compression and reduce fragmentation. Tokenadapt initializes new unique token embeddings via a hybrid heuristic that combines two methods: a local estimate based on subword decomposition using the old tokenizer, and a global estimate utilizing the top-k semantically similar tokens from the original vocabulary. This methodology aims to preserve semantics while significantly minimizing retraining requirements. Empirical investigations validate both contributions: the transplantation heuristic successfully initializes unique tokens, markedly outperforming conventional baselines and sophisticated methods including Transtokenizer and ReTok, while our Supertokens achieve notable compression gains. Our zero-shot perplexity results demonstrate that the TokenAdapt hybrid initialization consistently yields lower perplexity ratios compared to both ReTok and TransTokenizer baselines across different base models and newly trained target tokenizers. TokenAdapt typically reduced the overall perplexity ratio significantly compared to ReTok, yielding at least a 2-fold improvement in these aggregate scores.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。