/ Модель

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

Контекст
2 048 токенов
Параметры
6,6 млрд
Размер весов
13,5 ГБ
Лицензия
Apache 2.0
Архитектура
llama · dense
Опубликована
22 июн 2023

open_llama_7b-scaled

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

Модифицированная базовая языковая модель OpenLLaMA на 6,6 млрд параметров для генерации текста с поддержкой расширяемого контекста.

24скачиваний за 30 дней10лайковвеса обновлены22 июн 2023

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

emozilla/open_llama_7b-scaled — модифицированная версия OpenLLaMA, основанная на архитектуре LLaMA. Веса OpenLLaMA разработаны как открытая воспроизводимая реализация семейства LLaMA; эта версия добавляет Scaled Rotary Embeddings, предложенные kaiokendev. Модель содержит 6,6 млрд параметров и предназначена для генерации текста на основе предыдущего контекста.

Стандартная конфигурация соответствует контексту OpenLLaMA в 2048 токенов. README описывает возможность увеличить max_position_embeddings до степени двойки, например 4096 или 8192, при соответствующей настройке токенизатора; это не означает, что качество на увеличенном контексте отдельно подтверждено. Модель обучена с нуля на наборе RedPajama-Data-1T и показывает сопоставимые с оригинальной LLaMA 7B результаты на большинстве описанных бенчмарков.

Модель может служить базовой языковой моделью для продолжения текста и few-shot задач. В README отмечена проблема с автоматически конвертированным fast tokenizer: для корректной токенизации рекомендуется использовать медленный токенизатор. Лицензия репозитория — Apache-2.0.

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

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

Ограничения

В стандартной конфигурации контекст составляет 2048 токенов; увеличение контекста требует отдельной настройки и не сопровождается подтверждением качества для увеличенной длины. README предупреждает, что fast tokenizer может давать неверную токенизацию, поэтому рекомендуется использовать медленный токенизатор.

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

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

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

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

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

Открыть на Hugging Face

This is a modified version of the original LLaMA model that incorporates Scaled Rotary Embeddings first proposed by kaiokendev. By default, the model is configured to be equivalent to the original OpenLLaMA model (2048 context length). To modify, instantiate the LLaMA configuration and set max_position_embeddings to the desired context length. The value should be a power of 2, e.g. 2048, 4096, 8192, etc.

config = AutoConfig.from_pretrained("emozilla/open_llama_7b-scaled", \
  trust_remote_code=True)
config.max_position_embeddings = 8192
model = AutoModelForCausalLM.from_pretrained("emozilla/open_llama_7b-scaled", \
  config=config, trust_remote_code=True)

You should also set max_model_length on your tokenizer.

tokenizer = AutoTokenizer.from_pretrained("emozilla/open_llama_7b-scaled", max_model_length=8192)

OpenLLaMA: An Open Reproduction of LLaMA

In this repo, we present a permissively licensed open source reproduction of Meta AI's LLaMA large language model. We are releasing a 7B and 3B model trained on 1T tokens, as well as the preview of a 13B model trained on 600B tokens. We provide PyTorch and JAX weights of pre-trained OpenLLaMA models, as well as evaluation results and comparison against the original LLaMA models. Please see the project homepage of OpenLLaMA for more details.

Weights Release, License and Usage

We release the weights in two formats: an EasyLM format to be use with our EasyLM framework, and a PyTorch format to be used with the Hugging Face transformers library. Both our training framework EasyLM and the checkpoint weights are licensed permissively under the Apache 2.0 license.

Loading the Weights with Hugging Face Transformers

Preview checkpoints can be directly loaded from Hugging Face Hub. Please note that it is advised to avoid using the Hugging Face fast tokenizer for now, as we’ve observed that the auto-converted fast tokenizer sometimes gives incorrect tokenizations. This can be achieved by directly using the LlamaTokenizer class, or passing in the use_fast=False option for the AutoTokenizer class. See the following example for usage.

import torch
from transformers import LlamaTokenizer, LlamaForCausalLM

model_path = 'openlm-research/open_llama_3b'
# model_path = 'openlm-research/open_llama_7b'

tokenizer = LlamaTokenizer.from_pretrained(model_path)
model = LlamaForCausalLM.from_pretrained(
    model_path, torch_dtype=torch.float16, device_map='auto',
)

prompt = 'Q: What is the largest animal?\nA:'
input_ids = tokenizer(prompt, return_tensors="pt").input_ids

generation_output = model.generate(
    input_ids=input_ids, max_new_tokens=32
)
print(tokenizer.decode(generation_output[0]))

For more advanced usage, please follow the transformers LLaMA documentation.

Evaluating with LM-Eval-Harness

The model can be evaluated with lm-eval-harness. However, due to the aforementioned tokenizer issue, we need to avoid using the fast tokenizer to obtain the correct results. This can be achieved by passing in use_fast=False to this part of lm-eval-harness, as shown in the example below:

tokenizer = self.AUTO_TOKENIZER_CLASS.from_pretrained(
    pretrained if tokenizer is None else tokenizer,
    revision=revision + ("/" + subfolder if subfolder is not None else ""),
    use_fast=False
)

Loading the Weights with EasyLM

For using the weights in our EasyLM framework, please refer to the LLaMA documentation of EasyLM. Note that unlike the original LLaMA model, our OpenLLaMA tokenizer and weights are trained completely from scratch so it is no longer needed to obtain the original LLaMA tokenizer and weights. Note that we use BOS (beginning of sentence) token (id=1) during training, so it is best to prepend this token for best performance during few-shot evaluation.

Dataset and Training

We train our models on the RedPajama dataset released by Together, which is a reproduction of the LLaMA training dataset containing over 1.2 trillion tokens. We follow the exactly same preprocessing steps and training hyperparameters as the original LLaMA paper, including model architecture, context length, training steps, learning rate schedule, and optimizer. The only difference between our setting and the original one is the dataset used: OpenLLaMA employs the RedPajama dataset rather than the one utilized by the original LLaMA.

We train the models on cloud TPU-v4s using EasyLM, a JAX based training pipeline we developed for training and fine-tuning large language models. We employ a combination of normal data parallelism and fully sharded data parallelism (also know as ZeRO stage 3) to balance the training throughput and memory usage. Overall we reach a throughput of over 2200 tokens / second / TPU-v4 chip for our 7B model.

Evaluation

We evaluated OpenLLaMA on a wide range of tasks using lm-evaluation-harness. The LLaMA results are generated by running the original LLaMA model on the same evaluation metrics. We note that our results for the LLaMA model differ slightly from the original LLaMA paper, which we believe is a result of different evaluation protocols. Similar differences have been reported in this issue of lm-evaluation-harness. Additionally, we present the results of GPT-J, a 6B parameter model trained on the Pile dataset by EleutherAI.

The original LLaMA model was trained for 1 trillion tokens and GPT-J was trained for 500 billion tokens. We present the results in the table below. OpenLLaMA exhibits comparable performance to the original LLaMA and GPT-J across a majority of tasks, and outperforms them in some tasks.

Task/MetricGPT-J 6BLLaMA 7BOpenLLaMA 7BOpenLLaMA 3BOpenLLaMA 13B 600BT
anli_r1/acc0.320.350.330.330.33
anli_r2/acc0.340.340.360.320.35
anli_r3/acc0.350.370.380.350.38
arc_challenge/acc0.340.390.370.340.39
arc_challenge/acc_norm0.370.410.380.370.42
arc_easy/acc0.670.680.720.690.74
arc_easy/acc_norm0.620.520.680.650.70
ddboolq/acc0.500.560.530.490.71
hellaswag/acc0.360.360.630.430.54
hellaswag/acc_norm0.660.730.720.670.73
openbookqa/acc0.290.290.300.270.30
openbookqa/acc_norm0.380.410.400.400.41
piqa/acc0.750.780.760.750.77
piqa/acc_norm0.760.780.770.760.78
record/em0.880.910.890.880.90
record/f10.890.910.900.890.90
rte/acc0.540.560.600.580.65
truthfulqa_mc/mc10.200.210.230.220.22
truthfulqa_mc/mc20.360.340.350.350.35
wic/acc0.500.500.510.480.49
winogrande/acc0.640.680.670.620.67
Average0.510.530.550.520.56

We removed the task CB and WSC from our benchmark, as our model performs suspiciously well on these two tasks. We hypothesize that there could be a benchmark data contamination in the training set.

Contact

We would love to get feedback from the community. If you have any questions, please open an issue or contact us.

OpenLLaMA is developed by: Xinyang Geng* and Hao Liu* from Berkeley AI Research. *Equal Contribution

Acknowledgment

We thank the Google TPU Research Cloud program for providing part of the computation resources. We’d like to specially thank Jonathan Caton from TPU Research Cloud for helping us organizing compute resources, Rafi Witten from the Google Cloud team and James Bradbury from the Google JAX team for helping us optimizing our training throughput. We’d also want to thank Charlie Snell, Gautier Izacard, Eric Wallace, Lianmin Zheng and our user community for the discussions and feedback.

The OpenLLaMA 13B model is trained in collaboration with Stability AI, and we thank Stability AI for providing the computation resources. We’d like to especially thank David Ha and Shivanshu Purohit for the coordinating the logistics and providing engineering support.

Reference

If you found OpenLLaMA useful in your research or applications, please cite using the following BibTeX:

@software{openlm2023openllama,
  author = {Geng, Xinyang and Liu, Hao},
  title = {OpenLLaMA: An Open Reproduction of LLaMA},
  month = May,
  year = 2023,
  url = {https://github.com/openlm-research/open_llama}
}
@software{together2023redpajama,
  author = {Together Computer},
  title = {RedPajama-Data: An Open Source Recipe to Reproduce LLaMA training dataset},
  month = April,
  year = 2023,
  url = {https://github.com/togethercomputer/RedPajama-Data}
}
@article{touvron2023llama,
  title={Llama: Open and efficient foundation language models},
  author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and others},
  journal={arXiv preprint arXiv:2302.13971},
  year={2023}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей