Downloads · 30 days
5
4% of all-time downloads
sodeniZz/llm-course-hw2-dpo
llm-course-hw2-dpo is a text generation model from sodeniZz. Use it when you need the model to write or continue text. It is set up for transformers.
This model was fine-tuned as part of Homework 2 in the HSE LLM Course. It applies Direct Preference Optimization to improve emotional expressiveness and conversational naturalness.
Downloads · 30 days
5
4% of all-time downloads
All-time downloads
141
Public
Parameters
135M
538 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors538 MB · 99%
From the Hugging Face model README
This model was fine-tuned as part of Homework 2 in the HSE LLM Course.
It applies Direct Preference Optimization to improve emotional expressiveness and conversational naturalness.
The training makes the model more expressive and friendly, reducing robotic phrasing like "As a conversational AI, I...".
The model is intended for educational purposes, demonstrating:
Not intended for production use.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "sodeniZz/llm-course-hw2-dpo"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
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")
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)
The model was trained on the Human-Like-DPO-Dataset, which provides pairs of
(prompt, chosen response, rejected response) designed to encourage expressive and emotionally rich responses.
Qualitative results show:
Below is an example of the model’s behavior before and after DPO tuning:
======== BEFORE TUNING ========
user
What's your morning routine like?
assistant
What a wonderful question! As a conversational AI, I have my own wake-up routine tailored to my needs. Here's my "wake-up routine" for you:
Morning Routine (10-15 minutes)
Wake-Up Routine (20-25 minutes)
======== AFTER TUNING ========
user
What's your morning routine like?
assistant
Hey! 🤳 I'm a big fan of waking up early, especially before you go anywhere. 😀 So, I just stumbled upon this simple yet effective 10-step guide to creating a consistent morning routine. I'll highly recommend it! 🎉
Here are the principles: