/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
7,2 млрд
Размер весов
15 ГБ
Лицензия
Apache 2.0
Архитектура
mistral · dense
Опубликована
5 мар 2024

Breeze-7B-Instruct-v1_0

Генерация текстаТекст → текст15 профессий

Диалоговая модель MediaTek Research на базе Mistral для чата, ответов на вопросы, суммаризации и RAG на традиционном китайском и английском языках.

1 086скачиваний за 30 дней67лайковвеса обновлены28 июн 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Breeze-7B-Instruct-v1_0 — диалоговая языковая модель MediaTek Research для ответов на вопросы, многоходового чата, суммаризации и сценариев RAG. Это дообученная версия Breeze-7B-Base-v1_0, которая, в свою очередь, основана на Mistral-7B; модель использует архитектуру Mistral с плотным декодером и содержит 7,2 млрд параметров.

Модель рассчитана прежде всего на традиционный китайский язык, а также поддерживает английский. Словарь расширен с 32 тыс. до 62 тыс. токенов для лучшей поддержки традиционного китайского; в карточке заявлено ускорение инференса на этом языке. Контекст модели — 32 768 токенов по метаданным каталога; README описывает версию с контекстом 8 тыс. токенов. Эти значения различаются между источниками. Модель работает с текстом и предназначена для использования как готовый чат-ассистент.

В README отмечено, что для диалогов нет специальной обработки вредоносных запросов. Модель опубликована под лицензией Apache-2.0; её качество и скорость могут зависеть от сценария и условий запуска.

Сценарии применения

  • многоходовой чат на традиционном китайском
  • ответы на вопросы на китайском и английском
  • суммаризация статей и документов
  • генерация ответов по найденным документам в RAG
  • инструкционное выполнение типовых текстовых запросов

Ограничения

В README указано, что модель не имеет специальной обработки вредоносных запросов. Размер контекста в источниках расходится: README указывает 8 тыс. токенов, а метаданные каталога — 32 768.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

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

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.

The current release version of Breeze-7B is v1.0, which has undergone a more refined training process compared to Breeze-7B-v0_1, resulting in significantly improved performance in both English and Traditional Chinese.

For details of this model please read our paper.

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.

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.]

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 許大山.

Demo

Try Demo Here 👩‍💻🧑🏻‍💻

Features

  • Breeze-7B-Base-v1_0
    • Expanding the vocabulary dictionary size from 32k to 62k to better support Traditional Chinese
    • 8k-token context length
  • Breeze-7B-Instruct-v1_0
    • 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)

Model Details

  • Breeze-7B-Base-v1_0
    • 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-v1_0

Base Model Performance

Here we compare Breeze-7B-Base-v1_0 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.

Models#Parameters↑ TMMLU+ (ACC)DRCD (EM)Table (ACC)MMLU (ACC)
TC, KnowledgeTC, ReasoningTC, ReasoningEN, Knowledge
5 shot3 shot5 shot5 shot
Yi-6B6B49.6376.6134.7265.35
Qwen1.5-7B7B46.5974.4130.5663.07
Breeze-7B-Base-v1_07B42.6780.6131.9961.24
Mistral-7B-v0.17B36.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. Also, we listed the benchmark scores of GPT-3.5 Turbo (1106), which represents one of the most widely used high-quality cloud language model API services, for reference. 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. We use the code revised from fastchat llm_judge (GPT4 as judge) to evaluate MT-Bench-tw and MT-Bench.

Models#Parameters↑ MT-Bench-tw (Score)TMMLU+ (ACC)Table (ACC)MT-Bench (Score)MMLU (ACC)
TC, ChatTC, KnowledgeTC, ReasoningEN, ChatEN, Knowledge
0 shot0 shot0 shot0 shot0 shot
GPT-3.5-Turbo7.143.5645.147.967.09
Qwen1.5-7B-Chat7B6.445.6534.727.661.85
Breeze-7B-Instruct-v1_07B6.042.6739.587.461.73
Mistral-7B-v0.2-Instruct7B5.634.9533.337.659.97
Yi-6B-Chat6B5.044.7925.696.059.45
Taiwan-LLM-13B-v2.0-chat13B5.029.4723.61N/A*50.50
Taiwan-LLM-7B-v2.1-chat7B4.228.0831.25N/A*42.72

* Taiwan-LLM models respond to multi-turn questions (English) in Traditional Chinese.

Details on MT-Bench-tw (0 shot):ModelsSTEMExtractionReasoningMathCodingRoleplayWritingHumanitiesAVG
GPT-3.5-Turbo7.86.15.16.46.28.77.49.37.1
Qwen1.5-7B-Chat95.64.72.83.78.08.09.46.4
Breeze-7B-Instruct-v1_07.85.24.24.24.17.65.99.16.0
Mistral-7B-v0.2-Instruct6.94.64.33.34.47.26.27.85.6
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):ModelSTEMSocial ScienceHumanitiesOtherAVG
GPT-3.5-Turbo41.5848.5240.9643.1843.56
Qwen1.5-7B-Chat41.4851.6644.0545.4045.65
Breeze-7B-Instruct-v1_036.4648.3845.1140.7542.67
Mistral-7B-v0.2-Instruct32.7938.0534.8934.0434.94
Yi-6B-Chat37.8051.7445.3644.2544.79
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 2 RTX A6000 GPUs (using vllm, with a tensor-parallel size of 2).

Models↓ Inference Time (sec)Estimated Max Input Length (Char)
Qwen1.5-7B-Chat9.3538.9k
Yi-6B-Chat10.625.2k
Breeze-7B-Instruct-v1_010.7411.1k
Mistral-7B-Instruct-v0.220.485.1k
Taiwan-LLM-7B-v2.1-chat26.262.2k

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:

pip install packaging ninja
pip install flash-attn

Then load the model in transformers:

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

# Instruction Model
model = AutoModelForCausalLM.from_pretrained(
    "MediaTek-Research/Breeze-7B-Instruct-v1_0",
    device_map="auto",
    torch_dtype=torch.bfloat16,
    # attn_implementation="flash_attention_2" # optional
)

# Basemodel
model = AutoModelForCausalLM.from_pretrained(
    "MediaTek-Research/Breeze-7B-Base-v1_0",
    device_map="auto",
    torch_dtype=torch.bfloat16,
    # attn_implementation="flash_attention_2" # optional
)

For Breeze-7B-Instruct, the structure of the query is

<s>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

You are a helpful AI assistant built by MediaTek Research. The user you are helping speaks Traditional Chinese and comes from Taiwan.

We also integrate chat_template into tokenizer_config.json, so you can apply_chat_template to get the prompt.

>>> from transformers import AutoTokenizer
>>> tokenizer = AutoTokenizer.from_pretrained("MediaTek-Research/Breeze-7B-Instruct-v1_0")
>>> chat = [
...   {"role": "user", "content": "你好,請問你可以完成什麼任務?"},
...   {"role": "assistant", "content": "你好,我可以幫助您解決各種問題、提供資訊和協助您完成許多不同的任務。例如:回答技術問題、提供建議、翻譯文字、尋找資料或協助您安排行程等。請告訴我如何能幫助您。"},
...   {"role": "user", "content": "太棒了!"},
... ]
>>> tokenizer.apply_chat_template(chat, tokenize=False)
"<s>You are a helpful AI assistant built by MediaTek Research. The user you are helping speaks Traditional Chinese and comes from Taiwan.  [INST] 你好,請問你可以完成什麼任務? [/INST] 你好,我可以幫助您解決各種問題、提供資訊和協助您完成許多不同的任務。例如:回答技術問題、提供建議、翻譯文字、尋找資料或協助您安排行程等。請告訴我如何能幫助您。 [INST] 太棒了! [/INST] "
# Tokenized results
# ['▁', '你好', ',', '請問', '你', '可以', '完成', '什麼', '任務', '?']
# ['▁', '你好', ',', '我', '可以', '幫助', '您', '解決', '各種', '問題', '、', '提供', '資訊', '和', '協助', '您', '完成', '許多', '不同', '的', '任務', '。', '例如', ':', '回答', '技術', '問題', '、', '提供', '建議', '、', '翻譯', '文字', '、', '尋找', '資料', '或', '協助', '您', '安排', '行程', '等', '。', '請', '告訴', '我', '如何', '能', '幫助', '您', '。']
# ['▁', '太', '棒', '了', '!']

Text generation can be done by generate and apply_chat_template functions:

>>> outputs = model.generate(tokenizer.apply_chat_template(chat, return_tensors="pt"),
>>>                          # adjust below parameters if necessary 
>>>                          max_new_tokens=128,
>>>                          top_p=0.01,
>>>                          top_k=85,
>>>                          repetition_penalty=1.1,
>>>                          temperature=0.01)
>>>                          
>>> print(tokenizer.decode(outputs[0]))

Citation

@article{MediaTek-Research2024breeze7b,
      title={Breeze-7B Technical Report}, 
      author={Chan-Jan Hsu and Chang-Le Liu and Feng-Ting Liao and Po-Chun Hsu and Yi-Chang Chen and Da-Shan Shiu},
      year={2024},
      eprint={2403.02712},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
MistralForCausalLM
Ревизия весов
60d4fa0

0 моделей