--- pipeline_tag: text-generation --- # Model Card for Breeze-7B-Instruct-v0.1 Breeze-7B-Instruct-v0.1 is a 7-billion-parameter language model built from Mistral-7B and tailored for Traditional Chinese (TC). This model expands the TC vocabulary (extra 30k TC tokens) based on the original Mistral-7B to better adapt to TC and improve inference speed, resulting in a doubling of the original tokenizer's inference speed. To the best of our knowledge, this is the first work on vocabulary expansion in TC. This model uses 250GB of TC data for continued pre-training and uses over 1M instances for further supervised fine-tuning. Breeze-7B-Instruct-v0.1 performs well on both EN and TC benchmarks. This model outperforms Taiwan-LLM-7B-v2.1-chat, Taiwan-LLM-13B-v2.0-chat, and Yi-6B-Chat on all TC benchmarks and is comparable with Mistral-7B-Instruct-v0.1 on MMLU and MT-Bench in English. *A project by the members (in alphabetical order): Chan-Jan Hsu 許湛然, Chang-Le Liu 劉昶樂, Feng-Ting Liao 廖峰挺, Po-Chun Hsu 許博竣, Yi-Chang Chen 陳宜昌, and the supervisor Da-Shan Shiu 許大山.* ## Features - Expanding the vocabulary dictionary for Traditional Chinese from 32k to 62k vocabulary size - Multi-turn dialogue (without special handling for harmfulness) - 8k context length ## Model Details - **Finetuned from:** [MediaTek-Research/Breeze-7B-Base-v0.1](https://huggingface.co/MediaTek-Research/Breeze-7B-Base-v0.1) - **Model type:** Causal decoder-only transformer language model - **Language:** English and Traditional Chinese (zh-tw) ## Base Model Performance | Models | TMMLU+ (ACC) | DRCD (EM) | MMLU (ACC) | |-----------------------------------------------------|--------------|-----------|------------| | | 5 shot | 3 shot | 5 shot | | MediaTek-Research/Breeze-7B-Base-v0.1 | | 81.13 | 61.63 | | mistralai/Mistral-7B-v0.1 | | 79.27 | 64.89 | | yentinglin/Taiwan-LLM-7B-v2.1-base | | | | | yentinglin/Taiwan-LLM-13B-v2.0-base | | | | | 01-ai/Yi-6B | | 76.61 | 65.35 | | 01-ai/Yi-34B | | | | | Qwen/Qwen-7B | | 0.0 * | 61.00 | | Qwen/Qwen-14B | | | | \* Few-shot learning cannot effectively guide the model to generate the proper answer. ## Inference Performance | Models | Speed (char/sec) |Max Input Length (TC Char)| |--------------------------------------------------------------------|-------------------|--------------------------| | MediaTek-Research/Breeze-7B-Base-v0.1 | | | | mistralai/Mistral-7B-v0.1 | | | | yentinglin/Taiwan-LLM-7B-v2.1-base | | | | yentinglin/Taiwan-LLM-13B-v2.0-base | | | | 01-ai/Yi-6B | | | | 01-ai/Yi-34B | | | | Qwen/Qwen-7B | | | | Qwen/Qwen-14B | | | ## Chat Model Performance | Models | TMMLU+ (ACC) | DRCD (EM) | MT-Bench-tw (Score) | MMLU (ACC) | MT-Bench (Score) | |-----------------------------------------------------|--------------|-----------|---------------------|------------|------------------| | | 5 shot | 3 shot | 0 shot | 5 shot | 0 shot | | MediaTek-Research/Breeze-7B-Instruct-v0.1 | | | 5.7 | | | | mistralai/Mistral-7B-Instruct-v0.1 | | | 5.7* | | | yentinglin/Taiwan-LLM-7B-v2.1-chat | | | 4.2 | | | | yentinglin/Taiwan-LLM-13B-v2.0-chat | | | 5.0 | | | | 01-ai/Yi-6B-Chat | | | 5.0 | | | | 01-ai/Yi-34B-Chat | | | 6.9 | | | | Qwen/Qwen-7B-Chat | | | 5.4 | | | | Qwen/Qwen-14B-Chat | | | 6.4 | | | | gpt-3.5-turbo-0613 | | 76.30 | 7.1 | | | * Mistral-7B-Instruct can respond in Traditional Chinese, albeit with responses still frequently in Simplified Chinese and English. We will release judge prompts and model responses soon. ## Use in Transformers First install direct dependencies: ``` pip install transformers torch accelerate ``` If you want faster inference using flash-attention2, you need to install these dependencies: ```bash pip install packaging ninja pip install flash-attn ``` Then load the model in transformers: ```python from transformers import AutoModelForCausalLM, AutoTokenizer import torch model = AutoModelForCausalLM.from_pretrained( model="MediaTek-Research/Breeze-7B-Instruct-v0.1", device_map="auto", torch_dtype=torch.bfloat16, use_flash_attn_2=True # optional ) ``` The structure of the query template follows that of Mistral-7B-Instruct, as shown below. ```txt SYS_PROMPT [INST] QUERY1 [/INST] RESPONSE1 [INST] QUERY2 [/INST] ``` where `SYS_PROMPT`, `QUERY1`, `RESPONSE1`, and `QUERY2` can be provided by the user. The suggested default `SYS_PROMPT` is ```txt You are a helpful AI assistant built by MediaTek Research. The user you are helping speaks Traditional Chinese and comes from Taiwan. ```