Papers › GLM-130B: An Open Bilingual Pre-trained Model

GLM-130B: An Open Bilingual Pre-trained Model

5 Oct 2022arXiv:2210.02414archive 2025-07-28

Aohan Zeng, Xiao Liu, Zhengxiao Du, Zihan Wang, Hanyu Lai, Ming Ding, Zhuoyi Yang, Yifan Xu, Wendi Zheng, Xiao Xia, Weng Lam Tam, Zixuan Ma, Yufei Xue, Jidong Zhai, WenGuang Chen, Peng Zhang, Yuxiao Dong, Jie Tang

We introduce GLM-130B, a bilingual (English and Chinese) pre-trained language model with 130 billion parameters. It is an attempt to open-source a 100B-scale model at least as good as GPT-3 (davinci) and unveil how models of such a scale can be successfully pre-trained. Over the course of this effort, we face numerous unexpected technical and engineering challenges, particularly on loss spikes and divergence. In this paper, we introduce the training process of GLM-130B including its design choices, training strategies for both efficiency and stability, and engineering efforts. The resultant GLM-130B model offers significant outperformance over GPT-3 175B (davinci) on a wide range of popular English benchmarks while the performance advantage is not observed in OPT-175B and BLOOM-176B. It also consistently and significantly outperforms ERNIE TITAN 3.0 260B -- the largest Chinese language model -- across related benchmarks. Finally, we leverage a unique scaling property of GLM-130B to reach INT4 quantization without post training, with almost no performance loss, making it the first among 100B-scale models and more importantly, allowing its effective inference on 4×RTX 3090 (24G) or 8×RTX 2080 Ti (11G) GPUs, the most affordable GPUs required for using 100B-scale models. The GLM-130B model weights are publicly accessible and its code, training logs, related toolkit, and lessons learned are open-sourced at \url{https://github.com/THUDM/GLM-130B/}.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2210.02414")

Code

Syntology Ran 5 of 21 code samples harvested from 4 repositories linked to this paper; 16 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 4 ran with no contract checked.

By repository: official repository: 9 samples from 1 repository, 1 ran; community (archive-listed): 12 samples from 3 repositories, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

thudm/glm-130b officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
thudm/chatglm mentioned on GitHubpytorchApache-2.0 report
thudm/chatglm2-6b mentioned on GitHubpytorchNOASSERTION report
thudm/chatglm3 mentioned on GitHubpytorch report
THUDM/GLM pytorch report
modelscope/modelscope pytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

21 samples harvested; 5 ran; 0 honoured the contract we drafted; 16 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
4ran
16unverified

Licence: 0 of the 21 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

add_bminf_args THUDM/GLM-130B/initialize.py official repository ran Apache-2.0 (permissive) · 945d1222f0c75dab · report
F1_metric THUDM/GLM-130B/evaluation/metrics.py official repository unverified Apache-2.0 (permissive) · 57bdd79eeeb0d09e · report
accuracy_metric THUDM/GLM-130B/evaluation/metrics.py official repository unverified Apache-2.0 (permissive) · 1bc1a496ad4d784f · report
add_evaluation_specific_args THUDM/GLM-130B/evaluate.py official repository unverified Apache-2.0 (permissive) · 8c1dee88ecad5be5 · report
find_all_tasks THUDM/GLM-130B/evaluate.py official repository unverified Apache-2.0 (permissive) · 1a1a6bb1bc387926 · report
get_masks_and_position_ids THUDM/GLM-130B/generate.py official repository unverified Apache-2.0 (permissive) · 5530d6c17cee956e · report
isEnglish THUDM/GLM-130B/generate.py official repository unverified Apache-2.0 (permissive) · 294d09efc94ec53e · report
pad_batch THUDM/GLM-130B/evaluation/dataset.py official repository unverified Apache-2.0 (permissive) · 4cd519b7c609ddfa · report
precision_metric THUDM/GLM-130B/evaluation/metrics.py official repository unverified Apache-2.0 (permissive) · cef36ffea76c70c8 · report
PromptSpell THUDM/GLM/model/modeling_glm.py community (archive-listed) ran MIT (permissive) · 184ed80cb890ac12 · report
gelu jackaduma/ChatGLM-LoRA-RLHF-PyTorch/models/modeling_chatglm.py community (archive-listed) ran MIT (permissive) · 43c9688838aff8b2 · report
gelu_impl jackaduma/ChatGLM-LoRA-RLHF-PyTorch/models/modeling_chatglm.py community (archive-listed) ran MIT (permissive) · c8f235d13277facd · report
init_method_normal THUDM/GLM/model/modeling_glm.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 6bcca529f47d7b8e · report
GLMModel THUDM/GLM/model/modeling_glm.py community (archive-listed) unverified MIT (permissive) · c9043275a83fa6fd · report
format_example jackaduma/ChatGLM-LoRA-RLHF-PyTorch/cover_alpaca2jsonl.py community (archive-listed) unverified MIT (permissive) · 1b801af1b3425cfa · report
load_tf_weights_in_chatglm_6b jackaduma/ChatGLM-LoRA-RLHF-PyTorch/models/modeling_chatglm.py community (archive-listed) unverified MIT (permissive) · 25fd6233234767aa · report
load_tokenizer_and_model thudm/chatglm3/finetune_demo/finetune_hf.py community (archive-listed) unverified Apache-2.0 (permissive) · 632dd3e505d6e594 · report
preprocess jackaduma/ChatGLM-LoRA-RLHF-PyTorch/tokenize_dataset_rows.py community (archive-listed) unverified MIT (permissive) · 2df80eb832dfdf12 · report
preprocess_function jackaduma/ChatGLM-LoRA-RLHF-PyTorch/train_reward_model.py community (archive-listed) unverified MIT (permissive) · 732abe979cb6bf39 · report
print_model_size thudm/chatglm3/finetune_demo/finetune_hf.py community (archive-listed) unverified Apache-2.0 (permissive) · 677f282a0ca855b5 · report
print_rank_0 THUDM/GLM/model/modeling_glm.py community (archive-listed) unverified MIT (permissive) · 58b8c47b2ea3036c · report

Tasks

Language ModelingLanguage ModellingLong-Context UnderstandingMulti-task Language UnderstandingQuantizationmodel

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Language Modelling BIG-bench-lite GLM-130B (3-shot) Accuracy 15.11 #1 of 3 Archive leaderboard report
Language Modelling BIG-bench-lite GLM-130B (1-shot) Accuracy 14.91 #2 of 3 Archive leaderboard report
Language Modelling BIG-bench-lite GLM-130B (0-shot) Accuracy 13.31 #3 of 3 Archive leaderboard report
Language Modelling CLUE (AFQMC) GLM-130B Accuracy 71.2 #1 of 2 Archive leaderboard report
Language Modelling CLUE (AFQMC) ERNIE 3.0 Titan-260B Accuracy 69.0 #2 of 2 Archive leaderboard report
Language Modelling CLUE (C3) GLM-130B Accuracy 77.5 #1 of 2 Archive leaderboard report
Language Modelling CLUE (C3) ERNIE 3.0 Titan-260B Accuracy 54.9 #2 of 2 Archive leaderboard report
Language Modelling CLUE (CMNLI) GLM-130B Accuracy 77.0 #1 of 2 Archive leaderboard report
Language Modelling CLUE (CMNLI) ERNIE 3.0 Titan-260B Accuracy 51.7 #2 of 2 Archive leaderboard report
Language Modelling CLUE (CMRC2018) GLM-130B Accuracy 55.7 #1 of 2 Archive leaderboard report
Language Modelling CLUE (CMRC2018) ERNIE 3.0 Titan-260B Accuracy 16.6 #2 of 2 Archive leaderboard report
Language Modelling CLUE (DRCD) GLM-130B Accuracy 77.1 #1 of 2 Archive leaderboard report
Language Modelling CLUE (DRCD) ERNIE 3.0 Titan-260B Accuracy 29.5 #2 of 2 Archive leaderboard report
Language Modelling CLUE (OCNLI_50K) GLM-130B Accuracy 74.7 #1 of 2 Archive leaderboard report
Language Modelling CLUE (OCNLI_50K) ERNIE 3.0 Titan-260B Accuracy 44.6 #2 of 2 Archive leaderboard report
Language Modelling CLUE (WSC1.1) GLM-130B Accuracy 83.9 #1 of 2 Archive leaderboard report
Language Modelling CLUE (WSC1.1) ERNIE 3.0 Titan-260B Accuracy 81.1 #2 of 2 Archive leaderboard report
Language Modelling FewCLUE (BUSTM) GLM-130B Accuracy 77.5 #1 of 2 Archive leaderboard report
Language Modelling FewCLUE (BUSTM) ERNIE 3.0 Titan-260B Accuracy 64.4 #2 of 2 Archive leaderboard report
Language Modelling FewCLUE (CHID-FC) GLM-130B Accuracy 90.1 #1 of 2 Archive leaderboard report
Language Modelling FewCLUE (CHID-FC) ERNIE 3.0 Titan-260B Accuracy 87.1 #2 of 2 Archive leaderboard report
Language Modelling FewCLUE (CLUEWSC-FC) GLM-130B Accuracy 77.4 #1 of 2 Archive leaderboard report
Language Modelling FewCLUE (CLUEWSC-FC) ERNIE 3.0 Titan-260B Accuracy 53.5 #2 of 2 Archive leaderboard report
Language Modelling FewCLUE (EPRSTMT) GLM-130B Accuracy 92.5 #1 of 2 Archive leaderboard report
Language Modelling FewCLUE (EPRSTMT) ERNIE 3.0 Titan-260B Accuracy 88.8 #2 of 2 Archive leaderboard report
Language Modelling FewCLUE (OCNLI-FC) GLM-130B Accuracy 73.8 #1 of 2 Archive leaderboard report
Language Modelling FewCLUE (OCNLI-FC) ERNIE 3.0 Titan-260B Accuracy 53.8 #2 of 2 Archive leaderboard report
Language Modelling LAMBADA GLM-130B (bidirectional attention) Accuracy 80.2 #12 of 37 Archive leaderboard report
Language Modelling The Pile GLM-130B Bits per byte 0.634 #5 of 39 Archive leaderboard report
Language Modelling The Pile Jurassic-1 Bits per byte 0.65 #7 of 39 Archive leaderboard report
Language Modelling The Pile GPT-3 Bits per byte 0.742 #16 of 39 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 12k 0.9 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 16k 0.5 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 1k 39.8 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 2k 18.8 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 4k 9.0 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 6k 5.0 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM3-6b-32k 8k 3.4 #7 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 12k 0.0 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 16k 0.3 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 1k 31.2 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 2k 10.9 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 4k 4.5 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 6k 1.6 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (BestAnswer) ChatGLM2-6b-32k 8k 1.6 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM3-6b-32k 16k 0.7 #9 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM3-6b-32k 2k 2.3 #9 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM3-6b-32k 4k 2.4 #9 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM3-6b-32k 8k 2.0 #9 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM2-6b-32k 16k 0.9 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM2-6b-32k 2k 0.9 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM2-6b-32k 4k 0.2 #10 of 10 Archive leaderboard report
Long-Context Understanding Ada-LEval (TSort) ChatGLM2-6b-32k 8k 0.7 #10 of 10 Archive leaderboard report
Multi-task Language Understanding MML GLM-130B Average (%) 44.8 #30 of 44 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Introduced by this paper: GLM

AWAREAdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDropoutERNIEGLMGPT-3Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections