Paper · 2024-06-18 · cs.CL
ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools
Technical report for the ChatGLM family, centred on GLM-4: pre-training on about ten trillion tokens, grouped-query attention, RMSNorm and SwiGLU, SFT plus RLHF, and GLM-4 All Tools, which picks a browser, Python, image or user-defined tool itself. Author-reported: GLM-4 (0520) scores 83.3 MMLU, 93.3 GSM8K and 78.5 HumanEval.
Language model pretrainingInstruction tuningReinforcement learning from human feedback (RLHF)Tool usellmpretrainingalignmenttool-usetechnical-report
arXivPDFCodeMarkdown14 min read
AI-compiled by claude-haiku-5-5 on 2026-10-24, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
This report describes a family of language models called ChatGLM, made by Team GLM at Zhipu AI and Tsinghua University. It focuses on the newest series, GLM-4. The models first learn from a huge pile of mostly Chinese and English text, then are tuned to follow instructions and to match what people prefer.
One variant, GLM-4 All Tools, is trained to decide on its own when a question needs an outside tool: a web browser, a Python interpreter, an image generator, or a function a developer has defined. It then uses the tool's output to continue.
Most of the report is a list of benchmark results. The authors say GLM-4 is close to the strongest commercial models on common tests and ahead of them on Chinese alignment tests. Those are the authors' own numbers. The report gives few training details, so use it to judge whether the models are relevant, not to rebuild them.
TL;DR
The report describes the ChatGLM family from GLM-130B to GLM-4 and GLM-4 All Tools, by Team GLM at Zhipu AI and Tsinghua University p. 1. GLM-4 is pre-trained on about ten trillion tokens, mostly Chinese and English, and aligned with supervised fine-tuning and RLHF [abstract] §2 Alignment. GLM-4 All Tools is further trained to choose among a web browser, a Python interpreter, a text-to-image model and user-defined functions §2 GLM-4 All Tools. Results are author-reported. Training hyperparameters, the data mixture and the All Tools training method are largely not stated, so this card supports relevance checks, not reproduction.
Problem
The report has no single research question. Its goal is a family of general models that match top commercial systems on English benchmarks and lead on Chinese, with open releases alongside §1. Three concrete pressures shape it:
- Inference cost: the team switched to grouped-query attention to shrink the key-value cache during inference §2 Architecture.
- Context length: moving from 2K (ChatGLM-6B) to 32K and then to 128K and 1M needed position-encoding extension, continual training on long text and long-context alignment §2 Architecture.
- Tool use: the model has to decide when a task needs an external tool and to fold the tool's result back into the answer §2 GLM-4 All Tools.
Assumptions: the models are pre-trained mostly on Chinese and English, and aligned primarily for those two languages [abstract] §2 Pre-Training Data. Other languages get only a small share of the pre-training data and are not the alignment focus [abstract].
Method
The paper has no equations and no algorithm box. The steps below follow its prose.
- Pre-training data. Multilingual documents (mostly English and Chinese) from web pages, Wikipedia, books, code and research papers. The pipeline runs deduplication (exact and fuzzy), filtering of noisy web pages, and tokenization §2 Pre-Training Data. Sources are re-weighted to favour books and Wikipedia §2 Pre-Training Data. Mixture ratios are not stated.
- Tokenizer. Byte-level BPE learns separate Chinese and multilingual vocabularies, which are merged with the cl100k_base tokenizer of tiktoken into one vocabulary of 150,000 tokens §2 Pre-Training Data.
- Architecture changes from GLM-130B to GLM-4 §2 Architecture:
- Remove all bias terms except those of the query, key and value projections.
- Use RMSNorm instead of LayerNorm, and SwiGLU instead of ReLU in the feed-forward block.
- Extend rotary positional embeddings to two dimensions.
- Replace multi-head attention with grouped-query attention; set the feed-forward width to 10/3 of the hidden size so the parameter count stays the same.
- Context extension §2 Architecture. Position-encoding extension, continual training on long text, and long-context alignment. The paper defers the long-context recipe to LongAlign §2 ChatGLM Techniques.
- Alignment §2 Alignment. Supervised fine-tuning on authentic human prompts (the paper says template-based or model-written prompts were worse), then RLHF to reduce refusals, unsafe outputs, mixed-language output and multi-turn drift. Annotators score each response for safety, factuality, relevance, helpfulness and preference. Early models used annotations by the developers; later models used in-house annotation and purchased third-party data under quality control.
- All Tools §2 GLM-4 All Tools. The model analyses a request, plans steps, calls one or more tools, and uses their intermediate results. The tools named are a web browser, a Python interpreter and a text-to-image model; the GLMs platform adds user-defined functions, APIs and knowledge bases §2 GLM-4 All Tools.
Sketch of the architecture block as the paper describes it. Norm placement relative to the residual connection is not stated.
# Transformer block for GLM-4 [§2 Architecture]
# Input and output: hidden (B, T, d); cache holds grouped keys and values
def transformer_block(hidden, positions, cache):
# RMSNorm replaces LayerNorm [§2 Architecture]
normed = rms_norm(hidden) # (B, T, d)
# Only the Q, K and V projections carry a bias [§2 Architecture]
# Keys and values use fewer heads than queries (GQA) [§2 Architecture]
queries, keys, values = qkv_projection(normed)
# Two-dimensional rotary positional encoding [§2 Architecture]
queries, keys = rope_2d(queries, keys, positions)
# Keys and values are cached in the grouped (smaller) form [§2]
cache.append(keys, values)
attended = attention(queries, cache.keys, cache.values)
hidden = hidden + output_projection(attended)
# SwiGLU feed-forward; width d_ffn = 10/3 * d [§2 Architecture]
normed = rms_norm(hidden)
hidden = hidden + swiglu_ffn(normed)
return hiddenSketch of the All Tools loop, written from the prose. The paper gives no algorithm and no step limit §2 GLM-4 All Tools.
# Tool loop for an All Tools model [§2 GLM-4 All Tools]
# Tools: browser, Python, text-to-image, user-defined functions
def all_tools_loop(conversation, tools):
while True:
# The model plans and may request one tool [§2 GLM-4 All Tools]
reply = model.generate(conversation, tools)
if reply.tool_name is None:
return reply.text
# Run the tool, then feed its result back [§2 GLM-4 All Tools]
result = dispatch_tool(reply.tool_name, reply.arguments)
conversation.append(reply)
conversation.append(result)Hyperparameters
Values from the paper unless the notes say otherwise. Repository defaults are marked as such, because they are not the paper's training settings.
| Name | Value | Where | Notes |
|---|---|---|---|
| pre-training corpus size | about 10 trillion tokens | [abstract] §1 §2 Pre-Training Data | mostly Chinese and English, plus a small share from 24 languages [abstract] |
| tokenizer vocabulary | 150,000 | §2 Pre-Training Data | BPE, merged with cl100k_base |
| pre-training context length, GLM-4-9B | 8,192 | §1 | GLM-4 (128K) pre-training length: not stated |
| inference context length | 128K (GLM-4); 1M (experimental GLM-4-9B-Chat-1M) | §1 | |
| attention | grouped-query attention | §2 Architecture | number of key-value groups: not stated |
| feed-forward width d_ffn | 10/3 × hidden size | §2 Architecture | chosen to keep parameter count equal to multi-head attention |
| feed-forward activation | SwiGLU | §2 Architecture | replaces ReLU |
| normalization | RMSNorm | §2 Architecture | epsilon and norm placement: not stated |
| bias terms | none except Q, K, V | §2 Architecture | |
| positional encoding | two-dimensional RoPE | §2 Architecture | rotary base: not stated |
| evaluation precision | BFloat16 | §3 intro | |
| prompting, math and reasoning benchmarks | chain-of-thought for GSM8K, MATH and BBH | §3.1 | number of shots: not stated |
| IFEval | 541 prompts, 25 instruction types, strict and loose scoring | §3.2 | |
| AlignBench | v1.1; 683 queries in 8 categories; GPT-4-based judge | §3.3 | judge prompt: not stated |
| LongBench-Chat | scored by GPT-4, few-shot, averaged over repeated runs | §3.4 | number of runs and shots: not stated |
| Berkeley Function Call Leaderboard | about 2k question-function-answer pairs | §3.6 | |
| AgentBench | 7 of 8 environments; Digital Card Game excluded | §3.7 | official per-dataset weights |
| SFT and RLHF learning rate, batch size, steps, optimizer | not stated | §2 Alignment | |
| RLHF algorithm details | not stated here | §2 ChatGLM Techniques | defers to ChatGLM-RLHF |
| SafetyBench filter | Chinese subset with highly sensitive questions removed | §4 | |
| demo decoding (CLI) | top_p 0.8, temperature 0.6, repetition_penalty 1.2, max new tokens 8,192 | trans_cli_demo.py trans_cli_demo.py | repository demo default, not from the paper |
| demo decoding (web) | top_p 0.8, temperature 0.95, repetition_penalty 1.0, max new tokens 2,048 | main.py | slider defaults, not from the paper |
| full SFT config | learning rate 5e-5, 3,000 steps, DeepSpeed ZeRO-3 | sft.yaml | repository fine-tuning default, not the paper's |
| LoRA config | learning rate 5e-4, 3,000 steps, rank 8, alpha 32, dropout 0.1, targets q/k/v | lora.yaml lora.yaml | repository fine-tuning default, not the paper's |
Results
Author-reported throughout. Baselines come from public technical reports or from public APIs, which the paper says are the sources §3 intro. Table numbers follow source order in the LaTeX, because the compiled PDF is not in the repository.
Open models and earlier generations §1
Setup: ChatGLM-6B (2023-03-14), ChatGLM2-6B (2023-06-25), ChatGLM3-6B-Base (2023-10-27) and GLM-4-9B (2024-06-05). Evaluation settings are not stated tab. 1.
| Dataset | ChatGLM-6B | ChatGLM2-6B | ChatGLM3-6B-Base | GLM-4-9B |
|---|---|---|---|---|
| GSM8K | 1.5 | 25.9 | 72.3 | 84.0 |
| MATH | 3.1 | 6.9 | 25.7 | 30.4 |
| BBH | 0.0 | 29.2 | 66.1 | 76.3 |
| MMLU | 25.2 | 45.2 | 61.4 | 74.7 |
| GPQA | - | - | 26.8 | 34.3 |
| HumanEval | 0.0 | 9.8 | 58.5 | 70.1 |
| BoolQ | 51.8 | 79.0 | 87.9 | 89.6 |
| CommonSenseQA | 20.5 | 65.4 | 86.5 | 90.7 |
| HellaSwag | 30.4 | 57.0 | 79.7 | 82.6 |
| PIQA | 65.7 | 69.6 | 80.1 | 79.1 |
| DROP | 3.9 | 25.6 | 70.9 | 77.2 |
| C-Eval | 23.7 | 51.7 | 69.0 | 77.1 |
| CMMLU | 25.3 | 50.0 | 67.5 | 75.1 |
| GAOKAO-Bench | 26.8 | 46.4 | 67.3 | 74.5 |
| C3 | 35.1 | 58.6 | 73.9 | 77.2 |
Academic benchmarks §3.1 tab. 2
Setup: MMLU, GSM8K, MATH, BBH, GPQA and HumanEval, with chain-of-thought for GSM8K, MATH and BBH §3.1.
| Model | MMLU | GSM8K | MATH | BBH | GPQA | HumanEval |
|---|---|---|---|---|---|---|
| GPT-4 (0314) | 86.4 | 92.0 | 52.9 | 83.1 | 35.7 | 67.0 |
| GPT-4 Turbo (1106) | 84.7 | 95.7 | 64.3 | 88.3 | 42.5 | 83.7 |
| GPT-4 Turbo (2024-04-09) | 86.7 | 95.6 | 73.4 | 88.2 | 49.3 | 88.2 |
| Claude 3 Opus | 86.8 | 95.0 | 60.1 | 86.8 | 50.4 | 84.9 |
| Gemini 1.5 Pro | 85.9 | 90.8 | 67.7 | 89.2 | 46.2 | 84.1 |
| GLM-4-9B-Chat | 72.4 | 79.6 | 50.6 | 76.3 | 28.8 | 71.8 |
| GLM-4-Air (0605) | 81.9 | 90.9 | 57.9 | 80.4 | 38.4 | 75.7 |
| GLM-4 (0116) | 81.5 | 87.6 | 47.9 | 82.3 | 35.7 | 72.0 |
| GLM-4 (0520) | 83.3 | 93.3 | 61.3 | 84.7 | 39.9 | 78.5 |
Instruction following, IFEval §3.2 tab. 3
Setup: 541 prompts; L = loose, S = strict, P = prompt-level, I = instruction-level. The Chinese columns use a translated set with inapplicable instructions removed §3.2.
| Model | EN L-P | EN S-P | EN L-I | EN S-I | ZH L-P | ZH S-P | ZH L-I | ZH S-I |
|---|---|---|---|---|---|---|---|---|
| GPT-4 (0613) | 79.5 | 77.1 | 85.5 | 83.7 | 72.4 | 68.9 | 80.0 | 75.7 |
| GPT-4 Turbo (1106) | 79.1 | 75.4 | 85.1 | 82.4 | 74.3 | 69.1 | 80.8 | 76.5 |
| GPT-4 Turbo (2024-04-09) | 84.5 | 81.2 | 88.7 | 85.9 | 79.3 | 72.6 | 84.2 | 79.1 |
| Claude 2 | 75.0 | 58.0 | 81.7 | 67.7 | 57.1 | 46.5 | 64.9 | 55.1 |
| Claude 3 Opus | 90.6 | 85.5 | 93.7 | 90.0 | 78.3 | 73.3 | 84.3 | 80.4 |
| GLM-4-9B-Chat | 73.0 | 69.0 | 80.3 | 77.2 | 73.0 | 69.0 | 80.3 | 77.2 |
| GLM-4-Air (0605) | 80.4 | 75.2 | 86.1 | 82.3 | 79.3 | 71.2 | 84.0 | 77.3 |
| GLM-4 (0520) | 83.7 | 79.1 | 88.7 | 85.0 | 79.7 | 71.9 | 84.2 | 78.0 |
Alignment in Chinese, AlignBench v1.1 §3.3 tab. 4
Setup: 683 queries, 8 categories, GPT-4-based multidimensional scoring §3.3.
| Model | Math | Logic | Language | Chinese | QA | Writing | Role Play | Professional | Overall |
|---|---|---|---|---|---|---|---|---|---|
| GPT-4 (0613) | 7.54 | 7.17 | 7.82 | 7.02 | 7.39 | 7.67 | 8.20 | 7.29 | 7.46 |
| GPT-4 Turbo (1106) | 7.85 | 7.66 | 7.90 | 7.22 | 8.24 | 8.53 | 8.46 | 7.95 | 7.90 |
| GPT-4 Turbo (2024-04-09) | 8.32 | 7.67 | 7.60 | 7.57 | 8.37 | 7.75 | 8.18 | 8.59 | 8.00 |
| Claude 2 | 6.39 | 5.85 | 6.75 | 5.72 | 6.68 | 5.87 | 6.86 | 6.56 | 6.26 |
| Claude 3 Opus | 7.27 | 7.11 | 7.94 | 7.71 | 8.21 | 7.61 | 7.73 | 8.02 | 7.53 |
| Gemini 1.5 Pro | 7.07 | 7.77 | 7.31 | 7.22 | 8.55 | 7.83 | 7.79 | 8.52 | 7.47 |
| GLM-4-9B-Chat | 7.00 | 6.01 | 6.69 | 7.26 | 7.97 | 7.59 | 8.10 | 7.52 | 7.01 |
| GLM-4-Air (0605) | 7.69 | 6.95 | 7.53 | 8.00 | 7.90 | 8.01 | 8.35 | 8.09 | 7.65 |
| GLM-4 (0116) | 7.20 | 7.20 | 7.60 | 8.19 | 8.45 | 7.88 | 8.05 | 8.56 | 7.66 |
| GLM-4 (0520) | 7.89 | 7.95 | 8.00 | 7.86 | 8.11 | 8.04 | 8.06 | 8.47 | 8.00 |
Long context, LongBench-Chat §3.4 tab. 5
Setup: context lengths from 10k to 100k (unit not stated); GPT-4 scores, few-shot prompting, averaged over repeated runs §3.4.
| Model | English | Chinese |
|---|---|---|
| GPT-4 Turbo (1106) | 87.2 | 71.4 |
| GPT-4 Turbo (2024-04-09) | 85.0 | 82.1 |
| Claude 2 | 81.3 | 76.2 |
| Claude 3 Opus | 87.7 | 82.7 |
| GLM-4-9B-Chat | 76.8 | 79.0 |
| GLM-4-Air (0605) | 82.4 | 81.0 |
| GLM-4 (0520) | 87.3 | 84.0 |
Real-world coding, NaturalCodeBench §3.5 tab. 6
Setup: real user prompts in Python and Java, in English and Chinese §3.5.
| Model | Python (en) | Java (en) | Python (zh) | Java (zh) | Overall |
|---|---|---|---|---|---|
| GPT-4 (0613) | 55.7 | 51.1 | 53.4 | 51.1 | 52.8 |
| GPT-4 Turbo (1106) | 51.9 | 55.0 | 47.3 | 51.9 | 51.5 |
| GPT-4 Turbo (2024-04-09) | 57.5 | 52.3 | 53.1 | 52.3 | 53.8 |
| Claude 2 | 34.4 | 36.6 | 33.6 | 32.8 | 34.4 |
| Claude 3 Opus | 48.9 | 48.9 | 45.0 | 50.4 | 48.3 |
| Gemini 1.5 Pro | 45.0 | 39.7 | 41.5 | 43.1 | 42.3 |
| GLM-4-9B-Chat | 33.9 | 29.8 | 30.8 | 34.4 | 32.2 |
| GLM-4-Air (0605) | 40.8 | 39.7 | 43.1 | 39.7 | 40.8 |
| GLM-4 (0520) | 51.6 | 42.8 | 45.4 | 48.9 | 47.1 |
Function calling, Berkeley Function Call Leaderboard §3.6 tab. 7
Setup: AST summary, execution summary and relevance detection §3.6.
| Model | AST summary | Exec summary | Relevance | Overall |
|---|---|---|---|---|
| Llama-3-8B-Instruct | 59.25 | 70.01 | 45.83 | 58.88 |
| GPT-4 Turbo (2024-04-09) | 82.14 | 78.61 | 88.75 | 81.24 |
| GPT-4o (2024-05-13) | 85.23 | 80.37 | 81.25 | 82.94 |
| ChatGLM3-6B | 62.18 | 69.78 | 5.42 | 57.88 |
| GLM-4-9B-Chat | 80.26 | 84.40 | 87.92 | 81.00 |
| GLM-4-Air (0605) | 84.34 | 85.93 | 68.33 | 80.94 |
| GLM-4 (0520) | 82.59 | 87.78 | 84.17 | 81.76 |
Agents, AgentBench §3.7 tab. 8
Setup: seven environments; overall score uses AgentBench's per-dataset weights §3.7.
| Model | OS | DB | KG | LTP | HH | WS | WB | Overall |
|---|---|---|---|---|---|---|---|---|
| GPT-4 (0613) | 42.4 | 32.0 | 58.8 | 16.6 | 78.0 | 61.1 | 29.0 | 3.69 |
| GPT-4 Turbo (1106) | 40.3 | 52.7 | 54.0 | 17.7 | 70.0 | 52.8 | 30.0 | 3.77 |
| GPT-4 Turbo (2024-04-09) | 41.0 | 46.7 | 53.2 | 19.4 | 72.0 | 55.1 | 19.0 | 3.68 |
| Claude 2 | 18.1 | 27.3 | 41.3 | 8.4 | 54.0 | 61.4 | 0.0 | 2.03 |
| Claude 3 Opus | 23.6 | 55.0 | 53.4 | 20.0 | 70.0 | 48.5 | 28.0 | 3.62 |
| GLM-4-Air (0605) | 31.9 | 51.0 | 53.8 | 12.3 | 78.0 | 69.2 | 30.0 | 3.58 |
| GLM-4 (0520) | 36.8 | 52.7 | 51.4 | 15.3 | 82.0 | 68.3 | 29.0 | 3.79 |
OS = Operating System, DB = Database, KG = Knowledge Graph, LTP = Lateral Thinking Puzzles, HH = House Holding, WS = Web Shopping, WB = Web Browsing.
GLM-4 All Tools §3.8 tab. 9
Setup: the All Tools system on the web, GLM-4 All Tools (Web, 0116), compared with GPT-4 (Web, 0110). Python tasks are GSM8K, MATH and Math23K; the browser task is "Information Seeking", which the paper does not define §3.8.
| Tool | Task | GLM-4 All Tools (Web, 0116) | GPT-4 (Web, 0110) |
|---|---|---|---|
| Python interpreter | GSM8K | 91.59 | 92.72 |
| Python interpreter | MATH | 63.60 | 65.00 |
| Python interpreter | Math23K | 88.50 | 88.40 |
| Browser | Information Seeking | 78.08 | 67.12 |
Safety, SafetyBench (Chinese subset) §4 tab. 10
Setup: seven categories; Chinese subset with highly sensitive questions removed §4.
| Model | Ethics and Morality | Illegal Activities | Mental Health | Offensiveness | Physical Health | Privacy and Property | Unfairness and Bias | Overall |
|---|---|---|---|---|---|---|---|---|
| GPT-4 (0613) | 92.7 | 93.3 | 93.0 | 87.7 | 96.7 | 91.3 | 73.3 | 89.7 |
| GPT-4 Turbo (1106) | 91.0 | 92.0 | 93.0 | 86.0 | 92.0 | 88.7 | 74.3 | 88.1 |
| GPT-4 Turbo (2024-04-09) | 90.3 | 91.3 | 91.7 | 85.3 | 92.0 | 89.3 | 75.0 | 87.9 |
| Claude 3 Opus | 92.7 | 91.7 | 92.7 | 86.3 | 94.7 | 88.7 | 66.0 | 87.5 |
| GLM-4 (0520) | 92.3 | 91.3 | 93.3 | 86.3 | 92.3 | 88.6 | 66.0 | 87.2 |
Paper vs code
Code: github.com/THUDM/GLM-4 at commit 024d8fd, Apache-2.0 LICENSE. The README cites this arXiv id README.md, and the owner is the THUDM organisation of the authors' lab. The clone is the repository's current main branch, which is later than the paper. Its README lists releases after June 2024 README.md. The repository holds no training code, no model architecture code and no benchmark harness. The architecture lives in checkpoint configs loaded with trust_remote_code trans_cli_demo.py. I searched the repository for AlignBench, IFEval, LongBench, NaturalCodeBench and AgentBench and found only README mentions.
- Checkpoint: the CLI demo loads
zai-org/GLM-4-9B-0414, not the GLM-4 (0520) or GLM-4-Air (0605) checkpoints evaluated in the paper trans_cli_demo.py §3 intro. Numbers from the paper cannot be reproduced from this code. - Decoding: the paper gives no evaluation decoding settings §3 intro. The repository's two demos disagree: the CLI uses temperature 0.6 and repetition penalty 1.2 trans_cli_demo.py trans_cli_demo.py; the web demo defaults to temperature 0.95 and repetition penalty 1.0 main.py.
- Precision: the paper says BFloat16 at evaluation §3 intro. The CLI demo also loads in bfloat16 trans_cli_demo.py. These agree.
- Tool use: the paper says the model chooses tools itself §2 GLM-4 All Tools. The repository only contains the client-side dispatch.
ALL_TOOLSmapssimple_browser,pythonandcogviewtool_registry.py.dispatch_toolruns a predefined tool or a registered custom tool whose arguments are JSON tool_registry.py. The learned choice of tool is not in the repository. - Architecture: grouped-query attention, RMSNorm, SwiGLU and 2D RoPE cannot be checked against the repository. The one architecture log is from an Intel demo README and lists
multi_query_group_num = 2andffn_hidden_size = 13696README.md. It gives no hidden size, so the 10/3 width ratio §2 Architecture cannot be checked. - Fine-tuning defaults: the repository's SFT and LoRA configs use learning rates of 5e-5 and 5e-4 sft.yaml lora.yaml. The paper gives no SFT learning rate §2 Alignment, so these are user defaults and do not describe the paper's alignment.
Pitfalls
- Baseline labels disagree. The text compares GLM-4 with GPT-4 (0613) at 86.4 MMLU and Gemini 1.5 Pro at 83.7 §1. Table 2 labels 86.4 as GPT-4 (0314) and lists Gemini 1.5 Pro at 85.9 tab. 2. Use the table values and name the GPT-4 build.
- Percentage claim. The text says GLM-4 reaches 96.3% of GPT-4's MMLU accuracy §3.1. Dividing the table values 83.3 by 86.4 gives 96.4%. The difference is rounding or a different base.
- AlignBench wording. The text says GLM-4 outperforms GPT-4 Turbo overall §3.3. The table shows both at 8.00 for GLM-4 (0520) and GPT-4 Turbo (2024-04-09) tab. 4.
- Suspicious duplicate. The GLM-4-9B-Chat IFEval rows are identical for English and Chinese tab. 3. This looks like a copy error, so do not read it as a cross-language result.
- All Tools comparison. The text compares with "ChatGPT-4 (Web)" §3.8, but the table column is "GPT-4 (Web, 0110)" tab. 9. The browser benchmark "Information Seeking" is not defined, and no sample size is given. Its numbers cannot be re-run from the paper.
- Context length. GLM-4 is said to support 128K §1, but the only stated pre-training length is 8,192, for GLM-4-9B §1. The pre-training length for the 128K models is not stated, so long-context ability depends on the long-context alignment step §2 Architecture.
- Baseline sourcing. Baselines come from technical reports or public APIs, and the paper does not say which for each cell §3 intro. API results depend on each provider's safety policy, which the paper says affected its Chinese SafetyBench subset §4.
- Judge dependence. AlignBench and LongBench-Chat are scored by a GPT-4-based judge §3.3 §3.4. The judge prompt, judge version and the number of repeated runs are not stated.
- Benchmark edits. The SafetyBench results use a Chinese subset with highly sensitive questions removed §4, so they are not comparable with the full benchmark.
- Missing training detail. Learning rates, batch sizes, step counts, optimizer settings and the SFT and RLHF data sizes are not stated §2 Alignment. The RLHF methods are described in other reports the paper cites §2 ChatGLM Techniques.
- Norm placement and bias details. The paper does not say whether RMSNorm is applied before or after each residual branch, nor the RMSNorm epsilon. The sketch above leaves placement open.
- Tool loop limits. The paper gives no step limit, stopping rule or error handling for tool calls §2 GLM-4 All Tools. The repository's dispatcher returns a system error when a tool call fails tool_registry.py.
- Cost hidden in agents. The paper gives no latency or cost figures for the tool calls behind the All Tools results §3.8.
Lineage
- Builds on: GLM-130B, arXiv:2210.02414. This report keeps the transformer base but changes the normalization, feed-forward activation, bias setup and attention design §2 Architecture.
- Alignment work used or cited by the authors: ChatGLM-RLHF, arXiv:2404.00934 §2 ChatGLM Techniques; ChatGLM-Math, arXiv:2404.02893 §2 ChatGLM Techniques; Self-Contrast, arXiv:2404.00604 §2 ChatGLM Techniques. AgentTuning and LongAlign are cited in the paper, but their arXiv ids are not checked on this card.
- Compared against: GPT-4 (0314, 0613, Turbo variants), GPT-4o, Claude 2, Claude 3 Opus, Gemini 1.5 Pro and Llama-3-8B-Instruct tab. 2 to tab. 9.
- Superseded by: none known from content already in this wiki.
Source and license
Adapted from “ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools” by Team GLM, Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Dan Zhang, Diego Rojas, Guanyu Feng, Hanlin Zhao, Hanyu Lai, Hao Yu, Hongning Wang, Jiadai Sun, Jiajie Zhang, Jiale Cheng, Jiayi Gui, Jie Tang, Jing Zhang, Jingyu Sun, Juanzi Li, Lei Zhao, Lindong Wu, Lucen Zhong, Mingdao Liu, Minlie Huang, Peng Zhang, Qinkai Zheng, Rui Lu, Shuaiqi Duan, Shudan Zhang, Shulin Cao, Shuxun Yang, Weng Lam Tam, Wenyi Zhao, Xiao Liu, Xiao Xia, Xiaohan Zhang, Xiaotao Gu, Xin Lv, Xinghan Liu, Xinyi Liu, Xinyue Yang, Xixuan Song, Xunkai Zhang, Yifan An, Yifan Xu, Yilin Niu, Yuantao Yang, Yueyan Li, Yushi Bai, Yuxiao Dong, Zehan Qi, Zhaoyu Wang, Zhen Yang, Zhengxiao Du, Zhenyu Hou, Zihan Wang (arXiv:2406.12793), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/THUDM/GLM-4 at commit 024d8fd48e62 (Apache-2.0). Any quoted code is shown under that license.