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.
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.
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