Fix: require low avg_logprob before skipping fallback on no-speech - #2
Merged
Conversation
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.
This was referenced Aug 28, 2026
monai
marked this pull request as ready for review
August 28, 2026 14:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
decode_with_fallbackskips the retry steps whenno_speech_prob > no_speech_threshold. It ignoresavg_logprob. So good, real speech segments get dropped or transcribed wrong.openai/whisper(transcribe.py) andtransformers(generation_whisper.py,_need_fallback) both treat a segment as silence only when both are true:no_speech_prob > no_speech_thresholdANDavg_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.