/ Модель

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

Контекст
4 096 токенов
Параметры
1,2 млрд
Размер весов
5,1 ГБ
Лицензия
Apache 2.0
Архитектура
olmo · dense
Опубликована
15 июн 2024

OLMo-1B-0724-hf

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

Англоязычная авторегрессионная модель OLMo на 1,2 млрд параметров для генерации текста и последующей тонкой настройки.

4 791скачиваний за 30 дней24лайкавеса обновлены5 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

OLMo 1B July 2024 — авторегрессионная языковая модель семейства OLMo, разработанная Allen Institute for AI (AI2). Этот вариант предназначен для непосредственного использования с Hugging Face Transformers. Модель содержит 1,2 млрд параметров, построена на плотной архитектуре Transformer и имеет контекстное окно 4096 токенов.

Модель обучена на английском языке на наборе Dolma 1.7 с поэтапным обучением и дополнительным этапом на отфильтрованной высококачественной подвыборке. Она предназначена для генерации текста и может служить базой для прикладных решений и дальнейшей тонкой настройки. По оценкам из карточки, версия июля 2024 года улучшила результаты ряда тестов относительно исходной OLMo 1B.

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

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for OLMo 1B July 2024

OLMo 1B July 2024 is the latest version of the original OLMo 1B model rocking a 4.4 point increase in HellaSwag, among other evaluations improvements, from an improved version of the Dolma dataset and staged training. This version is for direct use with HuggingFace Transformers from v4.40 on.

OLMo is a series of Open Language Models designed to enable the science of language models. The OLMo models are trained on the Dolma dataset. We release all code, checkpoints, logs, and details involved in training these models.

Model Details

The core models released in this batch are the following:

SizeTraining TokensLayersHidden SizeAttention HeadsContext Length
OLMo 1B July 20243.05 Trillion162048164096
OLMo 7B July 20242.75 Trillion324096324096

[Coming soon] We are releasing many checkpoints for these models, for every 1000 training steps. The naming convention is stepXXX-tokensYYYB.

To load a specific model revision with HuggingFace, simply add the argument revision:

olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B-0724-hf", revision="step1000-tokens4B")

All revisions/branches are listed in the file revisions.txt. Or, you can access all the revisions for the models via the following code snippet:

from huggingface_hub import list_repo_refs
out = list_repo_refs("allenai/OLMo-1B-0724-hf")
branches = [b.name for b in out.branches]

Model Description

  • Developed by: Allen Institute for AI (AI2)
  • Supported by: Databricks, Kempner Institute for the Study of Natural and Artificial Intelligence at Harvard University, AMD, CSC (Lumi Supercomputer), UW
  • Model type: a Transformer style autoregressive language model.
  • Language(s) (NLP): English
  • License: The code and model are released under Apache 2.0.
  • Contact: Technical inquiries: olmo at allenai dot org. Press: press at allenai dot org
  • Date cutoff: Oct. 2023, with most data from Feb./March 2023 based on Dolma dataset version.

Model Sources

Uses

Inference

Install Transformers. Then proceed as usual with HuggingFace:

from transformers import AutoModelForCausalLM, AutoTokenizer
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B-0724-hf")
tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-1B-0724-hf")
message = ["Language modeling is "]
inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
# optional verifying cuda
# inputs = {k: v.to('cuda') for k,v in inputs.items()}
# olmo = olmo.to('cuda')
response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
>> 'Language modeling is the first step to build natural language generation...'

Alternatively, with the pipeline abstraction:

from transformers import pipeline
olmo_pipe = pipeline("text-generation", model="allenai/OLMo-1B-0724-hf")
print(olmo_pipe("Language modeling is "))
>> 'Language modeling is a branch of natural language processing that aims to...'

Or, you can make this slightly faster by quantizing the model, e.g. AutoModelForCausalLM.from_pretrained("allenai/OLMo-1B-0724-hf", torch_dtype=torch.float16, load_in_8bit=True) (requires bitsandbytes). The quantized model is more sensitive to typing / cuda, so it is recommended to pass the inputs as inputs.input_ids.to('cuda') to avoid potential issues.

Fine-tuning

Model fine-tuning can be done from the final checkpoint (the main revision of this model) or many intermediate checkpoints. Two recipes for tuning are available.

  1. Fine-tune with the OLMo repository:
torchrun --nproc_per_node=8 scripts/train.py {path_to_train_config} \
    --data.paths=[{path_to_data}/input_ids.npy] \
    --data.label_mask_paths=[{path_to_data}/label_mask.npy] \
    --load_path={path_to_checkpoint} \
    --reset_trainer_state

For more documentation, see the GitHub readme.

  1. Further fine-tuning support is being developing in AI2's Open Instruct repository. Details are here.

Evaluation

Core model results for the new and original 7B model are found below.

TaskLlama-7bLlama2-7bFalcon-7bMpt-7bOLMo-7BLlama2-13bOLMo 7B 0424
arc_c44.548.547.546.548.552.842.5
arc_e67.969.570.470.565.473.767.2
boolq75.480.274.674.273.482.283.7
copa91.086.086.085.090.090.086.0
hellaswag76.276.875.977.676.478.675.5
openbookqa51.248.453.048.650.451.850.0
piqa77.276.778.577.378.479.077.5
sciq93.994.593.993.793.895.596.7
winogrande70.569.468.969.967.973.569.8
truthfulQA (MC2)33.938.534.033.036.036.835.8
MMLU (5 shot MC)31.545.024.030.828.355.552.0
GSM8k10.012.04.04.58.525.029.0
Full average60.362.159.259.359.866.263.8

And for the 1B model:

taskrandomStableLM 2 1.6b*Pythia 1BTinyLlama 1.1BOLMo 1BOLMo 1B 0724 (ours)
arc_challenge2543.833.134.834.536.5
arc_easy2563.750.253.258.155.3
boolq5076.661.864.660.767.5
copa5084.072.078.079.083.0
hellaswag2568.244.758.762.566.9
openbookqa2545.837.843.646.446.4
piqa5074.069.171.173.774.9
sciq2594.786.090.588.193.4
winogrande5064.953.358.958.961.4
Average36.168.456.461.562.465.0

*Unlike OLMo, Pythia, and TinyLlama, StabilityAI has not disclosed yet the data StableLM was trained on, making comparisons with other efforts challenging.

Model Details

Data

For training data details, please see the Dolma documentation. This model uses the new 1.7 version with more data sources, better deduplication, and quality filtering. During the annealing phase we use a higher quality subset of Dolma with a linearly decaying learning rate to 0.

Staged training / annealing

In contrast to the first OLMo, we trained OLMo 7B 0424 with a two-stage curriculum:

  • In the first stage, we trained the model from scratch on the Dolma 1.7 dataset. We set a cosine learning rate schedule with a warmup of 2500 steps, a peak learning rate of 3e-4, and a cosine decay to 3e-5 after 3T tokens. We cut off this stage after 2T tokens, when the learning rate is still high.
  • At this point we switch to the second stage, in which we train on a higher-quality subset of Dolma 1.7 (see below) for another 50B tokens, while linearly decaying the learning rate to 0. Our high-quality subset includes (1) using all available Wikipedia, OpenWebMath and Flan data, (2) removing Dolma CC, CC News, and Megawika, and (3) rebalancing remaining sources to achieve approximately equal proportions of each. See exact token counts and relative proportions of this second stage mix below. Both stages contribute equally to the final performance of the OLMo model. After the first stage, OLMo 7B 0424 already outperforms the older OLMo. The second stage consistently adds 2 to 3 points of performance on top.

Architecture

OLMo 7B architecture with peer models for comparison.

OLMo 7BLlama 2 7BOpenLM 7BFalcon 7BPaLM 8B
d_model40964096409645444096
num heads3232327116
num layers3232323232
MLP ratio~8/3~8/3~8/344
LayerNorm typenon-parametric LNRMSNormparametric LNparametric LNparametric LN
pos embeddingsRoPERoPERoPERoPERoPE
attention variantfullGQAfullMQAMQA
biasesnonenonein LN onlyin LN onlynone
block typesequentialsequentialsequentialparallelparallel
activationSwiGLUSwiGLUSwiGLUGeLUSwiGLU
sequence length20484096204820482048
batch size (instances)2160102420482304512
batch size (tokens)~4M~4M~4M~4M~1M
weight tyingnonononoyes

Hyperparameters

AdamW optimizer parameters are shown below.

SizePeak LRBetasEpsilonWeight Decay
1B4.0E-4(0.9, 0.95)1.0E-50.1
7B3.0E-4(0.9, 0.99)1.0E-50.1

Optimizer settings comparison with peer models.

OLMo 7BLlama 2 7BOpenLM 7BFalcon 7B
warmup steps5000200020001000
peak LR3.0E-043.0E-043.0E-046.0E-04
minimum LR3.0E-053.0E-053.0E-051.2E-05
weight decay0.10.10.10.1
beta10.90.90.90.99
beta20.950.950.950.999
epsilon1.0E-051.0E-051.0E-051.0E-05
LR schedulelinearcosinecosinecosine
gradient clippingglobal 1.0global 1.0global 1.0global 1.0
gradient reduce dtypeFP32FP32FP32BF16
optimizer state dtypeFP32most likely FP32FP32FP32

Environmental Impact

OLMo 7B variants were either trained on MI250X GPUs at the LUMI supercomputer, or A100-40GB GPUs provided by MosaicML. A summary of the environmental impact. Further details are available in the paper.

GPU TypePower Consumption From GPUsCarbon Intensity (kg CO₂e/KWh)Carbon Emissions (tCO₂eq)
OLMo 7B TwinMI250X (LUMI supercomputer)135 MWh0*0*
OLMo 7BA100-40GB (MosaicML)104 MWh0.65675.05

Bias, Risks, and Limitations

Like any base language model or fine-tuned model without safety filtering, it is relatively easy for a user to prompt these models to generate harmful and generally sensitive content. Such content can also be produced unintentionally, especially in the case of bias, so we recommend users consider the risks of applications of this technology.

Otherwise, many facts from OLMo or any LLM will often not be true, so they should be checked.

Citation

BibTeX:

@article{Groeneveld2023OLMo,
  title={OLMo: Accelerating the Science of Language Models},
  author={Groeneveld, Dirk and Beltagy, Iz and Walsh, Pete and Bhagia, Akshita and Kinney, Rodney and Tafjord, Oyvind and Jha, Ananya Harsh and Ivison, Hamish and Magnusson, Ian and Wang, Yizhong and Arora, Shane and Atkinson, David and Authur, Russell and Chandu, Khyathi and Cohan, Arman and Dumas, Jennifer and Elazar, Yanai and Gu, Yuling and Hessel, Jack and Khot, Tushar and Merrill, William and Morrison, Jacob and Muennighoff, Niklas and Naik, Aakanksha and Nam, Crystal and Peters, Matthew E. and Pyatkin, Valentina and Ravichander, Abhilasha and Schwenk, Dustin and Shah, Saurabh and Smith, Will and Subramani, Nishant and Wortsman, Mitchell and Dasigi, Pradeep and Lambert, Nathan and Richardson, Kyle and Dodge, Jesse and Lo, Kyle and Soldaini, Luca and Smith, Noah A. and Hajishirzi, Hannaneh},
  journal={Preprint},
  year={2024}
}

APA:

Groeneveld, D., Beltagy, I., Walsh, P., Bhagia, A., Kinney, R., Tafjord, O., Jha, A., Ivison, H., Magnusson, I., Wang, Y., Arora, S., Atkinson, D., Authur, R., Chandu, K., Cohan, A., Dumas, J., Elazar, Y., Gu, Y., Hessel, J., Khot, T., Merrill, W., Morrison, J., Muennighoff, N., Naik, A., Nam, C., Peters, M., Pyatkin, V., Ravichander, A., Schwenk, D., Shah, S., Smith, W., Subramani, N., Wortsman, M., Dasigi, P., Lambert, N., Richardson, K., Dodge, J., Lo, K., Soldaini, L., Smith, N., & Hajishirzi, H. (2024). OLMo: Accelerating the Science of Language Models. Preprint.

Model Card Contact

For errors in this model card, contact Nathan, {nathanl} at allenai dot org.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей