Qwen/Qwen2-57B-A14B

Model

Qwen2-57B-A14B

58

16 commits

2 linked in READMEs

updated Jun 16, 2024

See the code

README

Qwen2-57B-A14B

Introduction

Qwen2 is the new series of Qwen large language models. For Qwen2, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters, including a Mixture-of-Experts model. This repo contains the 57B-A14B Mixture-of-Experts Qwen2 base language model.

Compared with the state-of-the-art opensource language models, including the previous released Qwen1.5, Qwen2 has generally surpassed most opensource models and demonstrated competitiveness against proprietary models across a series of benchmarks targeting for language understanding, language generation, multilingual capability, coding, mathematics, reasoning, etc.

For more details, please refer to our blog, GitHub, and Documentation.

Model Details

Qwen2 is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. It is based on the Transformer architecture with SwiGLU activation, attention QKV bias, group query attention, etc. Additionally, we have an improved tokenizer adaptive to multiple natural languages and codes.

Requirements

The code of Qwen2MoE has been in the latest Hugging face transformers and we advise you to install transformers>=4.40.0, or you might encounter the following error:

KeyError: 'qwen2_moe'

Usage

We do not advise you to use base language models for text generation. Instead, you can apply post-training, e.g., SFT, RLHF, continued pretraining, etc., on this model.

Performance

The evaluation of base models mainly focuses on the model performance of natural language understanding, general question answering, coding, mathematics, scientific knowledge, reasoning, multilingual capability, etc.

The datasets for evaluation include:

English Tasks: MMLU (5-shot), MMLU-Pro (5-shot), GPQA (5shot), Theorem QA (5-shot), BBH (3-shot), HellaSwag (10-shot), Winogrande (5-shot), TruthfulQA (0-shot), ARC-C (25-shot)

Coding Tasks: EvalPlus (0-shot) (HumanEval, MBPP, HumanEval+, MBPP+), MultiPL-E (0-shot) (Python, C++, JAVA, PHP, TypeScript, C#, Bash, JavaScript)

Math Tasks: GSM8K (4-shot), MATH (4-shot)

Chinese Tasks: C-Eval(5-shot), CMMLU (5-shot)

Multilingual Tasks: Multi-Exam (M3Exam 5-shot, IndoMMLU 3-shot, ruMMLU 5-shot, mMMLU 5-shot), Multi-Understanding (BELEBELE 5-shot, XCOPA 5-shot, XWinograd 5-shot, XStoryCloze 0-shot, PAWS-X 5-shot), Multi-Mathematics (MGSM 8-shot), Multi-Translation (Flores-101 5-shot)

Qwen2-57B-A14B performance

DatasetsJambaMixtral-8x7BYi-1.5-34BQwen1.5-32BQwen2-57B-A14B
ArchitectureMoEMoEDenseDenseMoE
#Activated Params12B12B34B32B14B
#Params52B47B34B32B57B
English
MMLU67.471.877.174.376.5
MMLU-Pro-41.048.344.043.0
GPQA-29.2-30.834.3
Theorem QA-23.2-28.833.5
BBH45.450.376.466.867.0
HellaSwag87.186.585.985.085.2
Winogrande82.581.984.981.579.5
ARC-C64.466.065.663.664.1
TruthfulQA46.451.153.957.457.7
Coding
HumanEval29.337.246.343.353.0
MBPP-63.965.564.271.9
EvalPlus-46.451.950.457.2
MultiPL-E-39.039.538.549.8
Mathematics
GSM8K59.962.582.776.880.7
MATH-30.841.736.143.0
Chinese
C-Eval---83.587.7
CMMLU--84.882.388.5
Multilingual
Multi-Exam-56.158.361.665.5
Multi-Understanding-70.773.976.577.0
Multi-Mathematics-45.049.356.162.3
Multi-Translation-29.830.033.534.5

Efficient MoE Models

Compared with training models smaller than 7 billion parameters, it is costly to train medium-size models like 32B while admittedly the 14B model is incapable of performing complex tasks well as the 72B model does. Owing to the recent success of MoE models, this time we turn to employ the MoE model architecture following our previous work Qwen1.5-MoE-A2.7B and extend it to larger model size. Specifically, we apply the same architecture and training strategy, e.g., upcycling, to the model with a total of 57B parameters, only 14B of which are activated in each forward pass. In the following, we list the inference performance of the two models in the deployment with vLLM on 2 NVIDIA A100:

Qwen2-57B-A14BQwen1.5-32B
QPS9.405.18
TPS10345.175698.37

In terms of efficiency, we observe clear advantages of Qwen2-57B-A14B over Qwen1.5-32B. Furthermore, based on the previous report of model performance on benchmarks, it can be found that Qwen2-57B-A14B obtains superior model quality compared with Qwen1.5-32B, which has more activated parameters.

Citation

If you find our work helpful, feel free to give us a cite.

@article{qwen2,
  title={Qwen2 Technical Report},
  year={2024}
}
conversational
endpoints_compatible
pretrained
qwen2_moe
safetensors
text-generation
transformers

Contributors

JustinLin610

4 commits

clonefy

2 commits

FE
feihu.hf

2 commits

bzheng

2 commits

Qwen/Qwen2-57B-A14B

Model

Qwen2-57B-A14B

58

16 commits

2 linked in READMEs

updated Jun 16, 2024

See the code

README

Qwen2-57B-A14B

Introduction

Qwen2 is the new series of Qwen large language models. For Qwen2, we release a number of base language models and instruction-tuned language models ranging from 0.5 to 72 billion parameters, including a Mixture-of-Experts model. This repo contains the 57B-A14B Mixture-of-Experts Qwen2 base language model.

Compared with the state-of-the-art opensource language models, including the previous released Qwen1.5, Qwen2 has generally surpassed most opensource models and demonstrated competitiveness against proprietary models across a series of benchmarks targeting for language understanding, language generation, multilingual capability, coding, mathematics, reasoning, etc.

For more details, please refer to our blog, GitHub, and Documentation.

Model Details

Qwen2 is a language model series including decoder language models of different model sizes. For each size, we release the base language model and the aligned chat model. It is based on the Transformer architecture with SwiGLU activation, attention QKV bias, group query attention, etc. Additionally, we have an improved tokenizer adaptive to multiple natural languages and codes.

Requirements

The code of Qwen2MoE has been in the latest Hugging face transformers and we advise you to install transformers>=4.40.0, or you might encounter the following error:

KeyError: 'qwen2_moe'

Usage

We do not advise you to use base language models for text generation. Instead, you can apply post-training, e.g., SFT, RLHF, continued pretraining, etc., on this model.

Performance

The evaluation of base models mainly focuses on the model performance of natural language understanding, general question answering, coding, mathematics, scientific knowledge, reasoning, multilingual capability, etc.

The datasets for evaluation include:

English Tasks: MMLU (5-shot), MMLU-Pro (5-shot), GPQA (5shot), Theorem QA (5-shot), BBH (3-shot), HellaSwag (10-shot), Winogrande (5-shot), TruthfulQA (0-shot), ARC-C (25-shot)

Coding Tasks: EvalPlus (0-shot) (HumanEval, MBPP, HumanEval+, MBPP+), MultiPL-E (0-shot) (Python, C++, JAVA, PHP, TypeScript, C#, Bash, JavaScript)

Math Tasks: GSM8K (4-shot), MATH (4-shot)

Chinese Tasks: C-Eval(5-shot), CMMLU (5-shot)

Multilingual Tasks: Multi-Exam (M3Exam 5-shot, IndoMMLU 3-shot, ruMMLU 5-shot, mMMLU 5-shot), Multi-Understanding (BELEBELE 5-shot, XCOPA 5-shot, XWinograd 5-shot, XStoryCloze 0-shot, PAWS-X 5-shot), Multi-Mathematics (MGSM 8-shot), Multi-Translation (Flores-101 5-shot)

Qwen2-57B-A14B performance

DatasetsJambaMixtral-8x7BYi-1.5-34BQwen1.5-32BQwen2-57B-A14B
ArchitectureMoEMoEDenseDenseMoE
#Activated Params12B12B34B32B14B
#Params52B47B34B32B57B
English
MMLU67.471.877.174.376.5
MMLU-Pro-41.048.344.043.0
GPQA-29.2-30.834.3
Theorem QA-23.2-28.833.5
BBH45.450.376.466.867.0
HellaSwag87.186.585.985.085.2
Winogrande82.581.984.981.579.5
ARC-C64.466.065.663.664.1
TruthfulQA46.451.153.957.457.7
Coding
HumanEval29.337.246.343.353.0
MBPP-63.965.564.271.9
EvalPlus-46.451.950.457.2
MultiPL-E-39.039.538.549.8
Mathematics
GSM8K59.962.582.776.880.7
MATH-30.841.736.143.0
Chinese
C-Eval---83.587.7
CMMLU--84.882.388.5
Multilingual
Multi-Exam-56.158.361.665.5
Multi-Understanding-70.773.976.577.0
Multi-Mathematics-45.049.356.162.3
Multi-Translation-29.830.033.534.5

Efficient MoE Models

Compared with training models smaller than 7 billion parameters, it is costly to train medium-size models like 32B while admittedly the 14B model is incapable of performing complex tasks well as the 72B model does. Owing to the recent success of MoE models, this time we turn to employ the MoE model architecture following our previous work Qwen1.5-MoE-A2.7B and extend it to larger model size. Specifically, we apply the same architecture and training strategy, e.g., upcycling, to the model with a total of 57B parameters, only 14B of which are activated in each forward pass. In the following, we list the inference performance of the two models in the deployment with vLLM on 2 NVIDIA A100:

Qwen2-57B-A14BQwen1.5-32B
QPS9.405.18
TPS10345.175698.37

In terms of efficiency, we observe clear advantages of Qwen2-57B-A14B over Qwen1.5-32B. Furthermore, based on the previous report of model performance on benchmarks, it can be found that Qwen2-57B-A14B obtains superior model quality compared with Qwen1.5-32B, which has more activated parameters.

Citation

If you find our work helpful, feel free to give us a cite.

@article{qwen2,
  title={Qwen2 Technical Report},
  year={2024}
}
conversational
endpoints_compatible
pretrained
qwen2_moe
safetensors
text-generation
transformers

Contributors

JustinLin610

4 commits

clonefy

2 commits

FE
feihu.hf

2 commits

bzheng

2 commits