--- language: - en thumbnail: null tags: - text generation - instruct pipeline_tag: text-generation inference: false ---

Metharme 7B 4bit

An instruction-tuned LLaMA biased towards fiction writing and conversation.

## 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."
Model: Wikitext 2 Ptb-New C4-New
Metharme 7b - 16bit 5.7208476066589355 41.61103439331055 7.512405872344971
Metharme 7b - 4bit --act-order 6.281311511993408 46.79158401489258 7.906069755554199

Other benchmark scores at the bottom of readme.
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 (``) 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.

Benchmarks of different quantized variations

GPTQ Variation: Wikitext2 Ptb-New C4-New
nothing 6.997134685516357 58.87525177001953 8.824191093444824
--act-order 6.281311511993408 46.79158401489258 7.906069755554199
--groupsize 32 6.902080535888672 50.237754821777344 8.081602096557617
--groupsize 128 10.206376075744629 49.00401306152344 8.198845863342285
--true-sequential 7.735969543457031 62.92238235473633 8.913650512695312
--true-sequential --groupsize 32 6.424218654632568 48.48588943481445 8.089512825012207
--true-sequential --groupsize 128 9.475017547607422 52.358829498291016 8.340700149536133
--act-order --groupsize 32 275425.5 267733.25 254506.71875
--act-order --groupsize 128 251321.265625 250117.859375 232929.234375