transcribe.cpp icon indicating copy to clipboard operation
transcribe.cpp copied to clipboard

Voxtral (Tekken tokenizer) falls back to qwen2 pretokenizer — no `tekken` support in transcribe-tokenizer.cpp

Open Karim-at-Powl opened this issue 4 months ago • 1 comments

Disclaimer: I am no professional programmer, this issue has been found with the help of Claude Code (Opus 4.8). I am creating a framework in which I incorporated release v0.1.2 and found this issue. All analysis is from CC, and I understand the issue and could create a fix, but don't mind if this is done by professionals only:

The tokenizer has no tekken pretokenizer, so Voxtral is tokenized with the qwen2 pretokenization rules instead of its native Tekken rules. This affects the entire Voxtral family, not one model or a bad download.

Environment

  • transcribe.cpp 0.1.2 (via the transcribe-cpp-sys 0.1.2 crate; ABI hash 86b16dd97ad1cb58)
  • Built from source via CMake, CPU backend, static link
  • Windows 11 (x86_64, MSVC)
  • Model: handy-computer/Voxtral-Mini-3B-2507-Q8_0.gguf (official org quant, byte-verified)
    • tokenizer.ggml.pre = "tekken" (correct metadata)

Steps to reproduce

  1. Load Voxtral-Mini-3B-2507-Q8_0.gguf.
  2. Offline transcribe any 16 kHz mono PCM buffer (transcribe_run, Task::Transcribe).
  3. Observe the warning on stderr; transcription proceeds with the qwen2 fallback.

Actual

pre_ == "tekken" is unhandled and routed to pretokenize_qwen2() with a WARN. In src/transcribe-tokenizer.cpp (~L500–517) the only pretokenizers implemented are gpt2, granite, and qwen2; every other non-empty flavor falls back to qwen2. tekken is referenced only under src/arch/voxtral_realtime/, so the offline Voxtral path never sets a Tekken pretokenizer.

Expected

A tekken pretokenizer applied for Voxtral, matching the model's training-time tokenization (as done in llama.cpp — see ggml-org/llama.cpp#8579).

Impact

Tokenization fidelity for the whole Voxtral family is reduced. Because Voxtral is an audio-LLM whose text prompt/template is encoded before generation, wrong pretokenization can degrade output quality — not just prompt handling. (Observed alongside minor word-level garbles in German output, e.g. "Publikum" → "Pubikom"; I have not isolated this as strict causation, but it is consistent with the mismatch.)

Suggested fix

  • Add a tekken pretokenizer (Mistral's tiktoken-style regex + byte mapping), analogous to llama.cpp#8579, and dispatch pre_ == "tekken" to it.
  • If out of scope short-term, document the fallback as a known Voxtral limitation so it isn't mistaken for a model/quant problem.

Happy to test a patch against this exact model/audio.

Thank you for this great framework!

Karim-at-Powl avatar Jul 11 '26 22:07 Karim-at-Powl

Thanks, I think this is an obvious thing we need to fix!

cjpais avatar Jul 15 '26 06:07 cjpais