[GH-ISSUE #728] Infinite loop issue #333

Closed
opened 2026-11-04 01:42:02 +07:00 by bsakaguchi · 20 comments
Owner

Originally created by @davidliudev on GitHub (Oct 4, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/728

Having switch-1.50iq2_xs, 8 bit KV cache, 128k context size, engine version v0.1.38 running out of the box after install on 4090 and 64 GB RAM, Windows 11.

Tried OpenCode and Qwen Coder but both will enter endless loop after a while.
Performance is good at 103 tok/s except when this issue was hit.

Is there anything I can tweak to prevent this?

Originally created by @davidliudev on GitHub (Oct 4, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/728 Having switch-1.50iq2_xs, 8 bit KV cache, 128k context size, engine version v0.1.38 running out of the box after install on 4090 and 64 GB RAM, Windows 11. Tried OpenCode and Qwen Coder but both will enter endless loop after a while. Performance is good at 103 tok/s except when this issue was hit. Is there anything I can tweak to prevent this?
Author
Owner

@tarunpaul commented on GitHub (Oct 4, 2026):

Most likely this is related to model settings and not the engine it self.
When a reasoning model gets stuck in a loop, it means the token probabilities have collapsed.
change the temperature and top_p values for your model.
Lower temperatures in LLMs actually make them more prone to looping.

<!-- gh-comment-id:5977744804 --> @tarunpaul commented on GitHub (Oct 4, 2026): Most likely this is related to model settings and not the engine it self. When a reasoning model gets stuck in a loop, it means the token probabilities have collapsed. change the temperature and top_p values for your model. Lower temperatures in LLMs actually make them more prone to looping.
Author
Owner

@davidliudev commented on GitHub (Oct 4, 2026):

@tarunpaul That is a good point and I also suspected so. But I was using the default setting right after running setup.
My understanding is that Strata is particularly optimized for Qwen Flash Next and everything should already be in place nicely? No?

Also do you have a recommended setting? From the very limited docs I saw these default:
"sampling": {"temperature": 1.0, "top_p": 0.95, "top_k": 20}

Correct me if I am wrong.

<!-- gh-comment-id:5977787865 --> @davidliudev commented on GitHub (Oct 4, 2026): @tarunpaul That is a good point and I also suspected so. But I was using the default setting right after running setup. My understanding is that Strata is particularly optimized for Qwen Flash Next and everything should already be in place nicely? No? Also do you have a recommended setting? From the very limited docs I saw these default: "sampling": {"temperature": 1.0, "top_p": 0.95, "top_k": 20} Correct me if I am wrong.
Author
Owner

@tarunpaul commented on GitHub (Oct 4, 2026):

@davidliudev Since you mentioned that you’re using it with OpenCode and Qwen Coder, it might be worth checking whether either of them is overriding the model’s sampling settings. That could potentially explain the looping behavior.

<!-- gh-comment-id:5977992777 --> @tarunpaul commented on GitHub (Oct 4, 2026): @davidliudev Since you mentioned that you’re using it with OpenCode and Qwen Coder, it might be worth checking whether either of them is overriding the model’s sampling settings. That could potentially explain the looping behavior.
Author
Owner

@davidliudev commented on GitHub (Oct 4, 2026):

@tarunpaul I just double checked and the default setting is actually indeed the official qwen flash next recommended settings.

Found a reddit post and someone suggested adding presence_penalty of 1.5. That is originally supposed to be only for the non-thinking mode, but considering the quantization loss I enabled it with thinking mode anyway.

I then updated strata-swift-iq2_xs.json and add that to it.

So far it works for a while without the looping issue anymore. If it comes back I will update this thread.

<!-- gh-comment-id:5978041819 --> @davidliudev commented on GitHub (Oct 4, 2026): @tarunpaul I just double checked and the default setting is actually indeed the official qwen flash next recommended settings. Found a reddit post and someone suggested adding presence_penalty of 1.5. That is originally supposed to be only for the non-thinking mode, but considering the quantization loss I enabled it with thinking mode anyway. I then updated `strata-swift-iq2_xs.json` and add that to it. So far it works for a while without the looping issue anymore. If it comes back I will update this thread.
Author
Owner

@tarunpaul commented on GitHub (Oct 4, 2026):

@davidliudev Glad to hear that the presence penalty seems to be helping. I'll be interested to hear if you experience the looping issue again.

It might also be worth taking a look at the issue below, as it describes a somewhat similar looping behavior with Qwen Flash Next and could provide some additional clues:

https://github.com/Niko1221/Strata/issues/75

<!-- gh-comment-id:5978228316 --> @tarunpaul commented on GitHub (Oct 4, 2026): @davidliudev Glad to hear that the presence penalty seems to be helping. I'll be interested to hear if you experience the looping issue again. It might also be worth taking a look at the issue below, as it describes a somewhat similar looping behavior with Qwen Flash Next and could provide some additional clues: https://github.com/Niko1221/Strata/issues/75
Author
Owner

@RobinMeyer commented on GitHub (Oct 4, 2026):

I had the same issue with swift1.5-iq2_xs and tried a few things. But the issue was completely solved, when switching to standard (non-swift) iq3_xxs. So I think, it's more a general behaviour of swift. For coding it worked good for me, but not much else. With standard iq3_xxs, I wrote even a 300 page story without any repetition.

<!-- gh-comment-id:5978336286 --> @RobinMeyer commented on GitHub (Oct 4, 2026): I had the same issue with swift1.5-iq2_xs and tried a few things. But the issue was completely solved, when switching to standard (non-swift) iq3_xxs. So I think, it's more a general behaviour of swift. For coding it worked good for me, but not much else. With standard iq3_xxs, I wrote even a 300 page story without any repetition.
Author
Owner

@davidliudev commented on GitHub (Oct 4, 2026):

Just report back that it still happen, but much less frequently so at least it is usable for now. I would just treat that as a temporary workaround and keep this issue open.

<!-- gh-comment-id:5980442842 --> @davidliudev commented on GitHub (Oct 4, 2026): Just report back that it still happen, but much less frequently so at least it is usable for now. I would just treat that as a temporary workaround and keep this issue open.
Author
Owner

@davidliudev commented on GitHub (Oct 4, 2026):

I had the same issue with swift1.5-iq2_xs and tried a few things. But the issue was completely solved, when switching to standard (non-swift) iq3_xxs. So I think, it's more a general behaviour of swift. For coding it worked good for me, but not much else. With standard iq3_xxs, I wrote even a 300 page story without any repetition.

@RobinMeyer Do you mind sharing what is your setup? I am wondering if I should also switch to it. Not sure if my setup can handle iq3 though.

<!-- gh-comment-id:5980450617 --> @davidliudev commented on GitHub (Oct 4, 2026): > I had the same issue with swift1.5-iq2_xs and tried a few things. But the issue was completely solved, when switching to standard (non-swift) iq3_xxs. So I think, it's more a general behaviour of swift. For coding it worked good for me, but not much else. With standard iq3_xxs, I wrote even a 300 page story without any repetition. @RobinMeyer Do you mind sharing what is your setup? I am wondering if I should also switch to it. Not sure if my setup can handle iq3 though.
Author
Owner

@RobinMeyer commented on GitHub (Oct 4, 2026):

@davidliudev :
Because of Strata, I updated extra to 64GB RAM and I have also a RTX5070ti and a 7950x3d.
At first, I used Swift1.5-iq2_xs with 32GB RAM, which worked well with paging with 40-80t/s.
But according the docu, 12GB VRAM and 64GB RAM is sufficient. Perhaps it works with paging with 48GB RAM. RAM is filled with 53GB.

<!-- gh-comment-id:5983131596 --> @RobinMeyer commented on GitHub (Oct 4, 2026): @davidliudev : Because of Strata, I updated extra to 64GB RAM and I have also a RTX5070ti and a 7950x3d. At first, I used Swift1.5-iq2_xs with 32GB RAM, which worked well with paging with 40-80t/s. But according the docu, 12GB VRAM and 64GB RAM is sufficient. Perhaps it works with paging with 48GB RAM. RAM is filled with 53GB.
Author
Owner

@christopherrobertbrooks-tech commented on GitHub (Oct 4, 2026):

Another data point, from the Coder (not Swift), with what looks like a specific trigger and a tested way to bound it.

Setup: Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB (low-RAM mode), default sampling from setup, reached through
/v1/messages by a coding agent (Claude Agent SDK, output_config.effort medium).

What happened: in 1 of 20 agent jobs, one thinking block ran to 140,267 characters and stopped only at the client's
32K output cap (about 5 minutes on this card). It is a loop of a single sentence, repeated 1,110 times:

Actually, wait: maybe the screenshot is showing the app's old Disk bar? No, the screenshot shows both Disk and Steam rows.

The 256-repeated-token guard (#606) does not catch this, since the repeat is a whole sentence.

Likely trigger: the block opens with the model puzzling over numbers "in the desktop screenshot" that contradict the
data it had just read from the app's web page. It never received that screenshot: images inside a tool_result were being
dropped (that's #819), so it reasoned about a picture it had imagined, met a contradiction it could not resolve, and
circled. That may not be the cause of every loop here, but "the model reasons about input it cannot see" seems worth
knowing. Since applying #819 we have run two agent jobs without a recurrence -- far too few to say more.

Bounding it: a reasoning_budget_tokens cap. On a prompt built to make it think at length (effort high, max_tokens
6000): no cap -> ~3.4K tokens of thinking until finish_reason: length and no answer; reasoning_budget_tokens: 400 ->
the server's wrap-up line ("I have thought about this long enough; time to give my answer.") and a full answer, 28 s
instead of 75 s. In our agent runs the longest normal thought was ~4K tokens, so we now run with
"reasoning_budget_tokens": 8192 in strata-<model>.json. In the two agent jobs since (16K and 8K caps) it never fired,
and it would cut a loop like the one above to roughly 8K tokens. It bounds the damage; it does not stop the loop from starting.

Drafted with an AI assistant (Claude) from our logs and tests, and checked by me.

<!-- gh-comment-id:5984010954 --> @christopherrobertbrooks-tech commented on GitHub (Oct 4, 2026): Another data point, from the Coder (not Swift), with what looks like a specific trigger and a tested way to bound it. **Setup:** Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB (low-RAM mode), default sampling from setup, reached through `/v1/messages` by a coding agent (Claude Agent SDK, `output_config.effort` medium). **What happened:** in 1 of 20 agent jobs, one thinking block ran to 140,267 characters and stopped only at the client's 32K output cap (about 5 minutes on this card). It is a loop of a single sentence, repeated **1,110 times**: ```text Actually, wait: maybe the screenshot is showing the app's old Disk bar? No, the screenshot shows both Disk and Steam rows. ``` The 256-repeated-token guard (#606) does not catch this, since the repeat is a whole sentence. **Likely trigger:** the block opens with the model puzzling over numbers "in the desktop screenshot" that contradict the data it had just read from the app's web page. It never received that screenshot: images inside a `tool_result` were being dropped (that's #819), so it reasoned about a picture it had imagined, met a contradiction it could not resolve, and circled. That may not be the cause of every loop here, but "the model reasons about input it cannot see" seems worth knowing. Since applying #819 we have run two agent jobs without a recurrence -- far too few to say more. **Bounding it:** a `reasoning_budget_tokens` cap. On a prompt built to make it think at length (effort high, `max_tokens` 6000): no cap -> ~3.4K tokens of thinking until `finish_reason: length` and no answer; `reasoning_budget_tokens: 400` -> the server's wrap-up line ("I have thought about this long enough; time to give my answer.") and a full answer, 28 s instead of 75 s. In our agent runs the longest normal thought was ~4K tokens, so we now run with `"reasoning_budget_tokens": 8192` in `strata-<model>.json`. In the two agent jobs since (16K and 8K caps) it never fired, and it would cut a loop like the one above to roughly 8K tokens. It bounds the damage; it does not stop the loop from starting. Drafted with an AI assistant (Claude) from our logs and tests, and checked by me.
Author
Owner

@MicEs1 commented on GitHub (Oct 5, 2026):

Another data point from the original Qwen3.8-Flash-Next model. I was able to trigger this with a very simple standalone coding prompt, without an agent, tools, images, MCP, or external context.

Setup:
Strata 0.1.39
Qwen3.8-Flash-Next IQ3_XXS
RTX 5080 16 GB
Ryzen 9 5900X
64 GB RAM
Windows
64K context, INT8 KV, vision disabled
temperature 0.60, top_p 0.95, top_k 20
reasoning effort: High

The test prompt was a small PowerShell task: write a function that performs a TCP reachability check with a maximum 5 second timeout and returns only a boolean result. Nothing unusual in the context.

I repeated the same prompt in fresh chats and got the following results:

Configuration Output tokens Time Final answer
default (presence_penalty=0, no reasoning budget) 65,382 738.2 s No - context exhausted
presence_penalty=1.0, no reasoning budget 42,000 539.3 s Yes
presence_penalty=1.5, no reasoning budget 21,643 286.4 s Yes
presence_penalty=1.0 + reasoning_budget_tokens=8192 8,998 113.2 s Yes

The final answers from all completed runs were technically usable; in particular, adding the 8192-token reasoning budget did not produce an obvious quality regression in this test.

I also fully restarted Strata and retried the same prompt with Thinking disabled. It still went beyond 17K generated tokens without reaching the final answer before I stopped it, so in my case this does not appear to be limited to reasoning_effort=high.

A second unrelated Home Assistant/state-machine design prompt completed successfully with the current workaround (presence_penalty=1.0, reasoning_budget_tokens=8192): 12,397 output tokens in 165.4 s, and the result was coherent and useful.

My current workaround is therefore:

"sampling": {
  "presence_penalty": 1.0
},
"reasoning_budget_tokens": 8192

This makes the model usable for me, but I see both settings as mitigation rather than a real fix. presence_penalty changes sampling behavior, while the reasoning budget only bounds the damage once a loop has already started.

The recent report about a loop triggered by reasoning over a missing image is very interesting, but my reproducible case contains no image or tool result at all, so there appear to be additional triggers.

It might be useful to detect repetition over longer token sequences / repeated n-grams or sentences inside the thinking block, rather than only identical-token repetition, and then use the same wrap-up path as reasoning_budget_tokens.

I can provide the exact prompt and logs if that would help reproduce it.

<!-- gh-comment-id:5989101875 --> @MicEs1 commented on GitHub (Oct 5, 2026): Another data point from the original Qwen3.8-Flash-Next model. I was able to trigger this with a very simple standalone coding prompt, without an agent, tools, images, MCP, or external context. **Setup:** Strata 0.1.39 Qwen3.8-Flash-Next IQ3_XXS RTX 5080 16 GB Ryzen 9 5900X 64 GB RAM Windows 64K context, INT8 KV, vision disabled temperature 0.60, top_p 0.95, top_k 20 reasoning effort: High The test prompt was a small PowerShell task: write a function that performs a TCP reachability check with a maximum 5 second timeout and returns only a boolean result. Nothing unusual in the context. I repeated the same prompt in **fresh chats** and got the following results: | Configuration | Output tokens | Time | Final answer | | --- | ---: | ---: | --- | | default (`presence_penalty=0`, no reasoning budget) | 65,382 | 738.2 s | No - context exhausted | | `presence_penalty=1.0`, no reasoning budget | 42,000 | 539.3 s | Yes | | `presence_penalty=1.5`, no reasoning budget | 21,643 | 286.4 s | Yes | | `presence_penalty=1.0` + `reasoning_budget_tokens=8192` | 8,998 | 113.2 s | Yes | The final answers from all completed runs were technically usable; in particular, adding the 8192-token reasoning budget did not produce an obvious quality regression in this test. I also fully restarted Strata and retried the same prompt with Thinking disabled. It still went beyond 17K generated tokens without reaching the final answer before I stopped it, so in my case this does not appear to be limited to `reasoning_effort=high`. A second unrelated Home Assistant/state-machine design prompt completed successfully with the current workaround (`presence_penalty=1.0`, `reasoning_budget_tokens=8192`): 12,397 output tokens in 165.4 s, and the result was coherent and useful. My current workaround is therefore: ```json "sampling": { "presence_penalty": 1.0 }, "reasoning_budget_tokens": 8192 ``` This makes the model usable for me, but I see both settings as mitigation rather than a real fix. `presence_penalty` changes sampling behavior, while the reasoning budget only bounds the damage once a loop has already started. The recent report about a loop triggered by reasoning over a missing image is very interesting, but my reproducible case contains no image or tool result at all, so there appear to be additional triggers. It might be useful to detect repetition over longer token sequences / repeated n-grams or sentences inside the thinking block, rather than only identical-token repetition, and then use the same wrap-up path as `reasoning_budget_tokens`. I can provide the exact prompt and logs if that would help reproduce it.
Author
Owner

@talisp commented on GitHub (Oct 5, 2026):

Two data points that may explain why loops come back even with the "official" settings in strata-<model>.json.

1. The web chat sends its own temperature, 0.6 by default. In serve/web/app.js, DEFAULTS = {thinking: "high", temperature: 0.6, top_p: 0.95, top_k: 20, ...}, and every chat request sends temperature, top_p and top_k explicitly. Request values win over the config's sampling, so the browser chat runs at 0.6, not the 1.0 that setup writes (1.0 / 0.95 / 20 / presence 0 is the published Qwen3.8 thinking default). With "Use for other apps too" on, the chat's settings are also applied to API clients for every field they don't send. So an agent can end up at 0.6 as well. @MicEs1's loop above was at temperature 0.60.

2. Agents often send their own sampling, sometimes per task. In our setup (Hermes Agent, Qwen3.8-Flash-Next IQ3_S, later UD-IQ4_XS), the loops came from:

  • No sampling at all: neither the client nor the config set it, so the engine default, greedy, applied. One reply reached 102,833 tokens.
  • A side task the client sends at temperature 0.1: its image-description calls.

After putting the official values in the config and raising that side task to 1.0, we saw 0 runaway loops in the following ~19.5 h of agent work (#980). "reasoning_budget_tokens" (we use 16000) also bounds the worst case.

My suggestion (opinion): check what each request really carries. "api_monitor": true in strata-<model>.json, then http://127.0.0.1:<port>/api-monitor, shows every request's body. If you use the web chat, set its temperature to 1.0 under the sampling settings. If you set an API key, add it there too (About > Settings).

<!-- gh-comment-id:6002042074 --> @talisp commented on GitHub (Oct 5, 2026): Two data points that may explain why loops come back even with the "official" settings in `strata-<model>.json`. **1. The web chat sends its own temperature, 0.6 by default.** In `serve/web/app.js`, `DEFAULTS = {thinking: "high", temperature: 0.6, top_p: 0.95, top_k: 20, ...}`, and every chat request sends `temperature`, `top_p` and `top_k` explicitly. Request values win over the config's `sampling`, so the browser chat runs at **0.6**, not the 1.0 that setup writes (1.0 / 0.95 / 20 / presence 0 is the published Qwen3.8 thinking default). With **"Use for other apps too"** on, the chat's settings are also applied to API clients for every field they don't send. So an agent can end up at 0.6 as well. @MicEs1's loop above was at temperature 0.60. **2. Agents often send their own sampling, sometimes per task.** In our setup (Hermes Agent, Qwen3.8-Flash-Next IQ3_S, later UD-IQ4_XS), the loops came from: - **No sampling at all:** neither the client nor the config set it, so the engine default, **greedy**, applied. One reply reached 102,833 tokens. - **A side task the client sends at temperature 0.1:** its image-description calls. After putting the official values in the config and raising that side task to 1.0, we saw **0 runaway loops in the following ~19.5 h** of agent work (#980). `"reasoning_budget_tokens"` (we use 16000) also bounds the worst case. **My suggestion (opinion):** check what each request really carries. `"api_monitor": true` in `strata-<model>.json`, then `http://127.0.0.1:<port>/api-monitor`, shows every request's body. If you use the web chat, set its temperature to 1.0 under the sampling settings. If you set an API key, add it there too (About > Settings).
Author
Owner

@christopherrobertbrooks-tech commented on GitHub (Oct 5, 2026):

Following up on @talisp's point about requests that carry no sampling: we checked ours, and then compared greedy against
the Qwen3.8 thinking defaults on real agent work.

What our client sends: a coding agent built on the Claude Agent SDK, talking to /v1/messages. Logging its requests
showed "temperature": null (no top_p / top_k either), only "thinking": {"type": "adaptive"} and
"output_config": {"effort": "medium"}. Our strata-coder-iq1_m.json had no sampling block, so every agent request
ran greedy. Our one loop earlier in this thread (the sentence repeated 1,110 times) happened under those settings.

The comparison: Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB, reasoning_budget_tokens: 8192 in both. The second
config only adds "sampling": {"temperature": 1.0, "top_p": 0.95, "top_k": 20, "presence_penalty": 0.0}. Same five
agent jobs on each: four real coding tasks in an existing Python project, graded by hidden acceptance tests the agent
never sees, plus one six-phase web app built from scratch.

Job Greedy (2 runs) 1.0 / 0.95 / 20 (1 run)
Task 1 pass, 6.3 / 6.7 min pass, 6.5 min
Task 2 pass, 26.3 / 6.5 min pass, 8.2 min
Task 3 pass, 7.2 / 8.9 min pass, 8.6 min
Task 4 pass, 5.4 / 5.2 min pass, 6.3 min
Six-phase app done, 24 / 40 min done, 47.5 min
  • No runaway thinking in any of the 15 jobs, at either setting.
  • Same results on the hidden tests. On the single tasks the times overlap; on the six-phase build the sampled run
    thought noticeably more (prompts up to 97K vs 60K) and took longer. That is one run, so treat the time as a hint.
    (The 40 min greedy run lost about 12 min to an unrelated problem in our own tooling.)
  • We kept greedy plus the 8K reasoning budget for now, since it already bounds a loop to about 8K tokens. That is a
    choice for our setup, not a general recommendation: 15 jobs are far too few to measure a roughly 1-in-20 event.

The part that seems worth knowing for others: an agent that sends no temperature gets greedy unless the config has a
sampling block, and nothing in the client shows it. "api_monitor": true or a logging proxy makes it visible.

Drafted with an AI assistant (Claude) from our runs and logs, and checked by me.

<!-- gh-comment-id:6004214799 --> @christopherrobertbrooks-tech commented on GitHub (Oct 5, 2026): Following up on @talisp's point about requests that carry no sampling: we checked ours, and then compared greedy against the Qwen3.8 thinking defaults on real agent work. **What our client sends:** a coding agent built on the Claude Agent SDK, talking to `/v1/messages`. Logging its requests showed `"temperature": null` (no `top_p` / `top_k` either), only `"thinking": {"type": "adaptive"}` and `"output_config": {"effort": "medium"}`. Our `strata-coder-iq1_m.json` had no `sampling` block, so every agent request ran **greedy**. Our one loop earlier in this thread (the sentence repeated 1,110 times) happened under those settings. **The comparison:** Coder IQ1_M, engine 0.1.39, Tesla V100 32 GB, `reasoning_budget_tokens: 8192` in both. The second config only adds `"sampling": {"temperature": 1.0, "top_p": 0.95, "top_k": 20, "presence_penalty": 0.0}`. Same five agent jobs on each: four real coding tasks in an existing Python project, graded by hidden acceptance tests the agent never sees, plus one six-phase web app built from scratch. | Job | Greedy (2 runs) | 1.0 / 0.95 / 20 (1 run) | | --- | --- | --- | | Task 1 | pass, 6.3 / 6.7 min | pass, 6.5 min | | Task 2 | pass, 26.3 / 6.5 min | pass, 8.2 min | | Task 3 | pass, 7.2 / 8.9 min | pass, 8.6 min | | Task 4 | pass, 5.4 / 5.2 min | pass, 6.3 min | | Six-phase app | done, 24 / 40 min | done, 47.5 min | - No runaway thinking in any of the 15 jobs, at either setting. - Same results on the hidden tests. On the single tasks the times overlap; on the six-phase build the sampled run thought noticeably more (prompts up to 97K vs 60K) and took longer. That is one run, so treat the time as a hint. (The 40 min greedy run lost about 12 min to an unrelated problem in our own tooling.) - We kept greedy plus the 8K reasoning budget for now, since it already bounds a loop to about 8K tokens. That is a choice for our setup, not a general recommendation: 15 jobs are far too few to measure a roughly 1-in-20 event. The part that seems worth knowing for others: an agent that sends no temperature gets greedy unless the config has a `sampling` block, and nothing in the client shows it. `"api_monitor": true` or a logging proxy makes it visible. Drafted with an AI assistant (Claude) from our runs and logs, and checked by me.
Author
Owner

@Niko1221 commented on GitHub (Oct 6, 2026):

Fixed in 0.1.40: an opt-in repeat stop for reasoning that repeats whole passages: "reasoning_loop_recovery": "stop" ends the reply there, "recover" goes on with the low-effort instruction (#869). Off by default. See DETAILS.

<!-- gh-comment-id:6010900239 --> @Niko1221 commented on GitHub (Oct 6, 2026): Fixed in 0.1.40: an opt-in repeat stop for reasoning that repeats whole passages: "reasoning_loop_recovery": "stop" ends the reply there, "recover" goes on with the low-effort instruction (#869). Off by default. See DETAILS.
Author
Owner

@davidliudev commented on GitHub (Oct 6, 2026):

Thanks @Niko1221 for the fast action.
I will try to test this out tonight.

<!-- gh-comment-id:6011989454 --> @davidliudev commented on GitHub (Oct 6, 2026): Thanks @Niko1221 for the fast action. I will try to test this out tonight.
Author
Owner

@davidliudev commented on GitHub (Oct 6, 2026):

Oh one more thing @Niko1221 , do you think that is the root cause or just a workaround? Or should I change model as suggested by others?

<!-- gh-comment-id:6012014689 --> @davidliudev commented on GitHub (Oct 6, 2026): Oh one more thing @Niko1221 , do you think that is the root cause or just a workaround? Or should I change model as suggested by others?
Author
Owner

@BlueKingMuch commented on GitHub (Oct 6, 2026):

The fact that a request with no sampling fields decodes greedy is also confusing other users. In this r/LocalLLaMA thread, someone compared the engine to llama.cpp with the same GGUF and observed looping on Strata, but "normal" behaviour on llama.cpp. After othe users pointed out that the reason may be his sampling settings, the poster retried it with different sampling settings and the loops stopped.

My recommendation would be to copy what llama.cpp does: every GGUF that setup offers carries Qwen's recommended sampling for thinking mode in general.sampling.* (temperature 1.0, top_p 0.95, top_k 20; checked on the ISTA, Swift, Coder and Unsloth quants), and llama.cpp uses it when neither the request nor the command line sets it (ggml-org/llama.cpp#17120).

@Niko1221: as a minimal change, would it make sense to take these as Strata's defaults, i.e. setup reads them from the GGUF and writes them into a new config's "sampling" block, and the web chat starts from them instead of 0.6? #869 deals with a loop once it has started; this changes what a client gets before that, so I'm asking first. A fallback in the server (the GGUF's values whenever a config has no "sampling" block) would be the bigger step: it also changes existing configs and the documented greedy default.

<!-- gh-comment-id:6013998562 --> @BlueKingMuch commented on GitHub (Oct 6, 2026): The fact that a request with no sampling fields decodes greedy is also confusing other users. In [this r/LocalLLaMA thread](https://www.reddit.com/r/LocalLLaMA/comments/1wxbm8w/need_maybe_say_use_llamacpp/), someone compared the engine to llama.cpp with the same GGUF and observed looping on Strata, but "normal" behaviour on llama.cpp. After othe users pointed out that the reason may be his sampling settings, the poster retried it with different sampling settings and the loops stopped. My recommendation would be to copy what llama.cpp does: every GGUF that setup offers carries Qwen's recommended sampling for thinking mode in general.sampling.* (temperature 1.0, top_p 0.95, top_k 20; checked on the ISTA, Swift, Coder and Unsloth quants), and llama.cpp uses it when neither the request nor the command line sets it (ggml-org/llama.cpp#17120). @Niko1221: as a minimal change, would it make sense to take these as Strata's defaults, i.e. setup reads them from the GGUF and writes them into a new config's "sampling" block, and the web chat starts from them instead of 0.6? #869 deals with a loop once it has started; this changes what a client gets before that, so I'm asking first. A fallback in the server (the GGUF's values whenever a config has no "sampling" block) would be the bigger step: it also changes existing configs and the documented greedy default.
Author
Owner

@Niko1221 commented on GitHub (Oct 7, 2026):

Answer to your question: the opt-in reasoning_loop_recovery (false, stop or recover) is a workaround, not the root cause. The cause is greedy default sampling when the client sends none, and the model itself. Set temperature, top_p and a presence penalty the way Qwen recommends in the config. Note that the web chat sends 0.6 where the config says 1.0.

<!-- gh-comment-id:6037762608 --> @Niko1221 commented on GitHub (Oct 7, 2026): Answer to your question: the opt-in reasoning_loop_recovery (false, stop or recover) is a workaround, not the root cause. The cause is greedy default sampling when the client sends none, and the model itself. Set temperature, top_p and a presence penalty the way Qwen recommends in the config. Note that the web chat sends 0.6 where the config says 1.0.
Author
Owner

@sharathanaik commented on GitHub (Oct 12, 2026):

I see looping too.. I traced it to these settings --resident-experts or --resident-cpu-experts or resident-budget-gib. remove all of these the looping goes away, but takes a 15-30% hit on token generation speed. This find is repeatable. Just to add i am on intel gpu, so could be backend specific, unless it can be confirmed for other GPUs showing the same behavior.

temperature/presence_penalty does not fix this, just shows up at different points.

<!-- gh-comment-id:6118186946 --> @sharathanaik commented on GitHub (Oct 12, 2026): I see looping too.. I traced it to these settings --resident-experts or --resident-cpu-experts or resident-budget-gib. remove all of these the looping goes away, but takes a 15-30% hit on token generation speed. This find is repeatable. Just to add i am on intel gpu, so could be backend specific, unless it can be confirmed for other GPUs showing the same behavior. temperature/presence_penalty does not fix this, just shows up at different points.
Author
Owner

@Niko1221 commented on GitHub (Oct 13, 2026):

Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

<!-- gh-comment-id:6155958655 --> @Niko1221 commented on GitHub (Oct 13, 2026): Thanks for the report. To keep the tracker current we are closing issues older than three days: [0.1.44](https://github.com/Niko1221/Strata/releases/tag/v0.1.44) is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1. If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#333
No description provided.