/ Модель

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

Контекст
2 048 токенов
Параметры
3,5 млрд
Размер весов
5,6 ГБ
Лицензия
Apache 2.0
Архитектура
phi · dense
Библиотека
transformers
Опубликована
12 мар 2024

Neural-phi2

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

Neural-phi2 — дообученная методом DPO англоязычная модель семейства Phi для генерации текста и диалоговых ответов.

36скачиваний за 30 дней0лайковвеса обновлены8 апр 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Neural-phi2 — языковая модель семейства Phi, разработанная автором репозитория на основе Phi-2 от Microsoft и дообученная методом Direct Preference Optimization на диалоговых парах из набора argilla/distilabel-intel-orca-dpo-pairs. Карточка описывает модель как примерно 2-миллиардную, тогда как метаданные Hugging Face указывают 3,5 млрд параметров; архитектура — плотная авторегрессионная PhiForCausalLM, формат весов — safetensors, библиотека — Transformers, длина контекста — 2048 токенов.

Модель предназначена для генерации текста и диалоговых сценариев, включая ответы на вопросы, суммаризацию и работу чат-ботов и виртуальных помощников. Карточка сообщает об использовании 4-битной загрузки и LoRA в процессе обучения, но не устанавливает однозначно формат итоговой модели. Лицензия — Apache-2.0. Модель ориентирована на английский язык; её качество подробно не оценивалось, а ответы могут содержать фактические ошибки и смещения.

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

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

Ограничения

Качество модели не было подробно оценено или подтверждено бенчмарками; возможны фактические ошибки, смещения и ухудшение результатов на задачах, далёких от обучающих данных. README указывает размер около 2 млрд параметров, а метаданные — 3,5 млрд.

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

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

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

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

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

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

Открыть на Hugging Face

Model Card: Neural-phi2

Poster Image

Model Details

  • Model Name: Neural-phi2
  • Model Type: Large Language Model (LLM)
  • Model Architecture: A finetuned version of the Phi2 model from Microsoft, utilizing Direct Preference Optimization (DPO) on the distilabel-intel-orca-dpo-pairs dataset.
  • Model Size: Approximately 2B parameters
  • Training Data: The model was finetuned on the distilabel-intel-orca-dpo-pairs dataset, which consists of chat-like prompts and responses.
  • Training Procedure: The Phi2 model was finetuned using the DPO technique. The training process involved:
    • Loading and formatting the distilabel-intel-orca-dpo-pairs dataset
    • Defining the training configuration, including batch size, learning rate, and number of epochs
    • Initializing the DPO Trainer and training the model
    • Saving the finetuned model and tokenizer

Training Parameters

This section outlines the key training parameters used to finetune the Phi2 model from Microsoft using the Direct Preference Optimization (DPO) technique on the distilabel-intel-orca-dpo-pairs dataset, resulting in the Neural-phi2 model.

  • SFT Model Name: phi2-sft-alpaca_loraemb-right-pad
  • New Model Name: Neural-phi2-v2
  • Dataset: argilla/distilabel-intel-orca-dpo-pairs
  • Tokenizer: Custom tokenizer created from the phi2-sft-alpaca_loraemb-right-pad model
  • Quantization Config:
    • load_in_4bit=True
    • bnb_4bit_quant_type="nf4"
    • bnb_4bit_compute_dtype=torch.float16
  • LoRA Config:
    • r=16
    • lora_alpha=64
    • lora_dropout=0.05
    • bias="none"
    • task_type="CAUSAL_LM"
    • target_modules=["q_proj", "k_proj", "v_proj", "dense", "fc1", "fc2"]
  • Training Arguments:
    • per_device_train_batch_size=1
    • gradient_accumulation_steps=8
    • gradient_checkpointing=True
    • learning_rate=5e-7
    • lr_scheduler_type="linear"
    • max_steps=500
    • optim="paged_adamw_32bit"
    • warmup_steps=100
    • bf16=True
    • report_to="wandb"
  • DPO Trainer:
    • loss_type="sigmoid"
    • beta=0.1
    • max_prompt_length=768
    • max_length=1024

Intended Use

The Neural-phi2 model is intended to be used as a general-purpose language model for a variety of natural language processing tasks, such as text generation, summarization, and question answering. It may be particularly useful in applications where the model needs to generate coherent and contextually appropriate responses, such as in chatbots or virtual assistants.

Sample Inference Code

from transformers import AutoModelForCausalLM, AutoTokenizer

# Load the Neural-phi2 model and tokenizer
model = AutoModelForCausalLM.from_pretrained("Neural-phi2")
tokenizer = AutoTokenizer.from_pretrained("Neural-phi2")

# Define a sample prompt
messages = [
    {"role": "system", "content": "You are a helpful chatbot assistant."},
    {"role": "user", "content": "Hello, how are you today?"}
]

# Format the prompt in ChatML format
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)

# Create a pipeline and generate a response
pipeline = transformers.pipeline("text-generation", model=model, tokenizer=tokenizer)
output = pipeline(
    prompt,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
    num_return_sequences=1,
    max_new_tokens=100,
)

# Print the generated response
print(output[0]["generated_text"])

Limitations and Biases

As with any large language model, the Neural-phi2 model may exhibit biases present in its training data, such as societal biases or factual inaccuracies. Additionally, the model's performance may degrade for tasks or inputs that are significantly different from its training data. Users should carefully evaluate the model's outputs and make appropriate adjustments for their specific use cases.

Performance

The performance of the Neural-phi2 model has not been extensively evaluated or benchmarked as part of this project. Users should conduct their own evaluations to assess the model's suitability for their specific tasks and use cases.

Ethical Considerations

The use of large language models like Neural-phi2 raises several ethical considerations, such as the potential for generating harmful or biased content, the risk of misuse, and the importance of transparency and accountability. Users should carefully consider these ethical implications and take appropriate measures to mitigate potential harms.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей