UD-IQ4_XS: canned, off-topic "graph cycle proof" reasoning replaces real thinking on agentic tool-call turns (~100K context)

#101
by Uer9 - opened

Summary
During a long agentic session (Hermes Agent, llama-server, ~100K tokens of context), 8 of 74 assistant turns had their entire reasoning block replaced by the same unrelated passage: a plan for proving that every graph with n vertices and more than nβˆ’1 edges contains a cycle. The wording varied slightly each time but was otherwise the same. Each of those turns still ended with a sensible, on-task tool call, so the task finished correctly. The reasoning text had nothing to do with the conversation, which was a server repair task with no math in it.

Setup

  • Model: UD-IQ4_XS (4 shards) + mmproj-F16.gguf; MTP draft mtp-Qwen3.8-Flash-Next-Q8_0.gguf (--spec-type draft-mtp --spec-draft-n-max 3)
  • llama.cpp: built from source, commit 7d7f028 (2026-11-08), Metal
  • Hardware: Mac Studio M4 Max, 128 GB, macOS 27.0.1
  • Server flags: -c 262144 -np 1 --jinja --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 --repeat-penalty 1.0 (thinking-mode settings from the model card)
  • Client: Hermes Agent over an OpenAI-compatible /v1/chat/completions endpoint, with streaming and tool calling. The agent is set to reasoning_effort: medium, and preserve_thinking was left at the template default.
  • A single slot (-np 1), so no concurrent requests shared the slot. The server log shows only this session, plus a few tiny 16-token requests between turns.

What happened

  • 8 of the 74 assistant turns in one session were affected. They clustered over about an hour, with roughly 100K–104K tokens in the slot.
  • In every affected turn, the reasoning started with "The user is asking for a mathematical proof." The rest was ~800 characters planning a proof by induction or contrapositive, ending with "Write the proof concisely." After that came a correct, on-task tool call.
  • In one turn the reasoning read "Two methods are needed. This is a well-known standard result, so I'll provide two concise proofs. No tools needed." That turn still ended with a tool call.
  • The other 66 turns in the same session had normal, on-topic reasoning.

Example (one affected turn, reasoning field only, lightly trimmed):

The user is asking for a mathematical proof. The proposition to be proved: every graph with n vertices and more than nβˆ’1 edges (i.e., at least n edges) contains a cycle. Equivalent proposition: an acyclic graph (forest) has at most nβˆ’1 edges. Proof by induction or by contrapositive. … Proof: take a maximal path. Its endpoint has degree 1. … Write the proof concisely.

What I ruled out

  • Cross-talk from another client: there's one slot, and no other client sent anything resembling this prompt. The canned reasoning and the on-task tool call came back in the same response.
  • A leftover test or benchmark: no test prompt anywhere on the system contains this text.

Questions

  1. Has anyone else seen stereotyped or canned reasoning like this, especially at long context or on tool-call turns?
  2. Is this more likely an IQ4_XS quantization artifact, or does it also happen on Q4_K_XL / Q8_0 / BF16? (On 128 GB I can't easily test the bigger quants at full context.)
  3. Is a different reasoning_effort or preserve_thinking setting recommended for long agentic sessions?

I can provide the full reasoning text for all 8 affected turns if that helps.

Update: likely mitigation found.

I set preserve_thinking to false server-side (llama-server --chat-template-kwargs '{"preserve_thinking":false}', everything else unchanged: same UD-IQ4_XS file, llama.cpp build, sampling, 262K context, MTP). I confirmed via /apply-template that prior turns' reasoning is no longer re-sent; reasoning within the current turn is still kept, and tool-call loops work normally.

Since then: two long Hermes Agent sessions today (one still running) with no occurrence of the canned graph-cycle passage. Before the change it showed up in 8 of 74 assistant turns in a single ~100K session.

That's a small sample, but it fits a separate report of Flash Next echoing its own earlier reasoning more often as more copies accumulate in context, also traced to preserve_thinking: true. It suggests this is a base-model/preserved-thinking feedback effect rather than an IQ4_XS quantization artifact.

For anyone hitting this in long agentic sessions: try preserve_thinking: false first. I'll post again if it comes back.

Sign up or log in to comment