Repository navigation
serve: opt-in recovery from repeated reasoning passages - #869
huangserva wants to merge 1 commit into
Conversation
|
Feedback (rig: 4 x RTX 5080 16 GB (PCIe Gen3 x16, sm_120), i9-10920X, Linux, IQ3_S, 262K context, int8 K/V, layer split
|
|
A data point before turning this on: our runaway reasoning loops (one reply reached 102,833 tokens) were greedy decoding. The client (Hermes Agent) sent no sampling fields, and the Setting the Qwen thinking defaults in the config removed them: 0 loops in the following ~19 h (details in #980): "sampling": {"temperature": 1.0, "top_p": 0.95, "top_k": 20, "min_p": 0.0, "presence_penalty": 0.0, "repetition_penalty": 1.0}An auxiliary vision call the client sends at temperature 0.1 also looped (suspected; it stopped after setting it to 1.0). So it is worth checking what sampling the client really sends before adding a loop guard. |
Maintainer: separate stop and recover modes (reasoning_loop_recovery: false|stop|recover), token-level splice of the effort sentence (EFFORT_TEXT), a client's top_p/top_k never touched, checks at the first clean boundary after each 512 tokens, bounded history, tests incl. a literal think tag (#728, #869) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks for this. We merged it for 0.1.40 with changes: a separate stop and recover mode ("reasoning_loop_recovery": false, "stop" or "recover"), the effort sentence is swapped as token ids (the prompt is not decoded and encoded again, so a literal stays text), a client's top_p and top_k are never changed, the check runs at the first clean boundary after each 512 tokens, and the history it counts is bounded. Off by default. |
|
Hi Niko,
Thanks for incorporating our contribution into v0.1.40 and for refining the
implementation. It’s great to see our testing and feedback help improve
Strata.
I’ll continue following the project and would be happy to contribute more
testing and feedback, especially on our single- and dual-V100 setups and
48GB RTX 4090. I’ve also been sharing our hands-on results on X to help
more people discover Strata:
https://x.com/servasyy_ai/status/2106934879309181101
Would you be open to crediting my GitHub account in the release notes or
project acknowledgements for the PR and testing behind #869? I’d really
appreciate it.
Thanks again for building Strata. I look forward to staying involved!
Best,
servasyy
GitHub: https://github.com/huangserva
Niko ***@***.***> 于2026年10月6日周二 14:43写道:
… *Niko1221* left a comment (Niko1221/Strata#869)
<#869 (comment)>
Thanks for this. We merged it for 0.1.40 with changes: a separate stop and
recover mode ("reasoning_loop_recovery": false, "stop" or "recover"), the
effort sentence is swapped as token ids (the prompt is not decoded and
encoded again, so a literal stays text), a client's top_p and top_k are
never changed, the check runs at the first clean boundary after each 512
tokens, and the history it counts is bounded. Off by default.
—
Reply to this email directly, view it on GitHub
<#869?email_source=notifications&email_token=BP7ARWUKVV5KBFYKGNIQFGL5SSIA5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMBRGA4DSOJWGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-6010899638>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BP7ARWVAWUCJPWL4R4SU22D5SSIA5AVCNFSNUABGKJSXA33TNF2G64TZHMYTGOBVHE2DMMZQGE5US43TOVSTWNJXGA2DQOBZG43DHILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BP7ARWRERJLULWP6ULV5UAL5SSIA5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMBRGA4DSOJWGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/BP7ARWX4JGCD2HYXCYGCVYT5SSIA5A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMBRGA4DSOJWGM4KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Maintainer: separate stop and recover modes (reasoning_loop_recovery: false|stop|recover), token-level splice of the effort sentence (EFFORT_TEXT), a client's top_p/top_k never touched, checks at the first clean boundary after each 512 tokens, bounded history, tests incl. a literal think tag (#728, #869)
…easoning passages
Upstream merged Niko1221#863, Niko1221#732, Niko1221#869, Niko1221#931 and Niko1221#846 (our copies dropped) and took its own form of Niko1221#970 (Niko1221#804). Kept: Niko1221#851, Niko1221#652, Niko1221#855, Niko1221#813, Niko1221#789. A pool turns off what it cannot run yet: --pipeline-windows, --batch-mtp, --kv-grow, session files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157fjixQD2nRxvCvtXq66DD
…easoning passages
Maintainer: separate stop and recover modes (reasoning_loop_recovery: false|stop|recover), token-level splice of the effort sentence (EFFORT_TEXT), a client's top_p/top_k never touched, checks at the first clean boundary after each 512 tokens, bounded history, tests incl. a literal think tag (Niko1221#728, Niko1221#869)
Maintainer: separate stop and recover modes (reasoning_loop_recovery: false|stop|recover), token-level splice of the effort sentence (EFFORT_TEXT), a client's top_p/top_k never touched, checks at the first clean boundary after each 512 tokens, bounded history, tests incl. a literal think tag (Niko1221#728, Niko1221#869)
A high-effort IQ3_S request can repeat whole reasoning passages until
max_tokensis exhausted and return no final answer. The 0.1.39 guard from #606 ends runs of one identical token; it does not detect a repeated sentence or a repeated code-verification pass. This draft adds an opt-in, one-shot recovery policy for those passages. It does not claim to fix numerical corruption or replace #838.Set
"reasoning_loop_recovery": truein the model config (default: false). At clean parser and UTF-8 boundaries every 512 output tokens, the server checks whether at least 25% of the most recent 2,000 word/punctuation units belongs to 12-unit passages seen at least three times in the reasoning history. It stops and drains the current generation and resumes with every generated token ID preserved. Only the native high-effort hint in the initial system message changes to the template's low-effort hint. No final answer, synthetic reasoning, or</think>is inserted; both passes share the original completion limit.On recovery only, temperature is raised to at least 1.0 and presence penalty to at least 1.5, with top-p 0.95/top-k 20 and the same seed. This deliberately overrides an explicit low-entropy client sampler and is documented as opt-in. An already-matching sampler is passed through unchanged. History and request traces record recovery count and repetition coverage. The 0.1.39 single-token guard stays enabled.
Validation:
python -m unittest discover -s serve -p 'test_*.py'on base6f32ec070f23ced9f50e704d854d775da52591ab: 281 tests run, 274 passed, 7 skipped (no GPU/model fixtures). The optional jsonschema package was installed for schema-validation tests. Includes 13 new recovery tests.3cf03257f219afbe7334045ff7c6a06ac68c627d: the captured original IQ3_S failure prefix produced 1,487 consecutive repeated passages, reached the 16,384-token cap, and never closed thinking or delivered a final answer. This is a multi-token loop, so the server's 256-identical-token guard does not match it. Recovery enabled on that same loaded engine, input, seed and cap detected coverage 1.0 at 2,048 generated tokens, recovered once, and finished naturally withstopat 9,629 total completion tokens, with a nonempty final answer (SHA-2565a35536b34032fce0094f6453067efb6952f2ae15a6620cbc59f863c5f188cad). The repeated prefix is retained, including 187 phrase repetitions generated before recovery. This is one diagnostic replay, not a new full-quality benchmark on 0.1.39.STRATA_NO_LARGEPAGES=1was used in both arms, after the default large-page startup was manually aborted before READY due to slow allocation. This switch changes page backing, not model arithmetic. No engine source was modified.stop/nonempty final answer at 6,655 completion tokens with one recovery. A frozen 31-request cohort then returned 31 complete final answers. Protocol, limitations and public answers.Limits: this is a heuristic policy and may trigger on useful repeated code/checks. It supports the exact native high-effort hint in the first system message, skips images, and can require re-prefilling the modified prompt. Other templates/effort positions are not validated. A resumed model can still loop or reach the shared output limit. The 31-request cohort was run on 0.1.38; the 0.1.39 GPU check above is one diagnostic pair, not evidence that every 0.1.39 request completes. The draft is open for feedback on the opt-in API, threshold, and sampler policy before broader use.