mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #5128] [Engine] Add sampling.thinking.temperature: thinking and answer share one temperature today #2400
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2400
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xunying7860 on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/5128
Area
[Engine]
What do you want to do?
Set the thinking segment's sampling temperature separately from the answer's, per request and as a run-config default, so a reply can "think wide, answer steady" — thinking at 1.0 while the answer stays at 0.3–0.7. For Qwen3.8-Flash-Next that is a real quality win: exploration where it matters, a steadier final text.
Today
model_card_sampling(arch, thinking)already picks one of two sets per request, andreasoning_budget_tokensalready proves the server can inject text mid-generation and continue from the prefix the engine holds. What is missing is the user-facing knob to set the two segments independently — the data path exists.Proposed surface, each layer optional and defaulting to today's behaviour:
"sampling": { "temperature": 0.3, "thinking": { "temperature": 1.0 } }"thinking_temperature": 1.0"thinking": { "type": "enabled", "budget_tokens": N, "temperature": 1.0 }Priority per request: request
thinking_temperature→ requestthinking.temperature→ run configsampling.thinking→ inherit the answer segment's value. Nothing set anywhere keeps one temperature for the whole reply, byte for byte as today.This can be done in
serve/server.pyalone, without touching the engine: take the thinking segment's parameters before sampling, break the pass when the parser leaves the reasoning state with a clean buffer and no pending detokeniser bytes, thenprompt = prompt + segand continue with the answer's parameters — the same "continue from the prefix the engine already holds" primitivereasoning_budget_tokensuses.reasoning_loop_recovery=recovershould raise the thinking segment's temperature only, never the answer's.What do you do today instead?
Run the whole reply at one temperature. A run config's
samplingblock applies to both segments, so a steady 0.3 answer makes the thinking 0.3 as well — and low-temperature reasoning loops (as reported in #728) get easier to trigger; 1.0 for the thinking leaves the answer loose.I have a working local patch against 0.2.10 (7 anchored edits in
serve/server.py, idempotent, py_compile-gated) with four regression tests: two passes with 1.0 then the answer's value, no-thinking replies still single-pass, requestthinking_temperatureoverriding the config, and the Anthropic route reading the same block. Measured here:dual sampling: thinking 1.0 -> answer 0.3 at 42 tokens, with the thinking segment and the answer segment reporting their own tok/s. Happy to send it as a PR if the scope is acceptable.@github-actions[bot] commented on GitHub (Nov 3, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
[GH-ISSUE #5128] Allow a different temperature for the thinking segment than for the answerto [GH-ISSUE #5128] [Engine] Add sampling.thinking.temperature: thinking and answer share one temperature today@github-actions[bot] commented on GitHub (Nov 3, 2026):
Thanks, this follows the format now.