[Paper Review] CPM-2: Large-scale Cost-effective Pre-trained Language Models
CPM-2 introduces a cost-effective pipeline for large-scale pre-trained language models, leveraging knowledge inheritance to accelerate pre-training, prompt tuning to reduce fine-tuning storage, and InfMoE—a dynamic offloading inference toolkit—for efficient single-GPU inference of MoE models. The framework enables a 11B-parameter bilingual model and a 198B-parameter MoE version that outperform mT5 on general language understanding tasks while drastically reducing computational and storage costs.
In recent years, the size of pre-trained language models (PLMs) has grown by leaps and bounds. However, efficiency issues of these large-scale PLMs limit their utilization in real-world scenarios. We present a suite of cost-effective techniques for the use of PLMs to deal with the efficiency issues of pre-training, fine-tuning, and inference. (1) We introduce knowledge inheritance to accelerate the pre-training process by exploiting existing PLMs instead of training models from scratch. (2) We explore the best practice of prompt tuning with large-scale PLMs. Compared with conventional fine-tuning, prompt tuning significantly reduces the number of task-specific parameters. (3) We implement a new inference toolkit, namely InfMoE, for using large-scale PLMs with limited computational resources. Based on our cost-effective pipeline, we pre-train two models: an encoder-decoder bilingual model with 11 billion parameters (CPM-2) and its corresponding MoE version with 198 billion parameters. In our experiments, we compare CPM-2 with mT5 on downstream tasks. Experimental results show that CPM-2 has excellent general language intelligence. Moreover, we validate the efficiency of InfMoE when conducting inference of large-scale models having tens of billions of parameters on a single GPU. All source code and model parameters are available at https://github.com/TsinghuaAI/CPM.
Motivation & Objective
- To address the high computational, storage, and inference costs associated with training and deploying large-scale pre-trained language models (PLMs).
- To accelerate pre-training by reusing knowledge from existing PLMs through knowledge inheritance.
- To reduce fine-tuning storage costs by replacing conventional fine-tuning with prompt tuning, which requires less than 0.01% of the model parameters.
- To enable efficient inference of large-scale MoE models on limited hardware using a novel dynamic offloading framework, InfMoE.
- To develop two high-performing, cost-efficient PLMs: CPM-2 (11B parameters) and CPM-2-MoE (198B parameters), for bilingual (Chinese-English) tasks.
Proposed method
- Knowledge inheritance is applied during pre-training by initializing the new model with weights from a previously trained PLM, dividing the process into stages: Chinese pre-training, bilingual pre-training, and MoE pre-training.
- Prompt tuning is used instead of full fine-tuning, where only learnable prompt embeddings are updated, reducing task-specific parameters to less than 0.01% of the full model.
- InfMoE is a high-performance, memory-efficient inference framework that uses dynamic scheduling to overlap parameter movement and computation, enabling single-GPU inference of models with tens of billions of parameters.
- The model architecture is a hybrid encoder-decoder Transformer with a masked language modeling objective tailored for span prediction, where spans are replaced with special tokens and predicted by the decoder.
- The MoE variant uses a gating mechanism to route tokens to sparse experts, with balanced expert usage observed during evaluation, enabling efficient scaling.
- Tokenization is enhanced using pronunciation-based and glyph-based methods, which outperform character-based tokenization in robustness and performance on Chinese NLP tasks.
Experimental results
Research questions
- RQ1Can knowledge inheritance significantly reduce the time and compute cost of pre-training large-scale PLMs by leveraging existing models?
- RQ2How effective is prompt tuning compared to full fine-tuning in reducing storage costs while maintaining or improving downstream performance?
- RQ3Can a dynamic offloading inference framework like InfMoE enable efficient single-GPU inference of large MoE models with tens of billions of parameters?
- RQ4What is the optimal placement and structure of prompts in large PLMs to maximize performance on downstream tasks?
- RQ5To what extent can non-Euclidean architectures like hyperbolic Transformers improve efficiency and performance with fewer parameters?
Key findings
- CPM-2 achieves state-of-the-art general language intelligence, demonstrating strong performance across seven specific language capabilities on downstream tasks, outperforming mT5.
- Prompt tuning with optimized prompt positions and hybrid prompt-fine-tuning strategies leads to better performance than either method alone.
- InfMoE enables efficient inference of CPM-2-MoE (198B parameters) on a single GPU, with computation times overlapping parameter movement and inference, reducing latency.
- Knowledge inheritance reduces pre-training time and cost by initializing from existing PLMs, accelerating training through staged pre-training on Chinese, bilingual, and MoE data.
- Pronunciation-based and glyph-based tokenization methods improve robustness and performance over character-based tokenization in Chinese NLP tasks.
- The hyperbolic Transformer framework achieves comparable performance to Euclidean Transformers with half the number of parameters, suggesting potential for more efficient future PLM architectures.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.