/ Модель

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

Контекст
4 096 токенов
Параметры
7,2 млрд
Размер весов
14,8 ГБ
Лицензия
Apache 2.0
Архитектура
mistral · dense
Базовая модель
Minerva-7B-base-v1.0
Библиотека
transformers
Опубликована
2 дек 2024

Minerva-7B-instruct-v1.0

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

Итальянско-английская диалоговая модель на архитектуре Mistral для ответов на вопросы, генерации текста и помощи с кодом.

3 056скачиваний за 30 дней26лайковвеса обновлены5 дек 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Minerva-7B-instruct-v1.0 — диалоговая языковая модель Sapienza NLP, созданная в рамках проекта FAIR при сотрудничестве с CINECA и участии Babelscape и проекта CREATIVE PRIN. Это дообученная версия Minerva-7B-base-v1.0 на архитектуре Mistral с 7,2 млрд параметров и контекстом до 4096 токенов. Семейство Minerva предварительно обучалось с нуля на итальянских и английских текстах; в составе данных также был код. Версия instruct прошла настройку инструкциями и оптимизацию предпочтений DPO.

Модель предназначена для диалога и генерации текста: она может отвечать на вопросы, объяснять темы, помогать с рассуждениями и решать задачи по коду. В первую очередь она рассчитана на итальянский и английский языки. Разработчики предупреждают, что ответы могут содержать фактические ошибки, стереотипы, оскорбительный или иной нежелательный контент, а также быть нерелевантными или повторяющимися. Лицензия — Apache-2.0.

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

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

Ограничения

Модель может выдавать фактические ошибки, предвзятый, оскорбительный или нежелательный контент, а также нерелевантные и повторяющиеся ответы. Качество и безопасность ответов требуют проверки.

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for Minerva-7B-instruct-v1.0

Minerva is the first family of LLMs pretrained from scratch on Italian developed by Sapienza NLP in the context of the Future Artificial Intelligence Research (FAIR) project, in collaboration with CINECA and with additional contributions from Babelscape and the CREATIVE PRIN Project. Notably, the Minerva models are truly-open (data and model) Italian-English LLMs, with approximately half of the pretraining data including Italian text.

Description

This is the model card for Minerva-7B-instruct-v1.0, a 7 billion parameter model trained on almost 2.5 trillion tokens (1.14 trillion in Italian, 1.14 trillion in English and 200 billion in code).

This model is part of the Minerva LLM family:

🚨⚠️🚨 Bias, Risks, and Limitations 🚨⚠️🚨

This section identifies foreseeable harms and misunderstandings.

This is a chat foundation model, subject to model alignment and safety risk mitigation strategies. However, the model may still:

  • Overrepresent some viewpoints and underrepresent others
  • Contain stereotypes
  • Contain personal information
  • Generate:
    • Racist and sexist content
    • Hateful, abusive, or violent language
    • Discriminatory or prejudicial language
    • Content that may not be appropriate for all settings, including sexual content
  • Make errors, including producing incorrect information or historical facts as if it were factual
  • Generate irrelevant or repetitive outputs

We are aware of the biases and potential problematic/toxic content that current pretrained large language models exhibit: more specifically, as probabilistic models of (Italian and English) languages, they reflect and amplify the biases of their training data. For more information about this issue, please refer to our survey:

How to use Minerva with Hugging Face transformers

import transformers
import torch

model_id = "sapienzanlp/Minerva-7B-instruct-v1.0"

# Initialize the pipeline.
pipeline = transformers.pipeline(
    model=model_id,
    model_kwargs={"torch_dtype": torch.bfloat16},
    device_map="auto",
)

# Input text for the model.
input_conv = [{"role": "user", "content": "Qual è la capitale dell'Italia?"}]

# Compute the outputs.
output = pipeline(
  input_conv,
  max_new_tokens=128,
)

output
[{'generated_text': [{'role': 'user', 'content': "Qual è la capitale dell'Italia?"}, {'role': 'assistant', 'content': "La capitale dell'Italia è Roma."}]}]

Model Architecture

Minerva-7B-base-v1.0 is a Transformer model based on the Mistral architecture. Please look at the configuration file for a detailed breakdown of the hyperparameters we chose for this model.

The Minerva LLM family is composed of:

Model NameTokensLayersHidden SizeAttention HeadsKV HeadsSliding WindowMax Context Length
Minerva-350M-base-v1.070B (35B it + 35B en)161152164204816384
Minerva-1B-base-v1.0200B (100B it + 100B en)162048164204816384
Minerva-3B-base-v1.0660B (330B it + 330B en)322560328204816384
Minerva-7B-base-v1.02.48T (1.14T it + 1.14T en + 200B code)324096328None4096

Model Training

Minerva-7B-base-v1.0 was trained using llm-foundry 0.8.0 from MosaicML. The hyperparameters used are the following:

Model NameOptimizerlrbetasepsweight decaySchedulerWarmup StepsBatch Size (Tokens)Total Steps
Minerva-350M-base-v1.0Decoupled AdamW2e-4(0.9, 0.95)1e-80.0Cosine2%4M16,690
Minerva-1B-base-v1.0Decoupled AdamW2e-4(0.9, 0.95)1e-80.0Cosine2%4M47,684
Minerva-3B-base-v1.0Decoupled AdamW2e-4(0.9, 0.95)1e-80.0Cosine2%4M157,357
Minerva-7B-base-v1.0AdamW3e-4(0.9, 0.95)1e-50.1Cosine20004M591,558

SFT Training

The SFT model was trained using Llama-Factory. The data mix was the following:

DatasetSourceCodeEnglishItalian
Glaive-code-assistantLink100,00000
Alpaca-pythonLink20,00000
Alpaca-cleanedLink050,0000
Databricks-dolly-15kLink015,0110
No-robotsLink09,4990
OASST2Link029,000528
WizardLMLink029,8100
LIMALink01,0000
OPENORCALink030,0000
UltrachatLink050,0000
MagpieMTLink030,0000
Tulu-V2-ScienceLink07,0000
Aya_datasetsLink03,944738
Tower-blocks_itLink007,276
Bactrian-XLink0067,000
Magpie (Translated by us)Link0059,070
Everyday-conversations (Translated by us)Link002,260
alpaca-gpt4-itLink0015,000
capybara-claude-15k-itaLink0015,000
WildchatLink005,000
GPT4_INSTLink0010,000
Italian Safety Instructions-0021,426
Italian Conversations-004,843

For more details, please check our tech page.

Online DPO Training

This model card is for our DPO model. Direct Preference Optimization (DPO) is a method that refines models based on user feedback, similar to Reinforcement Learning from Human Feedback (RLHF), but without the complexity of reinforcement learning. Online DPO further improves this by allowing real-time adaptation during training, continuously refining the model with new feedback. For training this model, we used the Hugging Face TRL library and Online DPO, with the Skywork/Skywork-Reward-Llama-3.1-8B-v0.2 model as the judge to evaluate and guide optimization. For this stage we used just the prompts from HuggingFaceH4/ultrafeedback_binarized (English), efederici/evol-dpo-ita (Italian) and Babelscape/ALERT translated to Italian, with additional manually curated data for safety.

For more details, please check our tech page.

Model Evaluation

For Minerva's evaluation process, we utilized ITA-Bench, a new evaluation suite to test the capabilities of Italian-speaking models. ITA-Bench is a collection of 18 benchmarks that assess the performance of language models on various tasks, including scientific knowledge, commonsense reasoning, and mathematical problem-solving.

Tokenizer Fertility

The tokenizer fertility measures the average amount of tokens produced per tokenized word. A tokenizer displaying high fertility values in a particular language typically indicates that it segments words in that language extensively. The tokenizer fertility is strictly correlated with the inference speed of the model with respect to a specific language, as higher values mean longer sequences of tokens to generate and thus lower inference speed.

Fertility computed over a sample of Cultura X (CX) data and Wikipedia (Wp):

ModelVoc. SizeFertility IT (CX)Fertility EN (CX)Fertility IT (Wp)Fertility EN (Wp)
Mistral-7B-v0.1320001.871.322.051.57
gemma-7b2560001.421.181.561.34
Minerva-3B-base-v1.0327681.391.321.661.59
Minerva-7B-base-v1.0512001.321.261.561.51

The Sapienza NLP Team

🧭 Project Lead and Coordination

  • Roberto Navigli: project lead and coordination; model analysis, evaluation and selection, safety and guardrailing, conversations.

🤖 Model Development

  • Edoardo Barba: pre-training, post-training, data analysis, prompt engineering.
  • Simone Conia: pre-training, post-training, evaluation, model, and data analysis.
  • Pere-Lluís Huguet Cabot: data processing, filtering,g and deduplication, preference modeling.
  • Luca Moroni: data analysis, evaluation, post-training.
  • Riccardo Orlando: pre-training process and data processing.

👮 Safety and Guardrailing

  • Stefan Bejgu: safety and guardrailing.
  • Federico Martelli: synthetic prompt generation, model and safety analysis.
  • Ciro Porcaro: additional safety prompts.
  • Alessandro Scirè: safety and guardrailing.
  • Simone Stirpe: additional safety prompts.
  • Simone Tedeschi: English dataset for safety evaluation.

Special thanks for their support

  • Giuseppe Fiameni, Nvidia
  • Sergio Orlandini, CINECA

Acknowledgments

This work was funded by the PNRR MUR project PE0000013-FAIR and the CREATIVE PRIN project, which is funded by the MUR Progetti di Rilevante Interesse Nazionale programme (PRIN 2020). We acknowledge the CINECA award "IscB_medit" under the ISCRA initiative for the availability of high-performance computing resources and support.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей