๐Ÿงฌ Mistral-LLaMA-Fusion: A Hybrid of Open Weight Titans

๐Ÿ“Œ Overview

Mistral-LLaMA-Fusion is an experimental merged language model combining the strengths of Mistral-7B-v0.1 and LLaMA-2-7B using the Linear Merge method via MergeKit. This hybrid model aims to balance Mistralโ€™s efficiency and architecture with LLaMA-2โ€™s robustness in reasoning and instruction following.

๐Ÿ”— Created by: [Matteo Khan]
๐ŸŽ“ Affiliation: Apprentice at TW3 Partners (Generative AI Research)
๐Ÿ“ License: MIT

๐Ÿ”— Connect on LinkedIn
๐Ÿ”— Model on Hugging Face

๐Ÿง  Model Details

๐ŸŽฏ Intended Use

This model is suited for research in model merging and hybridization, and can be used for:

  • โœ… Text Generation
  • โœ… Instruction Following
  • โœ… Creative Writing
  • โœ… Prompt Engineering Experiments

โš ๏ธ Limitations

As with all merged models, this fusion may inherit and combine weaknesses from both parents:

  • โŒ Possible generation of false, biased, or inappropriate content
  • โš ๏ธ Unpredictable behavior in edge cases
  • ๐Ÿ“‰ No guaranteed performance gain across all benchmarks

๐Ÿ”ฌ Merging Configuration

merge_method: linear
dtype: float16
models:
  - model: mistralai/Mistral-7B-v0.1
    parameters:
      t: 1.0
      weight: 0.6
  - model: meta-llama/Llama-2-7b-hf
    parameters:
      t: 1.0
      weight: 0.4

parameters:
  normalize: true
  int8_mask: false

layers:
  - pattern: "model.*"
๐Ÿ“Œ Note: No additional fine-tuning was performed. This is a straight merge using MergeKit.

๐ŸŒฑ Why Merging?
Merging allows rapid experimentation with existing checkpoints while reducing the computational cost and carbon footprint compared to training from scratch.

๐Ÿš€ How to Use
python
Copier
Modifier
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "MatteoKhan/Mistral-LLaMA-Fusion"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto")

prompt = "Explain the benefits of merging language models."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Downloads last month
4
Safetensors
Model size
7B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for MatteoKhan/Mistral-LLaMA-Fusion

Finetuned
(966)
this model
Quantizations
1 model