Panda LLM: Training Data and Evaluation for Open-Sourced Chinese Instruction-Following Large Language Models

Fangkai Jiao, Bosheng Ding, Tianze Luo, Zhanfeng MoarXiv 2023

Abstract

This project focuses on enhancing open-source large language models through instruction-tuning and providing comprehensive evaluations of their performance. We explore how various training data factors, such as quantity, quality, and linguistic distribution, influence the performance of instruction-tuned models trained on publicly accessible high-quality instruction datasets for both English and Chinese languages. Our goal is to supplement evaluation with quantitative analyses, providing valuable insights for the continued advancement of open-source chat models. Our model, data, and code are publicly available for others to use and build upon.

Introduction

While Large Language Models (LLMs) like GPT-4 have revolutionized natural language processing, they often function as "black boxes" with closed weights and proprietary training methodologies. This lack of transparency presents challenges for data security and industry-specific customization. Furthermore, most high-performing open-source models exhibit a significant bias toward English. The Dandelion Project introduces Panda LLM to address the scarcity of high-quality, transparent, and instruction-tuned Chinese LLMs, providing a reproducible "recipe" for effective instruction-following in Chinese.

Methods

Panda LLM utilizes the LLaMA family (ranging from 7B to 65B parameters) as its foundation. The development process follows a distinct two-stage pipeline designed to optimize linguistic adaptation and task performance.

The two-stage training pipeline transforming LLaMA into Panda LLM.
  1. Continual Pre-training: The base LLaMA model is first fine-tuned on a massive mixture of five Chinese corpora to enhance its fundamental understanding of the language.
  2. Instruction Tuning: Following pre-training, supervised fine-tuning (SFT) is performed using the COIG (Chinese Open Instruction Generalist) dataset to teach the model to follow specific user prompts.

The model incorporates standard LLaMA architectural improvements, including RMSNorm for pre-normalization, the SwiGLU activation function, and Rotary Positional Embeddings (RoPE). Training was conducted using DeepSpeed ZERO-1 with bfloat16 precision on a cluster of 16 NVIDIA A100 GPUs.

Datasets

The researchers employed a diverse array of datasets to ensure both broad linguistic coverage and high-quality instruction following.

Comparison of training datasets for LLaMA and Panda, highlighting sampling proportions.

A key insight from the training process was that data diversity is more critical than sheer volume. Although general Chinese corpora formed the bulk of the training data, the most significant performance gains were attributed to the COIG dataset, which represented only 4.2% of the total training samples.

Key Results and Insights

The evaluation of Panda LLM (7B version) against other open-source models like Linly and BELLE revealed several critical findings:

  • Staged Training Efficacy: The researchers found that a two-stage approach—establishing a linguistic foundation before instruction tuning—is superior to mixing all data types from the start. Indiscriminate data blending was found to hinder final performance.
  • Logical Reasoning and Comprehension: Instruction tuning significantly boosted logical reasoning capabilities. On the LogiQA-v2 benchmark, Panda-Instruct-7B achieved a score of 31.93, outperforming BELLE (26.41) and Linly (25.91). Similarly, on the $C^3$-m (Chinese Multiple-Choice Reading Comprehension) dataset, Panda reached a score of 57.04, a substantial improvement over BELLE’s 28.87.
  • Training Efficiency: The 7B and 13B models were trained in approximately 7 and 14 days, respectively, demonstrating a viable path for developing high-performance specialized models on modest compute clusters.

Limitations and Future Work

Due to the licensing of the original LLaMA weights, Panda LLM is released as "delta weights," requiring users to possess the original Meta weights. Future work for the Dandelion Project includes scaling the model to 33B and 65B parameters and expanding the instruction-tuning methodology to support a wider range of languages beyond Chinese and English.

Summary updated

BibTeX
@misc{jiao2023panda,
  author = {Fangkai Jiao and Bosheng Ding and Tianze Luo and Zhanfeng Mo},
  title = {{Panda LLM: Training Data and Evaluation for Open-Sourced Chinese Instruction-Following Large Language Models}},
  year = {2023},
  eprint = {2305.03025},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.03025},
}
Figure