mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#697
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 @nomishbhardwaj on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1753
Neither loop guard can see a loop that the model writes as one unbroken run of digits; only
reasoning_budget_tokensended it. A simple periodicity check catches it early, and in a 70-sample replay it never fired on a reasoning that went on to pass.Setup: Strata 0.1.41 (
fb58e0d), Qwen3.8-Flash-Next IQ2_XS, RTX 3090 24 GB, Linux.reasoning_budget_tokens24576,repeat_stop_tokens256 (the default). Requests go to/v1/chat/completionsat temperature 0: our eval harness pins greedy decoding on purpose. Your diagnosis in #728 says greedy makes loops likelier, but the blind spot below does not depend on sampling.Prompt:
How many times does the digit 8 appear in the decimal expansion of 9^104? End your reply with exactly: "FINAL: <answer>" and nothing after it.(Truth: 13.)What happened: in two captured runs, the reasoning wrote one unbroken string of digits: 24,255 characters (95% of the reasoning) and 32,455 characters (96%). Both repeat the 11-digit cycle
58747693387until the thinking budget closes them, at 24,599 and 32,791 tokens, and both answer 1. A third, earlier run ended the same way (24,599 tokens, answer 1); its reasoning was not saved.Why neither guard fires:
reasoning_repeat_coveragesplits text with\w+|[^\w\s], so the whole digit string is ONE word. No 12-word passage can repeat inside it, and the reasoning (about 250 words besides the string) never reaches the 2,000-word window either. Replayed through an exact copy of the function, the coverage is 0.00 at every check in both runs.A candidate check (replayed offline; we have not patched the server): at each look, test whether the last 2,048 characters of the reasoning repeat with some period p ≤ 64 (
w[p:] == w[:-p]). We replayed it over all 70 reasonings captured in a budget A/B (35 long-arithmetic prompts × budgets 24576 and 32768):The periodic check complements the passage detector rather than replacing it: it misses three passage loops that are not strictly periodic, which the current detector catches.
In the engine, the same idea could work on token ids as an extension of #606 from period 1 to short periods. For each p ≤ 64, keep a count of consecutive positions where
t[n] == t[n-p], and act when any count passes a threshold such as 1,024. That costs O(64) per token and needs no decoding.A smaller change that keeps the current detector did worse. Cutting long words into 16-character pieces (
\w{1,16}) caught the 32K-digit run but not the 24K one, because that reasoning still had fewer than 2,000 "words".Happy to share the 70 captured reasonings (about 1 MB of JSONL) and the replay script.
@nomishbhardwaj commented on GitHub (Oct 9, 2026):
Two follow-ups from the same setup:
reasoning_loop_recovery: "stop"set in the config, the same prompt (greedy) ran 24,599 tokens to the thinking budget and answered 1 again. The server's own record in/metrics→requests[]showsreasoning_repeat_coverage0.0 for it.@Niko1221 commented on GitHub (Oct 10, 2026):
Fixed in v0.1.42 by #1777 (with "reasoning_loop_recovery" on, a loop written as one long word, such as a repeating digit string, is now caught).