MOSS: An Open Conversational Large Language Model

Tianxiang Sun, Xiaotian Zhang, Zhengfu He, Peng Li, Qinyuan Cheng, Xiangyang Liu, Hang Yan, Yunfan Shao, Qiong Tang, Shiduo Zhang, Xingjian Zhao, Ke Chen, Yining Zheng, Zhejian Zhou, Ruixiao Li, Jun Zhan, Yunhua Zhou, Linyang Li, Xiaogui Yang, Lingling Wu, Zhangyue Yin, Xuanjing Huang, Yu-Gang Jiang, Xipeng Qiu

Introduction

The rapid advancement of Large Language Models (LLMs) like ChatGPT has transformed the landscape of artificial intelligence. However, the development recipes, training data, and alignment techniques for these state-of-the-art models remain largely proprietary. For the broader research community, creating a conversational agent from scratch is a formidable challenge due to the high costs of human annotation and the inherent complexity of Reinforcement Learning from Human Feedback (RLHF).

MOSS, a 16B-parameter open-source conversational model developed by Fudan University, addresses these barriers. It provides a transparent technical roadmap for building ChatGPT-like agents under resource-constrained conditions, relying heavily on synthetic data and automated feedback mechanisms.

Methodology

The development of MOSS is characterized by a structured three-stage pipeline designed to maximize efficiency and performance.

The three-stage training pipeline of MOSS, including cross-lingual pre-training, supervised fine-tuning, and preference-aware training.

1. Cross-lingual Pre-training

MOSS was pre-trained on a diverse corpus of 677 billion tokens spanning English, Chinese, and code. The model was initialized with Codegen-16B weights, leveraging the observation that code data enhances the logical reasoning capabilities necessary for complex dialogue.

2. Multi-stage Supervised Fine-Tuning (SFT)

The SFT process occurred in two distinct phases:

  • Warmup Phase: The model was initially fine-tuned on 1.1 million synthetic conversations generated by prompting OpenAI’s text-davinci-003.
  • Real-world Alignment: An early version of MOSS was released to the public to collect 100,000 real-world user prompts. These prompts served as seeds for generating a more authentic synthetic training set, ensuring the model's responses aligned with actual user intent distributions.

3. Preference-Aware Training (PAT)

To avoid the instability often associated with the Proximal Policy Optimization (PPO) algorithm used in standard RLHF, the authors introduced Preference-Aware Training. In this approach, a reward model assigns quality scores to various model responses. These scores are converted into "quality tags" (e.g., <quality:100>) and prepended to the training data. During inference, the model is prompted to generate responses following the highest quality tag, achieving alignment comparable to RLHF with significantly greater stability.

4. Tool Augmentation

Inspired by the Toolformer architecture, MOSS was trained to interact with external tools such as search engines, calculators, and image generators. The model generates "Inner Thoughts" and "Commands" in a hidden scratchpad before producing a final response, allowing for more accurate and factually grounded outputs.

Data and Evaluation

The training utilized a mix of The Pile (English), BigQuery/BigPython (Code), and proprietary Chinese web data. For preference alignment, 113,000 multi-turn conversations were ranked by GPT-4 to train the reward model. Evaluation was conducted across several benchmarks, including MMLU for general knowledge, TruthfulQA for honesty, and RealToxicityPrompts for safety.

Key Insights

  • Universal Knowledge Transfer: Pre-training on English and code significantly improved Chinese performance, suggesting that LLMs acquire universal conceptual representations that transcend specific languages.
  • The Power of Distillation: MOSS demonstrates that the conversational prowess of massive, closed-source models can be effectively distilled into smaller open-source models using "Self-Instruct" methodologies.
  • Stable Alignment: PAT offers a robust and easier-to-implement alternative to PPO-based reinforcement learning for aligning model behavior with human preferences.

Results and Limitations

MOSS-SFT showed substantial improvements over its base model and concurrent open-source models like Chinese Alpaca. In head-to-head evaluations against GPT-3.5, MOSS-SFT won or tied in approximately 58% of cases. Furthermore, tool integration led to dramatic performance gains; for instance, accuracy on mathematical tasks jumped from near-zero to over 60% when the equation solver was enabled.

Despite these successes, MOSS faces limitations common to its scale. At 16B parameters, it occasionally struggles with the complex reasoning emergent in 100B+ parameter models and remains susceptible to hallucinations. Future work will focus on scaling the model and diversifying tool integrations to further bridge the gap with proprietary state-of-the-art systems.

Summary updated

BibTeX
@article{sun2024moss,
  author = {Tianxiang Sun and Xiaotian Zhang and Zhengfu He and Peng Li and Qinyuan Cheng and Xiangyang Liu and Hang Yan and Yunfan Shao and Qiong Tang and Shiduo Zhang and Xingjian Zhao and Ke Chen and Yining Zheng and Zhejian Zhou and Ruixiao Li and Jun Zhan and Yunhua Zhou and Linyang Li and Xiaogui Yang and Lingling Wu and Zhangyue Yin and Xuanjing Huang and Yu-Gang Jiang and Xipeng Qiu},
  title = {{MOSS: An Open Conversational Large Language Model}},
  journal = {Mach. Intell. Res.},
  year = {2024},
  doi = {10.1007/s11633-024-1502-8},
}
Figure