/ Модель

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

Контекст
2 048 токенов
Параметры
4,8 млрд
Лицензия
MIT
Архитектура
gpt_neox · dense
Базовая модель
bilingual-gpt-neox-4b
Опубликована
31 июл 2023

bilingual-gpt-neox-4b-instruction-sft

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

Двуязычная GPT-NeoX-модель rinna для диалогов и выполнения инструкций на японском и английском языках.

281скачиваний за 30 дней17лайковвеса обновлены23 мар 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

rinna/bilingual-gpt-neox-4b-instruction-sft — двуязычная разговорная языковая модель компании rinna, созданная дообучением GPT-NeoX на 4,8 млрд параметров для выполнения инструкций. Архитектура — плотный трансформер GPT-NeoX; модель принимает текст и генерирует текст. Контекст составляет 2048 токенов.

Модель предназначена для диалогов, ответов на вопросы и других запросов на японском и английском языках. Для диалога README задаёт формат с репликами «ユーザー» и «システム»; качество генерации чувствительно к параметрам декодирования, поэтому их стоит подбирать под задачу. Модель дообучалась на данных Anthropic HH-RLHF и FLAN Instruction Tuning, включая японские переводы. Выпущенная 2 августа 2023 года версия распространяется по лицензии MIT.

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

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

Ограничения

Генерация чувствительна к параметрам декодирования, таким как temperature, top_p, top_k и repetition_penalty, и их рекомендуется подбирать для конкретной задачи. Контекст ограничен 2048 токенами.

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

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

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

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

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

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

Открыть на Hugging Face

bilingual-gpt-neox-4b-instruction-sft

rinna-icon


Update

  • 2023/08/02 We uploaded the newly trained rinna/bilingual-gpt-neox-4b-instruction-sft with the MIT license.
    • Please refrain from using the previous model released on 2023/07/31 for commercial purposes if you have already downloaded it.
    • The new model released on 2023/08/02 is built from datasets with less strict licenses and has better evaluation performance, so we suggest using the new model.
    • For reference, we provide the MD5 checksum values for the pytorch_model.bin files of the previous and current models.
      • 2023/07/31 model: edf190a323c0ae63f71476700fb0b462
      • 2023/08/02 model: de72aa5b66beee7b65783c96f687d186
  • 2023/07/31 In the previously released rinna/bilingual-gpt-neox-4b-instruction-sft, we found that part of the training data (i.e. Openchat ShareGPT4 and WizardLM) have a non-commercial license, and thus it does not comply with the MIT license. We decided to remove the previous version and build a new SFT model from datasets with less strict licenses. The new model will be uploaded in a few days. We sincerely apologize for our careless mistake.

Overview

This repository provides an English-Japanese bilingual GPT-NeoX model of 3.8 billion parameters.

The model is based on rinna/bilingual-gpt-neox-4b and has been finetuned to serve as an instruction-following conversational agent.


Benchmarking

Our evaluation experiments suggest that the bilingual-gpt-neox-4b-instruction-sft model performs slightly better than the previous Japanese GPT-NeoX 3.6B PPO in Japanese tasks.

  • The 4-task average accuracy is based on results of JCommonsenseQA, JNLI, MARC-ja, and JSQuAD.
  • The 6-task average accuracy is based on results of JCommonsenseQA, JNLI, MARC-ja, JSQuAD, XWinograd, and JAQKET-v2.
Model4-task average accuracy6-task average accuracy
bilingual-gpt-neox-4b-instruction-ppo61.0161.16
bilingual-gpt-neox-4b-instruction-sft61.0261.69
bilingual-gpt-neox-4b56.1251.83
japanese-gpt-neox-3.6b-instruction-ppo59.8660.07
japanese-gpt-neox-3.6b55.0750.32

I/O Format

A special format has been adopted to construct inputs.

  • An input prompt is formatted as a conversation between ユーザー and システム.
  • Each input utterance consists of (1) its speaker ("ユーザー" or "システム"), (2) a colon (":"), (3) a whitespace (" "), and (4) utterance text (e.g. "世界で一番高い山は?").
  • The input prompt should be ended with "システム: " to acknowledge the model to generate a response.
  • All the utterances in the input prompt should be separated by a newline \n.

Following is an example to construct input from a conversation.

prompt = [
    {
        "speaker": "ユーザー",
        "text": "Hello, you are an assistant that helps me learn Japanese."
    },
    {
        "speaker": "システム",
        "text": "Sure, what can I do for you?"
    },
    {
        "speaker": "ユーザー",
        "text": "VRはなんですか。"
    }
]
prompt = [
    f"{uttr['speaker']}: {uttr['text']}"
    for uttr in prompt
]
prompt = "\n".join(prompt)
prompt = (
    prompt
    + "\n"
    + "システム: "
)
print(prompt)
"""
ユーザー: Hello, you are an assistant that helps me learn Japanese.
システム: Sure, what can I do for you?
ユーザー: VRはなんですか。
システム:
"""

How to use the model

Notice: Since the model is sensitive to decoding hyper-parameters (e.g. temperature, top_p, top_k, repetition_penalty), it is suggested to explore the best setting for your task.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("rinna/bilingual-gpt-neox-4b-instruction-sft", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("rinna/bilingual-gpt-neox-4b-instruction-sft")

if torch.cuda.is_available():
    model = model.to("cuda")

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

with torch.no_grad():
    output_ids = model.generate(
        token_ids.to(model.device),
        max_new_tokens=512,
        do_sample=True,
        temperature=1.0,
        top_p=0.85,
        pad_token_id=tokenizer.pad_token_id,
        bos_token_id=tokenizer.bos_token_id,
        eos_token_id=tokenizer.eos_token_id
    )

output = tokenizer.decode(output_ids.tolist()[0][token_ids.size(1):])
print(output)
"""VRとはVirtual Realityの略で、仮想現実とも呼ばれます。これは、コンピューターを使用して仮想世界を作り出し、仮想世界上でコンピューターのゲームや仮想世界を体験するための技術です。この技術は、コンピューターやモバイ ルデバイスの進歩によって、2015年以降、ますます普及しています。VRは、ゲームや仮想世界、その他のアプリケー ションなどのさまざまな分野で、コンピューターと人間の相互作用の新しい方法を提供しています。</s>"""

Tokenization

The model uses a sentencepiece-based tokenizer.

  • The tokenizer has a vocabulary size of 65,536.
  • It uses byte fallback to decompose unknown text pieces into UTF-8 byte pieces to avoid producing <UNK> tokens.
  • It can recognize consecutive whitespaces, newlines, and tabs to handle structured texts better.
  • We turned off the default behaviour of prepending leading whitespace because it is not beneficial for processing Japanese.
  • Specifically, single whitespace is always processed as one token so that any English word won't have a preceding whitespace like in many other tokenizers (e.g. _Hello).
    • This decision trades the English processing efficiency for a unified way to treat whitespaces.
    • It leads to a significantly lower loss of next token prediction on English data because whitespaces are easy to predict.
  • Don't forget to set use_fast=False to make the above features function correctly.

How to cite

@misc{rinna-bilingual-gpt-neox-4b-instruction-sft,
    title = {rinna/bilingual-gpt-neox-4b-instruction-sft},
    author = {Zhao, Tianyu and Sawada, Kei},
    url = {https://huggingface.co/rinna/bilingual-gpt-neox-4b-instruction-sft}
}

@inproceedings{sawada2024release,
    title = {Release of Pre-Trained Models for the {J}apanese Language},
    author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
    booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
    month = {5},
    year = {2024},
    pages = {13898--13905},
    url = {https://aclanthology.org/2024.lrec-main.1213},
    note = {\url{https://arxiv.org/abs/2404.01657}}
}

Licenese

The MIT license

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
GPTNeoXForCausalLM
Ревизия весов
5f9d69b

0 моделей