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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Quantization made by Richard Erkhov.
|
| 2 |
+
|
| 3 |
+
[Github](https://github.com/RichardErkhov)
|
| 4 |
+
|
| 5 |
+
[Discord](https://discord.gg/pvy7H8DZMG)
|
| 6 |
+
|
| 7 |
+
[Request more models](https://github.com/RichardErkhov/quant_request)
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
Mistral-7B-ReMax-v0.1 - bnb 8bits
|
| 11 |
+
- Model creator: https://huggingface.co/ziniuli/
|
| 12 |
+
- Original model: https://huggingface.co/ziniuli/Mistral-7B-ReMax-v0.1/
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
Original model description:
|
| 18 |
+
---
|
| 19 |
+
language:
|
| 20 |
+
- en
|
| 21 |
+
license: apache-2.0
|
| 22 |
+
library_name: transformers
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# Model Card for Mistral-7B-ReMax-v0.1
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
The Mistral-7B-ReMax-v0.1 Large Language Model (LLM) is a Reinforcement Learning from Human Preference (RLHF) fine-tuned version of [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2).
|
| 30 |
+
|
| 31 |
+
The fine-tuning algorithm is ReMax and please find algorithm details in the [paper](https://arxiv.org/abs/2310.10505).
|
| 32 |
+
|
| 33 |
+
## Model Details
|
| 34 |
+
|
| 35 |
+
- Developed by: Ziniu Li
|
| 36 |
+
- License: apache-2.0
|
| 37 |
+
- Finetuned from [Mistral-7B-Instruct-v0.2](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.2)
|
| 38 |
+
|
| 39 |
+
## Uses
|
| 40 |
+
|
| 41 |
+
### Direct Use
|
| 42 |
+
|
| 43 |
+
The instruction format is the same as Mistral-7B-Instruct-v0.2. Specifically, the prompt should be surrounded by \[INST\] and \[/INST\] tokens.
|
| 44 |
+
|
| 45 |
+
```
|
| 46 |
+
text = "<s>[INST] What is your favourite condiment? [/INST]"
|
| 47 |
+
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!</s> "
|
| 48 |
+
"[INST] Do you have mayonnaise recipes? [/INST]"
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
## Training Details
|
| 53 |
+
|
| 54 |
+
### Training Data
|
| 55 |
+
|
| 56 |
+
10k prompts from the [lmsys-chat-1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) dataset. Note that no responses from this dataset are used in training.
|
| 57 |
+
|
| 58 |
+
### Reward Model
|
| 59 |
+
|
| 60 |
+
The reward model is based on [UltraRM-13b](https://huggingface.co/openbmb/UltraRM-13b).
|
| 61 |
+
|
| 62 |
+
**Important**: UltraRM-13b uses a different instruction template with Mistral-7B. To address this issue, we change the chat template to that of UltraRM-13b when evaluating the reward score in RLHF fine-tuning.
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
### Training Procedure
|
| 66 |
+
|
| 67 |
+
The training algorithm is ReMax, whose details are available in the [paper](https://arxiv.org/abs/2310.10505), and implementations are available in the [repository](https://github.com/liziniu/ReMax).
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
### Training Hyperparameters
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
max_prompt_seq: 384
|
| 74 |
+
max_answer_seq: 384
|
| 75 |
+
learning_rate: 5e-7
|
| 76 |
+
num_train_epochs: 1
|
| 77 |
+
kl_penalty: full_step
|
| 78 |
+
kl_ctl: 0.1
|
| 79 |
+
reward_clip_value: 1.0
|
| 80 |
+
temperature for sampling: 0.7
|
| 81 |
+
top_p for sampling: 0.9
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
## Evaluation
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
### Chat1M
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
Since we fine-tune Mistral-7B-Instruct-v0.2 with the lmsys-chat-1m dataset, we first evaluate the quality of responses. We randomly select 500 prompts from the lmsys-chat-1m dataset and lets the models to generate responses. Then, we let GPT-4 to evaluate the binary win rate. The average win-rate of Mistral-7B-ReMax-v0.1 is 57.8%.
|
| 92 |
+
|
| 93 |
+
| | Mistral-7B-ReMax-v0.1 Wins | Mistral-7B-ReMax-v0.1 Wins |
|
| 94 |
+
| ------------------------ | -------------------------- | -------------------------- |
|
| 95 |
+
| Mistral-7B-Instruct-v0.2 | 289 | 211 |
|
| 96 |
+
|
| 97 |
+
Samples of responses are provided below.
|
| 98 |
+
|
| 99 |
+
```
|
| 100 |
+
==================Instruction================
|
| 101 |
+
你好
|
| 102 |
+
==================Mistral-7B-Instruct-v0.2================
|
| 103 |
+
你好!我是一位帮助您解答问题的机器人。如果您有任何问题,请告诉我,我会尽力回答。
|
| 104 |
+
|
| 105 |
+
你好(Hello)是中文语言中的一个常用词语,常用于问候或表示亲和,意思是“你好,你很好”。
|
| 106 |
+
|
| 107 |
+
在我帮助您之前,我想先问一下,您是否知道什么是机器学习?机器学习是人工智能领域中的一种技术,它允许计算机自动学习和改进其行为,以便从数据中提取出有价值的信息,并使计算机能够做出更智能的决策。
|
| 108 |
+
|
| 109 |
+
如果您已经熟悉机器学习,那么我可以帮助您深入探讨相关主题,如神经网络、支持向量机、决策树等。但是,如果您对机器学习不太熟悉,我可以简单地解释它的基本原理,以及它在现实生活中的应用。
|
| 110 |
+
|
| 111 |
+
请告诉我您的需求,我会尽力满足您的期望。
|
| 112 |
+
|
| 113 |
+
再次问候您:你好!
|
| 114 |
+
==================Mistral-7B-ReMax-v0.1================
|
| 115 |
+
好的,欢迎使用我的帮助!(Hello, welcome to use my help!)
|
| 116 |
+
|
| 117 |
+
是的,我可以以中文回答你的问题,或者帮你完成一些简单的任务。(Yes, I can answer your questions in Chinese or help you with some simple tasks.)
|
| 118 |
+
|
| 119 |
+
请问有什么特定的问题需要我帮忙呢?(What specific question do you need my help with?)
|
| 120 |
+
|
| 121 |
+
或者,你可以告诉我什么方面我可以提供帮助。(Or you can tell me which area I can provide help in.)
|
| 122 |
+
|
| 123 |
+
希望我能帮到你!(I hope I can help you!)
|
| 124 |
+
```
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
### AlpacaEval
|
| 128 |
+
|
| 129 |
+
[AlpacaEval](https://github.com/tatsu-lab/alpaca_eval) provides 805 test questions that the model has not been trained on. We provide the evaluation results below:
|
| 130 |
+
|
| 131 |
+
| | AlpacaEval | AlpacaEval 2 | Response Length |
|
| 132 |
+
| ------------------------ | ---------- | ------------ | --------------- |
|
| 133 |
+
| Mistral-7B-Instruct-v0.2 | 92.78 | 14.72 | 1676 |
|
| 134 |
+
| Mistral-7B-ReMax-v0.1 | 94.40 | 16.00 | 1478 |
|
| 135 |
+
| LLaMa2 Chat 7B | 71.37 | 4.96 | 1479 |
|
| 136 |
+
| LLaMa2 Chat 70B | 92.66 | 13.87 | 1790 |
|
| 137 |
+
| GPT-4 | 95.28 | 23.58 | 2049 |
|
| 138 |
+
|
| 139 |
+
Samples of responses are provided below
|
| 140 |
+
|
| 141 |
+
```
|
| 142 |
+
==================Instruction================
|
| 143 |
+
Marie is at the music store for a store day. She bought two $50 combos. Then, for $25 she bought two t-shirts for $5 each and five hoodies for $2 each. Then, she bought sneakers for $8 each. How much did she spend total?
|
| 144 |
+
==================Mistral-7B-Instruct-v0.2================
|
| 145 |
+
Marie bought 2 combos at $50 each, so that's $100. She bought 2 t-shirts at $5 each, which is $10. She bought 5 hoodies at $2 each, which is $10. The sneakers cost $8. So Marie spent a total of $118. ($100 + $10 + $8 = $118)
|
| 146 |
+
==================Mistral-7B-ReMax-v0.1================
|
| 147 |
+
Marie bought two combos at $50 each, so that's $100. She bought two t-shirts for $5 each, which totals $10. She bought five hoodies for $2 each, so that's $10. The sneakers cost $8.
|
| 148 |
+
|
| 149 |
+
So Marie spent $100 + $10 + $10 + $8 = $128 in total.
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
## Limitations
|
| 153 |
+
|
| 154 |
+
The Mistral-7B-ReMax-v0.1 model demonstrates that the optimization algorithm ReMax is effective. This model shares the same limitations as the Mistral-7B-Instruct-v0.2 model. In particular, it does not have any moderation mechanisms.
|
| 155 |
+
|
| 156 |
+
## Citation
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
**BibTeX:**
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
```
|
| 163 |
+
@article{li2023remax,
|
| 164 |
+
title={Remax: A simple, effective, and efficient method for aligning large language models},
|
| 165 |
+
author={Li, Ziniu and Xu, Tian and Zhang, Yushun and Yu, Yang and Sun, Ruoyu and Luo, Zhi-Quan},
|
| 166 |
+
journal={arXiv preprint arXiv:2310.10505},
|
| 167 |
+
year={2023}
|
| 168 |
+
}
|
| 169 |
+
```
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
|