/ Модель

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

Контекст
32 768 токенов
Параметры
7,1 млрд
Размер весов
15,2 ГБ
Архитектура
qwen2 · dense
Опубликована
14 окт 2024

DistilQwen2-7B-Instruct

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

Дистиллированная модель Qwen2 на 7,1 млрд параметров для диалогов и выполнения текстовых инструкций.

22скачиваний за 30 дней2лайкавеса обновлены4 ноя 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

DistilQwen2-7B-Instruct — дистиллированная языковая модель Alibaba PAI на архитектуре Qwen2, созданная на основе Qwen2-7B-Instruct. Модель содержит 7,1 млрд параметров, принимает текстовые инструкции и генерирует текст; карточка демонстрирует использование в диалоговом формате. Длина контекста — 32 768 токенов.

Модель предназначена для следования инструкциям и диалоговых сценариев. Для дистилляции использованы открытые наборы Magpie, OpenHermes и Mammoth 2, а также синтетические данные; основная часть инструкций была на китайском и английском языках. README сообщает об оценивании на AlpacaEval, MT-Bench и IFEval. Репозиторий содержит веса в формате safetensors. Сведения о лицензии в предоставленных данных отсутствуют.

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

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

Ограничения

В README не приведены сведения о лицензии. Основная часть инструкционных данных была на китайском и английском языках, поэтому качество для других языков по предоставленным данным оценить нельзя.

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

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

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

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

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

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

Открыть на Hugging Face

📖 Introduction

DistilQwen2-7B is a distilled version of Qwen2-7B-Instruct, designed to distill the capabilities of stronger LLMs into smaller ones. To achieve this, we utilized a diverse range of datasets for the distillation process, including well-known open-source collections such as Magpie, Openhermes, and Mammoth 2, as well as proprietary synthetic datasets.

The training data primarily consists of instructions in Chinese and English. To enhance the quality and diversity of the instruction data, we implemented a difficulty scoring system and task-related resampling techniques.

For difficulty scoring, we employed the LLM-as-a-Judge paradigm, using the teacher model to evaluate responses based on accuracy, relevance, helpfulness, and level of detail. We then calculated the Model Fitting Difficulty (MFD) Score by subtracting the teacher model's score from the student model's score. A higher MFD Score indicates that the instruction is more valuable for distillation training. This approach allowed us to remove low-difficulty instructions from the training set, focusing on more challenging and informative examples.

This careful curation and scoring process ensures that DistilQwen2-7B achieves high performance after the distillation process.

🚀 Quick Start

Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

model = AutoModelForCausalLM.from_pretrained(
    "alibaba-pai/DistilQwen2-7B-Instruct",
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("alibaba-pai/DistilQwen2-7B-Instruct")

prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)

generated_ids = model.generate(
    model_inputs.input_ids,
    max_new_tokens=2048,
)
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]

🔍 Evaluation

We evaluated our model on instruction-following leaderboards such as AlpacaEval, MT-Bench and IFEval.

ModelAlpacaEval 2.0 (length-controlled)MT-BenchMT-Bench (single)IFEval (instruction-loose)IFEval (strict-prompt)
Qwen2-1.5B-Instruct5.225.856.4541.3728.10
DistilQwen2-1.5B-Instruct8.286.427.1249.7636.04
Qwen2-7B-Instruct24.338.278.6866.6752.31
DistilQwen2-7B-Instruct25.358.409.0371.4660.26

📜 Citation

If you find our work helpful, please cite it!

@misc{TAPIR,
      title={Distilling Instruction-following Abilities of Large Language Models with Task-aware Curriculum Planning}, 
      author={Yuanhao Yue and Chengyu Wang and Jun Huang and Peng Wang},
      year={2024},
      eprint={2405.13448},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2405.13448}, 
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
Qwen2ForCausalLM
Ревизия весов
7bce9e1

0 моделей