YAYI 2: Multilingual Open-Source Large Language Models

Yin Luo, Qingchao Kong, Nan Xu, Jia Cao, Bao Hao, Baoyu Qu, Bo Chen, Chao Zhu, Chenyang Zhao, Donglei Zhang, Fan Feng, Feifei Zhao, Hailong Sun, Hanxuan Yang, Haojun Pan, Hongyu Liu, Jianbin Guo, Jiangtao Du, Jingyi Wang, Junfeng Li, Lei Sun, Liduo Liu, Lifeng Dong, Lili Liu, Lin Wang, Liwen Zhang, Minzheng Wang, Pin Wang, Ping Yu, Qingxiao Li, Rui Yan, Rui Zou, Ruiqun Li, Taiwen Huang, Xiaodong Wang, Xiaofei Wu, Xin Peng, Xina Zhang, Xing Fang, Xinglin Xiao, Yanni Hao, Yao Dong, Yigang Wang, Ying Liu, Yongyu Jiang, Yungan Wang, Yuqi Wang, Zhangsheng Wang, Zhaoxin Yu, Zhen Luo, Wenji Mao, Lei Wang, Daniel Dajun ZengarXiv 2023 · DOI

TL;DR

This paper introduces YAYI 2, a new family of 30-billion parameter open-source multilingual large language models (LLMs) specifically designed to address the limitations of existing models in Chinese contexts. YAYI 2 achieves state-of-the-art performance on various benchmarks, outperforming similar-sized models and even larger ones in some cases, particularly in multilingual and Chinese-specific evaluations.

What Problem Does This Paper Address?

The rapid advancement of Large Language Models (LLMs) has led to impressive capabilities in natural language understanding and generation. While many powerful open-source LLMs like Llama 2 and Falcon have emerged, they are predominantly English-centric. This creates a significant gap for non-English applications, particularly in Chinese, where existing models often exhibit poor performance due to limited training data and cultural context. This paper aims to bridge this gap by developing a high-performing, multilingual LLM with a strong emphasis on Chinese language and culture.

Methods

YAYI 2 is built upon the Transformer architecture, utilizing a decoder-only structure. Key technical innovations and standard practices include:

  • Massive Multilingual Pre-training: The model is pre-trained on a colossal 2.65 trillion token multilingual corpus, with a significant portion (41.5%) being Chinese.
  • Advanced Data Processing Pipeline: A rigorous pipeline involving normalizing, heuristic cleaning, multi-level deduplication, and toxicity filtering is employed to ensure high-quality training data.
  • Optimized Architecture: The models incorporate FlashAttention 2 and Multi-Query Attention (MQA) to accelerate training and inference speeds.
  • Alignment Techniques: YAYI 2 undergoes supervised fine-tuning (SFT) with millions of instruction-output pairs and Reinforcement Learning from Human Feedback (RLHF) to align with human values and improve safety.
  • Multilingual Tokenizer: A custom-built multilingual tokenizer with a vocabulary size of 81,920 is developed to handle diverse languages effectively.
  • Long-Context Reasoning: The YaRN method is adopted for RoPE extrapolation, enabling enhanced performance on extended context lengths.

Datasets

  • Training Data: A massive multilingual corpus of 2.65 trillion tokens, derived from over 240 terabytes of raw data, including news, books, Wikipedia, and code. Notably, 41.5% of this data is in Chinese.
  • Evaluation Benchmarks: The models are evaluated on a suite of standard benchmarks, including:
  • Knowledge and Language Understanding: MMLU, C-Eval, CMMLU, AGIEval, GAOKAO-Bench.
  • Mathematical Reasoning: GSM8K, MATH, BBH.
  • Programming: HumanEval, MBPP.

Key Insights and Ideas

  • Multilingualism is Key: The success of YAYI 2 highlights the critical need for LLMs trained on diverse, high-quality multilingual datasets, especially for non-English languages.
  • Data Quality Over Quantity (to an extent): While a massive dataset is used, the paper emphasizes the importance of a sophisticated data processing pipeline to filter and clean data, reducing the final training set to 10.6 terabytes of high-quality data.
  • Chinese-Centric Improvements: By specifically focusing on Chinese data and cultural context, YAYI 2 demonstrates superior performance in Chinese-related tasks compared to general-purpose LLMs.
  • Efficiency Matters: The adoption of techniques like FlashAttention 2 and MQA underscores the ongoing effort to make LLMs more computationally efficient for both training and inference.
  • Long Context is Achievable: The integration of YaRN for RoPE extrapolation shows promising results in extending context window capabilities for open-source models.

Key Results

YAYI 2 demonstrates strong performance across various benchmarks:

  • Knowledge and Language Understanding: YAYI 2 outperforms similar-sized open-source LLMs on MMLU, AGIEval, and CMMLU. It even surpasses the larger Qwen-72B on MMLU and AGIEval.
  • Mathematical Reasoning: YAYI 2 achieves the best performance on the GSM8K benchmark among models with comparable parameter sizes.
  • Programming: YAYI 2 stands out as a top performer on HumanEval and MBPP, significantly outperforming comparable models and even the larger Qwen-72B on HumanEval.
  • Tokenizer Efficiency: The YAYI 2 tokenizer exhibits a lower compression ratio compared to other Chinese models, indicating superior training and inference efficiency.

Limitations and Future Work

  • Hallucination and Safety: The authors acknowledge that YAYI 2, like other LLMs, can still produce harmful content or fabricate "facts." They strongly encourage users to review answers, especially in safety-critical situations, and to prevent misuse.
  • Ongoing Development: The YAYI 2 models are still under active development, and the team welcomes suggestions and feedback.
  • Future Directions: While not explicitly detailed, the success in long-context reasoning and multilingual capabilities suggests future work could focus on further extending these areas and exploring even more diverse language and domain coverage.

Summary updated

BibTeX
@misc{luo2023yayi,
  author = {Yin Luo and Qingchao Kong and Nan Xu and Jia Cao and Bao Hao and Baoyu Qu and Bo Chen and Chao Zhu and Chenyang Zhao and Donglei Zhang and Fan Feng and Feifei Zhao and Hailong Sun and Hanxuan Yang and Haojun Pan and Hongyu Liu and Jianbin Guo and Jiangtao Du and Jingyi Wang and Junfeng Li and Lei Sun and Liduo Liu and Lifeng Dong and Lili Liu and Lin Wang and Liwen Zhang and Minzheng Wang and Pin Wang and Ping Yu and Qingxiao Li and Rui Yan and Rui Zou and Ruiqun Li and Taiwen Huang and Xiaodong Wang and Xiaofei Wu and Xin Peng and Xina Zhang and Xing Fang and Xinglin Xiao and Yanni Hao and Yao Dong and Yigang Wang and Ying Liu and Yongyu Jiang and Yungan Wang and Yuqi Wang and Zhangsheng Wang and Zhaoxin Yu and Zhen Luo and Wenji Mao and Lei Wang and Daniel Dajun Zeng},
  title = {{YAYI 2: Multilingual Open-Source Large Language Models}},
  year = {2023},
  eprint = {2312.14862},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.14862},
}
Figure