Add recognition context support for Qwen3-ASR - #144
Open
yukukotani wants to merge 1 commit into
Open
Conversation
yukukotani
marked this pull request as ready for review
August 25, 2026 15:03
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.
Adds a shared recognition-context option across the public API, CLI, and language bindings, with Qwen3-ASR as the only model family that currently advertises and consumes it.
Why
Qwen3-ASR can use background text such as names, jargon, and domain terminology to improve recognition, but transcribe.cpp did not expose a way to provide that context. Reusing Whisper's
initial_promptwould conflate two model-specific semantics and would not provide a consistent option across single, batch, and streaming APIs.What
Core API and Qwen3-ASR
contexttotranscribe_run_paramsand add the independentTRANSCRIBE_FEATURE_CONTEXTcapability while preserving size-aware ABI compatibility.CLI and bindings
--context TEXTto the CLI.Tests and documentation
Notes
contextis intentionally separate from Whisper'sinitialPrompt/initial_prompt. Whisper's option is a Whisper-specific decoder prompt: it conditions decoding as transcript text preceding the current audio and can carry vocabulary, capitalization, punctuation, or style into the output. Qwen3-ASR recognition context is background information placed in the chat template's system turn to bias recognition toward names, jargon, and domain terminology. It is not prior transcript text, and it does not promise instruction following, translation, output formatting, punctuation, or style control.contextis implemented in the commontranscribe_run_paramsAPI rather than as a Qwen3-ASR-specific extension. This follows the earlier review discussion on PR #83, which noted that multiple model families have analogous recognition-context capabilities and that the option therefore belongs in the main API. Qwen3-ASR is currently the only family that advertises and consumes the capability; unsupported families warn and ignore it.