/ Модель

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

Контекст
4 096 токенов
Параметры
68,8 млрд
Лицензия
Llama 2
Архитектура
llama · dense
Базовая модель
Swallow-70b-instruct-hf
Библиотека
transformers
Опубликована
11 фев 2024

Superswallow-70b-v0.3

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

Объединённая модель Llama 2 на 68,8 млрд параметров для диалоговой генерации текста и следования инструкциям с поддержкой японского и английского языков.

24скачиваний за 30 дней0лайковвеса обновлены11 фев 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Superswallow-70b-v0.3 — объединённая языковая модель от автора nitky, созданная с помощью mergekit на основе Swallow-70b-instruct и параметров allenai/tulu-2-dpo-70b. Это эксперимент слияния моделей, обученных на разных языках: в Swallow добавлена способность следовать намерениям пользователя, унаследованная от Tulu 2 DPO, с целью сохранить японские языковые возможности Swallow.

Модель использует плотную архитектуру Llama 2 с 68,8 млрд параметров, принимает текст и генерирует текст. Контекст составляет 4096 токенов; в карточке указаны английский и японский языки. README рекомендует формат запросов Tulu или Swallow и предупреждает, что при температуре около 1,0 ответы могут стать нестабильными; при слабом следовании инструкции советуется снизить температуру до 0,5 или ниже.

Модель предназначена для диалоговой генерации и выполнения пользовательских инструкций, в том числе на японском языке. Репозиторий распространяется под лицензией llama2, однако автор отмечает, что использование параметров Tulu 2 DPO может повлечь вопросы о применимости лицензии AI2 ImpACT и возможное изменение условий; перед использованием следует сверить актуальную лицензию.

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

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

Ограничения

При высокой температуре генерация может становиться нестабильной, а следование намерению пользователя — ухудшаться. Автор предупреждает о возможных вопросах к лицензии из-за использования параметров Tulu 2 DPO и допускает изменение условий использования.

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

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

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

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

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

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

Открыть на Hugging Face

Superswallow-70b-v0.3

Important Notice:

This model partially utilizes the parameters of Tulu V2 DPO finetuned based on Llama 2, so it may inherit the AI2 ImpACT license. Please use the model keeping in mind that there may be changes regarding the license if AI2 contacts me.

The AI2 ImpACT license includes information about data artifacts and model artifacts, but does not cover the case of directly applying parts of the LLM parameters of a model artifact to other models. However, I respect their research and great work, so I will change the license immediately if AI2 contacts me.

Description

This is a merge of pre-trained language models created using mergekit. The model was created by injecting the ability to follow user intent from Tulu 2 DPO into the Swallow instract model.

It was a proof of concept for merging LLMs trained in other languages, and paid close attention to preserving the linguistic capabilities of the merge-based model.

As far as I know, Swallow is the full set Llama 2 model(7B, 13B, 70B) that can output the most beautiful Japanese. Therefore, I used it as the base model for merging this time. Thank you for their wonderful work.

Test environment

This model was tested using text-generation-webui. I use preset simple-1 and Null preset for Generation.

Recommendation

Use simple-1 settings:

  • temperature: 0.7
  • top_p: 0.9
  • repetition_penalty: 1.15
  • top_k: 20

Tested temperature Range

  • temperature: 0.3 - 1.0

It works fine in most cases, but depending on the prompt, the output may become unstable at the temperature around 1.0.

If the output does not follow the user intent, please lower the temperature to 0.5 or less.

Tested repetition_penalty Range

  • repetition_penalty: 1.0 - 1.15

It works fine in most cases, but depending on the prompt, the output may become unstable at the repetition_penalty around 1.0.

Prompt template

All prompt templates are available as well.

Tulu Style

<|user|>
Your message here!
<|assistant|>

For best results, format all inputs in this manner. Make sure to include a newline after <|assistant|>, this can affect generation quality quite a bit.

Swallow Style (Alpaca format)

以下に、あるタスクを説明する指示があり、それに付随する入力が更なる文脈を提供しています。リクエストを適切に完了するための回答を記述してください。

### 指示:
{instruction}

### 応答:

Use the instruct model

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

model_name = "nitky/Superswallow-70b-v0.3"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, low_cpu_mem_usage=True, device_map="auto", load_in_4bit = True)


PROMPT_DICT = {
    "prompt_input": (
        "以下に、あるタスクを説明する指示があり、それに付随する入力が更なる文脈を提供しています。"
        "リクエストを適切に完了するための回答を記述してください。\n\n"
        "### 指示:\n{instruction}\n\n### 入力:\n{input}\n\n### 応答:"

    ),
    "prompt_no_input": (
        "以下に、あるタスクを説明する指示があります。"
        "リクエストを適切に完了するための回答を記述してください。\n\n"
        "### 指示:\n{instruction}\n\n### 応答:"
    ),
}

def create_prompt(instruction, input=None):
    """
    Generates a prompt based on the given instruction and an optional input.
    If input is provided, it uses the 'prompt_input' template from PROMPT_DICT.
    If no input is provided, it uses the 'prompt_no_input' template.

    Args:
        instruction (str): The instruction describing the task.
        input (str, optional): Additional input providing context for the task. Default is None.

    Returns:
        str: The generated prompt.
    """
    if input:
        # Use the 'prompt_input' template when additional input is provided
        return PROMPT_DICT["prompt_input"].format(instruction=instruction, input=input)
    else:
        # Use the 'prompt_no_input' template when no additional input is provided
        return PROMPT_DICT["prompt_no_input"].format(instruction=instruction)

# Example usage
instruction_example = "以下のトピックに関する詳細な情報を提供してください。"
input_example = "東京工業大学の主なキャンパスについて教えてください"
prompt = create_prompt(instruction_example, input_example)

input_ids = tokenizer.encode(
    prompt,
    add_special_tokens=False,
    return_tensors="pt"
)

tokens = model.generate(
    input_ids.to(device=model.device),
    max_new_tokens=200,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.15,
    top_k=20,
    do_sample=True,
)

out = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(out)

Merge Details

Merge Method

This model was merged using the DARE TIES and the SLERP merge method using tokyotech-llm/Swallow-70b-instruct-hf as a base.

Models Merged

The following models were included in the merge:

Configuration

The command example:

# please change the path and options according to your environment
mergekit-mega --cuda Superswallow-70b-v0.3.yml ~/text-generation-webui/models

The following YAML configuration was used to produce this model:

models:
  - model: allenai/tulu-2-dpo-70b
    # no parameters necessary for base model
  - model: tokyotech-llm/Swallow-70b-NVE-instruct-hf # Japanese language skills
    parameters:
      density: 1
      weight: 0.40
merge_method: dare_ties
base_model: allenai/tulu-2-dpo-70b
dtype: bfloat16
name: Superswallow-70b-v0.3-NVE
---
models:
  - model: tokyotech-llm/Swallow-70b-instruct-hf
    # no parameters necessary for base model
  - model: Superswallow-70b-v0.3-NVE
    parameters:
      density: 1
      weight:
      - filter: mlp
        value: 0.1
      - filter: self_attn
        value: 0.6
      - value: 0 # fallback for rest of tensors.
merge_method: dare_ties
base_model: tokyotech-llm/Swallow-70b-instruct-hf
dtype: bfloat16
tokenizer_source: union
name: Superswallow-70b-v0.3-base
---
models:
  - model: tokyotech-llm/Swallow-70b-instruct-hf
    # no parameters necessary for base model
  - model: Superswallow-70b-v0.3-NVE
    parameters:
      density: 1
      weight:
      - filter: mlp
        value: [0.6, 0.1, 0.6, 0.1, 0.6, 0.1, 0.6, 0.1, 0.1]
      - filter: self_attn
        value: [0.6, 0.6, 0.1, 0.6, 0.1, 0.6, 0.1, 0.6, 0.6]
      - value: 0 # fallback for rest of tensors.
merge_method: dare_ties
base_model: tokyotech-llm/Swallow-70b-instruct-hf
dtype: bfloat16
tokenizer_source: union
name: Superswallow-70b-v0.3-flavor
---
slices:
  - sources:
      - model: Superswallow-70b-v0.3-base
        layer_range: [0, 32]
      - model: Superswallow-70b-v0.3-flavor
        layer_range: [0, 32]
merge_method: slerp
base_model: Superswallow-70b-v0.3-base
parameters:
  t: # model stabilization
    - filter: self_attn
      value: [0, 0.5, 0.3, 0.7, 1]
    - filter: mlp
      value: [1, 0.5, 0.7, 0.3, 0]
    - value: 0.5 # fallback for rest of tensors
dtype: bfloat16
name: Superswallow-70b-v0.3

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

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

GPU в ailist

vLLM

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
b196643

0 моделей