groundy
Models & Research

Coding Agents on GLM-5.4: Budgeting for Marathon Thinking

GLM-5.4 loop architecture shifts reasoning depth, making token budgets insufficient. Operators should instrument wall-clock time and task success before production routing.

Published 5 references
On this page9 sections

GLM-5.4 should not be routed to coding agents on an output-token budget alone. Zhipu says part of the model’s reasoning moves “from explicit output tokens into the implicit depth of the loop,” while also acknowledging that it can get caught in overly long ‘marathon thinking’ loops. Every GLM-5.4 capability and performance figure in this article, including the claimed 2T, 3T parameter-model parity, the 10–14% output-length reduction Zhipu reports for a 30B ablation, and the reported throughput, is vendor-reported. SWE-Bench Pro V2’s reported results include the predecessor GLM-5.3 but not GLM-5.4.

The practical consequence is that reasoning depth can no longer be governed confidently through visible token limits. Before routing agent traffic, instrument per-task wall-clock p50 and p99, track internal passes if the API exposes them, and measure whether additional reflection actually improves task success. Timeouts, detection of loops that stop making progress, and fallback routing belong in the harness, not on a later hardening list. On the current evidence, I would run bounded trials but hold production commitments until independent coding results arrive.

What the loop architecture changes

Zhipu’s developer documentation describes a concrete mechanism: GLM-5.4 reuses 28 layers of the GLM-5 base across two iterations, aiming for deeper reasoning without increasing parameter count. The launch post presents this as Zhipu’s first flagship Loop Transformer and claims intelligence comparable to 2T, 3T parameter models, without naming comparison models that would make that parity claim independently testable.

Two iterations of 28 layers is a bounded architectural description, not evidence of unlimited internal recursion. “Marathon thinking” is a separate, vendor-acknowledged behavioral failure mode. Keeping those ideas distinct matters: operators should not invent an infinite-loop explanation for the architecture, but they still need controls for tasks that consume far more time than expected.

The vendor’s supporting training comparison also needs careful scope. In an iso-parameter comparison on a 30B model with the same architecture as the 750B base, Zhipu reports gains with identical parameter counts and approximately 10% more total training compute, according to the launch post. That is evidence for the architectural hypothesis as reported by its developer. It is not a controlled measurement of the flagship’s coding-agent accuracy, serving cost, or tail latency.

For an agent, the important distinction is between text emitted to the caller and computation used to produce a result. Output tokens remain useful for billing and response-size accounting. They are no longer a sufficient proxy for how much reasoning a task consumed.

A smaller response does not establish a cheaper task

Zhipu reports that average output length drops by 10–14% in the 30B iso-parameter ablation (launch post), described there as “evaluated on the 30B model after 200K long-context SFT, with thinking mode enabled.” The drop is mostly shorter chains of thought, across most benchmarks including GPQA-Diamond and MMLU-Pro. The launch material does not quantify GLM-5.4’s own output-length change. What it does state for the flagship, in the developer documentation, is the mechanism: part of the reasoning shifts from explicit output tokens into the implicit depth of the loop.

That mechanism still creates a metering blind spot. A dashboard can show fewer output tokens while missing the additional reflection that produced them. It would therefore be unsafe to interpret the reported reduction as a proportional reduction in total compute, energy, or elapsed task time.

This is an operational inference from the vendor’s architecture description, not a measured GLM-5.4 cost result. The launch post lists the model API as coming soon and documents no per-pass pricing, and neither vendor source documents internal-pass counters that callers can observe. A useful evaluation should record that uncertainty rather than filling it with an estimated multiplier.

Wall-clock measurements provide a more dependable starting point because the harness can observe them directly. Measure the whole task, including agent orchestration and tool work, and record model elapsed time separately where possible. Then compare:

  • Per-task p50 and p99 wall-clock time, not only generated tokens per second.
  • Billed tokens versus internal passes, if pass counts are exposed. If they are not, mark the pass count unavailable instead of deriving it from output length.
  • Verified task success versus additional reflection, using the same agent tasks and acceptance tests.
  • Timeout and fallback frequency, so a good average result does not conceal a problematic tail.

The last comparison answers the question that matters for routing: does the extra loop produce enough additional solved tasks to justify its delay and resource use? The vendor says prolonged reflection consistently improves accuracy beyond the model’s parameter count, but that claim does not determine the marginal benefit on your repository, tools, and task mix.

Plan for the peak envelope, not the attractive number

Zhipu reports throughput of up to 200 tokens/s during off-peak hours and 70–80 tokens/s at peak load (launch post). It also says that reaching this throughput with a multi-pass Loop architecture required close co-design between the model and its inference infrastructure.

Use the 70–80 tokens/s peak figure as the conservative vendor-reported planning envelope, then test the actual endpoint under your own agent workload. Token throughput is not task latency: it does not by itself reveal queueing, reflection time before useful output, tool waits, retries, or the p99 completion time of a multi-step repair.

The co-design statement also limits what can be inferred about self-hosting. Zhipu says it intends to release weights after safety hardening, but gives no release date in the launch post. That is an open availability question, not a reason to assume the release has been cancelled. It does mean that open weights would not automatically reproduce the reported serving figures. Similar throughput could depend on infrastructure work that does not arrive with the weight files.

For users on weekly quota plans, the developer documentation says GLM-5.4 receives 1.5× the GLM-5.3 quota. Treat that as capacity information when sizing a trial. It is not evidence of better accuracy or faster completion.

Marathon thinking requires controls that bind

Zhipu’s own limitation statement is unusually useful for harness design:

The model still has some limitations. Most notably, it tends to get caught in overly long “marathon thinking” loops, though this prolonged reflection and self-correction does consistently improve accuracy beyond its parameter count.

That statement, from the launch post, describes a tradeoff rather than a simple defect. Some asynchronous work may benefit from additional correction. An interactive coding session with a tight latency expectation may not tolerate the same behavior. The routing policy should reflect that difference.

Three controls follow:

  1. Task-level timeouts. Bound the whole agent attempt, not merely an individual visible response. The launch material does not establish that an output-token limit bounds total task wall-clock time.
  2. Loop-collapse detection. Define loss of progress in harness terms. For example, a trial could flag repeated reflection or agent actions that produce no new task-state change. That example is an instrumentation design, not a reported GLM-5.4 behavior frequency.
  3. Fallback routing. When a timeout or no-progress condition fires, move the task to another route or return control to the operator. A fallback is especially important when abandoning a session would leave unfinished repository changes or require substantial reconstruction.

Do not replace these controls with a “no thinking” flag and assume the problem is solved. The independent paper Thinking Inertia: LLMs Keep Thinking When Told Not To finds that explicit no-think controls do not reliably remove visible explicit inference across local Qwen3 models, scaled variants, and frontier APIs. It also reports that accuracy stays relatively stable on Boolean and multiple-choice tasks, while open-ended tasks expose a tradeoff between answer-only compliance and accuracy, and argues that whether direct answering works depends on the structural support provided by the task.

That research was not conducted on GLM-5.4, and visible inference is not a direct measurement of hidden loop passes. Its narrower lesson still applies: a suppression instruction is not a dependable depth cap. If GLM-5.4 exposes such a control, evaluate it by task category and treat it as a hint whose compliance and accuracy effects need measurement. Keep timeouts and fallback routing as the enforceable controls.

Budget cost per solved task, not tokens alone

A separate position paper, LLM Inference Should Be Evaluated as Energy-to-Token Production, argues that inference should be evaluated as token production bounded by compute-per-token and energy-per-token ceilings under fixed quality. It supplies an accounting frame, not GLM-5.4 measurements or coefficients.

Applied by analogy to a loop model, that frame prevents a common budgeting mistake: treating the visible response as the full unit of production. Even if a smaller output-token charge were to reduce one line on an invoice, that alone would not establish lower total serving cost or lower cost per accepted coding task.

A trial should therefore keep four quantities separate:

  • What the provider bills.
  • What the harness can observe about elapsed time and internal passes.
  • What infrastructure resource consumption can be measured, where self-hosting makes that possible.
  • How many tasks pass the same correctness checks.

Until per-pass pricing and observability are documented, a precise internal-compute budget would be invented precision. Cost per verified completed task is a more defensible comparison, with unavailable resource measurements explicitly left blank.

The missing evidence changes the routing decision

The independent SWE-Bench Pro V2 paper provides useful context for the current coding-agent bar. It reports Claude Opus 5 running in Claude Code resolving 99.4% of tasks, Gemini 3.8 Flash resolving 94.9%, and Inkling resolving 89.9%, and its release contains 642 tasks, with 391 repaired and 89 discarded from the original 731. Its reported results include the predecessor GLM-5.3 but not GLM-5.4. That omission does not prove the model has never been evaluated elsewhere. It does mean SWE-Bench Pro V2 offers no comparison of GLM-5.4’s coding-agent accuracy against those results, and no validation of the vendor’s 2T, 3T parity framing for agent work.

The resulting decision is conditional:

DecisionWhat the evidence supportsCondition to satisfy
Run a bounded coding-agent trialThe vendor reports accuracy benefits from reflection, but acknowledges marathon loopsMeasure task success, wall-clock p50/p99, timeouts, and fallback frequency
Use output-token budgets as the main guardrailThe reported 10–14% output drop comes from the 30B ablation, and the flagship’s reasoning shifts into implicit loop depthDo not rely on this control; add task-level limits
Use no-think suppression as a depth capIndependent research on other systems finds unreliable suppression and accuracy tradeoffsTest by task type, but retain enforceable timeouts and fallback routing
Commit capacity from the throughput headlineZhipu reports 70–80 tokens/s at peak and up to 200 off-peakPlan against the peak envelope and validate the actual workload
Assume open weights will reproduce hosted throughputThe vendor attributes its throughput to model-infrastructure co-designTreat serving-stack parity as separate engineering work
Make GLM-5.4 a committed production defaultSWE-Bench Pro V2’s reported results include GLM-5.3 but not GLM-5.4Wait for independent agent results, or keep commitments explicitly reversible

My routing judgment follows from those conditions. For interactive work where a long stall disrupts the developer, I would keep another route available and make GLM-5.4 earn its place through measured task-success gains within an acceptable p99. For asynchronous work that can tolerate longer reflection, a broader trial is reasonable, provided “longer” still has an enforced limit.

The open questions are open-weights timing, per-pass pricing, internal-pass observability, and independent coding performance. None should be converted into an assumed negative. Together, they do explain why the sensible first investment is harness instrumentation rather than a token-budget adjustment.

Frequently Asked Questions

How does GLM-5.4 quota compare to GLM-5.3 for weekly plans?

For users on weekly quota plans, the developer documentation says GLM-5.4 receives 1.5× the GLM-5.3 quota. Treat that as capacity information when sizing a trial. It is not evidence of better accuracy or faster completion.

Does SWE-Bench Pro V2 include results for GLM-5.4?

Its reported results include the predecessor GLM-5.3 but not GLM-5.4. That omission does not prove the model has never been evaluated elsewhere. It does mean SWE-Bench Pro V2 offers no comparison of GLM-5.4’s coding-agent accuracy against those results, and no validation of the vendor’s 2T, 3T parity framing for agent work.

References

Follow the links in the article for context. The supporting material is collected here for further reading.

  1. GLM-5.4 Launch Postz.aiAccessed
  2. SWE-Bench Pro V2 Paperarxiv.orgAccessed
  3. GLM-5.4 Developer Documentationdocs.z.aiAccessed

Join the discussion

Share a useful perspective or ask a question about this article.

Discussion guidelinesComments privacy