Repository navigation
feat: disable Qwen3 thinking by default + NIAH bench QoL flags - #125
Merged
Merged
Conversation
Three small, related changes around Qwen3.x thinking-mode handling and
the NIAH harness.
server.py: default `enable_thinking=False`
The OpenAI-compatible endpoint applied the tokenizer chat template with
no `enable_thinking` kwarg, which falls through to the Qwen3.x template
default of `True`. With thinking on, every reply burns its `n_gen`
budget on a chain-of-thought rollout that DFlash's drafter cannot
predict, collapsing acceptance rate (typically ~60% -> single digits)
and frequently exhausting `max_tokens` before the answer block starts.
The default flips to `False`. Clients keep full control by sending
`"chat_template_kwargs": {"enable_thinking": true}` per request, which
the existing template-kwargs passthrough merges in. This repo only
serves Qwen3.5/3.6, so the default is safe; the kwarg is silently
ignored by tokenizers whose templates do not reference it.
bench_niah_cpp.py: `--no-thinking` flag
The NIAH bench builds its own chat prompt (independent of the server
path) and hit the same problem at 117K context: Qwen3.6 spent the full
generation budget thinking and never reached the answer. Adds a
`--no-thinking` flag that injects `enable_thinking=False` into the
target's `apply_chat_template` call. Default is off, so existing
invocations are unchanged.
niah_gen.py: `--seed-base` flag
Replaces the hardcoded `seed=42 + i` with a `--seed-base` argument
(default 42). Lets you generate independent case sets without changing
`--n`, e.g. for held-out validation passes.
Contributor
|
@phazei thanks for your first contribution! Lgtm |
smpurkis
pushed a commit
to smpurkis/lucebox-hub
that referenced
this pull request
May 10, 2026
…flags feat: disable Qwen3 thinking by default + NIAH bench QoL flags
oliveagle
pushed a commit
to oliveagle/lucebox-hub
that referenced
this pull request
May 22, 2026
…flags feat: disable Qwen3 thinking by default + NIAH bench QoL flags
oliveagle
pushed a commit
to oliveagle/lucebox-hub
that referenced
this pull request
May 22, 2026
…flags feat: disable Qwen3 thinking by default + NIAH bench QoL flags
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.
Three small, related changes around Qwen3.x thinking-mode handling and the NIAH harness.
server.py: default
enable_thinking=FalseThe OpenAI-compatible endpoint applied the tokenizer chat template with no
enable_thinkingkwarg, which falls through to the Qwen3.x template default ofTrue. With thinking on, every reply burns itsn_genbudget on a chain-of-thought rollout that DFlash's drafter cannot predict, collapsing acceptance rate (typically ~60% -> single digits) and frequently exhaustingmax_tokensbefore the answer block starts.The default flips to
False. Clients keep full control by sending"chat_template_kwargs": {"enable_thinking": true}per request, which the existing template-kwargs passthrough merges in. This repo only serves Qwen3.5/3.6, so the default is safe; the kwarg is silently ignored by tokenizers whose templates do not reference it.bench_niah_cpp.py:
--no-thinkingflagThe NIAH bench builds its own chat prompt (independent of the server path) and hit the same problem at 117K context: Qwen3.6 spent the full generation budget thinking and never reached the answer. Adds a
--no-thinkingflag that injectsenable_thinking=Falseinto the target'sapply_chat_templatecall. Default is off, so existing invocations are unchanged.niah_gen.py:
--seed-baseflagReplaces the hardcoded
seed=42 + iwith a--seed-baseargument (default 42). Lets you generate independent case sets without changing--n, e.g. for held-out validation passes.