Repository navigation
docs: the end-token pair for replies that quote a template marker - #2437
Conversation
4197013 to
fb0700d
Compare
|
Thanks, @javierbits. This is a useful recipe, and the GB10 measurement backs it. Two small things before it lands. First, the CHANGELOG line thanks @robertung88. Who are they? If they're #2399's reporter, we'll keep them alongside you. The line should also cite this PR's own number: "(#2437, refs #2399). Thanks to @javierbits." Second, two sentences need a source. One is the Qwen3.8 tokenizer facts: |
|
Following up from #2399, as asked. Yes, I'm #2399's reporter, so the thanks line is right. This comment covers three things:
1. With an agent prompt, the pair as written runs into fabricated turns, on stock weights tooSetup: TensorFold 1.1.4 ( A runaway here is a reply whose content contains | ask | plain request | After its real end, the model often writes no Here is the greedy In production, the same thing made a scheduled mailbox check invent a Gmail thread (its id returns 404) and post it to a channel as a new email. One "Reply with exactly: OK" ran 122 tool calls. Drawn token ids (1.2.4). Same three asks, on stock TensorFold
So after its turn end, the model chooses between One case shows the cost of a text stop. In a sampled scheduled-job reply, the model wrote Suggested change to the paragraph: stop on 2. Sources for the two sentences you asked aboutTokenizer facts: "A
Receipts: |
|
Thanks, @robertung88. The drawn ids make the mechanism clear: with @javierbits, could you update the subsection along these lines?
For the CHANGELOG line, "(#2437, refs #2399). Thanks to @javierbits and @robertung88." works; we settle the CHANGELOG at landing, so no rebase is needed for it. |
…enize source, cite ashhart#2399 Per review: the tokenizer facts hold for Qwen3.8-Flash-Next only, shown by POST /tokenize. With ignore_eos the end token no longer stops the reply and behind an agent prompt the model often opens the next turn instead of writing end-of-text, so the stop list needs <|im_start|> beside <|endoftext|>; the invented turns' tool calls are returned. A stop string matches the spelling however it is tokenized, so a reply quoting either marker is cut there; drop the claim that the end-of-text stop ends a reply at a real end of turn. The agent-shaped runs are reported in ashhart#2399: 0/9 runaways with the pair against 7/9 with end-of-text alone, on stock Qwen3.8-Flash-Next weights. (ashhart#2437, refs ashhart#2399)
2891cd8 to
f7e1c2a
Compare
…enize source, cite ashhart#2399 Per review: the tokenizer facts hold for Qwen3.8-Flash-Next only, shown by POST /tokenize. With ignore_eos the end token no longer stops the reply and behind an agent prompt the model often opens the next turn instead of writing end-of-text, so the stop list needs <|im_start|> beside <|endoftext|>; the invented turns' tool calls are returned. A stop string matches the spelling however it is tokenized, so a reply quoting either marker is cut there; drop the claim that the end-of-text stop ends a reply at a real end of turn. The agent-shaped runs are reported in ashhart#2399: 0/9 runaways with the pair against 7/9 with end-of-text alone, on stock Qwen3.8-Flash-Next weights. (ashhart#2437, refs ashhart#2399)
…enize source, cite ashhart#2399 Per review: the tokenizer facts hold for Qwen3.8-Flash-Next only, shown by POST /tokenize. With ignore_eos the end token no longer stops the reply and behind an agent prompt the model often opens the next turn instead of writing end-of-text, so the stop list needs <|im_start|> beside <|endoftext|>; the invented turns' tool calls are returned. A stop string matches the spelling however it is tokenized, so a reply quoting either marker is cut there; drop the claim that the end-of-text stop ends a reply at a real end of turn. The agent-shaped runs are reported in ashhart#2399: 0/9 runaways with the pair against 7/9 with end-of-text alone, on stock Qwen3.8-Flash-Next weights. (ashhart#2437, refs ashhart#2399)
10e85b3 to
a911c31
Compare
|
All points addressed, on docs/api.md
CHANGELOG.md Thanks, @robertung88 — the drawn ids and the stop-list runs settled it. |
|
Thanks @javierbits. The recipe now leads with the plain request, the |
…enize source, cite ashhart#2399 Per review: the tokenizer facts hold for Qwen3.8-Flash-Next only, shown by POST /tokenize. With ignore_eos the end token no longer stops the reply and behind an agent prompt the model often opens the next turn instead of writing end-of-text, so the stop list needs <|im_start|> beside <|endoftext|>; the invented turns' tool calls are returned. A stop string matches the spelling however it is tokenized, so a reply quoting either marker is cut there; drop the claim that the end-of-text stop ends a reply at a real end of turn. The agent-shaped runs are reported in ashhart#2399: 0/9 runaways with the pair against 7/9 with end-of-text alone, on stock Qwen3.8-Flash-Next weights.
a911c31 to
22a7b37
Compare
|
Thank you @javierbits. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
What this changes
Fixesonce the reporter's base-model runs are in; the code and test side landed as server: quoted added spellings stay plain through the chat route with real tokenizers (#2399) #2400).16e044d94(rebased over 1.2.4's release commit; the measurement below was taken on964f98b0b, and the commits between change only docs, the version and install examples).atc overlap --json: run after the rebase; it reportscomplete: false(pullFilesUnavailable,timeLimit). The shared file isCHANGELOG.md, where the Unreleased list is the insertion point for every entry;docs/api.mdis clean, and no source or kernel file changed.Adds a Request fields subsection that names the failure and the client-side pair:
ignore_eos: truewith astoplist for the model's end-of-text spelling, then strip the trailing turn marker. Before this, both halves were documented separately but not as one recipe.Checks on this head
fb0700d13.python3 tools/zig/lean_check.py, on16e044d94and on this head: 116 problems on both, 0 new (tools/zig/lean_new.py).zig build test-cuda-host --summary allpassed on964f98b0b: 5344/5371 tests passed, 27 skipped;zig fmt --check build.zig zigandgit diff --checkpass.benchmark-clients(both),fmt,release-paths,zig,zig-macos-dev-toolsandzig-windows.Receipt
n/a: this change cannot reach inference; it documents an existing server behavior. The measurement behind the new paragraph:
964f98b0bplus this docs commit, Zig 0.17.0, CUDA 13.0, NVIDIA GB10 (sm_121), one stream, greedy, thinking off, 2,048-token context.mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3andnvidia/Qwen3.6-35B-A3B-NVFP4@491c2f1ea524c639598bf8fa787a93fed5a6fbce.<tool_call>,</tool_call>,<|tool_call_begin|>and<|im_end|>; two greedy repetitions each.ignore_eosandstop: ["<|endoftext|>"]both requests also finished, and each content ended with the drawn<|im_end|>(one trailing turn marker and a newline) to strip. No unmatched backticks in either mode.