We expand on our Olmo model series by introducing Olmo Hybrid, a new 7B hybrid RNN model in the Olmo family. Olmo Hybrid dramatically outperforms Olmo 3 in final performance, consistently showing roughly 2x data
efficiency on core evals over the course of our pretraining run. We also show gains in performance on long-context benchmarks, as well as improved inference efficiency
(throughput and memory) on long-context lengths by a factor of 75%.
The training of our hybrid model makes use of Olmo 3 7B, except that we change the learning rate schedule to be a standard cosine schedule rather than the piecewise schedule used by Olmo 3. Additionally, we use the improved data mix of Olmo 3 32B instead of the Olmo 3 7B mix. The table below highlights the architecture differences in our hybrid model.
Our overall layer matches the transformer architecture of Olmo 3 7B, except that 75% of layers use gated DeltaNet heads instead of attention heads. The layers alternate so that 3 contain DeltaNet sublayers followed by 1 with a multihead attention sublayer. In particular, each head uses gated DeltaNet heads, extended with negative eigenvaluesWe reduced the number of heads from 32 to 30 while keeping the head dimension fixed at 128 (effectively reducing dmodel from 4096 to 3840). Lastly, head dimension is doubled, which is the default behavior for DeltaNet.
The core models released in this batch include the following:
Olmo is a series of Open language models designed to enable the science of language models.
These models are pre-trained on the Dolma 3 dataset and post-trained on the Dolci datasets. We are releasing all code, checkpoints, logs (coming soon), and associated training details.
Installation
Olmo Hybrid is supported in transformers 5.3.0 or higher:
pip install transformers>=5.3.0
Inference
You can use OLMo with the standard HuggingFace transformers library:
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
2olmo = AutoModelForCausalLM.from_pretrained("allenai/Olmo-Hybrid-7B")3tokenizer = AutoTokenizer.from_pretrained("allenai/Olmo-Hybrid-7B")4message =["Language modeling is "]5inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)6# optional verifying cuda7# inputs = {k: v.to('cuda') for k,v in inputs.items()}8# olmo = olmo.to('cuda')9response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=0, temperature=1.0, top_p=0.7)10print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])11>> 'Language modeling is a fundamental task in natural language processing (NLP) that involves predicting the next word in a sequence given
12 the previous words. It has been widely used in various NLP applications such as machine translation, speech recognition,and text
13 generation...'
For faster performance, you can quantize the model using the following method:
The quantized model is more sensitive to data types and CUDA operations. To avoid potential issues, it's recommended to pass the inputs directly to CUDA using:
inputs.input_ids.to('cuda')
We have released checkpoints for these models. For pretraining, the naming convention is stage1-stepXXX. The conventions for midtraining and long context are stage2-stepXXX and stage3-stepXXX, respectively.
To load a specific model revision with HuggingFace, simply add the argument revision:
Or, you can access all the revisions for the models via the following code snippet:
python
1from huggingface_hub import list_repo_refs
2out = list_repo_refs("allenai/Olmo-Hybrid-7B")3branches =[b.name for b in out.branches]
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.
2 versions on 100B mix (midtraining), merged before starting long context run.
Bias, Risks, and Limitations
Like any base language model or fine-tuned model without safety filtering, these models can easily be prompted by users to generate harmful and sensitive content. Such content may also be produced unintentionally, especially in cases involving bias, so we recommend that users consider the risks when applying this technology. Additionally, many statements from OLMo or any LLM are often inaccurate, so facts should be verified.
License
This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2's Responsible Use Guidelines.
Citation
Coming Soon!
Model Card Contact
For errors in this model card, contact olmo@allenai.org.