Xwen-7B-Chat / README.md
shenzhi-wang's picture
Update README.md
d0c601f verified
|
raw
history blame
6.37 kB
metadata
license: apache-2.0
library_name: transformers
pipeline_tag: text-generation
base_model: Qwen/Qwen2.5-7B
language:
  - en
  - zh

Xwen-7B-Chat

Xwen-Cartoon

1. Introduction

If you enjoy our model, please give it a like on our Hugging Face repo. Your support means a lot to us. Thank you!

Xwen is a series of open-sourced large language models (currently including Xwen-72B-Chat and Xwen-7B-Chat), post-trained from the pre-trained Qwen2.5 models (i.e., Qwen2.5-72B and Qwen2.5-7B) [1].

πŸ† Top-1 chat performance! To the best of our knowledge, at the time of Xwen models' release (February 1, 2025), Xwen-72B-Chat and Xwen-7B-Chat exhibit the best chat performance among open-sourced models below 100B and 10B, respectively, based on evaluation results from widely-used benchmarks such as Arena-Hard-Auto [2], MT-Bench [3], and AlignBench [4]. Please view details in the Evaluation Results part.

πŸš€ Xwen technical report is on the way! During the training of Xwen models, we have accumulated many technical insights and lessons. To promote the democratization of technology, we are in the process of documenting these insights and lessons in a technical report, which will be released as soon as possible.

2. Usage

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.

This open-source model is provided "as is," without warranties or liabilities, and users assume all risks associated with its use; users are advised to comply with local laws, and the model's outputs do not represent the views or positions of the developers.

The usage of our Xwen-Chat models is similar to that of the Qwen2.5-Instruct models, with the tokenizer and chat template being identical to those of the Qwen2.5-Instruct models.

Here we provide a python script to demonstrate how to deploy our Xwen models to generate reponses:

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "xwen-team/Xwen-7B-Chat"   # Or "xwen-team/Xwen-72B-Chat" if you want to use the 72B model

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Give me a short introduction to large language models."
messages = [
    {"role": "system", "content": "You are Xwen, created by Xwen Team. You are a helpful assistant."},   # This system prompt is not necessary, and you can put it as an empty string.
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=512
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

print(response)

3. Evaluation Results

Results on other benchmarks will be updated soon! 😊

πŸ”‘: Open-sourced

πŸ”’: Proprietary

3.1 Arena-Hard-Auto

All results below, except those for Xwen-7B-Chat, are sourced from Arena-Hard-Auto (accessed on February 1, 2025).

3.1.1 No Style Control

Score 95% CIs
Xwen-7B-Chat πŸ”‘ 59.4 (-2.4, 2.1)
Qwen2.5-7B-Instruct πŸ”‘ 50.4 (-2.9, 2.5)
Gemma-2-27B-IT πŸ”‘ 57.5 (-2.1, 2.4)
Llama-3.1-8B-Instruct πŸ”‘ 21.3 (-1.9, 2.2)
Llama-3-8B-Instruct πŸ”‘ 20.6 (-2.0, 1.9)
Starling-LM-7B-beta πŸ”‘ 23.0 (-1.8, 1.8)

3.1.2 Style Control

Score 95% CIs
Xwen-7B-Chat πŸ”‘ 50.3 (-3.8, 2.8)
Qwen2.5-7B-Instruct πŸ”‘ 46.9 (-3.1, 2.7)
Gemma-2-27B-IT πŸ”‘ 47.5 (-2.5, 2.7)
Llama-3.1-8B-Instruct πŸ”‘ 18.3 (-1.6, 1.6)
Llama-3-8B-Instruct πŸ”‘ 19.8 (-1.6, 1.9)
Starling-LM-7B-beta πŸ”‘ 26.1 (-2.6, 2.0)

3.2 AlignBench-v1.1

We replaced the original judge model, GPT-4-0613, in AlignBench with the more powerful model, GPT-4o-0513. To keep fairness, all the results below are generated by GPT-4o-0513. As a result, the following results may differ from the AlignBench-v1.1 scores reported elsewhere.

Score
Xwen-7B-Chat πŸ”‘ 6.88
Qwen2.5-7B-Chat πŸ”‘ 6.56

3.3 MT-Bench

We replaced the original judge model, GPT-4, in MT-Bench with the more powerful model, GPT-4o-0513. To keep fairness, all the results below are generated by GPT-4o-0513. As a result, the following results may differ from the MT-Bench scores reported elsewhere.

Score
Xwen-7B-Chat πŸ”‘ 7.98
Qwen2.5-7B-Chat πŸ”‘ 7.71

References

[1] Yang, An, et al. "Qwen2. 5 technical report." arXiv preprint arXiv:2412.15115 (2024).

[2] Li, Tianle, et al. "From Crowdsourced Data to High-Quality Benchmarks: Arena-Hard and BenchBuilder Pipeline." arXiv preprint arXiv:2406.11939 (2024).

[3] Zheng, Lianmin, et al. "Judging llm-as-a-judge with mt-bench and chatbot arena." Advances in Neural Information Processing Systems 36 (2023).

[4] Liu, Xiao, et al. "Alignbench: Benchmarking chinese alignment of large language models." Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (2024).