use case · wild · cross-lingual hallucination, forced prompting & 9-condition DSP stress lab · WASM q8 · 76.91 MB

Wild: Cross-Lingual Hallucination & 9-Condition Stress Lab

Probe two failure modes of Whisper-Base's 72.6M-parameter 6+6 decoder: (1) Forced Prompting Ablation — inject mismatched <|en|>, <|fr|>, <|es|>, <|de|>, or <|ja|> prefix tokens; and (2) 9-Condition Acoustic Stress Lab — inject calibrated white noise, telephone bandpass, hard clipping, quiet gain, time-stretch, and pure -∞ silence / -30 dB 440 Hz tone traps with Unicode Levenshtein WER diff.

1 · Whisper-Base Multilingual worker (76.91 MB q8 WASM)

2 · Shared audio source & repetition guard

Initialise Whisper-Base above to run forced-language prompt ablation and 9-condition DSP stress tests.

Loading clip…

3 · Forced wrong-language prompt conditioning ablation

Force a mismatched <|lang|> prefix token (en / fr / es / de / ja) on the same clean audio to observe how decoder prefix conditioning induces cross-lingual hallucination.

Whisper-Base output under forced language prefix prompts
Prompt token Step-0 prior Latency WER vs auto NaN Decoded text
Run a forced language prompt or 6-language ablation above.

4 · 9-Condition Acoustic DSP Stress & Silence/Tone Traps

WER vs clean–
Word accuracy–
Sub / Del / Ins–
Latency · speed–
NaN count–

Clean Whisper-Base baseline

Run a condition to establish the clean baseline.

Word-level diff (+10 dB white noise)

Run a condition to inspect substitutions, deletions, insertions, or trap output.

DSP condition scoreboard

Measured WER and latency across all 9 acoustic degradations and hallucination traps
Condition Duration Latency WER vs clean WER vs ref Transcript
Run a DSP condition or full 9-condition sweep above to populate the scoreboard.

5 · Inspect Gaussian SNR noise, clipping & Levenshtein WER code

Show the code · whisper-base-core.mjs — addGaussianNoiseAtSnr() (Box-Muller calibrated SNR noise)
Show the code · whisper-base-core.mjs — applyHardClipping() (+12 dB drive saturation clamp)
Show the code · whisper-base-core.mjs — computeWerAndDiff() (Unicode-aware Levenshtein alignment)