CoolFace
Modelpublic

louisbrulenaudet/Pearl-34B-ties

sourceHugging Faceapache-2.0updated 3y agoView on Hugging Face
5likes68downloads
Model Card

<center><img src='https://i.imgur.com/0xFTuAX.png' width='450px'></center>

Pearl-34B-ties, an xtraordinary 34B model

03-22-2024 - To date, louisbrulenaudet/Pearl-34B-ties is the "Best 🤝 base merges and moerges model of around 30B" on the Open LLM Leaderboard.

Pearl-34B-ties is a merge of the following models:

Evaluation

The evaluation was performed using the HuggingFace Open LLM Leaderboard.

ModelAverageARCHellaSwagMMLUTruthfulQAWinograndeGSM8K#Params (B)
louisbrulenaudet/Pearl-34B-ties75.4870.9984.8376.6370.3282.6467.4834.39
louisbrulenaudet/Pearl-7B-0211-ties75.1171.4288.8663.9171.4684.3770.667.24
NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO73.3571.0887.2972.1754.8383.1171.6546.7
argilla/notus-8x7b-experiment73.1870.9987.7371.3365.7981.6161.6446.7
louisbrulenaudet/Pearl-7B-slerp72.7568.0087.1664.0462.3581.2973.627.24
mistralai/Mixtral-8x7B-Instruct-v0.172.770.1487.5571.464.9881.0661.1146.7
microsoft/Orca-2-13b61.9860.9279.8560.356.4276.5637.8313
microsoft/phi-261.3361.0975.1158.1144.4774.3554.812.78

Ties merging

TIES-Merging is a method designed to facilitate the efficient merging of multiple task-specific models into a consolidated multitask model. It addresses two primary challenges encountered in the process of model merging with a focus on maintaining objectivity.

One key challenge tackled by TIES-Merging involves addressing redundancy in model parameters. This is achieved by identifying and eliminating redundant parameters within task-specific models, emphasizing the changes made during fine-tuning and selectively retaining the top-k% most significant changes while discarding the rest.

Another challenge pertains to conflicts arising from disagreements between parameter signs across different models. TIES-Merging resolves these conflicts by creating a unified sign vector representing the most dominant direction of change across all models.

The TIES-Merging process consists of three steps:

  • —Trim: Reduces redundancy in task-specific models by retaining a fraction of the most significant parameters (density parameter) and resetting the remaining parameters to zero.
  • —Elect Sign: Resolves sign conflicts across different models by creating a unified sign vector based on the most dominant direction (positive or negative) in terms of cumulative magnitude.
  • —Disjoint Merge: Averages parameter values aligned with the unified sign vector, excluding zero values.

Configuration

yaml
models:
  - model: abacusai/Smaug-34B-v0.1
  - model: jondurbin/bagel-dpo-34b-v0.2
    parameters:
      density: 0.45
      weight: 0.5
  - model: abacusai/MetaMath-Bagel-DPO-34B
    parameters:
      density: 0.48
      weight: 0.5
merge_method: ties
base_model: abacusai/Smaug-34B-v0.1
parameters:
  normalize: true
  int8_mask: true
dtype: bfloat16

Usage

python
!pip install -qU transformers accelerate

from transformers import AutoTokenizer
import transformers
import torch

model = "louisbrulenaudet/Pearl-34B-ties"
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"])

Citing & Authors

If you use this code in your research, please use the following BibTeX entry.

BibTeX
@misc{louisbrulenaudet2023,
  author =       {Louis Brulé Naudet},
  title =        {Pearl-34B-ties, an xtraordinary 34B model},
  year =         {2023}
  howpublished = {\url{https://huggingface.co/louisbrulenaudet/Pearl-34B-ties}},
}

Feedback

If you have any feedback, please reach out at louisbrulenaudet@icloud.com.