Ziya2: Data-centric Learning is All LLMs Need

Ruyi Gan, Ziwei Wu, Renliang Sun, Junyu Lu, Xiaojun Wu, Dixiang Zhang, Kunhao Pan, Ping Yang, Qi Yang, Jiaxing Zhang, Yan Song · OpenReview

Abstract

Various large language models (LLMs) have been proposed in recent years, continually setting new records on multiple benchmarks. However, the development of LLMs still faces several issues, such as the high cost of training models from scratch and the risk of catastrophic forgetting during continual pre-training. While many studies focus on enlarging model sizes, they often overlook the optimization of pre-training data. In this work, we propose Ziya2, a 13-billion parameter model based on LLaMA2, further pre-trained on 700 billion tokens. By focusing on data-centric optimization across different training stages, Ziya2 significantly outperforms other models in multiple benchmarks, particularly in Chinese language tasks and mathematical reasoning.

Introduction

The current trajectory of LLM development often prioritizes "scaling up"—increasing parameter counts and raw data volume. However, this approach faces significant hurdles: prohibitive training costs, the challenge of catastrophic forgetting in continual pre-training, and a lack of transparency regarding data-cleaning methodologies. Ziya2 addresses these issues by shifting the focus from model size to data-centric learning: the strategic selection, cleaning, and sequencing of data to maximize learning efficiency within cost-effective settings.

Methodology: Structural Stability and Multi-Stage Training

Ziya2 utilizes LLaMA2-13B as its foundation, undergoing continual pre-training on an additional 700 billion tokens. To ensure stability and efficiency, the researchers implemented several structural and procedural enhancements.

Structural Enhancements

To better handle Chinese text, the vocabulary was expanded by 7,400 tokens, improving encoding efficiency by approximately 34%. Furthermore, to prevent training instabilities like "loss spikes" common in mixed-precision training, critical components such as Rotary Position Embeddings (RoPE) and Layer Normalization were shifted to FP32 precision to ensure stability over long training runs.

The Three-Stage Training Pipeline

Rather than a monolithic training phase, Ziya2 employs a curriculum-based approach:

  1. Stage 1 (Unsupervised): 650B tokens of high-quality English and Chinese text for general knowledge acquisition.
  2. Stage 2 (Supervised): 29B tokens of diverse tasks (classification, reasoning, Q&A) to enhance pattern-following.
  3. Stage 3 (Specialized): 0.1B tokens focused on mathematical reasoning (MetaMath) to bolster logic.
Overview of the Ziya2 training pipeline, illustrating the three stages of continual pre-training, the corresponding training strategies, and the underlying data factory processes.

Data-Centric Scaling Laws

A core contribution of the Ziya2 project is the exploration of "Data-centric Scaling Laws." Beyond the traditional variables of compute and parameters, the authors identify Coherence, Readability, and Similarity as critical factors. Their findings suggest that improving the grammatical and semantic quality of data (coherence and readability) is more effective for reducing model loss than simply increasing data similarity to specific test sets.

Experimental Results

Ziya2-13B demonstrates substantial improvements over the original LLaMA2-13B across various domains:

  • Mathematics: Scores on GSM8K and MATH increased by 138% and 120%, respectively.
  • Coding: Performance on HumanEval improved by 89%.
  • Bilingual Proficiency: On Chinese benchmarks (CMMLU and C-Eval), Ziya2 saw gains of 61% and 68%, even surpassing GPT-3.5-turbo.
Training loss curves for Ziya-13B and Ziya2-13B, showing the significantly lower and more stable loss achieved by the Ziya2 model through data-centric optimization.

Conclusion and Future Work

Ziya2 proves that data-centric optimization allows a 13B parameter model to compete with much larger architectures. While the current "Base" model is a powerful foundation, future work will focus on instruction tuning (Ziya2-Chat), scaling to a 70B parameter version, and expanding into multimodal capabilities.

Summary updated

Abstract

Various large language models (LLMs) have been proposed in recent years, including closed- and open-source ones, continually setting new records on multiple benchmarks. However, the development of LLMs still faces several issues, such as high cost of training models from scratch, and continual pre-training leading to catastrophic forgetting, etc. Although many such issues are addressed along the line of research on LLMs, an important yet practical limitation is that many studies overly pursue enlarging model sizes without comprehensively analyzing and optimizing the use of pre-training data in their learning process, as well as appropriate organization and leveraging of such data in training LLMs under cost-effective settings. In this work, we propose Ziya2, a model with 13 billion parameters adopting LLaMA2 as the foundation model, and further pre-trained on 700 billion tokens, where we focus on pre-training techniques and use data-centric optimization to enhance the learning process of Ziya2 on different stages. Experiments show that Ziya2 significantly outperforms other models in multiple benchmarks especially with promising results compared to representative open-source ones. Ziya2 (Base) is released at https://huggingface.co/IDEA-CCNL/Ziya2-13B-Base and https://modelscope.cn/models/Fengshenbang/Ziya2-13B-Base/summary.
BibTeX
@misc{gan2023ziya,
  author = {Ruyi Gan and Ziwei Wu and Renliang Sun and Junyu Lu and Xiaojun Wu and Dixiang Zhang and Kunhao Pan and Ping Yang and Qi Yang and Jiaxing Zhang and Yan Song},
  title = {{Ziya2: Data-centric Learning is All LLMs Need}},
  year = {2023},
  eprint = {2311.03301},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.03301},
}
Figure