How to Fix OpenAI Whisper Hallucinations and Repetition Loops

Whisper turns silent gaps into ghost phrases and loops identical sentences forever. Here is how to fix decoding parameters, tune VAD, and stabilize your transcription pipeline.

Sound engineer examining complex audio waveforms and spectral analysis on a monitor in a sound studio
On this page
  1. The Anatomy of a Whisper Hallucination
  2. Adjusting Whisper Decoding Parameters
  3. 1. Disable conditiononprevioustext
  4. 2. Tighten nospeechthreshold and logprobthreshold
  5. 3. Lower compressionratiothreshold
  6. 4. Configure Temperature Fallback
  7. Pre-Processing with Voice Activity Detection (VAD)
  8. Avoiding the Prompt Hallucination Trap
  9. Model Selection: Large-v2 vs Large-v3
  10. The Pain of Self-Hosting Whisper
  11. A Done-for-You Alternative: Whisper AI PRO
  12. Troubleshooting Checklist for Repetition Loops

OpenAI Whisper hallucination happens when the model generates phantom words during silent pauses or traps itself in an endless repetition loop. You can stop most hallucinations by tuning internal thresholds like no_speech_threshold and compression_ratio_threshold, pairing the model with voice activity detection, or setting condition_on_previous_text to False.

Whisper is an encoder-decoder Transformer. The audio encoder processes raw spectrograms into feature representations, while the autoregressive text decoder predicts the next word based on both those audio features and the tokens it has already generated. When the audio signal weakens, drops out, or contains ambient hum, the acoustic features stop providing clear guidance. At that exact moment, the language model takes over.

Instead of reporting silence, the decoder predicts what text "should" come next based on internet training data. That is why you suddenly see strings like "Thank you for watching!", random YouTube outro credits, or an identical sentence printed thirty times across your log.

The Anatomy of a Whisper Hallucination

Whisper hallucinations usually take one of two distinct forms. Recognizing which one you are dealing with tells you which parameter to adjust.

First are ghost transcriptions during silence or non-speech noise. Background air conditioning hum, vinyl crackle, distant music, or microphone hiss will trigger the decoder to invent complete sentences. It frequently outputs YouTube sign-offs ("Subscribe to my channel"), subtitle credits ("Transcribed by...", "Subtitles by the Amara.org community"), or religious verses. The model treats ambiguous acoustic noise as garbled speech and tries its best to decode it.

Second are repetition loops. The autoregressive decoder generates a sentence, feeds that sentence back into its context window as a prompt for the next 30-second window, and then gets trapped. It predicts the exact same sequence again. Because the sequence now appears twice in recent context, the probability that it should appear a third time climbs even higher. The model fills minute after minute of transcription with identical lines.

If you run Whisper on long files, you have probably watched this happen in real time. It destroys transcript accuracy, bloats file sizes, and wastes compute cycles.

Adjusting Whisper Decoding Parameters

OpenAI provided built-in heuristics in the official Whisper repository to detect and prevent hallucination loops. Many developers leave them at default values or accidentally disable them when porting code to custom inference engines.

1. Disable condition_on_previous_text

By default, Whisper carries over the text generated in the previous 30-second window to use as a prompt for the current window. This keeps style, names, and capitalization consistent across cuts. But it is also the primary driver of catastrophic repetition cascades.

If window A hallucinates a phrase or enters a loop, window B inherits that hallucinated text as context. Window B then repeats it, passing it forward to window C.

Setting condition_on_previous_text=False cuts this feedback loop entirely. Each 30-second chunk decodes in isolation. You sacrifice a tiny bit of stylistic continuity across window seams, but in practice, you instantly eliminate 80% of persistent repetition errors.

2. Tighten no_speech_threshold and logprob_threshold

Whisper computes two internal diagnostic scores for every audio chunk:

  • no_speech_prob: The probability that the 30-second segment contains zero speech.
  • avg_logprob: The average log probability of the generated tokens, measuring the model's confidence.

By default, no_speech_threshold is set to 0.6. If no_speech_prob is higher than this value and the average log probability is lower than logprob_threshold (default -1.0), Whisper marks the segment as silent and skips outputting text.

If your audio contains quiet room noise and Whisper still invents speech, lower no_speech_threshold to 0.4 or 0.3. Raise logprob_threshold to -0.8 or -0.6. This forces Whisper to discard speculative output unless it is genuinely confident that the audio contains human speech.

3. Lower compression_ratio_threshold

Repetitive text compresses exceptionally well. Whisper uses this mathematical quirk as a tripwire: it compresses its raw output using zlib. If the resulting compression ratio exceeds compression_ratio_threshold (default 2.4), Whisper flags the segment as a repetition loop, discards the output, and retries with a higher temperature or drops the chunk.

If repetitive loops are slipping past your pipeline, drop this threshold to 2.0 or 1.8. It catches subtle loops earlier. Be careful not to set it below 1.5, or natural human repetitions (like someone stuttering or reciting a list of numbers) will get dropped as false positives.

A visualization of audio waveforms alongside raw text output showing transcription verification
Spectrogram inspection showing silent gaps where hallucination errors typically generate

4. Configure Temperature Fallback

Whisper uses greedy decoding at temperature 0.0 by default. When a chunk fails the compression ratio or log probability check, Whisper does not give up immediately. It increases the temperature (for example, stepping through 0.2, 0.4, 0.6, 0.8, 1.0) and attempts to decode the chunk again.

A non-zero temperature introduces randomness. Sometimes this helps the decoder jump out of a repetitive trap. In noisy audio, however, high temperatures actually invite bizarre hallucinations. Setting your temperature schedule strictly to temperature=(0.0, 0.2) or disabling temperature fallback altogether often produces cleaner results on challenging recordings.

Here is a reference configuration in Python using the official whisper library:

import whisper

model = whisper.load_model("large-v3")
result = model.transcribe(
    "recording.mp3",
    condition_on_previous_text=False,
    compression_ratio_threshold=2.0,
    logprob_threshold=-0.8,
    no_speech_threshold=0.4,
    temperature=(0.0, 0.2)
)

Pre-Processing with Voice Activity Detection (VAD)

The most reliable way to prevent Whisper from hallucinating on silence is simple: do not feed silence to Whisper.

Whisper's built-in silence detection is trained on raw spectrograms and frequently fails on musical interludes, coughing, mic bumps, and distant traffic. If you are dealing with dirty recordings, check out our guide on how to transcribe audio with background noise.

A dedicated Voice Activity Detector like Silero VAD evaluates the audio before Whisper ever touches it. Silero runs fast, uses negligible memory, and segments the audio file into exact speech timestamps, stripping away silent gaps, ringtones, and pauses.

Libraries like faster-whisper include built-in Silero VAD integration out of the box. Running inference with VAD enabled looks like this:

from faster_whisper import WhisperModel

model = WhisperModel("large-v3", device="cuda", compute_type="float16")

segments, info = model.transcribe(
    "interview.wav",
    vad_filter=True,
    vad_parameters=dict(min_silence_duration_ms=500)
)

for segment in segments:
    print(f"[{segment.start:.2f}s -> {segment.end:.2f}s] {segment.text}")

When Whisper only receives audio segments that contain verified human speech, hallucinated YouTube credit lines disappear almost entirely.

Avoiding the Prompt Hallucination Trap

Whisper accepts an initial_prompt parameter. It is designed to nudge the model toward specific vocabulary, spelling conventions, product names, or acronyms. But prompts are a double-edged sword.

If you provide a prompt that contains repetitive punctuation, unnatural sentences, or prompt formats borrowed from conversational LLMs, Whisper treats that prompt as previous text. It mimics the style. If you pass an initial prompt like "Transcribe: Hello, world.", Whisper might begin prefixing every single output segment with "Transcribe: ".

Keep your initial prompts short, natural, and declarative. A comma-separated list of proper nouns and technical terms works best:

initial_prompt="PostgreSQL, Kubernetes, microservices, OAuth2."

Never feed conversational instructions, system commands, or multiple identical sentences into Whisper's prompt window. It will interpret them as precedent and hallucinate similar patterns throughout the file.

Studio microphone on an isolation mount over an acoustic diffuser in a soundproofed room
A studio microphone setup designed to minimize room noise and acoustic bleed

Model Selection: Large-v2 vs Large-v3

When OpenAI released large-v3, many practitioners noticed a surprising regression: while its word error rate (WER) improved slightly on benchmarks, its hallucination rate on non-speech segments and background noise jumped noticeably compared to large-v2.

The v3 model was trained on more diverse, weakly supervised data and uses a 128-channel mel filterbank instead of the 80-channel filterbank in previous versions. This makes it more sensitive to subtle acoustic textures, but that sensitivity leads to creative hallucinations when faced with music or room reverberation.

If you are struggling with hallucinations on noisy audio and fine-tuning thresholds has not fixed it, test the same file on large-v2 or medium.en. Many production transcription pipelines stick to large-v2 specifically because its behavior on silence is more predictable.

The Pain of Self-Hosting Whisper

Building a bulletproof transcription pipeline requires gluing together multiple moving parts. You need an optimized inference runner like CTranslate2, a tuned VAD model, chunking logic to handle long files, memory management for GPU vRAM, and post-processing filters to catch stray loops.

If you run into memory limits or file barriers, see our breakdown on how to bypass OpenAI Whisper 25MB file size limit. If your audio features multiple participants talking over each other, you also need to manage OpenAI Whisper speaker diarization alongside your hallucination guards.

All of this takes hours of configuration, testing, and infrastructure upkeep. If you just want accurate transcripts without writing Python scripts or maintaining GPU servers, you can use a ready-built interface instead.

A Done-for-You Alternative: Whisper AI PRO

If you prefer not to spend your afternoons tweaking compression thresholds in code, Whisper AI PRO handles the entire audio normalization and transcription pipeline automatically. You can read more about how managed setups compare to raw models in our overview of Whisper transcription online.

You can upload MP3, M4A, WAV, WEBM, MP4, MOV, OGG, FLAC, and AAC files directly, or record your voice right in the browser. The platform automatically detects the spoken language across 40+ options, strips out problematic silence, and applies speaker labels so you always know who said what.

Beyond raw text, each transcript includes time-stamped segments, automatic AI summaries, and interactive tools that let you ask questions about your recording, translate foreign speech, or generate study flashcards and quizzes. You can export clean results to PDF, Word (.docx), or plain text.

You can test it completely free: run one transcript up to 5 minutes without creating an account, and get another transcript free when you sign up. For heavy workloads, Whisper AI PRO plans offer unlimited transcriptions up to 2 hours per file.

If you do not want to manage Python virtual environments, check out our tutorial on how to use OpenAI Whisper without coding.

Troubleshooting Checklist for Repetition Loops

Before you deploy your next transcription run, run through this five-point diagnostic sequence:

  1. Check your audio track in an editor like Audacity to confirm silence levels. High noise floors fool Whisper's silence heuristics.
  2. Turn off previous text conditioning by setting condition_on_previous_text=False.
  3. Add a Voice Activity Detection stage (like Silero VAD) to strip silent passages before the audio reaches the Transformer.
  4. Drop compression_ratio_threshold from 2.4 down to 2.0 to catch repetitive text early.
  5. Test your audio on large-v2 if you are currently seeing high hallucination frequencies on large-v3.

Apply these steps systematically. Inspect the first two minutes of your output, monitor your decoder log probabilities, and you will have a stable, hallucination-resistant transcription workflow.

Questions

Whisper gets stuck in repetition loops because its autoregressive decoder uses its own previous output as context for subsequent audio windows. When it hallucinates once or encounters low-confidence audio, it reinforces the hallucinated phrase in the context window. Setting condition_on_previous_text to False breaks this loop.

Ghost phrases like 'Thank you for watching' appear because Whisper's training data contains thousands of YouTube videos with silent outro screens. You can eliminate them by passing your audio through a Voice Activity Detector (VAD) before transcription or by lowering the no_speech_threshold parameter to 0.4.

Yes, many developers report that large-v3 exhibits higher hallucination rates on silent or noisy background audio compared to large-v2. If strict thresholds and VAD do not resolve your repetition errors, switching back to large-v2 often provides more stable transcription.

The default compression_ratio_threshold is 2.4, which often allows subtle repetition loops through. Setting it between 1.8 and 2.0 catches repeating loops much earlier without discarding natural human speech like stuttering or repeated names.