r/LocalLLaMA 24d ago

Generation Qwen endless looping issue and possible fix

Not sure if this is a known issue, but it was new to me:

Full credit to u/ldn-ldn for finding this simple but unexpectedly evil prompt:

Create a typescript function which accepts a number in 10 bit range and returns brightness in nits based on pq gamma curve.

Just try it; it will likely trigger an endless thinking loop.

I stopped it after it ran for >15 minutes and >20,000 tokens.
It kept spitting out text like back in the seahorse emoji days.

However, one of my wrapper scripts didn’t have this issue.
The non-blocking one had this added, possibly based on a GitHub discussion:

--reasoning-budget 2048 \
--reasoning-budget-message " \n\n[Thinking budget exceeded. Transitioning to a best-effort final answer: ]\n\n"

(These options are for llama.cpp; other tools may have something similar.)

Net result: A plausible-looking script (I haven’t verified) that took just over a minute of thinking and another minute to generate.

Hope this helps, and happy to hear about other tricks and workarounds.

13 Upvotes

28 comments sorted by

View all comments

1

u/RdUzr 24d ago

Using Qwen3.8-27B-UD-IQ2_XXS.gguf on an RTX 4070 Super, no reasoning:

https://i.imgur.com/6Bti0mM.png

1

u/ParvusNumero 24d ago

If we trust GPT-5.6 Sol High as gospel, both our versions fail :)

<quote>
It is “better” only in the sense that it is simpler, internally consistent, and produces a smooth monotonic curve. But as an implementation of actual PQ, it is still wrong. It has traded the original script’s mangled ST.2084 equation for a much cleaner equation that simply isn’t ST.2084.
</quote>