Skip to content

qwen3_asr: scale decode budget for dense-script languages - #239

Open
mufradhossain wants to merge 1 commit into
handy-computer:mainfrom
mufradhossain:fix/dense-script-decode-budget
Open

mufradhossain wants to merge 1 commit into
handy-computer:mainfrom
mufradhossain:fix/dense-script-decode-budget

Conversation

@mufradhossain

Copy link
Copy Markdown

The shared transcript estimate (12 tokens/s of audio) is calibrated on Latin-script tokenizers: English realizes ~1.2 tokens/word (~2.6 tok/s of speech), leaving generous headroom. Qwen3-ASR's tokenizer fragments dense scripts — measured 6.0 tokens/word for Bengali and 4.6 for Hindi on identical text — so fast speech in those scripts reaches ~21 tok/s and continuous Bengali dictation truncates at ~25 s (observed: 1307 tokens budgeted for a 105 s clip that needed ~1457).

Give predict_transcript_tokens a per-family rate, default unchanged at 12, and pass 45 from qwen3_asr: the fastest measured speech with 2x margin, still clamped by the decoder context. Validated on a 105 s Bengali clip: rate 12 truncates with a warning, rate 45 decodes the full transcript with no slowdown (13.9 s vs 16.5 s wall clock).

Summary

I was using Bengali dictation through Handy and long clips kept truncating around 25 s. Looking into it: the shared transcript estimate (12 tokens/s of audio) is calibrated for Latin-script tokenizers — running the same text through Qwen3-ASR's tokenizer gives ~6 tokens/word for Bengali vs ~1.2 for English, so continuous Bengali speech outpaces the budget. This gives predict_transcript_tokens() a per-family rate (default stays 12, so no other family changes) and qwen3_asr passes 45.

Scope

  • src/transcribe-decode-budget.h — predict_transcript_tokens() gains a tokens_per_sec parameter (default 12)
  • src/arch/qwen3_asr/model.cpp — family rate constant + both budget call sites
  • tests/decode_budget_unit.cpp — 3 new checks

AI Assistance

I have used GLM 5.3 to implement the C++ changes based on the measurements I found. I reviewed the diff and ran the validations myself.

Validation

  • decode_budget_unit: ok — all existing checks unchanged, plus 3 new ones
  • End-to-end on a 104.7 s continuous Bengali clip (generated with macOS say -v Piya -r 210, so anyone with a Mac can regenerate it): rate 12 → output truncated at 1307 tokens, exit 1; rate 45 → full transcript through the last word, exit 0, and slightly faster (13.9 s vs 16.5 s — the budget is a ceiling, not an allocation)
  • No WER or numerical validation needed: only budget arithmetic changed, and families that keep the default rate are byte-identical (existing tests cover this)

Limitations

  • Whisper is not touched: it uses a fixed 256-token cap and a small context, which is a different mechanism and may deserve its own discussion
  • Languages other than Bengali were measured at the tokenizer level only

The shared transcript estimate (12 tokens/s of audio) is calibrated on
Latin-script tokenizers: English realizes ~1.2 tokens/word (~2.6 tok/s
of speech), leaving generous headroom. Qwen3-ASR's tokenizer fragments
dense scripts — measured 6.0 tokens/word for Bengali and 4.6 for Hindi
on identical text — so fast speech in those scripts reaches ~21 tok/s
and continuous Bengali dictation truncates at ~25 s (observed: 1307
tokens budgeted for a 105 s clip that needed ~1457).

Give predict_transcript_tokens a per-family rate, default unchanged at
12, and pass 45 from qwen3_asr: the fastest measured speech with 2x
margin, still clamped by the decoder context. Validated on a 105 s
Bengali clip: rate 12 truncates with a warning, rate 45 decodes the
full transcript with no slowdown (13.9 s vs 16.5 s wall clock).
@mufradhossain
mufradhossain requested a review from cjpais as a code owner October 30, 2026 22:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant