--- language: - en base_model: google/gemma-2-2b-it datasets: - BAAI/Infinity-Instruct model-index: - name: Gemma2-9B-IT-Simpo-Infinity-Preference results: - task: type: text-generation name: Text Generation dataset: name: IFEval (0-Shot) type: HuggingFaceH4/ifeval args: num_few_shot: 0 metrics: - type: inst_level_strict_acc and prompt_level_strict_acc value: 31.76 name: strict accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: BBH (3-Shot) type: BBH args: num_few_shot: 3 metrics: - type: acc_norm value: 42.19 name: normalized accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: MATH Lvl 5 (4-Shot) type: hendrycks/competition_math args: num_few_shot: 4 metrics: - type: exact_match value: 0.0 name: exact match source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: GPQA (0-shot) type: Idavidrein/gpqa args: num_few_shot: 0 metrics: - type: acc_norm value: 11.97 name: acc_norm source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: MuSR (0-shot) type: TAUR-Lab/MuSR args: num_few_shot: 0 metrics: - type: acc_norm value: 8.1 name: acc_norm source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard - task: type: text-generation name: Text Generation dataset: name: MMLU-PRO (5-shot) type: TIGER-Lab/MMLU-Pro config: main split: test args: num_few_shot: 5 metrics: - type: acc value: 31.82 name: accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard?query=BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference name: Open LLM Leaderboard --- ## Overview Gemma2-9B-IT-Simpo-Infinity-Preference is based on [gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it) and finetuned on [Infinity-Preference](https://huggingface.co/datasets/BAAI/Infinity-Preference) with [Simpo](https://github.com/princeton-nlp/SimPO). It achieves 73.4% LC win-rate on AlpacaEval 2.0 and 58.1% win-rate on Arena-Hard against GPT-4. ## Training hyperparameters ```yaml beta: 10 gamma_beta_ratio: 1 learning_rate: 8.0e-7 log_level: info logging_steps: 5 max_length: 2048 max_prompt_length: 1800 num_train_epochs: 1 batch_size: 128 ``` ## How to Use Gemma2-9B-IT-Simpo-Infinity-Preference adopt the same chat template of [gemma-2-9b-it](https://huggingface.co/google/gemma-2-9b-it): ```bash user How are you? model Hi! ``` To apply this model and template in conversation scenarios, you can refer to the following code: ```python from transformers import AutoModelForCausalLM, AutoTokenizer, LogitsProcessorList import torch device = "cuda" # the device to load the model onto model = AutoModelForCausalLM.from_pretrained("BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference", torch_dtype=torch.bfloat16, device_map="auto" ) tokenizer = AutoTokenizer.from_pretrained("BAAI/Gemma2-9B-IT-Simpo-Infinity-Preference") prompt = "Give me a short introduction to large language model." messages = [ {"role": "user", "content": prompt} ] text = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True ) model_inputs = tokenizer([text], return_tensors="pt").to(device) logits_processor = LogitsProcessorList( [ MinLengthLogitsProcessor(1, eos_token_id=tokenizer.eos_token_id), TemperatureLogitsWarper(0.8), ] ) generated_ids = model.generate( model_inputs.input_ids, logits_processor=logits_processor, max_new_tokens=512 ) generated_ids = [ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids) ] response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0] print(response) ``` ## Disclaimer The resources, including code, data, and model weights, associated with this project are restricted for academic research purposes only and cannot be used for commercial purposes. The content produced by any version of Infinity-Preference is influenced by uncontrollable variables such as randomness, and therefore, the accuracy of the output cannot be guaranteed by this project. This project does not accept any legal liability for the content of the model output, nor does it assume responsibility for any losses incurred due to the use of associated resources and output results. # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard) Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_BAAI__Gemma2-9B-IT-Simpo-Infinity-Preference) | Metric |Value| |-------------------|----:| |Avg. |20.97| |IFEval (0-Shot) |31.76| |BBH (3-Shot) |42.19| |MATH Lvl 5 (4-Shot)| 0.00| |GPQA (0-shot) |11.97| |MuSR (0-shot) | 8.10| |MMLU-PRO (5-shot) |31.82|