Original model: https://huggingface.co/google/gemma-2-2b-jpn-it
Prompt format
<start_of_turn>user
{prompt}<end_of_turn>
<start_of_turn>model
<end_of_turn>
<start_of_turn>model
Note that this model does not support a System prompt.
Since gemma-2-2b-jpn-it-ablitered-18 is slightly brain damaged compare to the original gemma-2-2b-jpn-it. I decided to try ORPO fine tuning to see if it can be headled.
Using the gemma-2-2b base model, I employed the ORPO method described by mlabonne but the input model was read into VRAM by unsloth to allow using the full 40k dataset to run on a single 3090.
Five epoches was run. Smallest eval_loss was achieve at epoch 7.72. Checkpoint at epoch 7.72 is used to obtain a model adapter and applied it to gemma-2-2b-jpn-it-ablitered-18 to obtain gemma-2-2b-ORPO-jpn-it-ablitered-18.
Epoch | loss | eval_loss | eval_logps/rejected | eval_logps/chosen |
---|---|---|---|---|
1.00 | 1.2868 | 1.0689 | -1.0857 | -0.7500 |
2.00 | 0.9663 | 1.0288 | -1.1321 | -0.7289 |
3.00 | 1.2255 | 1.0297 | -1.1840 | -0.7272 |
4.00 | 1.5293 | 1.0166 | -1.2004 | -0.7200 |
4.96 | 1.2893 | 1.0077 | -1.1754 | -0.7106 |
5.00 | 1.3458 | 1.0078 | -1.1730 | -0.7105 |
6.00 | 1.3807 | 0.9924 | -1.1757 | -0.6971 |
7.00 | 1.0855 | 0.9889 | -1.2634 | -0.7235 |
7.72 | 0.8720 | 0.9855 | -1.2374 | -0.7100 |
8.00 | 0.7301 | 0.9864 | -1.2406 | -0.7113 |
9.00 | 1.1939 | 0.9934 | -1.2703 | -0.6852 |
10.00 | 0.7421 | 1.0269 | -1.2552 | -0.7395 |
Then I followed Rombodawg's suggestion to merge gemma-2-2b, gemma-2-2b-ORPO-jpn-it-ablitered-18 and gemma-2-2b-jpn-it-ablitered-18 to obtain this model.
This model is uploaded here to be evaluated by the Open LLM Leaderboard. Further ORPO fine tuning is currently underway to see if it can regain its sanity. You can play with this model first or wait until I am done with the fine tuning.
Benchmark (100.0*raw scores only)
Click on the model name go to the raw score json generated by Open LLM Leaderboard.
Model | Average | IFEval | BHH | Math Lv5 | GPQA | MUSR | MMLU-PRO |
---|---|---|---|---|---|---|---|
gemma-2-2b-jpn-it | 30.82 | 54.11 | 41.43 | 0.0 | 27.52 | 37.17 | 24.67 |
gemma-2-2b-ORPO-jpn-it-abliterated-18-merge (5 epoches) | 29.26 | 49.16 | 38.15 | 2.49 | 28.19 | 33.07 | 24.51 |
gemma-2-2b-ORPO-jpn-it-abliterated-18-merge (10 epoches) | TBD | TBD | TBD | TBD | TBD | TBD | TBD |
gemma-2-2b-ORPO-jpn-it-abliterated-18 (5 epoches) | 29.57 | 48.05 | 41.26 | 0.0 | 27.18 | 36.51 | 24.43 |
gemma-2-2b-ORPO-jpn-it-abliterated-18 (10 epoches) | TBD | TBD | TBD | TBD | TBD | TBD | TBD |
gemma-2-2b-jpn-it-abliterated-17 | 30.29 | 52.65 | 40.46 | 0.0 | 27.18 | 36.90 | 24.55 |
gemma-2-2b-jpn-it-abliterated-18 | 30.61 | 53.02 | 40.96 | 0.0 | 27.35 | 37.30 | 25.05 |
gemma-2-2b-jpn-it-abliterated-24 | 30.61 | 51.37 | 40.77 | 0.0 | 27.77 | 39.02 | 24.73 |
How to run this model
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model_id = "gemma-2-2b-ORPO-jpn-it-abliterated-18-merge"
dtype = torch.bfloat16
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="cuda",
torch_dtype=dtype,)
chat = [
{ "role": "user", "content": "Write a hello world program" },
]
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
Downloading using huggingface-cli
First, make sure you have hugginface-cli installed:
pip install -U "huggingface_hub[cli]"
Then, you can target the specific file you want:
huggingface-cli download ymcki/gemma-2-2b-ORPO-jpn-it-abliterated-18-merge --include "*" --local-dir ./
Credits
Thank you mlabonne for describing the ORPO fine tuning method.
Thank you FullOf_Bad_Ideas from LocalLlama for the suggestion of using unsloth to save VRAM.
- Downloads last month
- 28