πŸ“‹ Model Description

Quantization made by Richard Erkhov.

Github

Discord

Request more models

OpenELM-450M-Instruct - GGUF

  • Model creator: https://huggingface.co/apple/
  • Original model: https://huggingface.co/apple/OpenELM-450M-Instruct/

NameQuant methodSize
OpenELM-450M-Instruct.Q2K.ggufQ2K0.18GB
OpenELM-450M-Instruct.IQ3XS.ggufIQ3XS0.19GB
OpenELM-450M-Instruct.IQ3S.ggufIQ3S0.2GB
OpenELM-450M-Instruct.Q3KS.ggufQ3K_S0.2GB
OpenELM-450M-Instruct.IQ3M.ggufIQ3M0.21GB
OpenELM-450M-Instruct.Q3K.ggufQ3K0.23GB
OpenELM-450M-Instruct.Q3KM.ggufQ3K_M0.23GB
OpenELM-450M-Instruct.Q3KL.ggufQ3K_L0.24GB
OpenELM-450M-Instruct.IQ4XS.ggufIQ4XS0.24GB
OpenELM-450M-Instruct.Q40.ggufQ400.25GB
OpenELM-450M-Instruct.IQ4NL.ggufIQ4NL0.25GB
OpenELM-450M-Instruct.Q4KS.ggufQ4K_S0.25GB
OpenELM-450M-Instruct.Q4K.ggufQ4K0.27GB
OpenELM-450M-Instruct.Q4KM.ggufQ4K_M0.27GB
OpenELM-450M-Instruct.Q41.ggufQ410.28GB
OpenELM-450M-Instruct.Q50.ggufQ500.3GB
OpenELM-450M-Instruct.Q5KS.ggufQ5K_S0.3GB
OpenELM-450M-Instruct.Q5K.ggufQ5K0.31GB
OpenELM-450M-Instruct.Q5KM.ggufQ5K_M0.31GB
OpenELM-450M-Instruct.Q51.ggufQ510.32GB
OpenELM-450M-Instruct.Q6K.ggufQ6K0.35GB
OpenELM-450M-Instruct.Q80.ggufQ800.45GB

Original model description:



license: other
license_name: apple-sample-code-license
license_link: LICENSE

OpenELM

Sachin Mehta, Mohammad Hossein Sekhavat, Qingqing Cao, Maxwell Horton, Yanzi Jin, Chenfan Sun, Iman Mirzadeh, Mahyar Najibi, Dmitry Belenko, Peter Zatloukal, Mohammad Rastegari

We introduce OpenELM, a family of Open Efficient Language Models. OpenELM uses a layer-wise scaling strategy to efficiently allocate parameters within each layer of the transformer model, leading to enhanced accuracy. We pretrained OpenELM models using the CoreNet library. We release both pretrained and instruction tuned models with 270M, 450M, 1.1B and 3B parameters.

Our pre-training dataset contains RefinedWeb, deduplicated PILE, a subset of RedPajama, and a subset of Dolma v1.6, totaling approximately 1.8 trillion tokens. Please check license agreements and terms of these datasets before using them.

Usage

We have provided an example function to generate output from OpenELM models loaded via HuggingFace Hub in generateopenelm.py.

You can try the model by running the following command:

python generateopenelm.py --model apple/OpenELM-450M-Instruct --hfaccesstoken [HFACCESSTOKEN] --prompt 'Once upon a time there was' --generatekwargs repetition_penalty=1.2

Please refer to this link to obtain your hugging face access token.

Additional arguments to the hugging face generate function can be passed via generatekwargs. As an example, to speedup the inference, you can try lookup token speculative generation by passing the promptlookupnumtokens argument as follows:

python generateopenelm.py --model apple/OpenELM-450M-Instruct --hfaccesstoken [HFACCESSTOKEN] --prompt 'Once upon a time there was' --generatekwargs repetitionpenalty=1.2 promptlookupnumtokens=10

Alternatively, try model-wise speculative generation with an assistive model by passing a smaller model through the assistantmodel argument, for example:
python generateopenelm.py --model apple/OpenELM-450M-Instruct --hfaccesstoken [HFACCESSTOKEN] --prompt 'Once upon a time there was' --generatekwargs repetitionpenalty=1.2 --assistantmodel [SMALLER_MODEL]

Main Results

Zero-Shot

Model SizeARC-cARC-eBoolQHellaSwagPIQASciQWinoGrandeAverage
OpenELM-270M26.4545.0853.9846.7169.7584.7053.9154.37
OpenELM-270M-Instruct30.5546.6848.5652.0770.7884.4052.7255.11
OpenELM-450M27.5648.0655.7853.9772.3187.2058.0157.56
OpenELM-450M-Instruct30.3850.0060.3759.3472.6388.0058.9659.95
OpenELM-1_1B32.3455.4363.5864.8175.5790.6061.7263.44
OpenELM-1_1B-Instruct37.9752.2370.0071.2075.0389.3062.7565.50
OpenELM-3B35.5859.8967.4072.4478.2492.7065.5167.39
OpenELM-3B-Instruct39.4261.7468.1776.3679.0092.5066.8569.15

LLM360

Model SizeARC-cHellaSwagMMLUTruthfulQAWinoGrandeAverage
OpenELM-270M27.6547.1525.7239.2453.8338.72
OpenELM-270M-Instruct32.5151.5826.7038.7253.2040.54
OpenELM-450M30.2053.8626.0140.1857.2241.50
OpenELM-450M-Instruct33.5359.3125.4140.4858.3343.41
OpenELM-1_1B36.6965.7127.0536.9863.2245.93
OpenELM-1_1B-Instruct41.5571.8325.6545.9564.7249.94
OpenELM-3B42.2473.2826.7634.9867.2548.90
OpenELM-3B-Instruct47.7076.8724.8038.7667.9651.22

OpenLLM Leaderboard

Model SizeARC-cCrowS-PairsHellaSwagMMLUPIQARACETruthfulQAWinoGrandeAverage
OpenELM-270M27.6566.7947.1525.7269.7530.9139.2453.8345.13
OpenELM-270M-Instruct32.5166.0151.5826.7070.7833.7838.7253.2046.66
OpenELM-450M30.2068.6353.8626.0172.3133.1140.1857.2247.69
OpenELM-450M-Instruct33.5367.4459.3125.4172.6336.8440.4858.3349.25
OpenELM-1_1B36.6971.7465.7127.0575.5736.4636.9863.2251.68
OpenELM-1_1B-Instruct41.5571.0271.8325.6575.0339.4345.9564.7254.40
OpenELM-3B42.2473.2973.2826.7678.2438.7634.9867.2554.35
OpenELM-3B-Instruct47.7072.3376.8724.8079.0038.4738.7667.9655.73
See the technical report for more results and comparison.

Evaluation

Setup

Install the following dependencies:

# install public lm-eval-harness

harness_repo="public-lm-eval-harness"
git clone https://github.com/EleutherAI/lm-evaluation-harness ${harness_repo}
cd ${harness_repo}

use main branch on 03-15-2024, SHA is dc90fec


git checkout dc90fec
pip install -e .
cd ..

66d6242 is the main branch on 2024-04-01

pip install datasets@git+https://github.com/huggingface/datasets.git@66d6242 pip install tokenizers>=0.15.2 transformers>=4.38.2 sentencepiece>=0.2.0

Evaluate OpenELM

# OpenELM-450M-Instruct
hf_model=apple/OpenELM-450M-Instruct

this flag is needed because lm-eval-harness set addbostoken to False by default, but OpenELM uses LLaMA tokenizer which requires addbostoken to be True

tokenizer=meta-llama/Llama-2-7b-hf addbostoken=True batch_size=1

mkdir lmevaloutput

shot=0
task=arcchallenge,arceasy,boolq,hellaswag,piqa,race,winogrande,sciq,truthfulqa_mc2
lm_eval --model hf \
--modelargs pretrained=${hfmodel},trustremotecode=True,addbostoken=${addbostoken},tokenizer=${tokenizer} \
--tasks ${task} \
--device cuda:0 \
--num_fewshot ${shot} \
--outputpath ./lmevaloutput/${hfmodel//\//}${task//,/_}-${shot}shot \
--batchsize ${batchsize} 2>&1 | tee ./lmevaloutput/eval-${hfmodel//\//}${task//,/}-${shot}shot.log

shot=5
task=mmlu,winogrande
lm_eval --model hf \
--modelargs pretrained=${hfmodel},trustremotecode=True,addbostoken=${addbostoken},tokenizer=${tokenizer} \
--tasks ${task} \
--device cuda:0 \
--num_fewshot ${shot} \
--outputpath ./lmevaloutput/${hfmodel//\//}${task//,/_}-${shot}shot \
--batchsize ${batchsize} 2>&1 | tee ./lmevaloutput/eval-${hfmodel//\//}${task//,/}-${shot}shot.log

shot=25
task=arcchallenge,crowspairs_english
lm_eval --model hf \
--modelargs pretrained=${hfmodel},trustremotecode=True,addbostoken=${addbostoken},tokenizer=${tokenizer} \
--tasks ${task} \
--device cuda:0 \
--num_fewshot ${shot} \
--outputpath ./lmevaloutput/${hfmodel//\//}${task//,/_}-${shot}shot \
--batchsize ${batchsize} 2>&1 | tee ./lmevaloutput/eval-${hfmodel//\//}${task//,/}-${shot}shot.log

shot=10
task=hellaswag
lm_eval --model hf \
--modelargs pretrained=${hfmodel},trustremotecode=True,addbostoken=${addbostoken},tokenizer=${tokenizer} \
--tasks ${task} \
--device cuda:0 \
--num_fewshot ${shot} \
--outputpath ./lmevaloutput/${hfmodel//\//}${task//,/_}-${shot}shot \
--batchsize ${batchsize} 2>&1 | tee ./lmevaloutput/eval-${hfmodel//\//}${task//,/}-${shot}shot.log

Bias, Risks, and Limitations

The release of OpenELM models aims to empower and enrich the open research community by providing access to state-of-the-art language models. Trained on publicly available datasets, these models are made available without any safety guarantees. Consequently, there exists the possibility of these models producing outputs that are inaccurate, harmful, biased, or objectionable in response to user prompts. Thus, it is imperative for users and developers to undertake thorough safety testing and implement appropriate filtering mechanisms tailored to their specific requirements.

Citation

If you find our work useful, please cite:

@article{mehtaOpenELMEfficientLanguage2024,
	title = {{OpenELM}: {An} {Efficient} {Language} {Model} {Family} with {Open} {Training} and {Inference} {Framework}},
	shorttitle = {{OpenELM}},
	url = {https://arxiv.org/abs/2404.14619v1},
	language = {en},
	urldate = {2024-04-24},
	journal = {arXiv.org},
	author = {Mehta, Sachin and Sekhavat, Mohammad Hossein and Cao, Qingqing and Horton, Maxwell and Jin, Yanzi and Sun, Chenfan and Mirzadeh, Iman and Najibi, Mahyar and Belenko, Dmitry and Zatloukal, Peter and Rastegari, Mohammad},
	month = apr,
	year = {2024},
}

@inproceedings{mehta2022cvnets,
author = {Mehta, Sachin and Abdolhosseini, Farzad and Rastegari, Mohammad},
title = {CVNets: High Performance Library for Computer Vision},
year = {2022},
booktitle = {Proceedings of the 30th ACM International Conference on Multimedia},
series = {MM '22}
}

πŸ“‚ GGUF File List

πŸ“ Filename πŸ“¦ Size ⚑ Download
OpenELM-450M-Instruct.IQ3_M.gguf
LFS Q3
218.26 MB Download
OpenELM-450M-Instruct.IQ3_S.gguf
LFS Q3
206.58 MB Download
OpenELM-450M-Instruct.IQ3_XS.gguf
LFS Q3
198.6 MB Download
OpenELM-450M-Instruct.IQ4_NL.gguf
LFS Q4
258.58 MB Download
OpenELM-450M-Instruct.IQ4_XS.gguf
LFS Q4
246.5 MB Download
OpenELM-450M-Instruct.Q2_K.gguf
LFS Q2
180.81 MB Download
OpenELM-450M-Instruct.Q3_K.gguf
LFS Q3
231.5 MB Download
OpenELM-450M-Instruct.Q3_K_L.gguf
LFS Q3
248.28 MB Download
OpenELM-450M-Instruct.Q3_K_M.gguf
LFS Q3
231.5 MB Download
OpenELM-450M-Instruct.Q3_K_S.gguf
LFS Q3
206.58 MB Download
OpenELM-450M-Instruct.Q4_0.gguf
Recommended LFS Q4
258.25 MB Download
OpenELM-450M-Instruct.Q4_1.gguf
LFS Q4
282.57 MB Download
OpenELM-450M-Instruct.Q4_K.gguf
LFS Q4
276.06 MB Download
OpenELM-450M-Instruct.Q4_K_M.gguf
LFS Q4
276.06 MB Download
OpenELM-450M-Instruct.Q4_K_S.gguf
LFS Q4
258.58 MB Download
OpenELM-450M-Instruct.Q5_0.gguf
LFS Q5
306.88 MB Download
OpenELM-450M-Instruct.Q5_1.gguf
LFS Q5
331.2 MB Download
OpenELM-450M-Instruct.Q5_K.gguf
LFS Q5
319.56 MB Download
OpenELM-450M-Instruct.Q5_K_M.gguf
LFS Q5
319.56 MB Download
OpenELM-450M-Instruct.Q5_K_S.gguf
LFS Q5
306.88 MB Download
OpenELM-450M-Instruct.Q6_K.gguf
LFS Q6
358.56 MB Download
OpenELM-450M-Instruct.Q8_0.gguf
LFS Q8
464.13 MB Download