GLM-5.3: Stronger Coding With Fewer Tokens
Z.ai's launch post for GLM-5.3 makes a specific claim. The model delivers better results than GLM-5.2 while using fewer output tokens. We wanted to check whether that holds up outside of Z.ai's own benchmark, so we ran both models on the same set of coding tasks and counted the tokens ourselves.
The claim we tested
In its launch announcement, Z.ai described GLM-5.3 as a major step forward in agentic coding compared to GLM-5.2, framed specifically around achieving stronger results while spending fewer output tokens. On their own Code Bench, they report GLM-5.3 reaching 34.5% at Max reasoning effort using roughly 75,000 output tokens per task, against GLM-5.2's 23.4% at roughly 96,000 tokens per task, according to coverage of the launch. That is a specific, checkable pairing of a quality number and a token number, so we treated it as the claim to reproduce, not the more general marketing language around it.
Z.ai has said the two models share the same underlying base checkpoint (744B parameters, 40B active), with all of GLM-5.3's reported gains coming from additional post-training rather than a new base model, according to the same coverage.
How we tested it
We did not build an app for this one. The claim is about coding-task correctness and output-token spend, so we built a small, objectively gradable coding benchmark instead:
- 8 self-contained Python problems: palindrome checking, two-sum with duplicate values, merging intervals that touch at an endpoint, an LRU cache with eviction, flattening a nested list without splitting strings, least common multiple of a list (including a zero case), cycle detection in a linked list, and parsing a CSV line with a quoted comma.
- Each task has an edge case built in that plausible-looking code can still get wrong. The palindrome test includes punctuation and mixed case, and the merge-intervals test checks that
[1,4]and[4,5]merge into one interval. - Each task also has a hidden pytest-style assertion suite the model never sees. We never asked either model to grade its own output.
- Both models ran at
reasoning_effort: "max", the same effort level Z.ai's own comparison uses, once per task per model. - We extracted the returned code and ran it ourselves with
python3against the test suite, recording pass or fail from actual execution. None of the 16 responses (8 tasks × 2 models) came back truncated. - We recorded the output-token count the API reports for each response. Those totals are exact. Where we report a reasoning/content split it's an estimate, since the API returns one combined completion-token count for GLM models, so we tokenized the reasoning and content strings separately and apportioned the reported total by that ratio.
These are the exact prompts we sent to both models:
1. palindrome
Write a Python function `is_palindrome(s: str) -> bool` that returns True if the string is a palindrome, ignoring case, spaces, and punctuation (so "A man, a plan, a canal: Panama" is a palindrome, and "" is a palindrome). Return ONLY a single Python code block with the function, no explanation.
2. two_sum
Write a Python function `two_sum(nums: list, target: int) -> list` that returns the indices of the two numbers in nums that add up to target. Assume exactly one valid answer exists per test, and handle duplicate values correctly (e.g. nums=[3,3], target=6 must return [0,1]). Return ONLY a single Python code block with the function, no explanation.
3. merge_intervals
Write a Python function `merge_intervals(intervals: list) -> list` that takes a list of [start, end] interval lists (not necessarily sorted) and returns a list of merged, non-overlapping intervals sorted by start. Two intervals that only touch at an endpoint (e.g. [1,4] and [4,5]) should be merged into one ([1,5]). Return ONLY a single Python code block with the function, no explanation.
4. lru_cache
Write a Python class `LRUCache` with methods `__init__(self, capacity: int)`, `get(self, key) -> value or -1 if missing`, and `put(self, key, value)`. When capacity is exceeded, evict the least recently used item. Accessing an item via get or put counts as a use (refreshes recency). Return ONLY a single Python code block with the class, no explanation.
5. flatten
Write a Python function `flatten(nested: list) -> list` that flattens an arbitrarily nested list into a single flat list, preserving order. Strings inside the list must be treated as atomic values, not iterated character by character (e.g. flatten(["ab", [1,2]]) == ["ab", 1, 2]). Return ONLY a single Python code block with the function, no explanation.
6. lcm_list
Write a Python function `lcm_list(nums: list) -> int` that returns the least common multiple of a list of positive integers. If the list contains a 0, return 0. If the list is empty, return 1. Return ONLY a single Python code block with the function, no explanation.
7. linked_list_cycle
Write a Python function `has_cycle(head) -> bool` that detects whether a singly linked list has a cycle. Assume nodes have a `.next` attribute (None if no next node). Use O(1) extra space (Floyd's cycle detection / two pointers), not a visited set. Also provide a simple `Node` class with a `.val` and `.next` attribute in the same code block. Return ONLY a single Python code block, no explanation.
8. csv_line
Write a Python function `parse_csv_line(line: str) -> list` that parses a single line of CSV into a list of field strings. Fields may be wrapped in double quotes, and a quoted field may contain a literal comma which must NOT be treated as a separator (e.g. 'a,"b,c",d' -> ["a", "b,c", "d"]). Quotes around a field should be stripped from the output. Do not use the csv module. Return ONLY a single Python code block with the function, no explanation.
Each task also carries a hidden pytest-style assertion suite (not shown to the model) used to grade the returned code by actual execution.
What we found
Both models passed all 8 tasks. Pass rate was tied at 8/8 for GLM-5.2 and 8/8 for GLM-5.3, including the edge cases we built in. Spot-checking the reasoning transcripts for the two most token-heavy responses (the CSV parser and the LCM task) showed genuine step-by-step reasoning, including the model manually tracing its own logic against sample inputs, not a repetition loop or corrupted output.
On tokens, the result did not match the direction of Z.ai's claim. GLM-5.2 used 12,471 output tokens total across the 8 tasks, averaging 1,558.9 tokens per task. GLM-5.3 used 14,076 output tokens total, averaging 1,759.5 tokens per task. That's about 13% more output tokens for GLM-5.3 on this task set, not fewer, even though the pass rate matched.
The per-task picture was inconsistent rather than uniformly better or worse:
| Task | GLM-5.2 tokens | GLM-5.3 tokens | GLM-5.3 vs GLM-5.2 |
|---|---|---|---|
| palindrome | 957 | 452 | 47% |
| two_sum | 333 | 200 | 60% |
| merge_intervals | 1,694 | 2,695 | 159% |
| lru_cache | 1,836 | 1,236 | 67% |
| flatten | 1,630 | 2,477 | 152% |
| lcm_list | 3,248 | 1,020 | 31% |
| linked_list_cycle | 1,242 | 1,164 | 94% |
| csv_line | 1,531 | 4,832 | 316% |
GLM-5.3 used fewer tokens than GLM-5.2 on 5 of the 8 tasks, in some cases by a wide margin (31% of GLM-5.2's spend on the LCM task). But on 3 tasks it used substantially more, including more than 3x on the CSV-parsing task. Across both models, the large majority of output tokens went into the reasoning trace rather than the final code. Our tokenizer-based estimate put roughly 93-94% of completion tokens in the reasoning portion for both models on this task set.
[Placeholder: screenshot of the results.json output / terminal run showing per-task pass/fail and token counts]
We want to be clear about scope here. Z.ai's own Code Bench is a larger, harder, and presumably more carefully calibrated set of coding-agent tasks than the 8 short, well-known problems we used, and their token-reduction claim is measured against their own harness (Claude Code 2.1.207, per third-party coverage of the launch).
Our result doesn't refute their benchmark. What we can say is that on this specific, independently graded task set, at the same reasoning effort level, GLM-5.3 matched GLM-5.2's pass rate but spent more total output tokens doing it, and the per-task variance was large enough that no consistent efficiency trend was visible.
Try It Yourself
Both models are available through Puter.js without an API key, using Puter's user-pays model.
Script tag:
<html>
<body>
<script src="https://js.puter.com/v2/"></script>
<script>
puter.ai.chat("Write a function that merges overlapping intervals.", {
model: "z-ai/glm-5.3",
reasoning_effort: "max"
}).then(response => {
console.log(response.message.content);
console.log("Output tokens:", response.usage.completion_tokens);
});
</script>
</body>
</html>
npm (@heyputer/puter.js):
import { init } from "@heyputer/puter.js/src/init.cjs";
const puter = init(); // browser-based auth, or pass your own token server-side
const response = await puter.ai.chat(
[{ role: "user", content: "Write a function that merges overlapping intervals." }],
{ model: "z-ai/glm-5.2", reasoning_effort: "max" }
);
console.log(response.message.content);
console.log("Output tokens:", response.usage.completion_tokens);
Swap z-ai/glm-5.2 for z-ai/glm-5.3 to compare directly. reasoning_effort accepts "low", "high", or "max" for GLM-5.3, and "high" or "max" for GLM-5.2.
FAQ
When was GLM-5.3 released?
Z.ai announced GLM-5.3 on August 14, 2026.
What actually changed between GLM-5.2 and GLM-5.3?
According to Z.ai, nothing at the base-model level. Both models reportedly share the same 744B-parameter (40B active) Mixture-of-Experts checkpoint. Z.ai says every capability gain in GLM-5.3 comes from additional post-training (reinforcement learning across a larger and more diverse set of task environments), not a new base model.
What's GLM-5.3's context window and output limit?
Multiple sources describing Z.ai's documentation put it at a 1-million-token context window with a maximum of 128K output tokens, unchanged from GLM-5.2.
Can I turn off reasoning/thinking in GLM-5.3?
No. Unlike some earlier GLM releases, GLM-5.3 cannot run with thinking disabled. The only control is reasoning_effort, which accepts low, high, or max and defaults to max. GLM-5.2 only accepts high or max for the same parameter.
Is GLM-5.3 pricing different from GLM-5.2?
We couldn't verify a standalone GLM-5.3 API token price at the time of writing. GLM-5.3 is available through Z.ai's GLM Coding Plan (subscription tiers reported to start around $18/month) and through the general API, but we don't have confirmed per-token pricing to report here, so we're flagging it as unverified rather than stating a number.
Are GLM-5.3's weights open?
At launch, GLM-5.3's weights were not yet public; Z.ai said it planned to release them roughly two weeks after launch, following safety review. We have not independently confirmed whether the full GLM-5.3 weights have since been published. A related model, GLM-5.3-Flash, was released separately under an MIT license with weights on Hugging Face.
Related
Ship a Full-Stack App with One Prompt
Create a to-do list app using Puter.js
Coding manually? see the guide