CoolFace
Modelpublic

mlabonne/NeuralMonarch-7B

sourceHugging Facecc-by-nc-4.0updated 3y agoView on Hugging Face
12likes25kdownloads
Model Card

image/jpeg

๐Ÿ‘‘ NeuralMonarch-7B

NeuralMonarch-7B is a DPO fine-tuned of mlabonne/Monarch-7B using the jondurbin/truthy-dpo-v0.1 and argilla/distilabel-intel-orca-dpo-pairs preference datasets.

It is based on a merge of the following models using LazyMergekit:

Special thanks to Jon Durbin, Intel, and Argilla for the preference datasets.

Try the demo: https://huggingface.co/spaces/mlabonne/NeuralMonarch-7B-GGUF-Chat

๐Ÿ” Applications

This model uses a context window of 8k. I recommend using it with the Mistral Instruct chat template (works perfectly with LM Studio).

Compared to other 7B models, it performs well in instruction following and reasoning tasks. For a chat/RP model with strong reasoning abilities, check out mlabonne/AlphaMonarch-7B.

โšก Quantized models

  • โ€”GGUF: https://huggingface.co/mlabonne/NeuralMonarch-7B-GGUF

๐Ÿ† Evaluation

Nous

NeuralMonarch-7B is one of the best-performing 7B models on Nous' benchmark suite (evaluation performed using LLM AutoEval). See the entire leaderboard here.

ModelAverageAGIEvalGPT4AllTruthfulQABigbench
**NeuralMonarch-7B** ๐Ÿ“„62.7345.3176.9978.3550.28
AlphaMonarch-7B ๐Ÿ“„62.7445.3777.0178.3950.2
Monarch-7B ๐Ÿ“„62.6845.4877.0778.0450.14
teknium/OpenHermes-2.5-Mistral-7B ๐Ÿ“„52.4242.7572.9952.9940.94
mlabonne/NeuralHermes-2.5-Mistral-7B ๐Ÿ“„53.5143.6773.2455.3741.76
mlabonne/NeuralBeagle14-7B ๐Ÿ“„60.2546.0676.7770.3247.86
mlabonne/NeuralOmniBeagle-7B ๐Ÿ“„62.345.8577.2676.0650.03
eren23/dpo-binarized-NeuralTrix-7B ๐Ÿ“„62.544.5776.3479.8149.27
CultriX/NeuralTrix-7B-dpo ๐Ÿ“„62.544.6176.3379.849.24

EQ-bench

NeuralMonarch-7B is also outperforming 70B and 120B parameter models on EQ-bench by Samuel J. Paech, who kindly ran the evaluations.

image/png

Open LLM Leaderboard

NeuralMonarch-7B is one of the best-performing 7B models on the Open LLM Leaderboard.

MT-Bench

########## First turn ##########
                                    score
model                       turn         
gpt-4                       1     8.95625
OmniBeagle-7B               1     8.31250
AlphaMonarch-7B             1     8.23750
claude-v1                   1     8.15000
NeuralMonarch-7B            1     8.09375
gpt-3.5-turbo               1     8.07500
claude-instant-v1           1     7.80000

########## Second turn ##########
                                     score
model                       turn          
gpt-4                       2     9.025000
claude-instant-v1           2     8.012658
OmniBeagle-7B               2     7.837500
gpt-3.5-turbo               2     7.812500
claude-v1                   2     7.650000
AlphaMonarch-7B             2     7.618750
NeuralMonarch-7B            2     7.375000

########## Average ##########
                                score
model                                
gpt-4                        8.990625
OmniBeagle-7B                8.075000
gpt-3.5-turbo                7.943750
AlphaMonarch-7B              7.928125
claude-instant-v1            7.905660
claude-v1                    7.900000
NeuralMonarch-7B             7.734375
NeuralBeagle14-7B            7.628125

๐Ÿ’ป Usage

python
!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "mlabonne/NeuralMonarch-7B"
messages = [{"role": "user", "content": "What is a large language model?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])