模型簡介
通義千問-7B(Qwen-7B) 是阿里云研發的通義千問大模型系列的70億參數規模的模型。Qwen-7B是基于Transformer的大語言模型, 在超大規模的預訓練數據上進行訓練得到。預訓練數據類型多樣,覆蓋廣泛,包括大量網絡文本、專業書籍、代碼等。同時,在Qwen-7B的基礎上,使用對齊機制打造了基于大語言模型的AI助手Qwen-7B-Chat。
使用場景
Qwen系列模型的開發和開源為自然語言處理領域帶來了新的可能性,尤其是在需要處理大量數據和復雜語言任務的場景中。主要使用場景包括對話系統、文本生成以及內容創作等。
評測效果
對于Qwen-7B-Chat模型,常規的中文理解(C-Eval)、英文理解(MMLU)、代碼(HumanEval)和數學(GSM8K)以及長序列任務等權威任務的評測結果如下。
注意 由于硬件和框架造成的舍入誤差,復現結果如有波動屬于正常現象。
中文評測(Chinese Evaluation)
在C-Eval驗證集上,Qwen-7B-Chat模型的0-shot & 5-shot準確率結果如下:
| Model | Avg. Acc. |
|---|---|
| LLaMA2-7B-Chat | 31.9 |
| LLaMA2-13B-Chat | 36.2 |
| LLaMA2-70B-Chat | 44.3 |
| ChatGLM2-6B-Chat | 52.6 |
| InternLM-7B-Chat | 53.6 |
| Baichuan2-7B-Chat | 55.6 |
| Baichuan2-13B-Chat | 56.7 |
| Qwen-7B-Chat (original) (0-shot) | 54.2 |
| Qwen-7B-Chat (0-shot) | 59.7 |
| Qwen-7B-Chat (5-shot) | 59.3 |
| Qwen-14B-Chat (0-shot) | 69.8 |
| Qwen-14B-Chat (5-shot) | 71.7 |
C-Eval測試集上,Qwen-7B-Chat模型的zero-shot準確率結果如下:
| Model | Avg. | STEM | Social Sciences | Humanities | Others |
|---|---|---|---|---|---|
| Chinese-Alpaca-Plus-13B | 41.5 | 36.6 | 49.7 | 43.1 | 41.2 |
| Chinese-Alpaca-2-7B | 40.3 | - | - | - | - |
| ChatGLM2-6B-Chat | 50.1 | 46.4 | 60.4 | 50.6 | 46.9 |
| Baichuan-13B-Chat | 51.5 | 43.7 | 64.6 | 56.2 | 49.2 |
| Qwen-7B-Chat (original) | 54.6 | 47.8 | 67.6 | 59.3 | 50.6 |
| Qwen-7B-Chat | 58.6 | 53.3 | 72.1 | 62.8 | 52.0 |
| Qwen-14B-Chat | 69.1 | 65.1 | 80.9 | 71.2 | 63.4 |
在7B規模模型上,經過人類指令對齊的Qwen-7B-Chat模型,準確率在同類相近規模模型中仍然處于前列。
英文評測(English Evaluation)
MMLU評測集上,效果同樣在同類對齊模型中同樣表現較優。Qwen-7B-Chat模型的 0-shot & 5-shot 準確率如下:
| Model | Avg. Acc. |
|---|---|
| ChatGLM2-6B-Chat | 46.0 |
| LLaMA2-7B-Chat | 46.2 |
| InternLM-7B-Chat | 51.1 |
| Baichuan2-7B-Chat | 52.9 |
| LLaMA2-13B-Chat | 54.6 |
| Baichuan2-13B-Chat | 57.3 |
| LLaMA2-70B-Chat | 63.8 |
| Qwen-7B-Chat (original) (0-shot) | 53.9 |
| Qwen-7B-Chat (0-shot) | 55.8 |
| Qwen-7B-Chat (5-shot) | 57.0 |
| Qwen-14B-Chat (0-shot) | 64.6 |
| Qwen-14B-Chat (5-shot) | 66.5 |
代碼評測(Coding Evaluation)
Qwen-7B-Chat在HumanEval的zero-shot Pass@1效果如下:
| Model | Pass@1 |
|---|---|
| ChatGLM2-6B-Chat | 11.0 |
| LLaMA2-7B-Chat | 12.2 |
| Baichuan2-7B-Chat | 13.4 |
| InternLM-7B-Chat | 14.6 |
| Baichuan2-13B-Chat | 17.7 |
| LLaMA2-13B-Chat | 18.9 |
| LLaMA2-70B-Chat | 32.3 |
| Qwen-7B-Chat (original) | 24.4 |
| Qwen-7B-Chat | 37.2 |
| Qwen-14B-Chat | 43.9 |
數學評測(Mathematics Evaluation)
在評測數學能力的GSM8K上,Qwen-7B-Chat的準確率結果如下:
| Model | Acc. |
|---|---|
| LLaMA2-7B-Chat | 26.3 |
| ChatGLM2-6B-Chat | 28.8 |
| Baichuan2-7B-Chat | 32.8 |
| InternLM-7B-Chat | 33.0 |
| LLaMA2-13B-Chat | 37.1 |
| Baichuan2-13B-Chat | 55.3 |
| LLaMA2-70B-Chat | 59.3 |
| Qwen-7B-Chat (original) (0-shot) | 41.1 |
| Qwen-7B-Chat (0-shot) | 50.3 |
| Qwen-7B-Chat (8-shot) | 54.1 |
| Qwen-14B-Chat (0-shot) | 60.1 |
| Qwen-14B-Chat (8-shot) | 59.3 |
長序列評測(Long-Context Understanding)
通過使用NTK(Neural Tangent Kernel)插值技術和LogN注意力縮放方法,Qwen-7B-Chat模型能夠顯著擴展其處理上下文的長度。在長文本摘要任務中,特別是在VCSUM數據集上,Qwen-7B-Chat模型展示了其強大的長序列理解能力。其Rouge-L評估指標的結果如下:
說明
為了啟用這些增強長序列處理能力的技巧,您需要在模型的配置文件config.json中將use_dynamic_ntk和use_logn_attn兩個選項設置為true。這樣配置后,模型將能夠利用NTK插值和LogN注意力縮放來優化其對長序列的處理。
| Model | VCSUM (zh) |
|---|---|
| GPT-3.5-Turbo-16k | 16.0 |
| LLama2-7B-Chat | 0.2 |
| InternLM-7B-Chat | 13.0 |
| ChatGLM2-6B-Chat | 16.3 |
| Qwen-7B-Chat | 16.6 |
技術亮點
與Qwen-7B預訓練模型相同,Qwen-7B-Chat模型規模基本情況如下所示:
| Hyperparameter | Value |
|---|---|
| n_layers | 32 |
| n_heads | 32 |
| d_model | 4096 |
| vocab size | 151851 |
| sequence length | 8192 |
在位置編碼、FFN激活函數和normalization的實現方式上,采用目前最流行的做法,即RoPE相對位置編碼、SwiGLU激活函數、RMSNorm(可選安裝flash-attention加速)。
在分詞器方面,相比目前主流開源模型以中英詞表為主,Qwen-7B-Chat使用了約15萬token大小的詞表。該詞表在GPT-4使用的BPE詞表cl100k_base基礎上,對中文、多語言進行了優化,在對中、英、代碼數據的高效編解碼的基礎上,對部分多語言更加友好,方便用戶在不擴展詞表的情況下對部分語種進行能力增強。詞表對數字按單個數字位切分。調用較為高效的tiktoken分詞庫進行分詞。
相關引用
如對你有幫助,歡迎引用!
@article{qwen,
title={Qwen Technical Report},
author={Jinze Bai and Shuai Bai and Yunfei Chu and Zeyu Cui and Kai Dang and Xiaodong Deng and Yang Fan and Wenbin Ge and Yu Han and Fei Huang and Binyuan Hui and Luo Ji and Mei Li and Junyang Lin and Runji Lin and Dayiheng Liu and Gao Liu and Chengqiang Lu and Keming Lu and Jianxin Ma and Rui Men and Xingzhang Ren and Xuancheng Ren and Chuanqi Tan and Sinan Tan and Jianhong Tu and Peng Wang and Shijie Wang and Wei Wang and Shengguang Wu and Benfeng Xu and Jin Xu and An Yang and Hao Yang and Jian Yang and Shusheng Yang and Yang Yao and Bowen Yu and Hongyi Yuan and Zheng Yuan and Jianwei Zhang and Xingxuan Zhang and Yichang Zhang and Zhenru Zhang and Chang Zhou and Jingren Zhou and Xiaohuan Zhou and Tianhang Zhu},
journal={arXiv preprint arXiv:2309.16609},
year={2023}
}免責聲明
Qwen-7B-Chat模型來源于第三方,本平臺不保證其合規性,請您在使用前慎重考慮,確保合法合規使用并遵守第三方的要求。