EarScribe
Correction7 min read

Whisper hallucination: what you can fix in a browser, and what you cannot

The standard advice is four decoder settings, and in a browser build 0 of the 4 reach the decoder. What 36 runs on silence actually returned, and the 3 things that do work, are below.

The advice paraphrases OpenAI's own transcribe.pysignature.

def transcribe(
    model, audio, *,
    compression_ratio_threshold: float = 2.4,   # gzip ratio above this = failed decode
    logprob_threshold: float = -1.0,            # avg logprob below this = failed decode
    no_speech_threshold: float = 0.6,           # <|nospeech|> above this = silence
    condition_on_previous_text: bool = True,    # previous output becomes the next prompt
    ...):
The four settings the advice is built on, as the reference implementation defaults them.— openai/whisper, whisper/transcribe.py, transcribe() signature

Do those settings exist in a browser build?

4 steps in the call chain, and the last one keeps only the names it already knows. A parameter reaches the model only if a property with that name exists on the generation config, and 0 of these 4 do.

4 settings the advice names

  • no_speech_threshold
  • compression_ratio_threshold
  • logprob_threshold
  • condition_on_previous_text

4 dropped before the decoder

  • dropped · src/models.js:1503
  • dropped · src/models.js:1503
  • dropped · src/models.js:1503
  • dropped · src/models.js:1503
The same four names; what changes is which file decides their fate.— @huggingface/transformers 3.8.1, content/guides/data/transformers-asr-params.json

The failure is silent: an unknown key is never rejected, logged or warned.

  1. 1pipeline(audio, kwargs)

    1804

  2. 2generation_config = { ...kwargs }

    1810

  3. 3model.generate({ inputs, ...generation_config })

    1883

  4. 4pick(kwargs, Object.getOwnPropertyNames(gen_config))

    1503

Your parameter survives 3 of these 4 steps; the last keeps only the names it knows.— @huggingface/transformers 3.8.1

2 near-misses explain why the advice survives a skim: suppress_tokens is real but its processor is commented out, and prompt_ids exists with nothing reading it.

Whisper hallucination on silence: the 36-run answer

6 files whose correct transcript is nothing — silence, 3 room-tone levels, 1 click, one that stops talking 26 s before it ends — through 3 models on 2 weight sets: 36 runs.

Inputtinybasesmall
Silence, 30 s[BLANK_AUDIO][BLANK_AUDIO][BLANK_AUDIO]
Room tone, −60 dB[silence] → [BLANK_AUDIO][ Silence ][ Silence ]
Room tone, −40 dB[silence] → [Music](water flowing) → [Pause][BREAKING]
Room tone, −20 dB(birds chirping) → [BLANK_AUDIO](clippers buzzing) → [Music][ ] [ ]
Silence + one click[BEEP] → [BLANK_AUDIO][BEEP] → [BLANK_AUDIO][BLANK_AUDIO]
Speech, then 26 s silenceWelcome back to the show, today we are talking with the researcher who studies attention at work. Thanks for having me, the first thing I tell people is that interactions aren't really the problem. Really, then what is? Getting back, after a short break, most of us need a few minutes to find out place again. So what actually helps? Before you start, write down the very next step. One sentence is enough. When you return, you start from that note instead of from memory. One sentence, that's simple enough to try this week. [BLANK_AUDIO] → Welcome back to the show, today we are talking with the researcher who studies attention at work. Thanks for having me, the first thing I tell people is that interactions aren't really the problem. Really, then what is? Getting back, after a short break, most of us need a few minutes to find out place again. So what actually helps? Before you stop, write down the very next step. One sentence is enough. When you return, you start from that note instead of from memory. One sentence, that's simple enough to try this week. [BLANK_AUDIO]Welcome back to the show, today we're talking with the researcher who studies attention at work. Thanks for having me, the first thing I tell people is that interruptions aren't really the problem. Really? Then what is? Getting back, after a short break, most of us need a few minutes to find our place again. So what actually helps? Before you start, write down the very next step. One sentence is enough, when you return, you start from that note instead of from memory. One sentence, that simple enough to try this week. [BLANK_AUDIO] → Welcome back to the show. Today we're talking with the researcher who studies attention at work. Thanks for having me. The first thing I tell people is that interruptions aren't really the problem. Really? Then what is? Getting back, after a short break, most of us need a few minutes to find our place again. So what actually helps? Before you stop, write down the very next step. One sentence is enough, when you return, you start from that note instead of from memory. One sentence, that simple enough to try this week. [BLANK_AUDIO]Welcome back to the show. Today we're talking with a researcher who studies attention at work. Thanks for having me. The first thing I tell people is that interruptions aren't really the problem. Really? Then what is? Getting back. After a short break, most of us need a few minutes to find our place again. So what actually helps? Before you stop, write down the very next step. One sentence is enough. When you return, you start from that note instead of from memory. One sentence. That's simple enough to try this week. [BLANK_AUDIO]
What came back. Amber means fp32 answered differently — 8-bit text first, fp32 after the arrow.— content/guides/data/silence-hallucinations.json

The famous failure — a subtitle filled with “Thank you.” — never appeared: on digital silence all 6 combinations answered [BLANK_AUDIO]. At −40 dB the largest model returned [BREAKING].

EarScribe transcript of a silent 30-second file showing a single [BLANK_AUDIO] annotation and an empty word count
30 s of digital silence in the shipped app: the annotation is the whole hallucination.— product UI, default model, 30 s silence

6 characters for [BEEP], 13 for [BLANK_AUDIO], 18 for (clippers buzzing) — all 36 runs:

Inputtiny q8tiny fp32base q8base fp32small q8small fp32AnswersRepeat
Silence, 30 s13131313131310
Room tone, −60 dB9131111111130
Room tone, −40 dB97157101050
Room tone, −20 dB16131877750
Silence + one click613613131320
Speech, then 26 s silence53953853753653653650
Characters returned per run, distinct answers per file, longest tandem repeat. 13 is the empty token; 536 to 539 is real speech with nothing appended.— content/guides/data/silence-hallucinations.json

Good news: this stack does not ramble — 0 characters of repeat across 36 runs. Bad news: an annotation is indistinguishable from speech in a transcript, and [BEEP] or[BLANK_AUDIO] for the same click depends on which weights loaded.

Whisper keeps repeating a sentence. Is that the same problem?

0 repeats in 36 runs, longest tandem repeat 0 characters. The four settings were written for this: the prompt is the model's own last line, so condition_on_previous_text feeds a loop — and it is 1 of the 4 missing here. The answer is 30 s windows with a 5 s stride.

Evidence about these 6 files, not a promise about yours: the 2-hour meeting people report most is the one we did not run.

So what can a browser actually do?

3 steps reduce whisper hallucination with no decoder parameter, all inside the local transcriber.

  1. 1Detect the language first

    One decoder token on the first 30 s window; a wrong language is the usual cause of nonsense.

  2. 2Re-run instead of patching

    If the pass returns only [Music], run it once more with the detected language.

  3. 3Keep the window short

    30 s windows, 5 s stride. A repetition loop cannot span a boundary it never sees.

  4. 4Let a person see the token

    The annotation is visible, so it can be deleted. Nothing else removes it.

What is left when the settings are gone: input control, a second pass, a visible annotation.— workers/whisper.worker.ts:291-345, 398-428

The last step is the honest one: nothing removes [BLANK_AUDIO] from a finished transcript, which is why the music-only check exists.

When is there nothing left to fix?

2 hours of a lecture hall with the microphone at the back gives a plausible transcript of the room. The other 2: music under speech, and a phone call where the first window picks the wrong language. In all 3 the whisper hallucination is upstream of the tool.

What this page does not measure

Written by Rocnubee. Method: probe-asr-params.mjs, whisper-text-bench.mjs.