You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Official BitNet-b1.58-2B-4T GGUF has no tokenizer.ggml.pre: llama.cpp falls back to the default pre-tokenizer and tokenizes differently from the official tokenizer #684
The official GGUF microsoft/bitnet-b1.58-2B-4T-gguf (ggml-model-i2_s.gguf, HF revision a1f2f1c, still the current one) has no tokenizer.ggml.pre key. When it loads, llama.cpp falls back to the default pre-tokenizer and logs:
missing pre-tokenizer type, using: 'default'
GENERATION QUALITY WILL BE DEGRADED!
The model uses the LLaMA 3 tokenizer, which needs the llama-bpe pre-tokenizer. With default, numbers, $ and contractions are split differently from the official tokenizer.json.
Reproduction
Setup: bitnet.cpp 404980e, built with setup_env.py -q i2_s, on an Apple M1 (macOS). The official GGUF above was used unchanged.
Sentence: In 1999, 1234567 people paid $3.50 each; it's 2,560 x 6912.
With --override-kv tokenizer.ggml.pre=str:llama-bpe, the count matches the HF tokenizer (289,078 through llama-cli).
Effect on perplexity
Protocol: WikiText-2, first 40 chunks of 512 tokens, llama-perplexity protocol, bitnet.cpp 404980e.
Setup
PPL
GGUF as distributed
16.74
GGUF with --override-kv tokenizer.ggml.pre=str:llama-bpe
14.963
HF transformers reference, fp32, HF tokens
14.968
The first number scores a different token sequence, so it is not directly comparable per token. Still, with the right pre-tokenizer bitnet.cpp matches the reference within 0.04%.
Suggested fix
Add tokenizer.ggml.pre = "llama-bpe" to the published GGUF, and to whatever pipeline produces it. Until then, passing --override-kv tokenizer.ggml.pre=str:llama-bpe restores the official tokenization.
Activity