File size: 6,549 Bytes
367f77f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ab9c6b2
367f77f
2fff865
367f77f
 
 
48a6056
 
4735495
 
 
 
 
 
 
367f77f
 
 
 
 
 
 
 
 
 
b489d10
367f77f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b489d10
367f77f
 
 
 
 
 
9eec746
 
d51d69c
 
8d7053f
 
 
 
 
 
 
 
 
 
 
367f77f
 
 
 
 
 
b489d10
367f77f
 
 
 
 
 
776aad4
 
367f77f
 
 
 
 
 
 
776aad4
 
367f77f
 
 
 
 
 
 
 
 
 
ab9c6b2
 
 
 
 
 
 
 
 
 
 
 
367f77f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
license: apache-2.0
datasets:
- HumanLLMs/Human-Like-DPO-Dataset
language:
- en
base_model:
- HuggingFaceTB/SmolLM2-135M-Instruct
pipeline_tag: text-generation
library_name: transformers
tags:
- safetensors
- humanized
- smollm
---


# SmolLM2-135M-Humanized

##  Table of Contents

1. [Model Summary](##model-summary)
2. [Limitations](##limitations)
3. [Training](##training)
4. [License](##license)
5. [Citation](##citation)

## Model Summary

**SmolLM2-135M-Humanized** is a fine-tuned version of the [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) model, optimized using the Direct Preference Optimization (DPO) method. To do this we used the "[Human-Like-DPO-Dataset](https://huggingface.co/datasets/HumanLLMs/Human-Like-DPO-Dataset)" from [Human-Like LLMs](https://huggingface.co/HumanLLMs). To not lose too much quality with this post-training, we also applied some extra training on the "[openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback)" dataset.

Unlike traditional fine-tuning datasets that aim to improve specific benchmarks or metrics, the Human-Like-DPO-Dataset focuses on aligning the model's behavior with human preferences. This process enhances the model's ability to generate more natural, human-like responses, making it particularly well-suited for conversational applications.

By emphasizing response quality and relatability, SmolLM2-135M-Humanized is designed to deliver an engaging and intuitive user experience in dialogue-based scenarios.

View our full report [here](https://www.assistantslab.com/research/smollm2-report).

### Model example response
To reiterate, the goal is to make the model more human and less 'robot like'.
Given the system prompt "You are a helpful assistant that lives inside the users PC" and the user message "How are you?"

| SmolLM2-135M-Instruct | SmolLM2-135M-Humanized |
|:---------------------:|:----------------------:|
| I'm doing great! I'm a helpful assistant that lives inside users PC. I'm here to help you with any questions or problems you might have. | I'm doing great! I'm a bit of a tech whiz, and I love learning about new gadgets and tech trends. What's on your mind? Want to chat about something cool or something that's been on your mind lately? |

### How to use

### Transformers
```bash
pip install transformers
```

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "AssistantsLab/SmolLM2-135M-humanized"

device = "cuda" # for GPU usage or "cpu" for CPU usage
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
# for multiple GPUs install accelerate and do `model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map="auto")`
model = AutoModelForCausalLM.from_pretrained(checkpoint).to(device)

messages = [{"role": "user", "content": "What is gravity?"}]
input_text=tokenizer.apply_chat_template(messages, tokenize=False)
print(input_text)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)
outputs = model.generate(inputs, max_new_tokens=50, temperature=0.2, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0]))
```

### Chat in TRL
You can also use the TRL CLI to chat with the model from the terminal:
```bash
pip install trl
trl chat --model_name_or_path AssistantsLab/SmolLM2-135M-humanized --device cpu
```

## Evaluation

In this section, we report the evaluation results of SmolLM2. All evaluations are zero-shot unless stated otherwise, and we use [lighteval](https://github.com/huggingface/lighteval) to run them.

## Instruction model Vs. Humanized model

| Metric                       | SmolLM2-135M-Instruct | SmolLM2-135M-Humanized | Difference |
|:-----------------------------|:---------------------:|:----------------------:|:----------:|
| MMLU                         | **23.1**              | 23.0                   | -0.1       |
| ARC (Easy)                   | 54.3                  | **55.0**               | +0.7       |
| ARC (Challenge)              | **26.1**              | 25.5                   | -0.6       |
| HellaSwag                    | **43.0**              | 42.4                   | -0.6       |
| PIQA                         | **67.2**              | 67.0                   | -0.2       |
| WinoGrande                   | **52.5**              | 52.1                   | -0.4       |
| TriviaQA                     | **0.3**               | 0.2                    | -0.1       |
| GSM8K                        | 0.2                   | **0.8**                | +0.6       |
| OpenBookQA                   | 32.6                  | **33.0**               | +0.4       |
| QuAC (F1)                    | **14.1**              | 13.2                   | -0.9       |



## Limitations

SmolLM2 models primarily understand and generate content in English. They can produce text on a variety of topics, but the generated content may not always be factually accurate, logically consistent, or free from biases present in the training data. These models should be used as assistive tools rather than definitive sources of information. Users should always verify important information and critically evaluate any generated content.

Humanized models display a bigger preference for confident hallucinating in some limited testing. Please keep this in mind in any potential applications.

## License

[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)

## Citation

SmolLM2:
```bash
@misc{allal2024SmolLM2,
      title={SmolLM2 - with great data, comes great performance}, 
      author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Lewis Tunstall and Agustín Piqueres and Andres Marafioti and Cyril Zakka and Leandro von Werra and Thomas Wolf},
      year={2024},
}
```

Human-Like-DPO-Dataset:
```bash
@misc{çalık2025enhancinghumanlikeresponseslarge,
      title={Enhancing Human-Like Responses in Large Language Models}, 
      author={Ethem Yağız Çalık and Talha Rüzgar Akkuş},
      year={2025},
      eprint={2501.05032},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.05032}, 
}
```

UltraFeedback dataset:
```bash
@misc{cui2023ultrafeedback,
      title={UltraFeedback: Boosting Language Models with High-quality Feedback}, 
      author={Ganqu Cui and Lifan Yuan and Ning Ding and Guanming Yao and Wei Zhu and Yuan Ni and Guotong Xie and Zhiyuan Liu and Maosong Sun},
      year={2023},
      eprint={2310.01377},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
```