OLMo is a series of
O
pen
L
anguage
Mo
dels 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:
[Coming soon] We are releasing many checkpoints for these models, for every 1000 training steps.
The naming convention is
stepXXX-tokensYYYB
. These checkpoints are already available at
OLMo 7B April 2024
and will be copied here soon.
To load a specific model revision with HuggingFace, simply add the argument
revision
:
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-7B-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.
from transformers import AutoModelForCausalLM, AutoTokenizer
olmo = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B-0724-hf")
tokenizer = AutoTokenizer.from_pretrained("allenai/OLMo-7B-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-7B-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-7B-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.
*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 OLMo 1.0, we trained OLMo 7B July 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 2.7T tokens, when the learning rate is still somewhat 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 1.7 already outperforms OLMo 1.0. The second stage consistently adds 2 to 3 points of performance on top.
Architecture
OLMo 7B architecture with peer models for comparison.
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
.
Runs of allenai OLMo-7B-0724-hf on huggingface.co
27.7K
Total runs
0
24-hour runs
-237
3-day runs
10.1K
7-day runs
24.5K
30-day runs
More Information About OLMo-7B-0724-hf huggingface.co Model
OLMo-7B-0724-hf huggingface.co is an AI model on huggingface.co that provides OLMo-7B-0724-hf's model effect (), which can be used instantly with this allenai OLMo-7B-0724-hf model. huggingface.co supports a free trial of the OLMo-7B-0724-hf model, and also provides paid use of the OLMo-7B-0724-hf. Support call OLMo-7B-0724-hf model through api, including Node.js, Python, http.
OLMo-7B-0724-hf huggingface.co is an online trial and call api platform, which integrates OLMo-7B-0724-hf's modeling effects, including api services, and provides a free online trial of OLMo-7B-0724-hf, you can try OLMo-7B-0724-hf online for free by clicking the link below.
allenai OLMo-7B-0724-hf online free url in huggingface.co:
OLMo-7B-0724-hf is an open source model from GitHub that offers a free installation service, and any user can find OLMo-7B-0724-hf on GitHub to install. At the same time, huggingface.co provides the effect of OLMo-7B-0724-hf install, users can directly use OLMo-7B-0724-hf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.