Views
No views yet

| param | token | Base Models |
|---|---|---|
| v1-385M | 1400B | 🤗 TransNormerLLM-385M |
| v1-1B | 1400B | 🤗 TransNormerLLM-1B |
| v1-7B | 1400B | 🤗 TransNormerLLM-7B |
| v2-1B | 300B | 🤗 TransNormerLLM2-1B-300B |
| v2-3B | 300B | 🤗 TransNormerLLM2-3B-300B |
| v2-7B | 300B | 🤗 TransNormerLLM2-7B-300B |
| Model | PS | T | BoolQ | PIQA | HS | WG | ARC-e | ARC-c | OBQA | MMLU | CMMLU | C-Eval |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| GPT-J | 6.9 | 0.3 | 65.44 | 75.41 | 66.25 | 64.09 | 66.92 | 36.60 | 38.20 | 25.40 | 26.47 | 23.39 |
| OPT | 6.7 | 0.3 | 66.18 | 76.22 | 67.21 | 65.19 | 65.66 | 34.64 | 37.20 | 24.57 | 25.36 | 25.32 |
| Pythia | 6.9 | 0.3 | 63.46 | 75.14 | 63.92 | 60.77 | 67.34 | 35.41 | 37.00 | 24.64 | 25.56 | 26.40 |
| BLOOM | 7.1 | 0.35 | 62.91 | 72.69 | 62.33 | 64.01 | 65.11 | 33.45 | 35.80 | 26.25 | 24.97 | 24.25 |
| RWKV | 7.4 | - | - | 76.06 | 65.51 | 61.01 | 67.80 | 37.46 | 40.20 | 24.96 | - | - |
| MPT | 6.9 | 1.0 | 73.88 | 79.43 | 76.25 | 68.27 | 74.79 | 41.72 | 42.20 | 30.80 | 25.99 | 24.06 |
| Falcon | 7.2 | 1.5 | 73.73 | 79.38 | 76.3 | 67.17 | 74.62 | 43.60 | 43.80 | 27.79 | 25.73 | 22.92 |
| Baichuan1 | 7.0 | 1.2 | 70.09 | 76.01 | 70.06 | 64.09 | 71.72 | 40.53 | 38.20 | 42.30 | 44.43 | 42.80 |
| Baichuan2 | 7.0 | 2.6 | 72.72 | 76.50 | 72.17 | 68.35 | 75.17 | 42.32 | 39.60 | 54.16 | 57.07 | 54.00 |
| ChatGLM1 | 6.7 | 1.0 | 74.74 | 68.88 | 45.57 | 52.25 | 48.78 | 31.66 | 36.80 | 40.63 | 37.48 | 40.23 |
| ChatGLM2 | 7.1 | 1.4 | 77.65 | 69.37 | 50.51 | 57.62 | 59.13 | 34.30 | 37.00 | 45.46 | 48.80 | 52.55 |
| OpenLLaMAv1 | 6.7 | 1.0 | 70.43 | 75.68 | 69.23 | 66.69 | 71.17 | 38.57 | 39.00 | 30.49 | 25.40 | 26.09 |
| OpenLLaMAv2 | 6.7 | 1.0 | 72.20 | 78.84 | 74.51 | 65.67 | 72.39 | 41.30 | 41.00 | 41.29 | 29.58 | 30.01 |
| LLaMA1 | 6.7 | 1.0 | 76.50 | 79.80 | 76.10 | 70.10 | 72.80 | 47.60 | 57.20 | 35.10 | 25.62 | 25.72 |
| LLaMA2 | 6.7 | 2.0 | 77.68 | 78.07 | 76.02 | 68.98 | 76.30 | 46.33 | 44.20 | 45.30 | 32.96 | 33.20 |
| TransNormerLLM-7B | 6.8 | 1.4 | 75.11 | 85.47 | 78.61 | 66.93 | 73.11 | 52.99 | 61.60 | 44.90 | 49.32 | 45.01 |
| TransNormerLLM2-7B | 6.8 | 0.3 | 65.20 | 74.37 | 61.68 | 60.62 | 64.6 | 32.08 | 38.00 | 25.80 | 25.69 | 26.77 |
P: parameter size (billion). T: tokens (trillion). BoolQ: acc. PIQA: acc. HellaSwag: acc_norm. WinoGrande: acc. ARC-easy: acc. ARC-challenge: acc_norm. OpenBookQA: acc_norm. MMLU: 5-shot acc. CMMLU: 5-shot acc. C-Eval: 5-shot acc.
1pip install triton==2.0.0
2pip install einopsexport use_triton=False1>>> from transformers import AutoModelForCausalLM, AutoTokenizer
2>>> tokenizer = AutoTokenizer.from_pretrained("OpenNLPLab/TransNormerLLM2-7B-300B", trust_remote_code=True)
3>>> model = AutoModelForCausalLM.from_pretrained("TransNormerLLM2-7B-300B", torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)
4>>> inputs = tokenizer('今天是美好的一天', return_tensors='pt')
5>>> pred = model.generate(**inputs, max_new_tokens=8192, repetition_penalty=1.0)
6>>> print(tokenizer.decode(pred.cpu()[0], skip_special_tokens=True))bfloat16 in TransNormerLLM, float16 might lead nan error, please check your divce compatibility!1git clone https://github.com/OpenNLPLab/TransNormerLLM.git
2cd TransNormerLLM/fine-tune
3pip install -r requirements.txtalpaca_data.json. This sample data was drawn from alpaca_data.json, consisting of a selection of 52,002 entries, and has been reformatted. The main purpose is to demonstrate how to SFT our model, and effectiveness is not guaranteed.1torchrun \
2 --nproc_per_node=8 \
3 train.py \
4 --model_name_or_path OpenNLPLab/TransNormerLLM-1B \
5 --data_path ./alpaca_data.json \
6 --output_dir output \
7 --num_train_epochs 1 \
8 --per_device_train_batch_size 2 \
9 --per_device_eval_batch_size 1 \
10 --gradient_accumulation_steps 1 \
11 --bf16 true \
12 --adam_beta1 0.9 \
13 --adam_beta2 0.95 \
14 --evaluation_strategy "no" \
15 --save_strategy "steps" \
16 --save_steps 5000 \
17 --save_total_limit 30 \
18 --learning_rate 1e-4 \
19 --weight_decay 0.1 \
20 --warmup_ratio 0.1 \
21 --lr_scheduler_type "cosine" \
22 --deepspeed 'configs/zero3.json' \
23 --logging_steps 1 \
24 --dataloader_num_workers 24 \
25 --ddp_find_unused_parameters false \
26 --tf32 true \@article{qin2023scaling,
title={Scaling transnormer to 175 billion parameters},
author={Qin, Zhen and Li, Dong and Sun, Weigao and Sun, Weixuan and Shen, Xuyang and Han, Xiaodong and Wei, Yunshen and Lv, Baohong and Yuan, Fei and Luo, Xiao and others},
journal={arXiv preprint arXiv:2307.14995},
year={2023}
}