EmpathLM is a fine-tuned version of
SmolLM2-135M-Instruct
trained to generate responses that combine
Motivational Interviewing (MI) and
Cognitive Behavioral Therapy (CBT) principles.
EmpathLM was benchmarked against GPT-4o-mini and a Groq baseline on 20 unseen test situations,
scored across: emotional_validation, advice_avoidance, perspective_shift, and overall_empathy.
1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3tokenizer = AutoTokenizer.from_pretrained("maliksaad/empathLM")
4model = AutoModelForCausalLM.from_pretrained("maliksaad/empathLM")
5
6SYSTEM_PROMPT = """You are EmpathLM — an emotionally intelligent AI trained in Motivational Interviewing
7and Cognitive Behavioral Therapy. When someone shares emotional pain:
8- Validate their feelings without judgment
9- Reflect their emotions back to them
10- Ask one powerful open-ended question
11- NEVER give unsolicited advice"""
12
13messages = [
14 {"role": "system", "content": SYSTEM_PROMPT},
15 {"role": "user", "content": "I failed my exam again. I feel like I'm just not smart enough."},
16]
17
18inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)
19outputs = model.generate(inputs, max_new_tokens=200, temperature=0.7)
20print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))
1@model{saad2025empathLM,
2 title = {EmpathLM: A Psychologically-Grounded Empathetic Response Model},
3 author = {Muhammad Saad},
4 year = {2025},
5 url = {https://huggingface.co/maliksaad/empathLM}
6}