Het bereiken van tokenizerflexibiliteit in taalmodellen door middel van heuristische aanpassing en supertokenleren
Achieving Tokenizer Flexibility in Language Models through Heuristic Adaptation and Supertoken Learning
May 14, 2025
Auteurs: Shaurya Sharthak, Vinayak Pahalwan, Adithya Kamath, Adarsh Shirawalmath
cs.AI
Samenvatting
Voorgetrainde taalmmodellen (LLMs) worden vaak beperkt door hun vaste tokenisatieschema's, wat leidt tot inefficiënties en prestatiebeperkingen, vooral voor meertalige of gespecialiseerde toepassingen. Deze tokenizer-lock-in vormt aanzienlijke uitdagingen. Standaardmethoden om dit te overwinnen vereisen vaak onhaalbaar veel rekenbronnen. Hoewel het vervangen van de tokenizer met heuristische initialisatie deze last probeert te verminderen, vereisen bestaande methoden vaak uitgebreide rest-finetuning en kunnen ze nog steeds niet volledig semantische nuances behouden of de onderliggende compressie-inefficiënties adequaat aanpakken. Ons framework introduceert twee innovaties: ten eerste, Tokenadapt, een model-agnostische methode voor tokenizer-transplantatie, en ten tweede, een nieuwe pre-tokenisatieleertechniek voor multi-woord Supertokens om compressie te verbeteren en fragmentatie te verminderen. Tokenadapt initialiseert nieuwe unieke token-embeddings via een hybride heuristiek die twee methoden combineert: een lokale schatting gebaseerd op subwoord-decompositie met behulp van de oude tokenizer, en een globale schatting die gebruikmaakt van de top-k semantisch vergelijkbare tokens uit de originele vocabulaire. Deze methodologie heeft als doel semantiek te behouden terwijl de hertrainingsvereisten aanzienlijk worden geminimaliseerd. Empirisch onderzoek valideert beide bijdragen: de transplantatieheuristiek initialiseert succesvol unieke tokens en presteert duidelijk beter dan conventionele baseline-methoden en geavanceerde methoden zoals Transtokenizer en ReTok, terwijl onze Supertokens aanzienlijke compressiewinsten behalen. Onze zero-shot perplexiteitsresultaten tonen aan dat de TokenAdapt hybride initialisatie consistent lagere perplexiteitsratio's oplevert in vergelijking met zowel ReTok als TransTokenizer baseline-methoden, over verschillende basismodellen en nieuw getrainde doel-tokenizers. TokenAdapt reduceerde typisch de algehele perplexiteitsratio aanzienlijk in vergelijking met ReTok, wat resulteerde in minstens een 2-voudige verbetering in deze geaggregeerde scores.
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.Summary
AI-Generated Summary