Skip to content

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

Merged
lucasnewman merged 2 commits into
Blaizzy:mainfrom
monai:fix/fallback-no-speech-condition
Aug 29, 2026
Merged

lucasnewman merged 2 commits into
Blaizzy:mainfrom
monai:fix/fallback-no-speech-condition

Conversation

@monai

@monai monai commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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 #918 and #920.

monai added 2 commits August 29, 2026 14:46
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 force-pushed the fix/fallback-no-speech-condition branch from 4314c6b to 05aaa40 Compare August 29, 2026 11:46
@lucasnewman
lucasnewman merged commit 9cef816 into Blaizzy:main Aug 29, 2026
15 checks passed
@monai
monai deleted the fix/fallback-no-speech-condition branch August 29, 2026 21:33
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.

2 participants