GLM: General Language Model Pretraining with Autoregressive Blank Infilling
Zhengxiao DuYujie QianXiao LiuMing DingJiezhong QiuZhilin YangJie Tang
Introduces an autoregressive blank-infilling pretraining framework with 2D positional encodings that unifies natural language understanding, conditional generation, and unconditional generation while outperforming BERT, T5, and GPT across equivalent model scales.
Existing natural language processing models generally rely on distinct architectures tailored to specific task types, creating inefficiencies and operational silos. Masked language models excel at text understanding but cannot handle generation, left-to-right generative models struggle with bidirectional context understanding, and encoder-decoder systems often require substantial parameter overhead. The article addresses this fragmentation by evaluating whether a unified pretraining framework can achieve top-tier performance across natural language understanding, conditional sequence-to-sequence generation, and open-ended text generation within a single architecture.
To achieve this, the article introduces the General Language Model (GLM), which pretrains a standard transformer architecture using an autoregressive blank infilling objective. The approach randomly masks continuous text spans and trains the model to generate them sequentially while applying span shuffling and two-dimensional positional encodings to preserve context without exposing output lengths beforehand. The framework was evaluated across standard benchmarks including SuperGLUE, GLUE, abstractive summarization, question generation, and zero-shot language modeling, comparing directly against BERT, RoBERTa, T5, BART, and GPT under matched data and compute constraints.
Empirical evaluations demonstrate that GLM consistently outperforms conventional architectures across diverse applications. On the SuperGLUE understanding benchmark, GLM outperformed BERT by 4.6% to 5.0% given identical parameters and data, while matching or exceeding larger specialized architectures like RoBERTa, BART, and T5. In text generation tasks, multi-task GLM configurations matched or outperformed strong sequence-to-sequence baselines such as BART and T5 on abstractive summarization and question generation. Furthermore, GLM scaled to 410 million and 515 million parameters matched or surpassed GPT in zero-shot language modeling while retaining superior bidirectional context encoding capabilities.
These findings indicate that organizations can consolidate separate language understanding and text generation pipelines into a single model family, reducing training redundancy, lowering parameter overhead, and streamlining deployment infrastructure. The evidence strongly supports adopting autoregressive blank infilling and cloze-style task reformulation over standard classification layers, particularly for tasks involving multi-token predictions. Decision-makers planning model deployments should consider multi-task GLM variants as a versatile foundation, while maintaining awareness of task-specific trade-offs, such as document-level objectives slightly degrading conditional summarization precision.
- Paper: BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding, Jacob Devlin et al. (2019). Understanding BERT's masked autoencoding architecture and bidirectional pretraining is essential to grasp GLM's motivation to unify autoencoding with autoregressive blank infilling.
- Paper: Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer, Colin Raffel et al. (2020). T5 establishes the span-corruption and encoder-decoder benchmark that GLM directly builds upon and modifies into a unified autoregressive blank-filling model.
- Paper: BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension, Mike Lewis et al. (2020). BART introduces sequence-to-sequence denoising and span-infilling objectives that provide vital architectural and conceptual context for GLM.
- Paper: XLNet: Generalized Autoregressive Pretraining for Language Understanding, Zhilin Yang et al. (2019). XLNet presents permutation autoregressive modeling and two-stream attention, motivating GLM's use of arbitrary span ordering and 2D positional encodings.
- Paper: Improving Language Understanding by Generative Pre-Training, Alec Radford et al. (2018). Reading GPT-1 provides foundational knowledge of standard autoregressive language modeling, highlighting the generation paradigm GLM seeks to unify with bidirectional understanding.
- Paper: SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems, Alex Wang et al. (2019). SuperGLUE serves as one of the primary evaluation benchmarks that GLM utilizes to prove its superiority over BERT and T5 on natural language understanding.
- Paper: Transformer-XL: Attentive Language Models beyond a Fixed-Length Context, Zihang Dai et al. (2019). Transformer-XL introduces relative positional encodings and segment recurrence mechanisms crucial for understanding long-context handling in autoregressive transformers.
- Paper: GLM-5: from Vibe Coding to Agentic Engineering, GLM-5-Team et al. (2026). GLM-5 represents the direct, scaled-up evolution of the General Language Model lineage toward mixture-of-experts architectures and autonomous agentic engineering.
- Paper: CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation, Yue Wang et al. (2021). CodeT5 adapts unified pretraining paradigms with identifier-aware denoising to specialized software engineering tasks.
- Paper: Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language models, BIG-bench authors (2022). BIG-bench expands the evaluation of scaled generalist language models across hundreds of diverse reasoning and generation benchmarks.
- Paper: Tulu 3: Pushing Frontiers in Open Language Model Post-Training, Nathan Lambert et al. (2024). Tulu 3 details modern post-training and alignment pipelines that take pretrained foundation models and adapt them for instruction following and verifiable reasoning.
