Repository navigation
Add an opt-in repetition guard for Nemotron Transcribe - #1198
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nemotron Transcribe can repeat generated text until its output cap without producing EOS. Add an opt-in
repetition_guardrequest option, defaultfalse, using NVIDIA NeMo-Speech.cpp'sLoopGuarddetection rules.The guard detects short periodic token loops and sustained replay of previously emitted token sequences. It retains the generated prefix, including the newest token, and reports
termination: "repetition_detected"rather than claiming EOS. State is local to each generation; logits and sampling are unchanged. Disabled requests do not construct or update detector state.Enable with
--request-option repetition_guard=true, or"options": {"repetition_guard": true}in a server request. It limits wasted generation; it does not repair wrong-language output or recover missing speech. Genuine repeated speech can trigger it, and some repetition does not meet its thresholds, so it remains opt-in.The implementation is adapted from NVIDIA/NeMo-Speech.cpp at
536b17a41bef62d2a67a40ed3df61df26a4389fe, retaining its attribution. No script/language mask is imported. Changes are limited to this model's decoder, request contract, documentation and tests, plus its source registration.Validation
Debug CUDA inference on RTX 5090 with native Q4_K_S experts and the F16 encoder, greedy decoding and a 768-token output cap:
Guarded text was an exact prefix of unguarded text. Disabling the guard afterward restored the original full output exactly. The uninterrupted fixture also ended normally in a smaller-capacity sequence, so the priming sequence is part of that reproducer; this does not claim all fresh three-minute requests loop.
Related: #1180. This addresses runaway repetition handling, not the broader language/prompt investigation.