❗️❗️❗️NOTICE: For optimal performance, we refrain from fine-tuning the model's identity. Thus, inquiries such as "Who are you" or "Who developed you" may yield random responses that are not necessarily accurate.
Updates:
- 🚀🚀🚀 [May 9, 2024] We're excited to introduce Llama3-70B-Chinese-Chat! Full-parameter fine-tuned on a mixed Chinese-English dataset of ~100K preference pairs, its Chinese performance surpasses ChatGPT and matches GPT-4, as shown by C-Eval and CMMLU results.
- 🔥 We provide the official Ollama model for the q4_0 GGUF version of Llama3-70B-Chinese-Chat at wangshenzhi/llama3-70b-chinese-chat-ollama-q4! Run the following command for quick use of this model:
ollama run wangshenzhi/llama3-70b-chinese-chat-ollama-q4:latest. - 🔥 We provide the official Ollama model for the q8_0 GGUF version of Llama3-70B-Chinese-Chat at wangshenzhi/llama3-70b-chinese-chat-ollama-q8! Run the following command for quick use of this model:
ollama run wangshenzhi/llama3-70b-chinese-chat-ollama-q8:latest. - 🔥 We provide the official q4_0 GGUF version of Llama3-70B-Chinese-Chat at shenzhi-wang/Llama3-70B-Chinese-Chat-GGUF-4bit.
- 🌟 If you are in China, you can download our model from our gitee repo.
- 🌟 Thanks for the support of Gitee, we have launched an online demo: https://ai.gitee.com/shenzhi-wang/llama3-70b-chinese-chat. You need to log in to your Gitee account with the invitation code
llama3.
Model Summary
Llama3-70B-Chinese-Chat is one of the first instruction-tuned LLMs for Chinese & English users with various abilities such as roleplaying, tool-using, and math, built upon the meta-llama/Meta-Llama-3-70B-Instruct model.
🎉According to the results from C-Eval and CMMLU, the performance of Llama3-70B-Chinese-Chat in Chinese significantly exceeds that of ChatGPT and is comparable to GPT-4!
Developers: Shenzhi Wang*, Yaowei Zheng*, Guoyin Wang (in.ai), Shiji Song, Gao Huang. (*: Equal Contribution)
- License: Llama-3 License
- Base Model: Meta-Llama-3-70B-Instruct
- Model Size: 70.6B
- Context length: 8K
1. Introduction
This is one of the first LLM fine-tuned specifically for Chinese and English users, based on the Meta-Llama-3-70B-Instruct model. The fine-tuning algorithm used is ORPO [1].
Our Llama3-70B-Chinese-Chat model was trained on a dataset containing over 100K preference pairs, with a roughly equal ratio of Chinese and English data. This dataset will be available soon.
Compared to the original Meta-Llama-3-70B-Instruct model, the Llama3-70B-Chinese-Chat model greatly reduces the issues of "Chinese questions with English answers" and the mixing of Chinese and English in responses. Additionally, Llama3-70B-Chinese-Chat excels at roleplaying, function calling, and mathematics.
With much more parameters than our Llama3-8B-Chinese-Chat model, our Llama3-70B-Chinese-Chat offers significant performance enhancements. If you enjoyed our Llama3-8B-Chinese-Chat, the Llama3-70B-Chinese-Chat is a must-try!
[1] Hong, Jiwoo, Noah Lee, and James Thorne. "Reference-free Monolithic Preference Optimization with Odds Ratio." arXiv preprint arXiv:2403.07691 (2024).
Training framework: LLaMA-Factory.
Training details:
- epochs: 3
- learning rate: 1.5e-6
- learning rate scheduler type: cosine
- Warmup ratio: 0.1
- cutoff len (i.e. context length): 8192
- orpo beta (i.e. $\lambda$ in the ORPO paper): 0.05
- global batch size: 128
- fine-tuning type: full parameters
- optimizer: paged_adamw_32bit
2. Benchmark Results
We utilize C-Eval [2] and CMMLU [3] to assess the performance of LLMs in Chinese. The results of ChatGPT and GPT-4 are borrowed from the C-Eval leaderboard and CMMLU leaderboard accessed on May 10, 2024.
| Model | C-Eval Avg (Test Set) | C-Eval Hard Avg (Test Set) | CMMLU Acc |
|---|---|---|---|
| ChatGPT | 54.4 | 41.4 | 55.51 |
| GPT-4 | 68.7 | 54.9 | 70.95 |
| Llama3-70B-Chinese-Chat | 66.1 | 55.2 | 70.28 |
C-Eval Hard is a distinct benchmark that comprises 8 difficult subjects in math, physics, and chemistry from C-Eval. [2]
[2] Huang, Yuzhen, et al. "C-eval: A multi-level multi-discipline chinese evaluation suite for foundation models." Advances in Neural Information Processing Systems 36 (2024).
[3] Li, Haonan, et al. "Cmmlu: Measuring massive multitask language understanding in chinese." arXiv preprint arXiv:2306.09212 (2023).
3. Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "shenzhi-wang/Llama3-70B-Chinese-Chat"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype="auto", device_map="auto"
)
messages = [
{"role": "user", "content": "写一首诗吧"},
]
input_ids = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(
input_ids,
max_new_tokens=8192,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))
4. Examples
The following are some examples generated by Llama3-70B-Chinese-Chat.
Citation
If our Llama3-70B-Chinese-Chat is helpful, please kindly cite as:
@misc {shenzhi_wang_2024,
author = {Wang, Shenzhi and Zheng, Yaowei and Wang, Guoyin and Song, Shiji and Huang, Gao},
title = {Llama3-70B-Chinese-Chat (Revision 3f5a0d4)},
year = 2024,
url = {https://huggingface.co/shenzhi-wang/Llama3-70B-Chinese-Chat},
doi = {10.57967/hf/2315},
publisher = {Hugging Face}
}
Acknowledgement
Thanks very much for Chang Liu's assistance in collecting examples.
- Downloads last month
- 58
Model tree for shenzhi-wang/Llama3-70B-Chinese-Chat
Base model
meta-llama/Meta-Llama-3-70B