Z.ai's GLM Models: From ChatGLM to GLM-5

The Serving Stack
by The Serving Stack··8 min read·
OPEN-MODEL LABS · 02GLM-4.5368 KiBGLM-587.75 KiBGLM-5.3-FLASH11 KiB33×KV CACHE PER TOKEN

Z.ai started as Zhipu AI, a company that grew out of Tsinghua University's research on language models, and its models carry the name GLM through every generation. Older releases live under the THUDM organization on Hugging Face, newer ones under zai-org. Few labs have changed direction as completely: GLM went from a pretraining objective, to small chat models for consumer hardware, to some of the largest open agentic models. This piece follows that path, the idea behind each step, and what it means for people who serve the models.

A timeline from 2021 to 2026, stretched after January 2025: GLM (blank infilling), GLM-130B (open, bilingual), ChatGLM-6B (consumer GPUs), GLM-4-9B (1M-token chat), GLM-4-32B and Z1 (reasoning), GLM-4.5 (agentic MoE, 355B), GLM-4.6 (200K, coding agents), GLM-4.7 (think before acting), GLM-5 (744B, sparse attention), GLM-5.2 (1M context), GLM-5.3-Flash (linear plus sparse attention).A timeline from 2021 to 2026, stretched after January 2025: GLM (blank infilling), GLM-130B (open, bilingual), ChatGLM-6B (consumer GPUs), GLM-4-9B (1M-token chat), GLM-4-32B and Z1 (reasoning), GLM-4.5 (agentic MoE, 355B), GLM-4.6 (200K, coding agents), GLM-4.7 (think before acting), GLM-5 (744B, sparse attention), GLM-5.2 (1M context), GLM-5.3-Flash (linear plus sparse attention).

GLM: an objective before a model

The name comes from a 2021 paper, GLM: General Language Model Pretraining with Autoregressive Blank Infilling. Language models were then split between two training styles: BERT-like models that fill in masked words (good at understanding) and GPT-like models that continue text (good at generating). GLM proposed one objective for both: remove spans of text, let the model read the rest in both directions, then have it write the missing spans back, one token at a time, in random order. A model trained this way could classify, fill gaps, and generate.

The field went the other way, toward plain left-to-right models, and GLM followed. But the objective explains the early models' name and their bilingual, research-first character. GLM-130B (2022), an open English and Chinese model that its authors reported to be "at least as good as GPT-3 (davinci)", is remembered mostly for its report on training stability: how to keep a 130-billion-parameter run from diverging.

ChatGLM: a chat model on a gaming GPU

The release that made GLM known was ChatGLM-6B, in March 2023: a 6-billion-parameter bilingual chat model that, quantized to 4 bits, ran on a single consumer graphics card. At a time when chat models meant an API, it put one on a desktop. ChatGLM2-6B and ChatGLM3-6B followed within the year, with longer contexts (32K, then 128K).

GLM-4 (2024) moved to a much larger training run, "ten trillions of tokens mostly in Chinese and English" per the ChatGLM family report, and released GLM-4-9B in chat, million-token-context, and vision versions. In April 2025, GLM-4-32B and the GLM-Z1 reasoning models closed this first life.

GLM-4.5: built for agents

GLM-4.5 (July 2025) is the turn. It is a mixture-of-experts model, 355 billion parameters with 32 billion active per token, and GLM-4.5-Air a smaller one, 106 billion with 12 billion active. The report names the target in its title: agentic, reasoning, and coding ("ARC") abilities in one model, with a "hybrid reasoning" switch between thinking and direct answers, and a post-training pipeline of specialist models merged and refined with reinforcement learning.

For serving, GLM-4.5 is a conventional large MoE: grouped-query attention (96 query heads sharing 8 key-value heads), 160 experts with 8 active, and one multi-token-prediction layer that serves as a built-in draft model for speculative decoding. vLLM and SGLang supported it at launch, with its MTP head as a speculative method.

GLM-4.6 (September 2025) raised the context from 128K to 200K tokens and targeted coding agents by name (Claude Code, Cline, Roo Code, Kilo Code); GLM-4.7 (December 2025) focused on "thinking before acting" in agent loops. The architecture did not change.

GLM-5: borrowing DeepSeek's attention

GLM-5 (February 2026) doubled the model, to 744 billion parameters with 40 billion active, and replaced its attention with DeepSeek's: multi-head latent attention, which caches one compressed vector per layer and token, and DeepSeek Sparse Attention, which attends only to the 2,048 most relevant earlier tokens. The config's architecture name says it plainly: GlmMoeDsaForCausalLM.

KV cache per token, BF16, from the configs: GLM-4.5 to 4.7 with grouped-query attention, 368 KiB; GLM-5 to 5.3 with latent attention, 87.75 KiB; GLM-5.3-Flash, with 11 cached layers and 34 linear-attention layers, 11 KiB.KV cache per token, BF16, from the configs: GLM-4.5 to 4.7 with grouped-query attention, 368 KiB; GLM-5 to 5.3 with latent attention, 87.75 KiB; GLM-5.3-Flash, with 11 cached layers and 34 linear-attention layers, 11 KiB.

The cache per token dropped from 368 KiB to 88 KiB even though the model doubled. Architecture ideas now move between labs within months: DeepSeek published sparse attention with V3.2-Exp in September 2025, and GLM-5 shipped it in February 2026.

GLM-5.2, 5.3, and 5.3-Flash

  • GLM-5.2 (June 2026) extended the context to one million tokens and introduced IndexShare: one sparse-attention indexer shared by every four layers, which Z.ai reports cuts computation per token by 2.9 times at a million tokens. It also improved the MTP layer for speculative decoding.
  • GLM-5.3 (August 2026) kept GLM-5.2's architecture and improved post-training, and changed the license (below).
  • GLM-5.3-Flash (August 2026) is a new, smaller base: 320 billion parameters with 18 billion active, natively multimodal, and the first GLM model to mix linear attention into the stack: 34 of its 45 layers keep a fixed-size state instead of a cache that grows with every token, and 11 keep a sparse-attention cache. Per token of context, it stores about 11 KiB, 33 times less than GLM-4.5.

The models at a glance

Model Released Parameters (active) Context Attention License
ChatGLM-6B Mar 2023 6B dense 2K full custom (model license)
GLM-4-9B Jun 2024 9B dense 128K (1M variant) full custom (GLM-4 license)
GLM-4.5 Jul 2025 355B (32B) 128K GQA MIT
GLM-4.5-Air Jul 2025 106B (12B) 128K GQA MIT
GLM-4.6 / 4.7 Sep / Dec 2025 355B (32B) 200K GQA MIT
GLM-5 Feb 2026 744B (40B) 200K MLA + sparse MIT
GLM-5.2 Jun 2026 744B (40B) 1M MLA + sparse, shared indexer MIT
GLM-5.3 Aug 2026 744B (40B) 1M MLA + sparse, shared indexer GLM-5.3 License
GLM-5.3-Flash Aug 2026 320B (18B) 1M linear + sparse MIT

From the papers, model cards, configs, and Hugging Face license fields, 2026-10-06.

The license

Through GLM-5.2 the large GLM models are MIT-licensed. GLM-5.3 ships under its own license, which reads like MIT with one added condition: a company operating a "model as a service" business (third parties controlling inference or fine-tuning, typically through an API) with more than 10 billion US dollars of revenue over 12 months must pass a Z.ai security review before using the model commercially. For almost everyone, including products that embed the model, it is MIT in practice; for the largest cloud and API providers, it is a gate. GLM-5.3-Flash stays MIT.

What it means if you serve them

  • GLM-4.5 to 4.7 are the easy ones: standard grouped-query attention and MoE, supported everywhere, with an MTP head for speculative decoding.
  • GLM-5 and later need DeepSeek-class kernels: latent attention and sparse attention, the same engine paths as DeepSeek V3.2. If your engine serves one, it is close to serving the other, but check the exact version.
  • GLM-5.3-Flash mixes linear attention in: most of its state does not grow with context, which makes million-token requests far cheaper to hold in memory, and needs an engine with hybrid-model support.
  • Read the license of the exact release: GLM-5.3 and GLM-5.3-Flash, released together, are under different licenses.

Next

MiniMax bet on linear attention earlier than anyone, and partly walked it back: the next piece follows its models.

The Serving Stack
The Serving Stack

Inference engineering and AI in production — depth-first, no hype.

Inference Notes

Once a week: what changed in serving AI models, and what it means if you build, run or pay for them, in about five minutes.

Related Articles