Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,179 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- ai2_arc
|
5 |
+
- unalignment/spicy-3.1
|
6 |
+
- codeparrot/apps
|
7 |
+
- facebook/belebele
|
8 |
+
- boolq
|
9 |
+
- jondurbin/cinematika-v0.1
|
10 |
+
- drop
|
11 |
+
- lmsys/lmsys-chat-1m
|
12 |
+
- TIGER-Lab/MathInstruct
|
13 |
+
- cais/mmlu
|
14 |
+
- Muennighoff/natural-instructions
|
15 |
+
- openbookqa
|
16 |
+
- piqa
|
17 |
+
- Vezora/Tested-22k-Python-Alpaca
|
18 |
+
- cakiki/rosetta-code
|
19 |
+
- Open-Orca/SlimOrca
|
20 |
+
- spider
|
21 |
+
- squad_v2
|
22 |
+
- migtissera/Synthia-v1.3
|
23 |
+
- datasets/winogrande
|
24 |
+
- nvidia/HelpSteer
|
25 |
+
- Intel/orca_dpo_pairs
|
26 |
+
- unalignment/toxic-dpo-v0.1
|
27 |
+
- jondurbin/truthy-dpo-v0.1
|
28 |
+
- allenai/ultrafeedback_binarized_cleaned
|
29 |
+
- Squish42/bluemoon-fandom-1-1-rp-cleaned
|
30 |
+
- LDJnr/Capybara
|
31 |
+
- JULIELab/EmoBank
|
32 |
+
- kingbri/PIPPA-shareGPT
|
33 |
---
|
34 |
+
|
35 |
+
# A bagel, with everything
|
36 |
+
|
37 |
+
![bagel](bagel.png)
|
38 |
+
|
39 |
+
## Overview
|
40 |
+
|
41 |
+
An experimental fine-tune of [mamba-2.8b-slimpj](https://hf.co/state-spaces/mamba-2.8b-slimpj) using [bagel](https://github.com/jondurbin/bagel)
|
42 |
+
|
43 |
+
Default recommended system prompt:
|
44 |
+
```
|
45 |
+
You are a helpful, unbiased, uncensored assistant.
|
46 |
+
```
|
47 |
+
|
48 |
+
Supports several prompt formats, but you can also use `tokenizer.apply_chat_template`
|
49 |
+
|
50 |
+
## SFT data sources
|
51 |
+
|
52 |
+
*Yes, you will see benchmark names in the list, but this only uses the train splits, and a decontamination by cosine similarity is performed at the end as a sanity check*
|
53 |
+
|
54 |
+
- [ai2_arc](https://huggingface.co/datasets/ai2_arc)
|
55 |
+
- Abstraction and reasoning dataset, useful in measuring "intelligence" to a certain extent.
|
56 |
+
- [airoboros](https://huggingface.co/datasets/unalignment/spicy-3.1)
|
57 |
+
- Variety of categories of synthetic instructions generated by gpt-4.
|
58 |
+
- [apps](https://huggingface.co/datasets/codeparrot/apps)
|
59 |
+
- Python coding dataset with 10k problems.
|
60 |
+
- [belebele](https://huggingface.co/datasets/facebook/belebele)
|
61 |
+
- Multi-lingual reading comprehension dataset.
|
62 |
+
- [bluemoon](https://huggingface.co/datasets/Squish42/bluemoon-fandom-1-1-rp-cleaned)
|
63 |
+
- Roleplay data scraped from Bluemoon, then cleaned and formatted as ShareGPT.
|
64 |
+
- [boolq](https://huggingface.co/datasets/boolq)
|
65 |
+
- Corpus of yes/no questions (which can be surprisingly difficult for AI to answer apparently?)
|
66 |
+
- [capybara](https://huggingface.co/datasets/LDJnr/Capybara)
|
67 |
+
- Multi-turn dataset used to create the capybara models.
|
68 |
+
- [cinematika](https://huggingface.co/datasets/jondurbin/cinematika-v0.1) (instruction and plain text)
|
69 |
+
- RP-style data synthesized from movie scripts so the model isn't quite as boring as it otherwise would be.
|
70 |
+
- [drop](https://huggingface.co/datasets/drop)
|
71 |
+
- More reading comprehension.
|
72 |
+
- [emobank](https://github.com/JULIELab/EmoBank)
|
73 |
+
- Emotion annotations using the Valence-Arousal-Domninance scheme.
|
74 |
+
- [gutenberg](https://www.gutenberg.org/) (plain text)
|
75 |
+
- Books/plain text, again to make the model less boring, only a handful of examples supported by [chapterize](https://github.com/JonathanReeve/chapterize)
|
76 |
+
- [lmsys_chat_1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) (only gpt-4 items, also used for DPO)
|
77 |
+
- Chats collected by the lmsys chat arena, containing a wide variety of chats with various models.
|
78 |
+
- [mathinstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
|
79 |
+
- Composite dataset with a variety of math-related tasks and problem/question formats.
|
80 |
+
- [mmlu](https://huggingface.co/datasets/cais/mmlu)
|
81 |
+
- Massive Multitask Language Understanding - a wide variety of questions about various subject matters.
|
82 |
+
- [natural_instructions](https://huggingface.co/datasets/Muennighoff/natural-instructions)
|
83 |
+
- Millions of instructions from 1600+ task categories (sampled down substantially, stratified by task type)
|
84 |
+
- [openbookqa](https://huggingface.co/datasets/openbookqa)
|
85 |
+
- Question answering dataset.
|
86 |
+
- [pippa](https://huggingface.co/datasets/kingbri/PIPPA-shareGPT)
|
87 |
+
- Deduped version of [PIPPA](https://huggingface.co/datasets/PygmalionAI/PIPPA) in ShareGPT format.
|
88 |
+
- [piqa](https://huggingface.co/datasets/piqa)
|
89 |
+
- Phyiscal interaction question answering.
|
90 |
+
- [python_alpaca](https://huggingface.co/datasets/Vezora/Tested-22k-Python-Alpaca)
|
91 |
+
- Python instruction response pairs, validated as functional.
|
92 |
+
- [rosetta_code](https://huggingface.co/datasets/cakiki/rosetta-code)
|
93 |
+
- Code problems and solutions in a variety of programming languages taken from rosettacode.org.
|
94 |
+
- [slimorca](https://huggingface.co/datasets/Open-Orca/SlimOrca)
|
95 |
+
- Collection of ~500k gpt-4 verified chats from OpenOrca.
|
96 |
+
- [spider](https://huggingface.co/datasets/spider)
|
97 |
+
- SQL-targeted dataset.
|
98 |
+
- [squad_v2](https://huggingface.co/datasets/squad_v2)
|
99 |
+
- Contextual question answering (RAG).
|
100 |
+
- [synthia](https://huggingface.co/datasets/migtissera/Synthia-v1.3)
|
101 |
+
- GPT-4 generated data using advanced prompting from Migel Tissera.
|
102 |
+
- [winogrande](https://huggingface.co/datasets/winogrande)
|
103 |
+
- Fill in the blank style prompts.
|
104 |
+
|
105 |
+
## DPO data sources
|
106 |
+
|
107 |
+
- [airoboros 3.1](https://huggingface.co/datasets/unalignment/spicy-3.1) vs [airoboros 2.2.1](https://huggingface.co/datasets/jondurbin/airoboros-gpt4-1.4.1)
|
108 |
+
- The creative/writing tasks from airoboros-2.2.1 were re-generated using gpt4-0314 and a custom prompt to get longer, more creative, less clichè responses for airoboros 3.1, so we can use the shorter/boring version as the "rejected" value and the rerolled response as "chosen"
|
109 |
+
- [helpsteer](https://huggingface.co/datasets/nvidia/HelpSteer)
|
110 |
+
- Really neat dataset provided by the folks at NVidia with human annotation across a variety of metrics. Only items with the highest "correctness" value were used for DPO here, with the highest scoring output as "chosen" and random lower scoring value as "rejected"
|
111 |
+
- [orca_dpo_pairs](https://huggingface.co/datasets/Intel/orca_dpo_pairs)
|
112 |
+
- Another interesting dataset by Intel, which provides various DPO pairs generated from prompts included in the SlimOrca dataset.
|
113 |
+
- [toxic-dpo](https://huggingface.co/datasets/unalignment/toxic-dpo-v0.1)
|
114 |
+
- __*highly toxic and potentially illegal content!*__ De-censorship, for academic and lawful purposes only, of course. Generated by llama-2-70b via prompt engineering.
|
115 |
+
- [truthy](https://huggingface.co/datasets/jondurbin/truthy-dpo-v0.1)
|
116 |
+
- DPO pairs meant to increase truthfulness of the model, e.g. common misconceptions, differentiate between AI assistants and roleplayed human in terms of corporeal awareness/locality/etc.
|
117 |
+
- [ultrafeedback](https://huggingface.co/datasets/allenai/ultrafeedback_binarized_cleaned)
|
118 |
+
- One of the bits of magic behind the Zephyr model. Only the items with a chosen score of 8 or higher were included.
|
119 |
+
|
120 |
+
Only the train splits were used (if a split was provided), and an additional pass of decontamination is performed using approximate nearest neighbor search (via faiss).
|
121 |
+
|
122 |
+
## Prompt formatting
|
123 |
+
|
124 |
+
In sticking with the theme of the bagel, I didn't want to use a single prompt format, so I used 4 - vicuna, llama-2, alpaca, and chat-ml (sorta).
|
125 |
+
I also didn't want to randomly select a single prompt format for each item (hoping each instruction would generalize more when used in a variety of prompt formats), so each instruction is actually converted into every prompt format.
|
126 |
+
|
127 |
+
This means each epoch of our fine-tune is really basically 4 epochs. So, for the fine-tunes, I would recommend only doing 1 epoch (or 0.75 epochs). I am testing with a single epoch using a relatively low learning rate.
|
128 |
+
|
129 |
+
### Alpaca (sort of)
|
130 |
+
|
131 |
+
```
|
132 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
133 |
+
|
134 |
+
### Instruction:
|
135 |
+
{system prompt, if provided}
|
136 |
+
{instruction}
|
137 |
+
|
138 |
+
### Response:
|
139 |
+
```
|
140 |
+
|
141 |
+
The main difference here is that because of the dataset formatting and variety of data sources, it would have been much to tedious to add an `### Input:` block, so the inputs are just in the instruction section.
|
142 |
+
|
143 |
+
### Vicuna
|
144 |
+
|
145 |
+
```
|
146 |
+
{system prompt, if provided, randomly defaulting to "A chat between a user and an unbiased, uncensored assistant."}
|
147 |
+
USER: {instruction}
|
148 |
+
ASSISTANT:
|
149 |
+
```
|
150 |
+
|
151 |
+
### ChatML (sort of)
|
152 |
+
|
153 |
+
I don't really understand the point of having special tokens for `<|im_start|>` and `<|im_end|>`, because in practice they just act as BOS and EOS tokens (but, please correct me if I'm wrong).
|
154 |
+
|
155 |
+
So, instead of:
|
156 |
+
```text
|
157 |
+
{bos}<|im_start|>{role}
|
158 |
+
{text}
|
159 |
+
<|im_end|>{eos}
|
160 |
+
```
|
161 |
+
|
162 |
+
I just changed it to:
|
163 |
+
```text
|
164 |
+
{bos}{role}
|
165 |
+
{text}
|
166 |
+
{eos}
|
167 |
+
```
|
168 |
+
|
169 |
+
If you *really* want to use `<|im_start|>` and `<|im_end|>`, just update your `tokenizer_config.json` to use `<|im_start|>` instead of `<s>` and `<|im_end|>` instead of `</s>` and when tokenizing. And if you still don't like what I've done to this chat-ml-ish format, feel free to cry into your pillow or fork the code and do a new fine-tune.
|
170 |
+
|
171 |
+
### Llama-2 chat
|
172 |
+
|
173 |
+
```
|
174 |
+
[INST] <<SYS>>
|
175 |
+
{system}
|
176 |
+
<</SYS>>
|
177 |
+
|
178 |
+
{instruction} [/INST]
|
179 |
+
```
|