Skip to content

feat: disable Qwen3 thinking by default + NIAH bench QoL flags - #125

Merged
davide221 merged 1 commit into
Luce-Org:mainfrom
phazei:feat/qwen3-thinking-mode-flags
May 8, 2026
Merged

davide221 merged 1 commit into
Luce-Org:mainfrom
phazei:feat/qwen3-thinking-mode-flags

Conversation

@phazei

@phazei phazei commented May 8, 2026

Copy link
Copy Markdown
Contributor

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.

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

@davide221

Copy link
Copy Markdown
Contributor

@phazei thanks for your first contribution! Lgtm

@davide221
davide221 merged commit 1b61190 into Luce-Org:main May 8, 2026
1 check passed
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
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.

2 participants