Views
No views yet
Columbia-NLP/LION-Gemma-2b-dpo-v1.0 using online DPO from the LION pipeline.gemma-2bColumbia-NLP/LION-Gemma-2b-dpo-v1.0| Model | Method | Size | Arena-Hard | AlpacaEval-2 | MT-Bench | OpenLLM |
|---|---|---|---|---|---|---|
| Gemma-2b | - | 2B | - | - | - | 46.69 |
| Gemma-2b-it | SFT+RLHF | 2B | 3.4 | 5.44 | 5.63 | 42.75 |
| Gemma-2b-zephyr | SFT+DPO | 2B | 0.9 | 2.65 | 4.13 | 46.92 |
| LLaMA-2-7b-chat | SFT | 7B | 4.6 | 5.35 | 6.22 | 53.16 |
| Vicuna-7b-v1.5 | SFT | 7B | 2.5 | 7.62 | 6.57 | 52.06 |
| LION-Gemma-2b-sft-v1.0 (ours) | SFT | 2B | 2.4 | 7.79 | 6.37 | 54.78 |
| LION-Gemma-2b-dpo-v1.0 (ours) | SFT+DPO | 2B | 4.6 | 8.75 | 6.58 | 55.35 |
| ⮕ LION-Gemma-2b-odpo-v1.0 (ours) | SFT+DPO+ODPO | 2B | 5.0 | 9.57 | 6.75 | 55.98 |
1import torch
2from transformers import pipeline
3
4pipe = pipeline(
5 "text-generation",
6 model="Columbia-NLP/LION-Gemma-2b-odpo-v1.0",
7 device_map="auto",
8 torch_dtype=torch.bfloat16,
9)
10messages = [
11 {
12 "role": "system",
13 "content": "",
14 },
15 {
16 "role": "user",
17 "content": "Write a short paragraph where every sentence start with the letter A."
18 },
19]
20outputs = pipe(
21 messages,
22 max_new_tokens=128,
23 do_sample=True,
24 temperature=0.7,
25 top_p=0.7,
26 stop_sequence="<|im_end|>",
27)
28print(outputs[0]["generated_text"][-1]["content"])
29# Alice always aspired to acquire ample adventure.
30# Astonishingly, amid abundant allurements, Alice allocated ample attention to each activity, ensuring an array of adventures.
31# Albeit anxieties arose, Alice assuaged them with affirmations, ardently advancing ambitiously towards an array of adventures.1tokenizer = AutoTokenizer.from_pretrained("Columbia-NLP/LION-Gemma-2b-odpo-v1.0")
2prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
3print(prompt)
4# tokenize prompt and use model.generate@misc{yu2024lionsempiricallyoptimizedapproach,
title={LIONs: An Empirically Optimized Approach to Align Language Models},
author={Xiao Yu and Qingyang Wu and Yu Li and Zhou Yu},
year={2024},
eprint={2407.06542},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2407.06542},
}