Repository navigation
0.10.13+: exit-thinking for Nemotron 3.5 Super (its owner's route; stacked on #2046) - #2061
Merged
Merged
Conversation
Since 0.10.12 the loop guard ends a repeating thought as `length` with no answer for every guarded family. #2040 lets Gemma 4 answer instead; this extends it to Qwen 3.5 and 3.6 (`qwen3_5`, `qwen3_5_moe`). Production, the last 12 h on 0.10.12, GPQA-shaped requests: 15.6-29.5 per 1,000 end guard-stopped with no answer (Qwen 3.6 35B 25.6, Qwen 3.5 35B 15.6, Qwen 3.5 9B 29.5), as often as Gemma's 20.2. Qwen 3.8 (`qwen4_exp`) is 1.4 per 1,000, so it stays out. Red tests and the API they need, with no behaviour yet: - Qwen's exit is the close as its template writes it, `\n</think>\n\n`, with `</think>` as its own token: [10, 248069, 10, 10] with the repo's Qwen byte tokenizer. The served prompt opens the thought (`<think>\n`), so the row starts inside it. Qwen 3.8 has none; the env list still turns Qwen's off and keeps Gemma's. - A repeating Qwen thought asks to end the thought; a loop after `</think>` does not. - The splice: with a multi-token exit, only the close marker's own token in flight means the row closed its thought itself (newlines do not). - Served end to end (scheduler, bridge, a scripted engine): the continuation is the prompt, the row's tokens and the four exit tokens; the answer follows `</think>\n\n`; and the continuation's stop strings apply from its first token (its scope starts outside the thought, where the row's started inside). - GenerationLoopExitThinking.closeToken and Markers.before/after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As #2040 does for Gemma 4: when the loop guard stops a verbatim loop inside a Qwen 3.5 or 3.6 thought (`qwen3_5`, `qwen3_5_moe`), the request continues with the thought closed and the model answers, instead of ending `length` with no answer. - The exit is the close as Qwen's template writes it, `\n</think>\n\n` (both served models' chat_template.jinja: '\n<think>\n' + reasoning + '\n</think>\n\n' + content; generation prompt `<think>\n`). `</think>` is an added token (248069, special: false); the text on each side is tokenized on its own, as in the whole string (`Markers.before/after`; [198, 248069, 271] with the real tokenizer). - Only the close marker's own token in the row's in-flight tokens means the row closed its thought itself (`closeToken`): with a multi-token exit a newline would have. - The continuation's stop strings are scoped from outside the thought (`reasoningPrefix: nil`): the row's scope starts inside, as Qwen's prompt opens `<think>`, which would have kept a client's stop strings off for the whole answer. - Default list: gemma4, gemma4_text, qwen3_5, qwen3_5_moe. Not Qwen 3.8 (`qwen4_exp`): 1.4 per 1,000 GPQA-shaped requests end that way. DARKBLOOM_LOOP_EXIT_THINKING=gemma4,gemma4_text keeps Gemma's alone. - Docs (loop guard section) and a changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fresh-context review of eac6e9f (REQUEST CHANGES) found: - 1 (major): `qwen3_5` is not only Qwen 3.5 9B but also Qwen 3.8 27B (EigenLabs/Qwen3.8-27B-4bit[-mtp]; `qwen4_exp` is Flash-Next), so the default turned the exit on for a model with rare loops and an unchecked template, and the 9B is not in the A/B. - 3 (minor): the "closed its thought itself" check reads tokens only. A `</think>` whose text the detokenizer has not released when the guard fires, or one spelled as ordinary pieces after the stop, would get a second close. - 4 (minor): a client stop string that ends the continuation is not the request's matched stop sequence (the row ended `length`). - 6 (nit): nothing checks that the exit's tokens spell its text. Red tests and the API they need, with no behaviour yet: - Only `qwen3_5_moe` (Qwen 3.5/3.6 35B) is on by default; `qwen3_5` through the env list. Served: Qwen 3.8 27B keeps `length`. - A close token in the stopping delta whose text has not arrived keeps the stop a `length`; `</think>` in the in-flight text after the stop marks the record (`GenerationLoopExitRecord.closedAfterStop`), and the splice then does not continue. - With `stop: ["B"]`, the continuation's matched stop is the request's. - A tokenizer whose encode adds a prefix gets no exit. - Coverage: a multi-turn prompt with `</think>` in its history starts inside; a thought the model opens itself after a thinking-off prompt can be ended; a split `</think>` closes it. The serving tests use Qwen 3.6 (`qwen3_5_moe`); the marker-less family is GPT-OSS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 1: `qwen3_5` keeps its marker but is off by default. It is Qwen 3.5 9B and also Qwen 3.8 27B (EigenLabs/Qwen3.8-27B-4bit[-mtp]), whose loops are rare and whose template was not checked; the 9B is not in the A/B. On by default: gemma4, gemma4_text, qwen3_5_moe (Qwen 3.5 35B, Qwen 3.6 35B). `DARKBLOOM_LOOP_EXIT_THINKING=gemma4,gemma4_text,qwen3_5_moe,qwen3_5` adds the 9B and Qwen 3.8 27B. Wording fixed (Qwen 3.8 is not `qwen4_exp`). - 3: the guard does not ask to end the thought when the stopping delta carries the close token whose text the detokenizer still holds back; after the stop it keeps following the in-flight text, and a close there (a `</think>` spelled as ordinary pieces, or one that arrived late) marks the record, so the splice ends the request `length` instead of closing twice. - 4: the continuation has its own usage signal (one per engine request); when it ends the answer, its matched stop sequence is the request's, so the coordinator sees the stop that ended the answer (Gemma 4's too). - 6: no exit unless its tokens decode to its text. - 7: the channel-carry comment is right for `<think>`. - Docs and the changelog fragment. Also: 0.10.12's "a reasoning loop is stopped in the engine and ends as length" serving test (`qwen3_5`, Qwen 3.5 9B) failed on eac6e9f, which had `qwen3_5` on; it holds again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Super has the highest rate of any family: on 0.10.12, 29.6 per 1,000 GPQA-shaped requests (24/812, the last 12 h) end with the loop guard's stop and no answer, all `success` below the cap; identical prompts stop at the same count. Its GPQA rolling score is 82.7 against an 82.8 derank cutoff. Super's requests take its owner's route (NemotronSuperLocalImageHTTP -> NemotronSuperLocalBinding), not the scheduler's text path, so #2040/#2046's continuation never reaches them. Red tests and the API they need, with no behaviour yet: - Super's exit is `</think>` alone, as its pinned template writes a closed thought ("<think>\n" + reasoning + "</think>" + content); the thinking-on prompt opens the thought, thinking off starts outside; never with logprobs; the env list can leave Super's off; the guard carries it (`NemotronSuperRequestPlan.exitThinking(promptTokens:tokenizer:)`, `loopGuard(exitThinking:)`). - End to end through the binding (a scripted Super engine): a repeating thought is continued on the same bridge with the prompt, the row's tokens and `</think>`; the client gets `...</think>Answer: B` and one terminal with every token; a stop that ends the answer is the request's matched stop sequence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Super's requests take its owner's route, so the scheduler's continuation (#2040, #2046) never reached them. Now: - `nemotron_h_omni`'s exit is `</think>` alone: Super's pinned template writes "<think>\n" + reasoning + "</think>" + content, nothing around the marker (`</think>` is an added token, 13, special: false). On by default, subject to the A/B. - NemotronSuperRequestPlan.exitThinking(promptTokens:tokenizer:) resolves it from the rendered text prompt (never with logprobs or media), and the route passes it in the request's guard (`loopGuard(exitThinking:)`). - NemotronSuperLocalBinding.executeBridge continues the answer as the scheduler does (LoopExitThinkingContinuation), within the same admitted request and on the same bridge: it waits for the stopped row's slot (waitForRowRelease, 5 s), submits the prompt + the row's tokens + `</think>` with the budget the row left (at most 8,192), its own usage signal (its matched stop becomes the request's) and a plain guard (GenerationLoopGuard.withoutExit(), so a loop in the answer still ends `length`). A cancel stops whichever row runs, and the request waits for both rows' terminal observations. Never on a pair. - Docs (loop guard section) and a changelog fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…red) The A/B (Mac B, signed 0.10.12 vs this branch) found too few Qwen thought loops to show rescues: Qwen 3.6 never looped in 198 greedy GPQA draws, nor in 135 at T 0.5; Qwen 3.5 35B looped on 3 of 198 greedy draws, and of those only one looped again on the candidate, whose answer then looped too. Corrected production rates (the guard's stops only; cut-short streams were counted before): Qwen 3.6 1.6 and Qwen 3.5 35B 8.3 per 1,000 GPQA-shaped requests. So per the D1 rule (default-on only per the A/B), Qwen's exit stays listed and off by default; the env list turns it on. Red tests and the API they need, with no behaviour yet: - The default list leaves `qwen3_5_moe` (and `qwen3_5`) off; the env list turns it on. - Served: Qwen 3.5/3.6 keep today's `length` by default. - MultiModelBatchSchedulerEngine.exitThinkingSetting (the process's DARKBLOOM_LOOP_EXIT_THINKING unless a test sets it): the Qwen serving tests turn Qwen's exit on through it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- GenerationLoopExitThinkingPolicy.defaultModelTypes is gemma4, gemma4_text: Qwen 3.5/3.6 (`qwen3_5_moe`, `qwen3_5`) keep their marker and exit, off by default. DARKBLOOM_LOOP_EXIT_THINKING=gemma4,gemma4_text,qwen3_5_moe turns it on for the 35B models; ...,qwen3_5 adds the 9B and Qwen 3.8 27B. - The scheduler resolves the exit with its `exitThinkingSetting`. - Docs and the changelog fragment (with the corrected production rates: 0.16 % for Qwen 3.6, 0.83 % for Qwen 3.5 35B). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#2046 now keeps Qwen 3.5/3.6's exit listed and off by default (the A/B found too few Qwen thought loops to show rescues). Conflict in GenerationLoopExitThinkingPolicy: the default list keeps Gemma 4 and, as this branch had it, Super; the doc comment takes #2046's Qwen wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fresh-context review of #2061 (REQUEST CHANGES) found: - 1 (blocker): on by default for all Super traffic before its A/B. Super's continuation re-prefills a 120B hybrid model's whole thought, and its answer quality and pause are unmeasured. - 2 (major): a cancel or drain during the hand-off (the stopped row's release wait, the submission) could return the owner's admission before the second row was submitted: the splice's task was not joined, and a continuation submitted after the cancel was cancelled only later. - 3 (minor): the tests overwrote the terminal (one `info` not checked), and did not cover the answer loop or thinking off on Super's route, the real `</think>` id (13), or the sampling the continuation keeps. Red tests and the API they need, with no behaviour yet: - Super's exit is listed but off by default; the env list turns it on. - On the binding: one terminal `info`; the continuation keeps temperature, seed, top-p/k and penalties; Super's real ids (`</think>` 13); with the exit on, a loop in the answer or after a thinking-off prompt still ends `length` with one submission. - The splice: a cancel during the hand-off starts no continuation, and `finished` (new; a stub here) returns only once the submission returned and was cancelled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Qwen's exit off by default, the check that a thinking-off prompt starts outside the thought must turn it on, as the other Qwen policy checks do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
0.10.13: exit-thinking for Qwen 3.5/3.6 (
</think>): a repeating Qwen thought ends in an answer
#2046
Merged
jonathan308
added a commit
that referenced
this pull request
Nov 13, 2026
- 1: Super's exit is listed but off by default until its A/B (Mac B, in progress); DARKBLOOM_LOOP_EXIT_THINKING=...,nemotron_h_omni turns it on. - 2: the splice returns `finished`, which joins its task; the Super binding joins it before waiting for both rows' terminal observations, so a continuation a cancel or drain overtook during the hand-off is cancelled before the owner's admission returns. After the stopped row's release wait, the hand-off checks the request's cancel (the binding's RowCancel, the scheduler's task) and submits no second row. - 4: Super's continuation is submitted with the request's prompt progress and the owner's make-room hook cleared, as the scheduler's is. - 7: the continuation's prompt passes the binding's own token checks. - 6: the binding's type doc stays on the actor (helpers moved below it). - 8: the docs note that the guard follows the last thought marker, Super's reasoning channel the first `</think>`. - Docs and the changelog fragment (off by default). Not here (listed in the PR): 5 (`answerFinished` set at the first row's `length`; shared with #2040), 9 (the continuation's checkpoint writes), outcome telemetry (#2040's F3). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s setting The scheduler's exit-thinking setting defaults to the process's environment (DARKBLOOM_LOOP_EXIT_THINKING). The serving tests that rely on the default (the `serve` helper's, and the full-Mac admission test's own scheduler) now take a clean process's setting (`setting(environment: [:])`) unless they pass one, so a runner with the variable set gets the same results. Red, on de5c483's build with the variable set on the test run: `gemma4,gemma4_text,qwen3_5_moe` fails "Qwen 3.5/3.6 35B keep today's length by default"; `0` fails three of Gemma's serving tests. Review (fresh context) n2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bullet's heading read as if Qwen's exit were on by default, and so did the env list's examples: `gemma4,gemma4_text` is the default; `…,qwen3_5_moe` adds the Qwen 3.5/3.6 35B models, and `…,qwen3_5` the 9B and Qwen 3.8 27B. Review (fresh context) n1; the delta review's n-a. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng and examples) The docs' env examples conflicted with the Super paragraph that follows them: #2046's new examples, then the Super paragraph as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… are - The changelog's value turned Qwen 3.5/3.6 35B's exit on too: Super alone beside Gemma 4's is `gemma4,gemma4_text,nemotron_h_omni`. - inference.md: the bullet's heading names the listed families; a cancel or drain during the stopped row's release wait submits no second row, and one that races the submission cancels it at once. - The scheduler's comment after the release wait: the task check covers a consumer that stopped reading the spliced stream; a cancel that reaches only the splice's control (the local API's disconnect hook) is seen once the row is submitted, and cancels it at once (closing that window is a follow-up). Review (fresh context) n1, and m1's comment; the delta review's n-b. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
marked this pull request as ready for review
November 13, 2026 10:22
jonathan308
added a commit
that referenced
this pull request
Nov 13, 2026
jonathan308
added a commit
that referenced
this pull request
Nov 13, 2026
… continuation row `LoopExitThinkingContinuation.Submit` takes the splice's own cancel (`cancelled`). The scheduler checks it after the stopped row's release wait, beside its `Task.checkCancellation()`; Super's binding beside its `RowCancel`. A cancel that reaches only the splice's control (the local API's disconnect hook; on the native route, the hand-off's cancel) therefore submits nothing, instead of submitting the continuation and cancelling it at once (a wasted prefill of the prompt and the whole thought). A refusal that cancel caused ends the request as `length` with the outcome "cancelled". A splice-level test pins the owner's check; the existing hand-off test still shows that an owner that does not check is cancelled at once. Local: 54/54 (red 7da06f7: exactly the new serving test failed). Review (fresh context) of #2046 + #2061, m1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 13, 2026
…+ #2061 fold resolution #2070 merged dev (the 0.10.13 candidate, #2046 folded at b4cc618), took the GPU A/B's tools-only gate and delta review 2's nits; #2061 moved to 1a87349 (based on b4cc618). This merge takes both new heads at once; its tree is #2070 601fd40 + #2061 1a87349, resolved: - `defaultModelTypes` = ["gemma4", "gemma4_text", "gpt_oss"]; Qwen 3.5/3.6 and Super (`nemotron_h_omni`) listed, off by default, as folded / as in #2061. - The policy's doc comment and `inference.md` describe Gemma 4 and GPT-OSS on (GPT-OSS only for requests that declare tools), Qwen and Super listed and off, and Super's own route and switch. Locally (trimmed package: the exit-thinking suites, the real GPT-OSS tokenizer suite, Super's loop-guard suite): 76/76. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonathan308
added a commit
that referenced
this pull request
Nov 15, 2026
0.10.14: exit-thinking: a local client that leaves during the hand-off gets no continuation row (stacked on #2061)
This branch was successfully deployed
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.
Super: listed, off by default until its A/B (Mac B, running since 09:40Z; ETA ≈ 11:55Z). Stacked on #2046: this branch contains #2046's head (
b4cc61883c), so until #2046 merges the diff shows both. Merge #2046 first.DARKBLOOM_LOOP_EXIT_THINKING, Super's requests behave as in 0.10.12 (the guard'slength).DARKBLOOM_LOOP_EXIT_THINKING=gemma4,gemma4_text,nemotron_h_omni.The same exit from a repeating thought as #2040 (Gemma 4) and #2046 (Qwen 3.5/3.6), now for Nemotron 3.5 Super (
nemotron_h_omni). Super's requests take its owner's own route (NemotronSuperLocalImageHTTP→NemotronSuperLocalBinding), not the scheduler's text path.Why
max_tokens≥ 32,768): 29.6 per 1,000 end with the guard's stop and no answer (24/812). All of them finishedsuccessbelow the cap, and none were cut short. The highest rate of any family, ahead of Gemma's 19.9.What
</think>alone. Super's pinned template writes a closed thought as"<think>\n" + reasoning + "</think>" + content, with nothing around the marker. Its tool-turn outputs end the reasoning with "." right before</think>.</think>is an added token (13,special: false).<|im_start|>assistant\n<think>\n), so the guard starts inside it. Thinking off (<think></think>) starts outside.NemotronSuperRequestPlan.exitThinking(promptTokens:tokenizer:)resolves the exit for a text request's rendered prompt. Never with logprobs or media.loopGuard(exitThinking:)puts it in the guard.NemotronSuperLocalBinding.executeBridgesplices the continuation as the scheduler does (LoopExitThinkingContinuation), within the same admitted request and on the same bridge:waitForRowRelease, 5 s);</think>, with the budget the row left, at most 8,192;GenerationLoopGuard.withoutExit()), so a loop in the answer still endslength;gemma4,gemma4_text).nemotron_h_omniis listed with its marker and exit, off by default; the env list above turns it on.Tests (red first)
…</think>Answer: B);Review (fresh context) and fixes:
e40e4d1231(red) →47f665f7df(green)</think>alone… its prompt opens the thought"). Green: 52/52.finished, which joins its task; the binding joins it before waiting for both rows' terminal observations.RowCancel, the scheduler's task) and submits no second row.</think>); the changelog fragment.answerFinishedis set at the first row'slength; shared with 0.10.13: the loop guard ends a repeating thought and lets Gemma answer (exit-thinking) #2040), 9 (the continuation's checkpoint writes), outcome telemetry (0.10.13: the loop guard ends a repeating thought and lets Gemma answer (exit-thinking) #2040's F3).47f665f7df: 43401218591 passed.Re-review (fresh context, #2046 + #2061, 09:37Z): APPROVE WITH NITS
DARKBLOOM_LOOP_EXIT_THINKING, Super's route takes the old path.RowCancelis checked after the release wait, and the splice is joined before both terminal waits.1a8734918c, after merging 0.10.13: exit-thinking for Qwen 3.5/3.6 (</think>): a repeating Qwen thought ends in an answer #2046'sb4cc61883cindb2b69a3e4):A/B (Mac B, running since 09:40Z; ETA ≈ 11:55Z)
e487abcc); cand this branch at47f665f7df(a63aecac), withDARKBLOOM_LOOP_EXIT_THINKING=gemma4,gemma4_text,nemotron_h_omni.SuperSlotProofLiveharness as an executable: the production loader and MTP as shipped, serving the in-process loop's own local endpoint. Production checkpoint2026-10-20-nvfp4-r2, productionmlx.metallib.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.