Papers › GLM: General Language Model Pretraining with Autoregressive Blank Infilling

GLM: General Language Model Pretraining with Autoregressive Blank Infilling

18 Mar 2021ACL 2022 5arXiv:2103.10360archive 2025-07-28

Zhengxiao Du, Yujie Qian, Xiao Liu, Ming Ding, Jiezhong Qiu, Zhilin Yang, Jie Tang

There have been various types of pretraining architectures including autoencoding models (e.g., BERT), autoregressive models (e.g., GPT), and encoder-decoder models (e.g., T5). However, none of the pretraining frameworks performs the best for all tasks of three main categories including natural language understanding (NLU), unconditional generation, and conditional generation. We propose a General Language Model (GLM) based on autoregressive blank infilling to address this challenge. GLM improves blank filling pretraining by adding 2D positional encodings and allowing an arbitrary order to predict spans, which results in performance gains over BERT and T5 on NLU tasks. Meanwhile, GLM can be pretrained for different types of tasks by varying the number and lengths of blanks. On a wide range of tasks across NLU, conditional and unconditional generation, GLM outperforms BERT, T5, and GPT given the same model sizes and data, and achieves the best performance from a single pretrained model with 1.25x parameters of BERT Large , demonstrating its generalizability to different downstream tasks.

PaperPDFConference PDFCodeCode 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="2103.10360")

Code

Syntology Ran 1 of 1 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 1 ran · our draft was wrong.

By repository: community (archive-listed): 1 sample from 1 repository, 1 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 officialmentioned in papermentioned on GitHubpytorch report
BBuf/GLM mentioned on GitHubpytorch report
thudm/chatglm mentioned on GitHubpytorchApache-2.0 report
thudm/chatglm2-6b mentioned on GitHubpytorchNOASSERTION report
thudm/chatglm3 mentioned on GitHubpytorch report
thudm/swissarmytransformer mentioned on GitHubpytorch report
thudm/visualglm-6b mentioned on GitHubpytorchApache-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

1 sample harvested; 1 ran; 0 honoured the contract we drafted; 0 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

Licence: 0 of the 1 sample 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 thudm/swissarmytransformer. “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.

get_masks_and_position_ids_glm thudm/swissarmytransformer/examples/glm/inference_glm.py community (archive-listed) ran · our draft was wrong fingerprinted Apache-2.0 (permissive) · 562eb223eab20399 · report

Tasks

Abstractive Text SummarizationClassificationDecoderDocument SummarizationGeneral ClassificationLanguage ModelingLanguage ModellingNatural Language Understanding

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Abstractive Text Summarization CNN / Daily Mail GLM-XXLarge ROUGE-1 44.7 #9 of 53 Archive leaderboard report
Abstractive Text Summarization CNN / Daily Mail GLM-XXLarge ROUGE-2 21.4 #9 of 53 Archive leaderboard report
Abstractive Text Summarization CNN / Daily Mail GLM-XXLarge ROUGE-L 41.4 #9 of 53 Archive leaderboard report
Document Summarization CNN / Daily Mail GLM-XXLarge ROUGE-1 44.7 #4 of 26 Archive leaderboard report
Document Summarization CNN / Daily Mail GLM-XXLarge ROUGE-2 21.4 #4 of 26 Archive leaderboard report
Document Summarization CNN / Daily Mail GLM-XXLarge ROUGE-L 41.4 #4 of 26 Archive leaderboard report
Language Modelling LAMBADA GLM-XXLarge (bidirectional) Accuracy 72.35 #21 of 37 Archive leaderboard report
Language Modelling LAMBADA GLM-XXLarge (unidirectional) Accuracy 67.18 #27 of 37 Archive leaderboard report
Language Modelling WikiText-103 GLM-XXLarge (bidirectional) Number of params 10000M #4 of 89 Archive leaderboard report
Language Modelling WikiText-103 GLM-XXLarge (bidirectional) Test perplexity 11.33 #4 of 89 Archive leaderboard report
Language Modelling WikiText-103 GLM-XXLarge (unidirectional) Number of params 10000M #5 of 89 Archive leaderboard report
Language Modelling WikiText-103 GLM-XXLarge (unidirectional) Test perplexity 12.22 #5 of 89 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

AdafactorAdamAttentionAttention DropoutBERTBPECosine AnnealingDense ConnectionsDiscriminative Fine-TuningDropoutGPTGated Linear UnitInverse Square Root ScheduleLayer NormalizationLinear LayerLinear Warmup With Cosine AnnealingLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSentencePieceSoftmaxT5Weight DecayWordPiece

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