Skip to content

Render GLM low reasoning as Low - #1362

Open
saralilyb wants to merge 1 commit into
antirez:mainfrom
saralilyb:fix/glm-low-reasoning-effort
Open

saralilyb wants to merge 1 commit into
antirez:mainfrom
saralilyb:fix/glm-low-reasoning-effort

Conversation

@saralilyb

Copy link
Copy Markdown

Problem

GLM 5.3's chat template (zai-org/GLM-5.3-Flash, chat_template.jinja) has three effort levels:

{%- set effective_reasoning_effort = reasoning_effort if reasoning_effort is defined and reasoning_effort in ['low', 'high'] else 'max' -%}

ds4_glm_reasoning_effort_text() collapses DS4_THINK_LOW to Reasoning Effort: High, so a client asking for low effort gets high. test_reasoning_effort_mapping asserts that mapping, so it may be deliberate; if it is, I'd like to know the reason.

Change

Render Reasoning Effort: Low for DS4_THINK_LOW and update the assertion. DS4_THINK_MEDIUM stays High. The template would send medium (and anything else, including xhigh) to Max, but changing that would raise effort for clients that send medium today, so I left it alone and am raising it here as a question instead.

Testing

M5 Max 128 GB, Metal, GLM-5.3-Flash-Q2.gguf, resident.

  • make clean && make, no warnings; ./ds4_test --server passes. With the parent's ds4.c the updated assertion fails; with the fix it passes.
  • Live trace: Hermes Agent sends reasoning_effort: "low", think_mode: low, and the rendered prompt carries Reasoning Effort: Low.
  • The level has a real effect. On seven CPython 3.14 bug fixes run as agent tasks (two runs each, same harness, the fix's own tests hidden), GLM at Low generated 84–130K tokens across the seven tasks against 261–370K at High, finished in 1.3–1.9 h against 4.0–6.7 h, and hit the one-hour task limit 0 times against 7. It resolved 4–5 of 7 tasks either way.
  • Prompt text only; no kernel or graph change, so no speed or logprob runs.
GLM 5.3's chat template has three effort levels: it renders reasoning_effort
"low" and "high" as "Reasoning Effort: Low" and "High", and anything else as
"Max". ds4_glm_reasoning_effort_text() collapsed DS4_THINK_LOW to High, so a
client asking for low effort got high. Render Low for DS4_THINK_LOW.

DS4_THINK_MEDIUM keeps High as before. The template would send medium (and
xhigh) to Max, but changing that would raise effort for clients that send
medium today, so it is left for a separate decision.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant