RichardErkhov commited on
Commit
143c4dd
·
verified ·
1 Parent(s): b4009f0

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +268 -0
README.md ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ starcoder2-15b-instruct-v0.1 - GGUF
11
+ - Model creator: https://huggingface.co/bigcode/
12
+ - Original model: https://huggingface.co/bigcode/starcoder2-15b-instruct-v0.1/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [starcoder2-15b-instruct-v0.1.Q2_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q2_K.gguf) | Q2_K | 5.77GB |
18
+ | [starcoder2-15b-instruct-v0.1.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.IQ3_XS.gguf) | IQ3_XS | 6.25GB |
19
+ | [starcoder2-15b-instruct-v0.1.IQ3_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.IQ3_S.gguf) | IQ3_S | 6.52GB |
20
+ | [starcoder2-15b-instruct-v0.1.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q3_K_S.gguf) | Q3_K_S | 6.51GB |
21
+ | [starcoder2-15b-instruct-v0.1.IQ3_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.IQ3_M.gguf) | IQ3_M | 6.8GB |
22
+ | [starcoder2-15b-instruct-v0.1.Q3_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q3_K.gguf) | Q3_K | 7.49GB |
23
+ | [starcoder2-15b-instruct-v0.1.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q3_K_M.gguf) | Q3_K_M | 7.49GB |
24
+ | [starcoder2-15b-instruct-v0.1.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q3_K_L.gguf) | Q3_K_L | 8.35GB |
25
+ | [starcoder2-15b-instruct-v0.1.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.IQ4_XS.gguf) | IQ4_XS | 8.12GB |
26
+ | [starcoder2-15b-instruct-v0.1.Q4_0.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q4_0.gguf) | Q4_0 | 8.44GB |
27
+ | [starcoder2-15b-instruct-v0.1.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.IQ4_NL.gguf) | IQ4_NL | 8.55GB |
28
+ | [starcoder2-15b-instruct-v0.1.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q4_K_S.gguf) | Q4_K_S | 8.53GB |
29
+ | [starcoder2-15b-instruct-v0.1.Q4_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q4_K.gguf) | Q4_K | 9.18GB |
30
+ | [starcoder2-15b-instruct-v0.1.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q4_K_M.gguf) | Q4_K_M | 9.18GB |
31
+ | [starcoder2-15b-instruct-v0.1.Q4_1.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q4_1.gguf) | Q4_1 | 9.35GB |
32
+ | [starcoder2-15b-instruct-v0.1.Q5_0.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q5_0.gguf) | Q5_0 | 10.27GB |
33
+ | [starcoder2-15b-instruct-v0.1.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q5_K_S.gguf) | Q5_K_S | 10.27GB |
34
+ | [starcoder2-15b-instruct-v0.1.Q5_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q5_K.gguf) | Q5_K | 10.65GB |
35
+ | [starcoder2-15b-instruct-v0.1.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q5_K_M.gguf) | Q5_K_M | 10.65GB |
36
+ | [starcoder2-15b-instruct-v0.1.Q5_1.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q5_1.gguf) | Q5_1 | 11.18GB |
37
+ | [starcoder2-15b-instruct-v0.1.Q6_K.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q6_K.gguf) | Q6_K | 12.2GB |
38
+ | [starcoder2-15b-instruct-v0.1.Q8_0.gguf](https://huggingface.co/RichardErkhov/bigcode_-_starcoder2-15b-instruct-v0.1-gguf/blob/main/starcoder2-15b-instruct-v0.1.Q8_0.gguf) | Q8_0 | 15.8GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ pipeline_tag: text-generation
46
+ base_model: bigcode/starcoder2-15b
47
+ datasets:
48
+ - bigcode/self-oss-instruct-sc2-exec-filter-50k
49
+ license: bigcode-openrail-m
50
+ library_name: transformers
51
+ tags:
52
+ - code
53
+ model-index:
54
+ - name: starcoder2-15b-instruct-v0.1
55
+ results:
56
+ - task:
57
+ type: text-generation
58
+ dataset:
59
+ name: LiveCodeBench (code generation)
60
+ type: livecodebench-codegeneration
61
+ metrics:
62
+ - type: pass@1
63
+ value: 20.4
64
+ - task:
65
+ type: text-generation
66
+ dataset:
67
+ name: LiveCodeBench (self repair)
68
+ type: livecodebench-selfrepair
69
+ metrics:
70
+ - type: pass@1
71
+ value: 20.9
72
+ - task:
73
+ type: text-generation
74
+ dataset:
75
+ name: LiveCodeBench (test output prediction)
76
+ type: livecodebench-testoutputprediction
77
+ metrics:
78
+ - type: pass@1
79
+ value: 29.8
80
+ - task:
81
+ type: text-generation
82
+ dataset:
83
+ name: LiveCodeBench (code execution)
84
+ type: livecodebench-codeexecution
85
+ metrics:
86
+ - type: pass@1
87
+ value: 28.1
88
+ - task:
89
+ type: text-generation
90
+ dataset:
91
+ name: HumanEval
92
+ type: humaneval
93
+ metrics:
94
+ - type: pass@1
95
+ value: 72.6
96
+ - task:
97
+ type: text-generation
98
+ dataset:
99
+ name: HumanEval+
100
+ type: humanevalplus
101
+ metrics:
102
+ - type: pass@1
103
+ value: 63.4
104
+ - task:
105
+ type: text-generation
106
+ dataset:
107
+ name: MBPP
108
+ type: mbpp
109
+ metrics:
110
+ - type: pass@1
111
+ value: 75.2
112
+ - task:
113
+ type: text-generation
114
+ dataset:
115
+ name: MBPP+
116
+ type: mbppplus
117
+ metrics:
118
+ - type: pass@1
119
+ value: 61.2
120
+ - task:
121
+ type: text-generation
122
+ dataset:
123
+ name: DS-1000
124
+ type: ds-1000
125
+ metrics:
126
+ - type: pass@1
127
+ value: 40.6
128
+ ---
129
+
130
+ # StarCoder2-Instruct: Fully Transparent and Permissive Self-Alignment for Code Generation
131
+
132
+ ![Banner](https://huggingface.co/datasets/bigcode/starcoder2-instruct-assets/resolve/main/banner.png)
133
+
134
+ ## Model Summary
135
+
136
+ We introduce StarCoder2-15B-Instruct-v0.1, the very first entirely self-aligned code Large Language Model (LLM) trained with a fully permissive and transparent pipeline. Our open-source pipeline uses StarCoder2-15B to generate thousands of instruction-response pairs, which are then used to fine-tune StarCoder-15B itself without any human annotations or distilled data from huge and proprietary LLMs.
137
+
138
+ - **Model:** [bigcode/starcoder2-15b-instruct-v0.1](https://huggingface.co/bigcode/starcoder2-instruct-15b-v0.1)
139
+ - **Code:** [bigcode-project/starcoder2-self-align](https://github.com/bigcode-project/starcoder2-self-align)
140
+ - **Dataset:** [bigcode/self-oss-instruct-sc2-exec-filter-50k](https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k/)
141
+ - **Authors:**
142
+ [Yuxiang Wei](https://yuxiang.cs.illinois.edu),
143
+ [Federico Cassano](https://federico.codes/),
144
+ [Jiawei Liu](https://jw-liu.xyz),
145
+ [Yifeng Ding](https://yifeng-ding.com),
146
+ [Naman Jain](https://naman-ntc.github.io),
147
+ [Harm de Vries](https://www.harmdevries.com),
148
+ [Leandro von Werra](https://twitter.com/lvwerra),
149
+ [Arjun Guha](https://www.khoury.northeastern.edu/home/arjunguha/main/home/),
150
+ [Lingming Zhang](https://lingming.cs.illinois.edu).
151
+
152
+ ![self-alignment pipeline](https://huggingface.co/datasets/bigcode/starcoder2-instruct-assets/resolve/main/method.png)
153
+
154
+ ## Use
155
+
156
+ ### Intended use
157
+
158
+ The model is designed to respond to **coding-related instructions in a single turn**. Instructions in other styles may result in less accurate responses.
159
+
160
+ Here is an example to get started with the model using the [transformers](https://huggingface.co/docs/transformers/index) library:
161
+
162
+ ```python
163
+ import transformers
164
+ import torch
165
+
166
+ pipeline = transformers.pipeline(
167
+ model="bigcode/starcoder2-15b-instruct-v0.1",
168
+ task="text-generation",
169
+ torch_dtype=torch.bfloat16,
170
+ device_map="auto",
171
+ )
172
+
173
+ def respond(instruction: str, response_prefix: str) -> str:
174
+ messages = [{"role": "user", "content": instruction}]
175
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False)
176
+ prompt += response_prefix
177
+
178
+ teminators = [
179
+ pipeline.tokenizer.eos_token_id,
180
+ pipeline.tokenizer.convert_tokens_to_ids("###"),
181
+ ]
182
+
183
+ result = pipeline(
184
+ prompt,
185
+ max_length=256,
186
+ num_return_sequences=1,
187
+ do_sample=False,
188
+ eos_token_id=teminators,
189
+ pad_token_id=pipeline.tokenizer.eos_token_id,
190
+ truncation=True,
191
+ )
192
+ response = response_prefix + result[0]["generated_text"][len(prompt) :].split("###")[0].rstrip()
193
+ return response
194
+
195
+
196
+ instruction = "Write a quicksort function in Python with type hints and a 'less_than' parameter for custom sorting criteria."
197
+ response_prefix = ""
198
+
199
+ print(respond(instruction, response_prefix))
200
+ ```
201
+
202
+ Here is the expected output:
203
+
204
+ ``````
205
+ Here's how you can implement a quicksort function in Python with type hints and a 'less_than' parameter for custom sorting criteria:
206
+
207
+ ```python
208
+ from typing import TypeVar, Callable
209
+
210
+ T = TypeVar('T')
211
+
212
+ def quicksort(items: list[T], less_than: Callable[[T, T], bool] = lambda x, y: x < y) -> list[T]:
213
+ if len(items) <= 1:
214
+ return items
215
+
216
+ pivot = items[0]
217
+ less = [x for x in items[1:] if less_than(x, pivot)]
218
+ greater = [x for x in items[1:] if not less_than(x, pivot)]
219
+ return quicksort(less, less_than) + [pivot] + quicksort(greater, less_than)
220
+ ```
221
+ ``````
222
+
223
+ ### Bias, Risks, and Limitations
224
+
225
+ StarCoder2-15B-Instruct-v0.1 is primarily finetuned for Python code generation tasks that can be verified through execution, which may lead to certain biases and limitations. For example, the model might not adhere strictly to instructions that dictate the output format. In these situations, it's beneficial to provide a **response prefix** or a **one-shot example** to steer the model’s output. Additionally, the model may have limitations with other programming languages and out-of-domain coding tasks.
226
+
227
+ The model also inherits the bias, risks, and limitations from its base StarCoder2-15B model. For more information, please refer to the [StarCoder2-15B model card](https://huggingface.co/bigcode/starcoder2-15b).
228
+
229
+ ## Evaluation on EvalPlus, LiveCodeBench, and DS-1000
230
+
231
+ ![EvalPlus](https://huggingface.co/datasets/bigcode/starcoder2-instruct-assets/resolve/main/evalplus.png)
232
+
233
+ ![LiveCodeBench and DS-1000](https://huggingface.co/datasets/bigcode/starcoder2-instruct-assets/resolve/main/lcb-ds1000.png)
234
+
235
+ ## Training Details
236
+
237
+ ### Hyperparameters
238
+
239
+ - **Optimizer:** Adafactor
240
+ - **Learning rate:** 1e-5
241
+ - **Epoch:** 4
242
+ - **Batch size:** 64
243
+ - **Warmup ratio:** 0.05
244
+ - **Scheduler:** Linear
245
+ - **Sequence length:** 1280
246
+ - **Dropout**: Not applied
247
+
248
+ ### Hardware
249
+
250
+ 1 x NVIDIA A100 80GB
251
+
252
+ ## Resources
253
+
254
+ - **Model:** [bigcode/starCoder2-15b-instruct-v0.1](https://huggingface.co/bigcode/starcoder2-instruct-15b-v0.1)
255
+ - **Code:** [bigcode-project/starcoder2-self-align](https://github.com/bigcode-project/starcoder2-self-align)
256
+ - **Dataset:** [bigcode/self-oss-instruct-sc2-exec-filter-50k](https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k/)
257
+
258
+ ### Full Data Pipeline
259
+
260
+ Our dataset generation pipeline has several steps. We provide intermediate datasets for every step of the pipeline:
261
+ 1. Original seed dataset filtered from The Stack v1: https://huggingface.co/datasets/bigcode/python-stack-v1-functions-filtered
262
+ 2. Seed dataset filtered using StarCoder2-15B as a judge for removing items with bad docstrings: https://huggingface.co/datasets/bigcode/python-stack-v1-functions-filtered-sc2
263
+ 3. seed -> concepts: https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-concepts
264
+ 4. concepts -> instructions: https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-instructions
265
+ 5. instructions -> response: https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-responses-unfiltered
266
+ 6. Responses filtered by executing them: https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-500k-raw
267
+ 7. Executed responses filtered by deduplicating them (final dataset): https://huggingface.co/datasets/bigcode/self-oss-instruct-sc2-exec-filter-50k
268
+