In plain words: A new tool finds vocabulary words a language model barely saw in training, which can make it act strangely, by checking the vocabulary, the model's weights, and its responses to prompts. Unlike guess-and-check efforts, it shows these glitch tokens are common across many models.
Abstract · Fishing for Magikarp: Automatically Detecting Under-trained Tokens in Large Language Models
The disconnect between tokenizer creation and model training in language models allows for specific inputs, such as the infamous SolidGoldMagikarp token, to induce unwanted model behaviour. Although such `glitch tokens', tokens present in the tokenizer vocabulary but that are nearly or entirely absent during model training, have been observed across various models, a reliable method to identify and address them has been missing. We present a comprehensive analysis of Large Language Model tokenizers, specifically targeting this issue of detecting under-trained tokens. Through a combination of tokenizer analysis, model weight-based indicators, and prompting techniques, we develop novel and effective methods for automatically detecting these problematic tokens. Our findings demonstrate the prevalence of such tokens across a diverse set of models and provide insights into improving the efficiency and safety of language models.
Sander Land, Max Bartolo
arXiv:2405.05417 · cs.CL · submitted May 8, 2024 · updated Sep 27, 2024
abstract · pdf · 16 pages, 6 figures. Accepted at EMNLP 2024, main track. For associated code, see https://github.com/cohere-ai/magikarp/
https://www.youtube.com/watch?v=WO2X3oZEJOA