mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[GH-ISSUE #273] EXL3 quant: long thinking loops run to max_tokens #102
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#102
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 @eliaskg on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/mw00/project-maya/issues/273
Setup
What happens
I run multi-turn coding-agent sessions through the API. The system prompt tells the model to put executable Python in a fenced block. The harness runs that code and returns the program output as the next user message. Requests are greedy (temperature 0) with thinking enabled.
All of this was seen with the EXL3 3.05bpw quant. I did not test other quants on the same workload, so I cannot say whether this is specific to the quant.
On many prompts the first turn never ends. The model stays in thinking, decodes to the request's
max_tokens(81,920 tokens, about 35 minutes at ~40 tok/s) and returnsfinish_reason: "length". No fenced code block appears in the content. At temperature 0 the same prompt shape fails the same way again.This is the failure mode the loop guard of #33 was built for, but the guard does not fire. It closes thinking only when the last window repeats one pattern of at most 32 tokens. The loops I see vary their wording, so the pattern check does not match and the turn runs to the ceiling.
Why the sampling knobs do not help
#33 states the GLM path has no repetition penalties. #146 made the server accept llama.cpp's
repeat_penalty/repeat_last_nfields in requests, but I found nothing on the GLM decode path that applies them. A client that sendsrepeat_penaltyto stop a loop gets no effect.@mw00 commented on GitHub (Oct 19, 2026):
Thanks for the detailed report - you're right on the penalties: the server accepts
repeat_penalty/presence_penalty/frequency_penalty, but the GLM engine drops them, so they have no effect on GLM today. That's a bug, and the fix (applying them in GLM's sampler, drafting included) is planned for the next release.Two things that should help right now:
thinking_budgettokens (run config, default 32768), and the answer follows. A lower value, e.g. 16384, caps the time a stuck turn can take.So the budget may not have fired for you, or the answer itself kept going after it. Could you share the server's log of one failing turn and your run config? Please include the request's
max_tokensand whether aglm loop guardline appears.@eliaskg commented on GitHub (Oct 19, 2026):
Thanks, that explains it. Here is what I can answer from my side.
The thinking budget never fired. My run config has "thinking_budget": 0, which the server reads as none (int(cfg.get("thinking_budget", 32768) or 0)), so no budget reached the engine and a reasoning block was never closed. A stuck turn thinks to the request's max_tokens (81,920) and ends with finish_reason: "length" and empty content. The setup pass wrote that config, and the key holds 0, not the 32768 default. Nothing on my side asked for a budget of zero, so that default may deserve a look.
The loop guard fired once, in an answer, not in thinking. The entire log holds one guard line:
The runaway turns stay inside thinking with varied wording, and no guard line appears for them.
Sampling: greedy is deliberate, the client pins temperature 0 for reproducible runs. I can rerun the same prompts with the dashboard's recommended sampling and report back.
Happy to retest once the penalty fix lands.
@mw00 commented on GitHub (Oct 19, 2026):
Thanks, that settles it: with
"thinking_budget": 0the cap is off, so a stuck reasoning block runs tomax_tokens. Our setup doesn't write that key; when it's absent, the server uses 32768. Could you check where it came from, e.g. an older config or another tool that edits it? Removing the key, or setting e.g. 16384, brings the cap back.The penalties fix is coming in the next release. A rerun with the recommended sampling would be very helpful too, thanks!
@mw00 commented on GitHub (Oct 20, 2026):
Fixed in v1.1.17. Thanks for the report! Please reopen if it shows up again.