hf_mirrors/Breeze-7B-Instruct-v0_1
Model Introduction
Files & versions
Analysis

Model Card for MediaTek Research Breeze-7B-Instruct-v0_1

MediaTek Research Breeze-7B (hereinafter referred to as Breeze-7B) is a language model family that builds on top of [Mistral-7B], specifically intended for Traditional Chinese use.

[Breeze-7B-Base] is the base model for the Breeze-7B series. It is suitable for use if you have substantial fine-tuning data to tune it for your specific use case.

Breeze-7B-Instruct derives from the base model Breeze-7B-Base, making the resulting model amenable to be used as-is for commonly seen tasks.

[Breeze-7B-Instruct-64k] is a slightly modified version of Breeze-7B-Instruct to enable a 64k-token context length. Roughly speaking, that is equivalent to 88k Traditional Chinese characters.

Update (Mar. 7th, 2024): The current release version of Breeze-7B is v1.0. See Breeze-7B-Instruct-v1_0.

The current release version of Breeze-7B is v0.1.

Practicality-wise:

  • Breeze-7B-Base expands the original vocabulary with an additional 30,000 Traditional Chinese tokens. With the expanded vocabulary, and everything else being equal, Breeze-7B operates at twice the inference speed for Traditional Chinese to Mistral-7B and Llama 7B. [See Inference Performance.]
  • Breeze-7B-Instruct can be used as is for common tasks such as Q&A, RAG, multi-round chat, and summarization.
  • In particular, Breeze-7B-Instruct-64k can perform tasks at a document level, not a chapter level.

Performance-wise:

  • Breeze-7B-Instruct demonstrates impressive performance in benchmarks for Traditional Chinese and English when compared to similar-sized open-source contemporaries such as Taiwan-LLM-7B/13B-chat, QWen(1.5)-7B-Chat, and Yi-6B-Chat. [See Chat Model Performance.]

Features

  • Breeze-7B-Base-v0_1
    • Expanding the vocabulary dictionary size from 32k to 62k to better support Traditional Chinese
    • 8k-token context length
  • Breeze-7B-Instruct-v0_1
    • Expanding the vocabulary dictionary size from 32k to 62k to better support Traditional Chinese
    • 8k-token context length
    • Multi-turn dialogue (without special handling for harmfulness)
  • Breeze-7B-Instruct-64k-v0_1
    • Expanding the vocabulary dictionary size from 32k to 62k to better support Traditional Chinese
    • 64k-token context length
    • Multi-turn dialogue (without special handling for harmfulness)

Model Details

  • Breeze-7B-Base-v0_1
    • Finetuned from: [mistralai/Mistral-7B-v0.1]
    • Model type: Causal decoder-only transformer language model
    • Language: English and Traditional Chinese (zh-tw)
  • Breeze-7B-Instruct-v0_1
    • Finetuned from: [MediaTek-Research/Breeze-7B-Base-v0_1]
    • Model type: Causal decoder-only transformer language model
    • Language: English and Traditional Chinese (zh-tw)
  • Breeze-7B-Instruct-64k-v0_1
    • Finetuned from: MediaTek-Research/Breeze-7B-Instruct-v0_1
    • Model type: Causal decoder-only transformer language model
    • Language: English and Traditional Chinese (zh-tw)

Base Model Performance

Here we compare Breeze-7B-Base-v0_1 with other open-source base language models of similar parameter size that are widely recognized for their good performance in Chinese. TMMLU+, DRCD, and Table source from [MediaTek-Research/TCEval-v2]. [MediaTek-Research/TCEval-v2] derives from [TCEval-v1] and [ikala/tmmluplus]. MMLU sources from [hails/mmlu_no_train]. We use the code revised from [EleutherAI/lm-evaluation-harness] to evaluate TMMLU+, DRCD, Table, and MMLU. All choice problems adapt the selection by the log-likelihood.

ModelsTMMLU+ (ACC)DRCD (EM)Table (ACC)MMLU (ACC)
TC, KnowledgeTC, ReasoningTC, ReasoningEN, Knowledge
5 shot3 shot5 shot5 shot
[Yi-34B]34B63.1084.5749.3177.42
[Qwen-14B]14B51.3016.95 *50.6968.83
[Yi-6B]6B49.6376.6134.7265.35
[Qwen-7B]7B42.840.0 *39.5861.00
[Breeze-7B-Base-v0_1]7B40.3581.1328.4761.63
[Mistral-7B-v0.1]7B36.9379.2727.7864.89

Instruction-tuned Model Performance

Here we compare Breeze-7B-Instruct-v1_0 with other open-source instruction-tuned language models of similar parameter size that are widely recognized for their good performance in Chinese. TMMLU+, DRCD, Table, and MT-Bench-tw source from [MediaTek-Research/TCEval-v2]. [MediaTek-Research/TCEval-v2] derives from [TCEval-v1] and [ikala/tmmluplus]. MMLU sources from [hails/mmlu_no_train]. MT-Bench source from [lmsys/mt_bench_human_judgments]. We use the code revised from [EleutherAI/lm-evaluation-harness] to evaluate TMMLU+, DRCD, Table, and MMLU. All choice problems adapt the selection by the log-likelihood.

ModelsMT-Bench-tw (Score)TMMLU+ (ACC)TMMLU+ (ACC)DRCD (EM)Table (ACC)MT-Bench (Score)MMLU (ACC)MMLU (ACC)
TC, ChatTC, KnowledgeTC, KnowledgeTC, ReasoningTC, ReasoningEN, ChatEN, KnowledgeEN, Knowledge
0 shot0 shot5 shot3 shot0 shot0 shot0 shot5 shot
[Yi-34B-Chat]34B6.954.8736.817.671.04
[Qwen-14B-Chat]14B6.448.4141.677.264.91
Breeze-7B-Instruct-v0_17B5.741.6145.837.163.26
[Breeze-7B-Instruct-64k-v0_1]7B5.540.9936.117.163.68
[Qwen-7B-Chat]7B5.440.0233.336.255.94
[Yi-6B-Chat]6B5.044.7925.696.059.45
[Taiwan-LLM-13B-v2.0-chat]13B5.029.4723.61-*50.50
[Taiwan-LLM-7B-v2.1-chat]7B4.228.0831.25-*42.72
Details on MT-Bench-tw (0 shot):
Models
STEMExtractionReasoningMathCodingRoleplayWritingHumanitiesAVG
Yi-34B-Chat9.04.85.74.04.78.58.79.86.9
Qwen-14B-Chat7.65.74.54.25.37.57.39.16.4
Breeze-7B-Instruct-v0_1(https://modelers.cn/models/FuJianAscend/Breeze-7B-Instruct-v0_1)6.55.63.93.64.36.95.79.35.7
Breeze-7B-Instruct-64k-v0_16.15.33.72.94.27.06.78.35.5
Qwen-7B-Chat6.64.54.82.93.66.26.88.25.4
Yi-6B-Chat7.32.73.13.32.37.25.28.85.0
Taiwan-LLM-13B-v2.0-chat6.13.44.12.33.17.46.66.85.0
Taiwan-LLM-7B-v2.1-chat5.22.62.31.23.46.65.76.84.2
Details on TMMLU+ (0 shot):
Model
STEMSocial ScienceHumanitiesOtherAVG
Yi-34B-Chat47.6564.2552.7354.9154.87
Qwen-14B-Chat43.8355.0048.5546.2248.41
Yi-6B-Chat37.8051.7445.3644.2544.79
Breeze-7B-Instruct-v0_1(https://modelers.cn/models/FuJianAscend/Breeze-7B-Instruct-v0_1)37.4146.8142.0640.1641.61
Breeze-7B-Instruct-64k-v0_137.8846.3540.3139.4040.99
Qwen-7B-Chat35.4446.2238.3540.0640.02
Taiwan-LLM-13B-v2.0-chat27.7433.6927.0329.4329.47
Taiwan-LLM-7B-v2.1-chat25.5831.7627.3627.6128.08

Inference Performance

In this test, we use the first 700 characters of the [web article] as the input and ask the model to write the same article again. All inferences run on Atlas 800T A2 (using vllm, with a tensor-parallel size of 2).

ModelsInference Time (sec)Estimated Max Input Length (Char)
Yi-6B-Chat10.625.2k
Breeze-7B-Instruct-v0_1(https://modelers.cn/models/FuJianAscend/Breeze-7B-Instruct-v0_1)10.7411.1k
Breeze-7B-Instruct-64k-v0_110.7488.8k
Qwen-7B-Chat10.869.8k
Qwen-14B-Chat18.899.8k
Mistral-7B-v0.1-Instruct20.485.1k
Taiwan-LLM-7B-v2.1-chat26.262.2k
Taiwan-LLM-13B-v2.0-chat36.802.2k
Yi-34B-Chat43.714.5k

How to use

import argparse
from openmind import AutoModel, AutoTokenizer
from openmind import is_torch_npu_available

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--model_name_or_path",type=str,help="Path to model",default=None,)
    args = parser.parse_args()
    return args


if __name__ == '__main__':
    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"
    args = parse_args()
    model_path = args.model_name_or_path

    tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True, add_eos_token=True)

    model = AutoModel.from_pretrained(model_path, trust_remote_code=True).to(device)

    inputs = tokenizer.encode("def print_hello_world():\tprint('Hello World!')", return_tensors="pt").to(device)
    embedding = model(inputs)[0]
    print(f'Dimension of the embedding: {embedding[0].size()}')
    print(embedding)