NewsCrawler.org

Google patches tokenizer of small Gemma 4 models to fix glitch tokens

Google patches tokenizer of small Gemma 4 models to fix glitch tokens
Image: Reddit

Google changed tokenizer.json, the tokenizer file, of the small Gemma 4 model google/gemma-4-E4B-it. The patch removes 219 glitch tokens[1], which are vocabulary entries whose embeddings have collapsed to near-identical representations and can cause unpredictable model behavior. It uses BPE merge pruning[2] to remove 253 merge rules that build these tokens. All vocabulary entries and token IDs stay intact, but the flagged text is now split into well-trained subwords.

No model weights are changed, and the chat template and tokenizer_config.json are identical to the original. The tokenizer length stays at 262,144. The pull request discloses three side effects: 5 compound tokens now split into subwords, 9 surviving merge rules are inert, and 4 target tokens were already shadowed by higher-priority merges.

The pull request notes that many of these glitch tokens are shared across Gemma 1, 2, 3 and 4. For agentic pipelines, it recommends applying the patch to all Gemma models so these token strings are not injected into prompts for unpatched models.

Google shares (GOOGL)

265.29 USD −6.5% since the news day, November 16

Close on November 20 Quotes: CNBC Chart by TradingView

Read the original huggingface.coDiscussion

Discussion

Commenters welcome the fix, but ask how the tokenizer went wrong outside the model weights and whether a version number exists to track such changes. Others wonder which other models may have similar issues that were never fixed, and ask whether community teams have posted GGUF[3] versions of the updated model yet.

Sources

Published: First seen: Читать по-русски

Open as a page