NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools

Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Diego Rojas, Guanyu Feng, Hanlin Zhao, Hanyu Lai, Hao Yu, Hongning Wang, Jiadai Sun, Jiajie Zhang, Jiale Cheng, Jiayi Gui, Jie Tang, Jing Zhang, 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 WangarXiv 2024 · DOI

Introduction

The ChatGLM team, a collaboration between Zhipu AI and Tsinghua University, has developed a series of large language models (LLMs) that have evolved from the foundational GLM-130B to the state-of-the-art GLM-4. This progression aims to bridge the gap between open-source models and proprietary giants like GPT-4, with a specific focus on high-quality Chinese-English bilingual alignment and autonomous tool use. GLM-4 represents a significant leap, rivaling top-tier models in general capabilities and introducing the "All Tools" system for complex, multi-step problem solving.

Evolution and Architecture

The development of the GLM family has been marked by significant architectural refinements and scaling. GLM-4 was trained on a massive 10 trillion tokens across 24 languages, primarily Chinese and English. The model utilizes a Transformer-based backbone with several modern optimizations, including Group Query Attention (GQA) for reduced KV cache size and faster inference, and 2D Rotary Positional Embeddings (RoPE) for better spatial awareness.

Evolution of the GLM model family and MMLU performance gains.

Further improvements include the adoption of SwiGLU and RMSNorm for training stability, and the removal of bias terms (except in QKV matrices) to improve length extrapolation. The alignment process transitioned from simple instruction following to a multi-stage approach involving Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF) using authentic human prompts to ensure high-quality interaction.

The "All Tools" Paradigm

A standout feature of the latest generation is "All Tools." Unlike traditional LLMs that act as passive chatbots, GLM-4 All Tools functions as an active agent. It is specifically aligned to understand user intent and autonomously decide when to call external APIs—such as web browsers, Python interpreters, and text-to-image generators—in a recursive loop.

Workflow of GLM-4 All Tools solving a multi-step query.

As illustrated above, the model can search the web for data, summarize the findings, and then write and execute Python code to perform complex calculations or data analysis. This recursive execution loop allows the model to plan, analyze, and refine its output based on real-world data and computational feedback, achieving a level of autonomy that rivals proprietary systems.

Evaluation and Results

GLM-4 demonstrates competitive performance across a wide range of benchmarks. It achieves 96.3% of GPT-4’s accuracy on MMLU and outperforms the original GPT-4 on MATH and GPQA. In the realm of instruction following, GLM-4's performance on IFEval (79.1%) is nearly identical to GPT-4 Turbo (81.2%).

Notably, GLM-4 excels in Chinese alignment, scoring 8.00 on AlignBench compared to GPT-4’s 7.46. The model also maintains high performance across long context windows, supporting up to 128K and experimental 1M tokens using the "LongAlign" recipe. In practical tool-use scenarios, such as solving math problems via Python, GLM-4 All Tools achieved a score of 91.59 on GSM8K, closely matching ChatGPT-4's 92.72.

Conclusion and Future Work

While GLM-4 significantly narrows the gap with proprietary models, challenges remain in complex logic reasoning and specific safety dimensions, such as providing risky physical health advice. The team is currently working on enhancing human-like reasoning and continues its commitment to democratizing LLM technology through open-source releases of capable models like GLM-4-9B, which rival larger predecessors and contemporary models like Llama-3-8B.

Summary updated

BibTeX
@misc{zeng2024chatglm,
  author = {Aohan Zeng and Bin Xu and Bowen Wang and Chenhui Zhang and Da Yin and Diego Rojas and Guanyu Feng and Hanlin Zhao and Hanyu Lai and Hao Yu and Hongning Wang and Jiadai Sun and Jiajie Zhang and Jiale Cheng and Jiayi Gui and Jie Tang and Jing Zhang and Juanzi Li and Lei Zhao and Lindong Wu and Lucen Zhong and Mingdao Liu and Minlie Huang and Peng Zhang and Qinkai Zheng and Rui Lu and Shuaiqi Duan and Shudan Zhang and Shulin Cao and Shuxun Yang and Weng Lam Tam and Wenyi Zhao and Xiao Liu and Xiao Xia and Xiaohan Zhang and Xiaotao Gu and Xin Lv and Xinghan Liu and Xinyi Liu and Xinyue Yang and Xixuan Song and Xunkai Zhang and Yifan An and Yifan Xu and Yilin Niu and Yuantao Yang and Yueyan Li and Yushi Bai and Yuxiao Dong and Zehan Qi and Zhaoyu Wang and Zhen Yang and Zhengxiao Du and Zhenyu Hou and Zihan Wang},
  title = {{ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Tools}},
  year = {2024},
  eprint = {2406.12793},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.12793},
}
Figure