Skip to content

Disable context_window_optimization by default#130

Merged
peteonrails merged 1 commit intomainfrom
fix/context-window-optimization-default
Jan 27, 2026
Merged

Disable context_window_optimization by default#130
peteonrails merged 1 commit intomainfrom
fix/context-window-optimization-default

Conversation

@peteonrails
Copy link
Owner

Summary

Problem

Some Whisper models (especially large-v3 and large-v3-turbo) experience phrase repetition loops when context window optimization is enabled. Users report output like "word word word" when saying something once.

Solution

  1. Default to disabled - Maximum compatibility out of the box
  2. Safer when enabled - When users opt-in, the optimization now includes:
    • no_context=true to prevent text conditioning loops
    • Minimum 384 frame threshold (~7.7s context) to avoid instability
    • Alignment to multiple of 8 for GPU backend compatibility (Metal, Vulkan)
    • Increased padding (128 vs 64 frames)

Test plan

  • All 232 tests pass
  • Verified new default behavior in config tests
  • Verified audio_ctx calculations with new formula
  • Verified alignment to multiple of 8

Closes #124

Co-authored-by: Christopher Albert albert@alumni.tugraz.at

Some Whisper models (especially large-v3 and large-v3-turbo) experience
phrase repetition loops when context window optimization is enabled.
This change disables the optimization by default for maximum compatibility
while making it safer when explicitly enabled.

Changes:
- Default context_window_optimization to false
- Add no_context=true when optimization is enabled (prevents repetition)
- Use more conservative formula with minimum threshold (384 frames)
- Align audio_ctx to multiple of 8 for GPU backend compatibility
- Update documentation and troubleshooting guide

Closes #124

Co-authored-by: Christopher Albert <albert@alumni.tugraz.at>
@peteonrails peteonrails merged commit 0af2abb into main Jan 27, 2026
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.

context_window_optimization causes text repetition/hallucination loops

1 participant