File size: 7,298 Bytes
fb1cbd9
 
 
 
 
 
 
 
 
 
5f4cc4f
fb1cbd9
 
 
 
 
5ab84bb
4609ffc
 
c64c13c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fb1cbd9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df38374
 
 
c64c13c
4609ffc
f4610d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
---
language:
  - en
thumbnail: null
tags:
  - text generation
  - instruct
pipeline_tag: text-generation
inference: false
---
<h1 style="text-align: center">Metharme 7B 4bit</h1>
<h2 style="text-align: center">An instruction-tuned LLaMA biased towards fiction writing and conversation.</h2>

## Model Details

Converted from the XORs weights from PygmalionAI's release https://huggingface.co/PygmalionAI/metharme-7b

  Quantized for KoboldAI use using https://github.com/0cc4m/GPTQ-for-LLaMa
  
I created several quantized variations of this model and believe this variation to be "best." <br>
<!DOCTYPE html>
<html>
<head>
	<title>HTML Table Generator</title> 
	<style>
		table {
			border:1px solid #b3adad;
			border-collapse:collapse;
			padding:5px;
		}
		table th {
			border:1px solid #b3adad;
			padding:5px;
			background: #f0f0f0;
			color: #313030;
		}
		table td {
			border:1px solid #b3adad;
			text-align:center;
			padding:5px;
			background: #ffffff;
			color: #313030;
		}
	</style>
</head>
<body>
	<table>
		<thead>
			<tr>
				<th>GPTQ Variation:</th>
				<th>Wikitext2</th>
				<th>Ptb-New</th>
				<th>C4-New</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>&nbsp;--act-order</td>
				<td>&nbsp;6.281311511993408</td>
				<td>&nbsp;46.79158401489258</td>
				<td>&nbsp;7.906069755554199</td>
			</tr>
		</tbody>
	</table>
</body>
</html>
<br>Other benchmark scores at the bottom of readme.
<hr>
Metharme 7B is an instruct model based on Meta's LLaMA-7B.

This is an experiment to try and get a model that is usable for conversation, roleplaying and storywriting, but which can be guided using natural language like other instruct models. See the [prompting](#prompting) section below for examples.

It was trained by doing supervised fine-tuning over a mixture of regular instruction data alongside roleplay, fictional stories and conversations with synthetically generated instructions attached.

## Prompting

The current model version has been trained on prompts using three different roles, which are denoted by the following tokens: `<|system|>`, `<|user|>` and `<|model|>`.

The `<|system|>` prompt can be used to inject out-of-channel information behind the scenes, while the `<|user|>` prompt should be used to indicate user input. The `<|model|>` token should then be used to indicate that the model should generate a response. These tokens can happen multiple times and be chained up to form a conversation history.

### Prompting example

Here's a concrete example. Let's say you have the following system prompt:

> This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.

And the user has typed in the following message:

> Start!

To perform inference against the model, the prompt should be formatted like this:

```
<|system|>This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.<|user|>Start!<|model|>
```

The model might generate something like:

> You are standing in front of an old, abandoned house. The windows are boarded up, and there's no sign of life around it. As you approach, you notice a strange feeling emanating from within. Suddenly, you hear a voice calling out to you... 'Come inside!'
>
> - Go inside the house.
> - Ignore the call and move away.
> - Run as fast as you can.

It will automatically emit an end-of-text token (`</s>`) when it judges that the response is complete.

Pretend then that the user has replied with `go inside`. The next prompt should then be:

```
<|system|>This is a text adventure game. Describe the scenario to the user and give him three options to pick from on each turn.<|user|>Start!<|model|>You are standing in front of an old, abandoned house. The windows are boarded up, and there's no sign of life around it. As you approach, you notice a strange feeling emanating from within. Suddenly, you hear a voice calling out to you... 'Come inside!'

- Go inside the house.
- Ignore the call and move away.
- Run as fast as you can.<|user|>go inside<|model|>
```

Which might generate something like:

> You enter the house, and immediately, a wave of unsettling energy washes over you. Your senses seem heightened, but your mind feels foggy. A figure appears before you - a tall man with piercing eyes. He speaks to you in a language you don't understand.
>
> - Ask him what he wants.
> - Attack him.
> - Run away.

Same process applies. Usually, it is best to do a sliding window over the user and model turns, but keep the system prompt fixed at the start of the context window.

## Limitations and biases

The intended use-case for this model is fictional writing for entertainment purposes. Any other sort of usage is out of scope.

As such, it was **not** fine-tuned to be safe and harmless: the base model _and_ this fine-tune have been trained on data known to contain profanity and texts that are lewd or otherwise offensive. It may produce socially unacceptable or undesirable text, even if the prompt itself does not include anything explicitly offensive. Outputs might often be factually wrong or misleading.


<p><strong><font size="5">Benchmarks of different quantize variations</font></strong></p>
<hr>
<!DOCTYPE html>
<html>
<head>
	<title>HTML Table Generator</title> 
	<style>
		table {
			border:1px solid #b3adad;
			border-collapse:collapse;
			padding:5px;
		}
		table th {
			border:1px solid #b3adad;
			padding:5px;
			background: #f0f0f0;
			color: #313030;
		}
		table td {
			border:1px solid #b3adad;
			text-align:center;
			padding:5px;
			background: #ffffff;
			color: #313030;
		}
	</style>
</head>
<body>
	<table>
		<thead>
			<tr>
				<th>GPTQ Variation:</th>
				<th>Wikitext2</th>
				<th>Ptb-New</th>
				<th>C4-New</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>nothing</td>
				<td>6.997134685516357&nbsp;</td>
				<td>&nbsp;58.87525177001953</td>
				<td>&nbsp;8.824191093444824</td>
			</tr>
			<tr>
				<td>--act-order</td>
				<td>6.281311511993408&nbsp;</td>
				<td>46.79158401489258&nbsp;</td>
				<td>7.906069755554199&nbsp;</td>
			</tr>
			<tr>
				<td>--groupsize 32</td>
				<td>6.902080535888672&nbsp;</td>
				<td>50.237754821777344&nbsp;</td>
				<td>8.081602096557617&nbsp;</td>
			</tr>
			<tr>
				<td>--groupsize 128</td>
				<td>&nbsp;10.206376075744629</td>
				<td>49.00401306152344&nbsp;</td>
				<td>&nbsp;8.198845863342285</td>
			</tr>
			<tr>
				<td>&nbsp;--true-sequential</td>
				<td>7.735969543457031&nbsp;</td>
				<td>62.92238235473633&nbsp;</td>
				<td>&nbsp;8.913650512695312</td>
			</tr>
			<tr>
				<td>--true-sequential --groupsize 32</td>
				<td>&nbsp;6.424218654632568</td>
				<td>&nbsp;48.48588943481445</td>
				<td>&nbsp;8.089512825012207</td>
			</tr>
			<tr>
				<td>&nbsp;--true-sequential --groupsize 128</td>
				<td>&nbsp;9.475017547607422</td>
				<td>&nbsp;52.358829498291016</td>
				<td>&nbsp;8.340700149536133</td>
			</tr>
			<tr>
				<td>&nbsp;--act-order --groupsize 32</td>
				<td>&nbsp;275425.5</td>
				<td>267733.25&nbsp;</td>
				<td>&nbsp;254506.71875</td>
			</tr>
			<tr>
				<td>&nbsp;--act-order --groupsize 128</td>
				<td>&nbsp;251321.265625</td>
				<td>&nbsp;250117.859375</td>
				<td>&nbsp;232929.234375</td>
			</tr>
		</tbody>
	</table>
</body>
</html>