File size: 6,256 Bytes
1d24a42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62cad89
1d24a42
e208f70
 
 
 
8426368
e208f70
 
 
 
1d24a42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50b6440
 
 
1d24a42
 
93c2b0a
 
 
 
 
 
 
1d24a42
93c2b0a
 
1d24a42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
datasets:
- HumanLLMs/Human-Like-DPO-Dataset
language:
- en
base_model:
- HuggingFaceTB/SmolLM2-1.7B-Instruct
pipeline_tag: text-generation
library_name: transformers
tags:
- safetensors
- humanized
- smollm
---


# SmolLM2-1.7B-Humanized

##  Table of Contents

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

## Model Summary

**SmolLM2-1.7B-Humanized** is a fine-tuned version of the [SmolLM2-1.7B-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-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).

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-1.7B-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-1.7B-Instruct | SmolLM2-1.7B-Humanized |
|:---------------------:|:----------------------:|
| I'm functioning as intended, ready to assist you with your queries. | I'm doing great! It's a pleasure to help you with anything you need. How about you? How are you today? |


### How to use

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

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "AssistantsLab/SmolLM2-1.7B-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-1.7B-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

### Note
We observe an unexpectedly worse TriviaQA score compared to the base instruct model. A bit of training on a dataset such as squad-v2 quickly resolves this issue and just one epoch results in a TriviaQA score far above the base instruct model (>21). We did not release this model due to worse scores on different metrics after this one epoch training. If your specific use-case requires a better grasp of trivia, feel free to train on squad-v2.

| Metric                       | SmolLM2-1.7B-Instruct | SmolLM2-1.7B-Humanized | Difference |
|:-----------------------------|:---------------------:|:----------------------:|:----------:|
| MMLU                         | **49.5**              | 48.8                   | -0.7       |
| ARC (Easy)                   | **68.9**              | 64.9                   | -4.0       |
| ARC (Challenge)              | 38.5                  | **40.3**               | +1.8       |
| HellaSwag                    | **71.7**              | 71.3                   | -0.4       |
| PIQA                         | **76.2**              | 75.8                   | -0.6       |
| WinoGrande                   | **62.5**              | 61.2                   | -1.3       |
| TriviaQA                     | **10.2**              | 1.3                    | -8.9       |
| GSM8K                        | **0.0**               | **0.0**                | +0.0       |
| OpenBookQA                   | **45.6**              | 44.8                   | -0.8       |
| QuAC (F1)                    | 30.2                  | **31.1**               | +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}, 
}
```