Text Generation
Transformers
Safetensors
llama
conversational
Inference Endpoints
text-generation-inference
jondurbin commited on
Commit
3f491ed
1 Parent(s): 06f8e2d

Update README.md

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