TL;DR
Baichuan 2 introduces a new family of open-source, large-scale multilingual language models (7B and 13B parameters) trained on an unprecedented 2.6 trillion tokens. These models demonstrate competitive or superior performance across a wide range of benchmarks, including specialized domains like medicine and law, while also excelling in multilingual capabilities, addressing a key gap in current LLM research.
What Problem Does This Paper Address?
The field of large language models (LLMs) has seen rapid advancements, but many of the most powerful models remain closed-source or primarily English-centric. This limits research accessibility, hinders multilingual development, and makes it difficult for the community to deeply study and fine-tune these systems. Baichuan 2 aims to democratize access to high-performing LLMs by releasing open-source, multilingual models trained on a massive dataset, fostering greater transparency and accelerating responsible development.
Methods
Baichuan 2 builds upon the Transformer architecture with several modifications. Key techniques include:
- Massive Pre-training Data: Trained on 2.6 trillion tokens, significantly more than previous open-source models.
- Multilingual Focus: Explicitly trained on a Chinese-English bilingual dataset to improve performance in non-English languages.
- Tokenizer Expansion: An expanded vocabulary size (125,696 tokens) to better handle diverse languages and improve compression.
- Positional Embeddings: Uses Rotary Positional Embedding (RoPE) for the 7B model and ALiBi for the 13B model, leveraging ALiBi's improved extrapolation performance.
- Optimized Architecture: Incorporates SwiGLU activation and memory-efficient attention via xFormers.
- Training Optimizations: Employs AdamW optimizer, BFloat16 mixed precision, and introduces "NormHead" to stabilize training by normalizing output embeddings and a "Max-z loss" to normalize logits, improving inference robustness.
- Alignment: Utilizes Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF) with a PPO algorithm to create chat models.
- Safety Enhancements: Rigorous data filtering, curated multilingual datasets, and red-teaming procedures to improve safety and harmlessness.
Datasets
- Training Data: A massive corpus of 2.6 trillion tokens, sourced from general internet webpages, books, research papers, and codebases. A significant portion includes a curated Chinese-English bilingual dataset.
- Evaluation Benchmarks:
- General: MMLU, CMMLU, GSM8K, HumanEval, C-Eval, AGIEval, Gaokao, BBH.
- Vertical Domains: JEC-QA (law), MedQA, MedMCQA (medicine).
- Multilingual: Flores-101 (seven subtasks including zh-en, zh-fr, zh-es, zh-ar, zh-ru, zh-ja, and zh-de).
- Safety: Toxigen, Baichuan Harmless Evaluation Dataset (BHED).
Key Insights and Ideas
- Scale Matters (and Data Scale Even More): The paper strongly suggests that training on a massive dataset (2.6 trillion tokens) is crucial for achieving state-of-the-art performance, even for models of moderate size (7B and 13B).
- Multilingualism is Achievable with Open Models: Baichuan 2 demonstrates that high-quality multilingual capabilities can be achieved in open-source models, addressing a significant gap.
- Architectural Tweaks Yield Benefits: Innovations like "NormHead" and "Max-z loss" contribute to training stability and inference robustness, crucial for large-scale LLMs.
- Safety is a Multi-Stage Process: Effective safety measures require attention not only during data cleaning but also throughout the alignment and RLHF stages.
- Openness Accelerates Progress: By releasing checkpoints at various training stages, the authors aim to provide valuable insights into LLM training dynamics, fostering community research.
Key Results
- Benchmark Performance: Baichuan 2-7B and 13B models match or outperform other open-source models of similar size on general benchmarks like MMLU, CMMLU, GSM8K, and HumanEval.
- Vertical Domain Excellence: Baichuan 2 shows strong performance in law (JEC-QA) and medicine (MedQA, MedMCQA), often surpassing GPT-3.5 Turbo and LLaMA 2.
- Multilingual Prowess: Baichuan 2-7B outperforms similar-sized models across seven multilingual tasks. Baichuan 2-13B rivals GPT-4 on some Chinese-English tasks and significantly improves over Baichuan 1 in multilingual settings.
- Safety Improvements: The alignment process significantly improved harmlessness while largely maintaining helpfulness, as shown in safety evaluations.
- Training Efficiency: The models were trained efficiently on 1,024 NVIDIA A800 GPUs, achieving high computational efficiency.
Limitations and Future Work
- Static Knowledge: Like most LLMs, Baichuan 2's knowledge is static and can become outdated, posing challenges for domains requiring up-to-date information (e.g., medicine, law).
- Multilingual Limitations: While strong in Chinese and English, the model may have limitations in other languages and might not fully capture biases relevant to non-Chinese cultures.
- Potential for Misuse: The authors acknowledge the potential for misuse, such as generating harmful content, and emphasize the need for responsible use.
- Safety Over-cautions: Some safety measures might appear overly cautious, potentially affecting usability for certain tasks.
- Future Work: The authors plan to continue optimizing safety and releasing updated versions. They also highlight the potential for further gains by continuing to scale training data and exploring the correlation between training FLOPs and math problem-solving improvements. The release of intermediate checkpoints is intended to facilitate further research into training dynamics.
Summary updated