直交マッチング追跡によるトレーニング不要なトークナイザー移植
Training-Free Tokenizer Transplantation via Orthogonal Matching Pursuit
June 7, 2025
著者: Charles Goddard, Fernando Fernandes Neto
cs.AI
要旨
事前学習済み大規模言語モデル(LLM)におけるトークナイザーの移植を、直交マッチング追跡法(OMP)を用いて未知のトークン埋め込みを再構築することで、学習不要で実現する手法を提案します。具体的には、共有トークンの疎な線形結合として各未知語トークンを近似する2段階のプロセスを採用します。まず、共有アンカートークンの小さな辞書を用いて、ドナーの埋め込み空間における新しいトークンの表現を計算し、次にこれらの同じ疎係数をベースモデルの埋め込み空間に転送します。
2つの挑戦的なクロストークナイザータスク(LlamatoMistral NeMo(12B)とQwentoLlama(1B))において、OMPが複数のベンチマークでベースモデルの性能を最も良く維持する一方で、他のゼロショットアプローチは大幅に性能が低下することを示します。ベースライン(ゼロ初期化、平均初期化、およびWECHSEL、FOCUS、ZETTなどの既存手法)と比較して、OMPは一貫して最高の総合性能を達成し、勾配更新なしで大きなトークナイザーの差異を効果的に橋渡しします。さらに、数値トークン化スキームの不一致が数学的推論能力を維持する上での重要な課題であることを分析により特定します。この技術により、新しいトークナイザーで事前学習済みモデルの重みを直接再利用することが可能となり、クロストークナイザー知識蒸留、投機的デコード、アンサンブル、マージ、およびドメイン固有の語彙適応を容易にします。本手法をオープンソースのmergekit-tokensurgeonツールに統合し、事後の語彙再調整を実現します。
English
We present a training-free method to transplant tokenizers in pretrained
large language models (LLMs) by reconstructing unseen token embeddings via
Orthogonal Matching Pursuit (OMP). Specifically, we approximate each
out-of-vocabulary token as a sparse linear combination of shared tokens, in two
phases: first, compute each new token's representation in the donor embedding
space with a small dictionary of shared anchor tokens, then transfer these same
sparse coefficients back into the base model's embedding space.
On two challenging cross-tokenizer tasks--LlamatoMistral NeMo (12B) and
QwentoLlama (1B)--we show that OMP achieves best zero-shot preservation of
the base model's performance across multiple benchmarks, while other zero-shot
approaches degrade significantly. Compared to baselines (zero-init, mean-init,
and existing approaches like WECHSEL, FOCUS, ZETT), OMP consistently achieves
the best overall performance, effectively bridging large tokenizer
discrepancies without gradient updates. Our analysis further identifies
mismatched numerical tokenization schemes as a critical challenge for
preserving mathematical reasoning capabilities. This technique enables direct
reuse of pretrained model weights with new tokenizers, facilitating
cross-tokenizer knowledge distillation, speculative decoding, ensembling,
merging, and domain-specific vocabulary adaptations. We integrate our method
into the open-source mergekit-tokensurgeon tool for post hoc vocabulary
realignment.