Whisper 靜音幻覺測試:500 段無語音片段中有 74 段產生文字
Whisper Hallucination on Silence: 74 of 500 Empty Clips Got Text
作者以 faster-whisper large-v3 的預設設定測試 500 段無語音片段,其中 74 段(14.8%)產生文字,呼吸聲片段的幻覺比例最高,達 1 in 4。
The candidate said nothing for nine seconds. They were thinking. My AI interviewer replied: "You're welcome! Happy to help."
Nobody had thanked it. Whisper had transcribed those nine seconds of breathing as "Thank you." and the LLM did the polite thing. That's Whisper hallucination on silence, and once I went looking, it was all over my logs.
So I stopped guessing and measured it. I fed 500 clips that contained zero speech into Whisper large-v3. 74 of them came back with words.
TL;DR
- Whisper hallucinates on silence. With faster-whisper defaults, 74 of my 500 speech-free clips (14.8%) produced text, mostly "Thank you.", "Thanks for watching!" and a lone "you".
-
no_speech_thresholddoesn't save you by itself. A segment is only dropped whenno_speech_prob > 0.6ANDavg_logprob < -1.0. Confident hallucinations have a high logprob, so they pass. -
A VAD gate is the real fix.
vad_filter=Truecut hallucinations from 74 to 5. Adding ano_speech_probpost-filter and a tiny phrase blocklist got it to 0. - It costs something. The full filter dropped 9 of 300 real short answers ("yeah", "mm, no") versus 2 with defaults. Tuning the VAD threshold brought that to 4.
Where did this show up?
In the voice pipeline of Preterview, a mock interview platform I built and run (full disclosure: I built it). It runs spoken interviews with three interviewer styles and writes a scored report at the end, so every transcript line either feeds the next question or ends up in a score. A phantom "Thanks for watching!" isn't cosmetic there. It's an off-topic answer the scorer has to grade. If you want to see the kind of session where this happens, it's at preterview.com/en.
I grepped two weeks of transcripts for "thanks for watching". It appeared in 23 sessions. Nobody says that in an interview.
Why does Whisper hallucinate on silence?
Whisper is a sequence-to-sequence model trained on a huge pile of web audio paired with subtitles. It was never really trained to output "nothing". When it gets a 30-second window with no speech, the decoder still wants to emit tokens, and the most likely tokens for "quiet audio at the end of a video" are exactly the phrases that sat at the end of a lot of subtitle files: thank-yous, sign-offs, subtitle credits.
That's the common explanation, and my results fit it perfectly. The model isn't confused. It's confidently predicting what usually follows silence on the internet.
How often does Whisper hallucinate on silent audio?
Here's the setup. I recorded 500 clips, 4 to 12 seconds each, with no speech at all, across three mics in my own office:
- 200 clips of plain room tone
- 150 clips of "thinking noises": breathing, sighs, lip smacks
- 100 clips of keyboard and mouse
- 50 clips of a fan running
Then I ran them through faster-whisper with the settings I actually had in production:
from faster_whisper import WhisperModel
model = WhisperModel("large-v3", device="cuda", compute_type="float16")
segments, info = model.transcribe(audio_path, language="en")
text = "".join(s.text for s in segments).strip()
74 clips returned non-empty text. By category:
| Clip type | Clips | Hallucinated |
|---|---|---|
| Room tone | 200 | 9 |
| Breathing / thinking | 150 | 38 |
| Keyboard / mouse | 100 | 19 |
| Fan | 50 | 8 |
Breathing was the worst: 1 in 4. Which is brutal, because "candidate breathes while thinking" is the single most common silence in an interview.
What it said:
- "Thank you.": 31
- "Thanks for watching!": 12
- "you": 10
- "Bye.": 5
- subtitle-credit style lines: 4
- other junk: 12
Why doesn't no_speech_threshold catch Whisper hallucinations?
Because it's half of an AND gate. In both openai-whisper and faster-whisper, a segment is treated as silence and skipped only when both conditions hold:
# simplified from the decode loop
should_skip = (
no_speech_prob > no_speech_threshold # default 0.6
and avg_logprob < log_prob_threshold # default -1.0
)
The logic is reasonable on paper: "the model thinks there's no speech, and the text it produced is low-confidence, so throw it away." But a hallucinated "Thank you." is not low-confidence. It's one of the most probable token sequences the model knows.
In my 74 hallucinations:
- 52 had
no_speech_prob > 0.6. The model knew there was probably no speech. - All 52 of those had
avg_logprob > -1.0. So the AND gate kept every single one. - The other 22 had
no_speech_probunder 0.6. The model was simply wrong about there being speech.
That was the moment the bug made sense. The signal was sitting right there in no_speech_prob, and the default skip rule was throwing it away.
How do you stop Whisper from hallucinating on silence?
Don't send silence to Whisper. Gate it with a VAD first, then filter what comes back. Here's the stack I ended up with, and what each layer did on the same 500 clips:
| Change | Hallucinations |
|---|---|
| Defaults | 74 |
Post-filter: drop if no_speech_prob > 0.6 (ignore logprob) |
22 |
vad_filter=True only |
5 |
VAD + no_speech_prob post-filter |
3 |
| VAD + post-filter + short-phrase blocklist | 0 |
The code:
BLOCKLIST = {"thank you.", "thanks for watching!", "you", "bye."}
segments, info = model.transcribe(
audio_path,
language="en",
vad_filter=True, # Silero VAD, off by default
vad_parameters=dict(min_silence_duration_ms=500),
condition_on_previous_text=False, # stop one ghost seeding the next
)
kept = []
for s in segments:
if s.no_speech_prob > 0.6:
continue
short = (s.end - s.start) < 1.5
if short and s.text.strip().lower() in BLOCKLIST:
continue
kept.append(s.text)
A few notes from getting this wrong first:
The VAD does almost all the work. faster-whisper ships Silero VAD built in, but vad_filter defaults to False. Flipping one boolean took me from 74 to 5. If you take one thing from this post, it's that line.
condition_on_previous_text=False matters for long answers. With it on, a hallucinated phrase becomes the prompt for the next 30-second window, and you get loops: "Thank you. Thank you. Thank you." In 120 long answers (60+ seconds, with a real thinking pause in the middle), 7 had a repetition loop with defaults. With it off: 1.
The blocklist is ugly, and I kept it anyway. It only fires on segments under 1.5 seconds whose entire text is an exact match. A real candidate who says "Thank you" after a 40-word answer is untouched. A 0.8-second isolated "you" after a breath is gone.
What did the fix cost?
Real words. Every silence filter trades hallucinations for dropped speech, and short, quiet answers are what get eaten.
I recorded 300 real short answers: "yes", "yeah", "mm, no", "I think so", said at normal and low volume.
- Defaults: 2 of 300 dropped or clipped
- Full stack (VAD + post-filter + blocklist): 9 of 300
- Full stack with Silero
thresholdlowered from 0.5 to 0.35: 4 of 300
The lower threshold let 1 hallucination back in on the silent set (0 became 1). I took that trade. A missed "yeah" is recoverable: the interviewer just asks again. A phantom "Thanks for watching!" gets graded.
Latency barely moved. The VAD pass is cheap next to a large-v3 decode, and skipping silent windows means fewer decodes overall, so end-to-end it was a wash on my hardware.
What I'd check in any Whisper pipeline
- Is
vad_filter(or an external VAD) actually on? Check, don't assume. - Are you using
no_speech_probon your own, not just through the AND gate? - Is
condition_on_previous_texton for long-form audio with pauses? Try it off. - Grep your transcripts for "thank you", "thanks for watching", and lone "you". The count will tell you if you have this bug.
- Build a silence test set from your audio conditions. Breathing hallucinated 4x more often than room tone for me. Your mics and rooms will differ.
So does Whisper hallucinate on silence?
Yes. Whisper hallucination on silence is reproducible: with faster-whisper's default settings, 74 of my 500 speech-free clips (14.8%) came back with text, mostly "Thank you." and "Thanks for watching!", and breathing noise was the worst trigger at 1 in 4. The built-in no_speech_threshold misses most of it because a segment is only skipped when no_speech_prob is high and avg_logprob is low, and hallucinations are high-confidence. The fix is to gate audio with a VAD (vad_filter=True in faster-whisper), drop segments with no_speech_prob > 0.6 on your own, disable condition_on_previous_text for long audio, and accept that you'll lose a few very quiet short answers in exchange.
Written by the developer behind Preterview, an interview prep platform.
來源:DEV Community · dev.to
