Skip to content

Fix: require low avg_logprob before skipping fallback on no-speech - #2

Merged
monai merged 1 commit into
mainfrom
fix/fallback-no-speech-condition
Aug 28, 2026
Merged

Fix: require low avg_logprob before skipping fallback on no-speech#2
monai merged 1 commit into
mainfrom
fix/fallback-no-speech-condition

Conversation

@monai

@monai monai commented Aug 28, 2026

Copy link
Copy Markdown
Owner

decode_with_fallback skips the retry steps when no_speech_prob > no_speech_threshold. It ignores avg_logprob. So good, real speech segments get dropped or transcribed wrong.

openai/whisper (transcribe.py) and transformers (generation_whisper.py, _need_fallback) both treat a segment as silence only when both are true: no_speech_prob > no_speech_threshold AND avg_logprob < logprob_threshold. This fix uses the same rule.

The same bug is tracked in mlx-examples: ml-explore/mlx-examples#1427 (diagnosis), ml-explore/mlx-examples#1430 (open fix), ml-explore/mlx-examples#1402 (related symptom: hallucination on silence).

Found during an ASR accuracy check. Helps lower WER, together with #1 and #3.

decode_with_fallback skipped the temperature-ladder fallback as soon
as no_speech_prob exceeded no_speech_threshold, treating the segment
as silence. This let genuine (low-confidence) speech get dropped
whenever the no-speech probability happened to be high, even when the
decoded text was otherwise plausible.

Require both no_speech_prob > no_speech_threshold AND
avg_logprob < logprob_threshold before treating the result as
silence and skipping fallback, matching openai-whisper and Hugging
Face transformers' generation_whisper.py, which both gate on this
same conjunction.
@monai
monai marked this pull request as ready for review August 28, 2026 14:12
@monai
monai merged commit 290e1d0 into main Aug 28, 2026
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