GLM (General Language Model)

A family of large language models by Zhipu AI (Z.ai) using a unique autoregressive blank infilling architecture. From GLM-130B to GLM-5.2 with 1M context.

🧬

Introduction

One of the first trillion-parameter open-source models in the world didn't come from Meta, Google, or Microsoft. It came from a university spin-off in Beijing called Zhipu AI, backed by Tsinghua University researchers who'd been working on their own approach to language models since before ChatGPT. That model was GLM-130B.

GLM (General Language Model, formerly ChatGLM) is a family of large language models developed by Zhipu AI (now branded internationally as Z.ai), a Chinese AI company spun out of Tsinghua University's Knowledge Engineering Group (KEG). Unlike most LLMs that follow the GPT-style decoder-only architecture, GLM uses a unique autoregressive blank infilling training strategy.

As of mid-2026, GLM has evolved through five major generations, from the early ChatGLM models through to GLM-5.2 with a 1-million token context window. Z.ai went public on the Hong Kong Stock Exchange in January 2026, becoming China's first major LLM company to IPO. Since July 2025, all GLM models have been released under the permissive MIT License.

📜

History

The GLM story starts in 2019, when a team of researchers at Tsinghua University's Knowledge Engineering Group began working on a new approach to language model training. Unlike the GPT-style "predict the next token" approach, they wanted to build a model that could handle both natural language understanding and generation in a unified framework. The result was the GLM training algorithm, published at ACL in May 2022.

In 2019, the research group spun out as an independent company: Zhipu AI. The founding team included Tsinghua professors and researchers. The company raised 2.5 billion yuan ($350M) from Alibaba Group, Tencent, Meituan, Ant Group, Xiaomi, and HongShan. In May 2024, Saudi Arabia's Prosperity7 Ventures participated in a $400M round valuing the company at $3 billion.

In January 2025, the US Commerce Department added Zhipu AI to its Entity List, restricting access to US technology. The company pivoted to domestic Chinese chips (Huawei Ascend, Cambricon). In July 2025, Zhipu rebranded internationally to Z.ai and released GLM-4.5 under MIT License. In January 2026, Z.ai held its IPO on the Hong Kong Stock Exchange.

📊

Model Generations

ChatGLM / GLM-130B (2022-2023) - GLM-130B, released in August 2022, was one of the largest open-source models at the time with 130 billion parameters. The ChatGLM-6B became extremely popular in China for its strong performance at a tiny 6B size.

GLM-4 Series (2024) - Included 9B and 32B models with 128K context. Later variants included GLM-4V-9B (vision), GLM-4-9B-Chat-1M (1M context), and GLM-4-Voice (end-to-end speech LLM). GLM-4.5 (July 2025) was a 355B MoE model (32B active) that marked the MIT License switch.

GLM-Z1 Reasoning Series (Apr 2025) - Dedicated reasoning models similar to DeepSeek-R1. The GLM-Z1-Rumination-32B added "rumination" capabilities for deep research-style thinking with multi-step research and tool use.

GLM-5 Series (2026) - GLM-5 (Feb 2026) was 355B MoE (32B active), ranking #1 among open-source models on Humanity's Last Exam. GLM-5.1 (Mar 2026) was 754B MoE achieving SOTA on SWE-Bench Pro. GLM-5.2 (Jun 2026) brought 1M token context, matching leading US lab models.

ModelDateParametersContextLicense
GLM-130BAug 2022130B dense2KProprietary
ChatGLM-6BMar 20236B dense8KProprietary
GLM-4-9BJun 20249B dense128KProprietary
GLM-4-PlusAug 2024Undisclosed128KProprietary
GLM-4.5Jul 2025355B MoE (32B active)128KMIT
GLM-Z1-32BApr 202532B dense128KMIT
GLM-5Feb 2026355B MoE (32B active)200KMIT
GLM-5.1Mar 2026754B MoE200KMIT
GLM-5.2Jun 2026754B MoE1MMIT
🏗️

Architecture: Blank Infilling

GLM's architecture is genuinely different from most other LLMs. While GPT-style models are trained exclusively on "predict the next token," GLM uses a technique called autoregressive blank infilling. During training, the model is shown text with random segments masked out, and its job is to predict the missing tokens one at a time in order.

This gives GLM several advantages: unified understanding and generation in a single framework, better long-range dependencies by learning to fill blanks that span hundreds of tokens, and natural bidirectional context when filling in gaps. Starting with GLM-4.5, the architecture shifted to Mixture of Experts (MoE) with 355B total parameters and 32B active per token.

🌐

Ecosystem and Products

  • AutoGLM - AI agent for smartphones that uses voice commands to complete multi-step tasks like ordering items or repeating past orders.
  • Ying - Text-to-video model generating 6-second clips from image and text prompts in about 30 seconds.
  • GLM-4-Voice - End-to-end speech LLM that adjusts tone, emotion, speed, and dialect in a unified model.
  • Chinese Chip Compatibility - Deep integration with Cambricon, Huawei Ascend, and Moore Threads processors.
  • AMiner - AI-powered research platform indexing academic papers and scientific knowledge graphs.
  • Enterprise Adoption - Used in finance, healthcare, education, and government, including a 61.28M yuan smart city deal in Hangzhou.
⚖️

Comparison with Alternatives

vs Qwen (Alibaba) - Both are Chinese model families. Qwen has broader model sizes; GLM's blank infilling gives theoretical advantages on bidirectional context tasks. Qwen has stronger enterprise distribution through Alibaba Cloud.

vs DeepSeek - DeepSeek grabbed headlines with efficiency breakthroughs. GLM took steady iteration, unique architecture, and a successful IPO. DeepSeek pushes cost frontiers; GLM is known for architectural innovation and Chinese chip compatibility.

vs Llama / Mistral - GLM's strongest advantage is in Chinese and multilingual Asian language tasks. The MIT License matches Llama and Mistral's permissive licenses.

🛡️

Security and Entity List

Z.ai's inclusion on the US Entity List in January 2025 restricts its access to US-origin semiconductor technology. This forced the company to pivot to domestic Chinese chips, which turned out to be a strategic advantage as US-China tech tensions escalated. Organizations in certain countries may face legal restrictions on using GLM models in production.

🚀

Getting Started

Quick Start with Transformers:

from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained(
    "THUDM/GLM-4-9B-Chat", trust_remote_code=True
)
model = AutoModelForCausalLM.from_pretrained(
    "THUDM/GLM-4-9B-Chat",
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True
)

response, history = model.chat(
    tokenizer,
    "Explain the GLM blank infilling architecture in simple terms.",
    history=[]
)
print(response)

Run with Ollama:

ollama run glm4:9b

Try GLM for free at chat.z.ai or access the commercial API at bigmodel.cn.