Info

This model is a homework assignment from LLM course from HSE University. It was trained on a human preference dataset.

Model & tokenizer: SmolLM2-135M-Instruct

It was fine-tuned using PPO from TRL with kl_coef=0.7, lr=3e-5 and gradient accumulation for 16 steps.

System prompt was deleted from tokenizer's chat template.

Training

Link to wandb run

Usage

tokenizer = AutoTokenizer.from_pretrained('ligaydima/llm-course-hw2-ppo')
model = AutoModelForCausalLM.from_pretrained('ligaydima/llm-course-hw2-ppo')

messages = [{"role": "user", "content": "What's your morning routine like?"}]

text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
model_inputs = tokenizer([text], return_tensors="pt").to(DEVICE)

generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=256, do_sample=True)
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]

print(response)

Comparison

Prompt: What's your morning routine like?

Before

My morning routine is a bit unconventional, but it's been a labor of love for me. I wake up before the sun rises, around 6:30 am. I head to the kitchen, where I fire up the coffee machine and start brewing a cup of coffee. I like to start my day with a cup of coffee, and I like to make it a ritual.

After brewing, I head to the gym, where I do a few sets of push-ups, squats, and lunges. I like to get some fresh air and get my blood flowing. I also like to do some stretching exercises, like leg raises and shoulder stretches, to help my muscles recover.

After my workout, I head to the kitchen to grab a quick breakfast. I usually grab a bagel or a cup of coffee, and then head to the office to get ready for the day. I like to get a good night's sleep, and I like to make sure I have a good cup of coffee and a healthy breakfast.

I also like to take a short walk around the block, just to clear my head and get some fresh air. I like to do some stretching exercises, like leg raises and shoulder stretches, to help my muscles recover...

After

My mornings are always a joy. As a child, I was always fascinated by the way the sun rises over the mountains. I remember waking up early, just like that, and watching the sun rise over the hills. It was like nothing I'd ever seen before. I'd sit there for hours, mesmerized, and then I'd go back to sleep, feeling like I'd seen it all.

As a kid, I was always curious about the world around me. I'd watch the sunrise from the top of my house, and it was like nothing I'd ever seen before. I'd sit there, mesmerized, and then I'd go back down, feeling like I'd seen it all. It was like I was seeing the world from a different perspective, and it was like nothing I'd ever seen before.

As I got older, my mornings became more like a ritual. I'd wake up early, just like that, and I'd start with a cup of tea and a warm cup of coffee. I'd sit there, just like that, and I'd listen to the birds singing, and I'd watch the sun rise over the mountains. It was like nothing I'd ever seen before.

I remember one time, I...

Quality report

The generation changed slightly towards more human-like behavior, but not as drastically as DPO.

Downloads last month
10
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including ligaydima/llm-course-hw2-ppo