Text Generation
Transformers
Safetensors
llama
conversational
Inference Endpoints
text-generation-inference
jondurbin commited on
Commit
18e2886
1 Parent(s): 4a3699c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +174 -1
README.md CHANGED
@@ -1,3 +1,176 @@
1
  ---
2
- license: apache-2.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ license_name: yi-license
4
+ license_link: https://huggingface.co/01-ai/Yi-34B-200K/blob/main/LICENSE
5
+ datasets:
6
+ - ai2_arc
7
+ - unalignment/spicy-3.1
8
+ - codeparrot/apps
9
+ - facebook/belebele
10
+ - boolq
11
+ - jondurbin/cinematika-v0.1
12
+ - drop
13
+ - lmsys/lmsys-chat-1m
14
+ - TIGER-Lab/MathInstruct
15
+ - cais/mmlu
16
+ - Muennighoff/natural-instructions
17
+ - openbookqa
18
+ - piqa
19
+ - Vezora/Tested-22k-Python-Alpaca
20
+ - cakiki/rosetta-code
21
+ - Open-Orca/SlimOrca
22
+ - spider
23
+ - squad_v2
24
+ - migtissera/Synthia-v1.3
25
+ - datasets/winogrande
26
+ - nvidia/HelpSteer
27
+ - Intel/orca_dpo_pairs
28
+ - unalignment/toxic-dpo-v0.1
29
+ - jondurbin/truthy-dpo-v0.1
30
+ - allenai/ultrafeedback_binarized_cleaned
31
+ - Squish42/bluemoon-fandom-1-1-rp-cleaned
32
+ - LDJnr/Capybara
33
+ - JULIELab/EmoBank
34
+ - kingbri/PIPPA-shareGPT
35
  ---
36
+
37
+ # A bagel, with everything
38
+
39
+ ![bagel](bagel.png)
40
+
41
+ ## Overview
42
+
43
+ An experimental fine-tune of [yi-34b-200k](https://huggingface.co/01-ai/Yi-34B-200K) using [bagel](https://github.com/jondurbin/bagel)
44
+
45
+ This version underwent a subset of DPO, but is fairly censored. For a less censored version, try [bagel-dpo-34b-v0.2](https://hf.co/jondurbin/bagel-dpo-34b-v0.2)
46
+
47
+ ## SFT data sources
48
+
49
+ *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*
50
+
51
+ - [ai2_arc](https://huggingface.co/datasets/ai2_arc)
52
+ - Abstraction and reasoning dataset, useful in measuring "intelligence" to a certain extent.
53
+ - [airoboros](https://huggingface.co/datasets/unalignment/spicy-3.1)
54
+ - Variety of categories of synthetic instructions generated by gpt-4.
55
+ - [apps](https://huggingface.co/datasets/codeparrot/apps)
56
+ - Python coding dataset with 10k problems.
57
+ - [belebele](https://huggingface.co/datasets/facebook/belebele)
58
+ - Multi-lingual reading comprehension dataset.
59
+ - [bluemoon](https://huggingface.co/datasets/Squish42/bluemoon-fandom-1-1-rp-cleaned)
60
+ - Roleplay data scraped from Bluemoon, then cleaned and formatted as ShareGPT.
61
+ - [boolq](https://huggingface.co/datasets/boolq)
62
+ - Corpus of yes/no questions (which can be surprisingly difficult for AI to answer apparently?)
63
+ - [capybara](https://huggingface.co/datasets/LDJnr/Capybara)
64
+ - Multi-turn dataset used to create the capybara models.
65
+ - [cinematika](https://huggingface.co/datasets/jondurbin/cinematika-v0.1) (instruction and plain text)
66
+ - RP-style data synthesized from movie scripts so the model isn't quite as boring as it otherwise would be.
67
+ - [drop](https://huggingface.co/datasets/drop)
68
+ - More reading comprehension.
69
+ - [emobank](https://github.com/JULIELab/EmoBank)
70
+ - Emotion annotations using the Valence-Arousal-Domninance scheme.
71
+ - [gutenberg](https://www.gutenberg.org/) (plain text)
72
+ - Books/plain text, again to make the model less boring, only a handful of examples supported by [chapterize](https://github.com/JonathanReeve/chapterize)
73
+ - [lmsys_chat_1m](https://huggingface.co/datasets/lmsys/lmsys-chat-1m) (only gpt-4 items, also used for DPO)
74
+ - Chats collected by the lmsys chat arena, containing a wide variety of chats with various models.
75
+ - [mathinstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
76
+ - Composite dataset with a variety of math-related tasks and problem/question formats.
77
+ - [mmlu](https://huggingface.co/datasets/cais/mmlu)
78
+ - Massive Multitask Language Understanding - a wide variety of questions about various subject matters.
79
+ - [natural_instructions](https://huggingface.co/datasets/Muennighoff/natural-instructions)
80
+ - Millions of instructions from 1600+ task categories (sampled down substantially, stratified by task type)
81
+ - [openbookqa](https://huggingface.co/datasets/openbookqa)
82
+ - Question answering dataset.
83
+ - [pippa](https://huggingface.co/datasets/kingbri/PIPPA-shareGPT)
84
+ - Deduped version of [PIPPA](https://huggingface.co/datasets/PygmalionAI/PIPPA) in ShareGPT format.
85
+ - [piqa](https://huggingface.co/datasets/piqa)
86
+ - Phyiscal interaction question answering.
87
+ - [python_alpaca](https://huggingface.co/datasets/Vezora/Tested-22k-Python-Alpaca)
88
+ - Python instruction response pairs, validated as functional.
89
+ - [rosetta_code](https://huggingface.co/datasets/cakiki/rosetta-code)
90
+ - Code problems and solutions in a variety of programming languages taken from rosettacode.org.
91
+ - [slimorca](https://huggingface.co/datasets/Open-Orca/SlimOrca)
92
+ - Collection of ~500k gpt-4 verified chats from OpenOrca.
93
+ - [spider](https://huggingface.co/datasets/spider)
94
+ - SQL-targeted dataset.
95
+ - [squad_v2](https://huggingface.co/datasets/squad_v2)
96
+ - Contextual question answering (RAG).
97
+ - [synthia](https://huggingface.co/datasets/migtissera/Synthia-v1.3)
98
+ - GPT-4 generated data using advanced prompting from Migel Tissera.
99
+ - [winogrande](https://huggingface.co/datasets/winogrande)
100
+ - Fill in the blank style prompts.
101
+
102
+ ## DPO data sources
103
+
104
+ - [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)
105
+ - 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"
106
+ - [helpsteer](https://huggingface.co/datasets/nvidia/HelpSteer)
107
+ - 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"
108
+ - [orca_dpo_pairs](https://huggingface.co/datasets/Intel/orca_dpo_pairs)
109
+ - Another interesting dataset by Intel, which provides various DPO pairs generated from prompts included in the SlimOrca dataset.
110
+ - [toxic-dpo](https://huggingface.co/datasets/unalignment/toxic-dpo-v0.1)
111
+ - __*highly toxic and potentially illegal content!*__ De-censorship, for academic and lawful purposes only, of course. Generated by llama-2-70b via prompt engineering.
112
+ - [truthy](https://huggingface.co/datasets/jondurbin/truthy-dpo-v0.1)
113
+ - 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.
114
+ - [ultrafeedback](https://huggingface.co/datasets/allenai/ultrafeedback_binarized_cleaned)
115
+ - One of the bits of magic behind the Zephyr model. Only the items with a chosen score of 8 or higher were included.
116
+
117
+ 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).
118
+
119
+ ## Prompt formatting
120
+
121
+ 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).
122
+ 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.
123
+
124
+ 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.
125
+
126
+ ### Alpaca (sort of)
127
+
128
+ ```
129
+ Below is an instruction that describes a task. Write a response that appropriately completes the request.
130
+
131
+ ### Instruction:
132
+ {system prompt, if provided}
133
+ {instruction}
134
+
135
+ ### Response:
136
+ ```
137
+
138
+ 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.
139
+
140
+ ### Vicuna
141
+
142
+ ```
143
+ {system prompt, if provided, randomly defaulting to "A chat between a user and an unbiased, uncensored assistant."}
144
+ USER: {instruction}
145
+ ASSISTANT:
146
+ ```
147
+
148
+ ### ChatML (sort of)
149
+
150
+ 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).
151
+
152
+ So, instead of:
153
+ ```text
154
+ {bos}<|im_start|>{role}
155
+ {text}
156
+ <|im_end|>{eos}
157
+ ```
158
+
159
+ I just changed it to:
160
+ ```text
161
+ {bos}{role}
162
+ {text}
163
+ {eos}
164
+ ```
165
+
166
+ 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.
167
+
168
+ ### Llama-2 chat
169
+
170
+ ```
171
+ [INST] <<SYS>>
172
+ {system}
173
+ <</SYS>>
174
+
175
+ {instruction} [/INST]
176
+ ```