TheBloke commited on
Commit
22aac86
1 Parent(s): 81642d1

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +407 -0
README.md ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: EleutherAI/llemma_34b
3
+ datasets:
4
+ - EleutherAI/proof-pile-2
5
+ inference: false
6
+ language:
7
+ - en
8
+ license: llama2
9
+ model_creator: EleutherAI
10
+ model_name: Llemma 34B
11
+ model_type: llama
12
+ prompt_template: '{prompt}
13
+
14
+ '
15
+ quantized_by: TheBloke
16
+ tags:
17
+ - math
18
+ - reasoning
19
+ ---
20
+ <!-- markdownlint-disable MD041 -->
21
+
22
+ <!-- header start -->
23
+ <!-- 200823 -->
24
+ <div style="width: auto; margin-left: auto; margin-right: auto">
25
+ <img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
26
+ </div>
27
+ <div style="display: flex; justify-content: space-between; width: 100%;">
28
+ <div style="display: flex; flex-direction: column; align-items: flex-start;">
29
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
30
+ </div>
31
+ <div style="display: flex; flex-direction: column; align-items: flex-end;">
32
+ <p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
33
+ </div>
34
+ </div>
35
+ <div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
36
+ <hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
37
+ <!-- header end -->
38
+
39
+ # Llemma 34B - GPTQ
40
+ - Model creator: [EleutherAI](https://huggingface.co/EleutherAI)
41
+ - Original model: [Llemma 34B](https://huggingface.co/EleutherAI/llemma_34b)
42
+
43
+ <!-- description start -->
44
+ ## Description
45
+
46
+ This repo contains GPTQ model files for [EleutherAI's Llemma 34B](https://huggingface.co/EleutherAI/llemma_34b).
47
+
48
+ Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
49
+
50
+ <!-- description end -->
51
+ <!-- repositories-available start -->
52
+ ## Repositories available
53
+
54
+ * [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/llemma_34b-AWQ)
55
+ * [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/llemma_34b-GPTQ)
56
+ * [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/llemma_34b-GGUF)
57
+ * [EleutherAI's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/EleutherAI/llemma_34b)
58
+ <!-- repositories-available end -->
59
+
60
+ <!-- prompt-template start -->
61
+ ## Prompt template: Unknown
62
+
63
+ ```
64
+ {prompt}
65
+
66
+ ```
67
+
68
+ <!-- prompt-template end -->
69
+
70
+
71
+ <!-- README_GPTQ.md-provided-files start -->
72
+ ## Provided files, and GPTQ parameters
73
+
74
+ Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
75
+
76
+ Each separate quant is in a different branch. See below for instructions on fetching from different branches.
77
+
78
+ Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
79
+
80
+ <details>
81
+ <summary>Explanation of GPTQ parameters</summary>
82
+
83
+ - Bits: The bit size of the quantised model.
84
+ - GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
85
+ - Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
86
+ - Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
87
+ - GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
88
+ - Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
89
+ - ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama models in 4-bit.
90
+
91
+ </details>
92
+
93
+ | Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
94
+ | ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
95
+ | [main](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 17.69 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
96
+ | [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 18.33 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
97
+ | [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 20.28 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
98
+ | [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 14.14 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
99
+ | [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 34.30 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
100
+ | [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 15.99 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
101
+ | [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/llemma_34b-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [CamelAI Math](https://huggingface.co/datasets/andersonbcdefg/math) | 4096 | 35.07 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
102
+
103
+ <!-- README_GPTQ.md-provided-files end -->
104
+
105
+ <!-- README_GPTQ.md-download-from-branches start -->
106
+ ## How to download, including from branches
107
+
108
+ ### In text-generation-webui
109
+
110
+ To download from the `main` branch, enter `TheBloke/llemma_34b-GPTQ` in the "Download model" box.
111
+
112
+ To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/llemma_34b-GPTQ:gptq-4bit-128g-actorder_True`
113
+
114
+ ### From the command line
115
+
116
+ I recommend using the `huggingface-hub` Python library:
117
+
118
+ ```shell
119
+ pip3 install huggingface-hub
120
+ ```
121
+
122
+ To download the `main` branch to a folder called `llemma_34b-GPTQ`:
123
+
124
+ ```shell
125
+ mkdir llemma_34b-GPTQ
126
+ huggingface-cli download TheBloke/llemma_34b-GPTQ --local-dir llemma_34b-GPTQ --local-dir-use-symlinks False
127
+ ```
128
+
129
+ To download from a different branch, add the `--revision` parameter:
130
+
131
+ ```shell
132
+ mkdir llemma_34b-GPTQ
133
+ huggingface-cli download TheBloke/llemma_34b-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir llemma_34b-GPTQ --local-dir-use-symlinks False
134
+ ```
135
+
136
+ <details>
137
+ <summary>More advanced huggingface-cli download usage</summary>
138
+
139
+ If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Huggingface cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
140
+
141
+ The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
142
+
143
+ For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
144
+
145
+ To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
146
+
147
+ ```shell
148
+ pip3 install hf_transfer
149
+ ```
150
+
151
+ And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
152
+
153
+ ```shell
154
+ mkdir llemma_34b-GPTQ
155
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/llemma_34b-GPTQ --local-dir llemma_34b-GPTQ --local-dir-use-symlinks False
156
+ ```
157
+
158
+ Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
159
+ </details>
160
+
161
+ ### With `git` (**not** recommended)
162
+
163
+ To clone a specific branch with `git`, use a command like this:
164
+
165
+ ```shell
166
+ git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/llemma_34b-GPTQ
167
+ ```
168
+
169
+ Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
170
+
171
+ <!-- README_GPTQ.md-download-from-branches end -->
172
+ <!-- README_GPTQ.md-text-generation-webui start -->
173
+ ## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
174
+
175
+ Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
176
+
177
+ It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
178
+
179
+ 1. Click the **Model tab**.
180
+ 2. Under **Download custom model or LoRA**, enter `TheBloke/llemma_34b-GPTQ`.
181
+
182
+ - To download from a specific branch, enter for example `TheBloke/llemma_34b-GPTQ:gptq-4bit-128g-actorder_True`
183
+ - see Provided Files above for the list of branches for each option.
184
+
185
+ 3. Click **Download**.
186
+ 4. The model will start downloading. Once it's finished it will say "Done".
187
+ 5. In the top left, click the refresh icon next to **Model**.
188
+ 6. In the **Model** dropdown, choose the model you just downloaded: `llemma_34b-GPTQ`
189
+ 7. The model will automatically load, and is now ready for use!
190
+ 8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
191
+
192
+ - Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
193
+
194
+ 9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
195
+
196
+ <!-- README_GPTQ.md-text-generation-webui end -->
197
+
198
+ <!-- README_GPTQ.md-use-from-tgi start -->
199
+ ## Serving this model from Text Generation Inference (TGI)
200
+
201
+ It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
202
+
203
+ Example Docker parameters:
204
+
205
+ ```shell
206
+ --model-id TheBloke/llemma_34b-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
207
+ ```
208
+
209
+ Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
210
+
211
+ ```shell
212
+ pip3 install huggingface-hub
213
+ ```
214
+
215
+ ```python
216
+ from huggingface_hub import InferenceClient
217
+
218
+ endpoint_url = "https://your-endpoint-url-here"
219
+
220
+ prompt = "Tell me about AI"
221
+ prompt_template=f'''{prompt}
222
+ '''
223
+
224
+ client = InferenceClient(endpoint_url)
225
+ response = client.text_generation(prompt,
226
+ max_new_tokens=128,
227
+ do_sample=True,
228
+ temperature=0.7,
229
+ top_p=0.95,
230
+ top_k=40,
231
+ repetition_penalty=1.1)
232
+
233
+ print(f"Model output: {response}")
234
+ ```
235
+ <!-- README_GPTQ.md-use-from-tgi end -->
236
+ <!-- README_GPTQ.md-use-from-python start -->
237
+ ## How to use this GPTQ model from Python code
238
+
239
+ ### Install the necessary packages
240
+
241
+ Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
242
+
243
+ ```shell
244
+ pip3 install transformers optimum
245
+ pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
246
+ ```
247
+
248
+ If you have problems installing AutoGPTQ using the pre-built wheels, install it from source instead:
249
+
250
+ ```shell
251
+ pip3 uninstall -y auto-gptq
252
+ git clone https://github.com/PanQiWei/AutoGPTQ
253
+ cd AutoGPTQ
254
+ git checkout v0.4.2
255
+ pip3 install .
256
+ ```
257
+
258
+ ### You can then use the following code
259
+
260
+ ```python
261
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
262
+
263
+ model_name_or_path = "TheBloke/llemma_34b-GPTQ"
264
+ # To use a different branch, change revision
265
+ # For example: revision="gptq-4bit-128g-actorder_True"
266
+ model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
267
+ device_map="auto",
268
+ trust_remote_code=False,
269
+ revision="main")
270
+
271
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
272
+
273
+ prompt = "Tell me about AI"
274
+ prompt_template=f'''{prompt}
275
+ '''
276
+
277
+ print("\n\n*** Generate:")
278
+
279
+ input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
280
+ output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
281
+ print(tokenizer.decode(output[0]))
282
+
283
+ # Inference can also be done using transformers' pipeline
284
+
285
+ print("*** Pipeline:")
286
+ pipe = pipeline(
287
+ "text-generation",
288
+ model=model,
289
+ tokenizer=tokenizer,
290
+ max_new_tokens=512,
291
+ do_sample=True,
292
+ temperature=0.7,
293
+ top_p=0.95,
294
+ top_k=40,
295
+ repetition_penalty=1.1
296
+ )
297
+
298
+ print(pipe(prompt_template)[0]['generated_text'])
299
+ ```
300
+ <!-- README_GPTQ.md-use-from-python end -->
301
+
302
+ <!-- README_GPTQ.md-compatibility start -->
303
+ ## Compatibility
304
+
305
+ The files provided are tested to work with AutoGPTQ, both via Transformers and using AutoGPTQ directly. They should also work with [Occ4m's GPTQ-for-LLaMa fork](https://github.com/0cc4m/KoboldAI).
306
+
307
+ [ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
308
+
309
+ [Huggingface Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference) is compatible with all GPTQ models.
310
+ <!-- README_GPTQ.md-compatibility end -->
311
+
312
+ <!-- footer start -->
313
+ <!-- 200823 -->
314
+ ## Discord
315
+
316
+ For further support, and discussions on these models and AI in general, join us at:
317
+
318
+ [TheBloke AI's Discord server](https://discord.gg/theblokeai)
319
+
320
+ ## Thanks, and how to contribute
321
+
322
+ Thanks to the [chirper.ai](https://chirper.ai) team!
323
+
324
+ Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
325
+
326
+ I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
327
+
328
+ If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
329
+
330
+ Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
331
+
332
+ * Patreon: https://patreon.com/TheBlokeAI
333
+ * Ko-Fi: https://ko-fi.com/TheBlokeAI
334
+
335
+ **Special thanks to**: Aemon Algiz.
336
+
337
+ **Patreon special mentions**: Pierre Kircher, Stanislav Ovsiannikov, Michael Levine, Eugene Pentland, Andrey, 준교 김, Randy H, Fred von Graf, Artur Olbinski, Caitlyn Gatomon, terasurfer, Jeff Scroggin, James Bentley, Vadim, Gabriel Puliatti, Harry Royden McLaughlin, Sean Connelly, Dan Guido, Edmond Seymore, Alicia Loh, subjectnull, AzureBlack, Manuel Alberto Morcote, Thomas Belote, Lone Striker, Chris Smitley, Vitor Caleffi, Johann-Peter Hartmann, Clay Pascal, biorpg, Brandon Frisco, sidney chen, transmissions 11, Pedro Madruga, jinyuan sun, Ajan Kanaga, Emad Mostaque, Trenton Dambrowitz, Jonathan Leane, Iucharbius, usrbinkat, vamX, George Stoitzev, Luke Pendergrass, theTransient, Olakabola, Swaroop Kallakuri, Cap'n Zoog, Brandon Phillips, Michael Dempsey, Nikolai Manek, danny, Matthew Berman, Gabriel Tamborski, alfie_i, Raymond Fosdick, Tom X Nguyen, Raven Klaugh, LangChain4j, Magnesian, Illia Dulskyi, David Ziegler, Mano Prime, Luis Javier Navarrete Lozano, Erik Bjäreholt, 阿明, Nathan Dryer, Alex, Rainer Wilmers, zynix, TL, Joseph William Delisle, John Villwock, Nathan LeClaire, Willem Michiel, Joguhyik, GodLy, OG, Alps Aficionado, Jeffrey Morgan, ReadyPlayerEmma, Tiffany J. Kim, Sebastain Graf, Spencer Kim, Michael Davis, webtim, Talal Aujan, knownsqashed, John Detwiler, Imad Khwaja, Deo Leter, Jerry Meng, Elijah Stavena, Rooh Singh, Pieter, SuperWojo, Alexandros Triantafyllidis, Stephen Murray, Ai Maven, ya boyyy, Enrico Ros, Ken Nordquist, Deep Realms, Nicholas, Spiking Neurons AB, Elle, Will Dee, Jack West, RoA, Luke @flexchar, Viktor Bowallius, Derek Yates, Subspace Studios, jjj, Toran Billups, Asp the Wyvern, Fen Risland, Ilya, NimbleBox.ai, Chadd, Nitin Borwankar, Emre, Mandus, Leonard Tan, Kalila, K, Trailburnt, S_X, Cory Kujawski
338
+
339
+
340
+ Thank you to all my generous patrons and donaters!
341
+
342
+ And thank you again to a16z for their generous grant.
343
+
344
+ <!-- footer end -->
345
+
346
+ # Original model card: EleutherAI's Llemma 34B
347
+
348
+ <img src="llemma.png" width="400">
349
+
350
+ [ArXiv](http://arxiv.org/abs/2310.10631) | [Models](https://huggingface.co/EleutherAI/llemma_34b) | [Data](https://huggingface.co/datasets/EleutherAI/proof-pile-2) | [Code](https://github.com/EleutherAI/math-lm) | [Blog](https://blog.eleuther.ai/llemma/) | [Sample Explorer](https://llemma-demo.github.io/)
351
+
352
+ [Zhangir Azerbayev](https://zhangir-azerbayev.github.io/), [Hailey Schoelkopf](https://github.com/haileyschoelkopf), [Keiran Paster](https://keirp.com), [Marco Dos Santos](https://github.com/dsantosmarco), [Stephen McAleer](https://www.andrew.cmu.edu/user/smcaleer/), [Albert Q. Jiang](https://albertqjiang.github.io/), [Jia Deng](https://www.cs.princeton.edu/~jiadeng/), [Stella Biderman](https://www.stellabiderman.com/), [Sean Welleck](https://wellecks.com/)
353
+
354
+ **Llemma 34B** is a language model for mathematics. It was initialized with [Code Llama 34B](https://github.com/facebookresearch/codellama) weights, and trained on the [Proof-Pile-2](https://huggingface.co/datasets/EleutherAI/proof-pile-2) for 50B tokens.
355
+
356
+ This model also comes in a 7B parameter version: [Llemma 7B](https://huggingface.co/EleutherAI/llemma_7b).
357
+
358
+ ## Evaluations
359
+
360
+ Llemma models are particularly strong at chain-of-thought mathematical reasoning and using computational tools for mathematics, such as Python and formal theorem provers.
361
+
362
+
363
+ ### Chain-of-thought Math
364
+ On chain-of-thought mathematics tasks, Llemma models outperform Llama-2, Code Llama, and when controlled for model size, outperform Minerva.
365
+
366
+ | Model | Size | GSM8k | [OCW](https://openreview.net/forum?id=IFXTZERXdM7) | MMLU-STEM | [SAT](https://huggingface.co/datasets/mcaleste/sat_multiple_choice_math_may_23) | MATH |
367
+ |------------|------|--------|-------|-----------|-------|-------|
368
+ | Llama 2 | 7B | 11.8% | 3.7% | 29.9% | 25% | 3.2% |
369
+ | Code Llama | 7B | 10.5% | 4.4% | 25.1% | 9.4% | 4.5% |
370
+ | LLEMMA | 7B | **36.4%** | **7.7%** | **37.7%** | **53.1%** | **18.0%** |
371
+ | Minerva | 8B | 16.2% | **7.7%** | 35.6% | - | 14.1% |
372
+ |------------|------|--------|-------|-----------|-------|-------|
373
+ | Code Llama | 34B | 29.6% | 7.0% | 40.5% | 40.6% | 12.2% |
374
+ | LLEMMA | 34B | **51.5%** | **11.8%** | **49.0%** | **71.9%** | **25.0%** |
375
+ |------------|------|--------|-------|-----------|-------|-------|
376
+ | Minerva | 62B | 52.4% | 12.0% | 53.9% | - | 27.6% |
377
+ | Minerva | 540B | 58.8% | 17.6% | 63.9% | - | 33.6% |
378
+
379
+
380
+ Further performance can be extracted by using majority voting:
381
+
382
+ | Model | Size | GSM8k maj@100 | OCW maj@100 | MMLU-STEM maj@16 | SAT maj@16 | MATH maj@256 |
383
+ |---------|------|-------------|-----------|-----------------|-----------|------------|
384
+ | LLEMMA | 7B | 54.0% | 14.3% | 49.9% | 78.1% | **33.5** |
385
+ | Minerva | 8B | 28.4% | 12.5% | 43.4% | - | 25.4% |
386
+ |---------|------|-------------|-----------|-----------------|-----------|------------|
387
+ | LLEMMA | 34B | 69.3% | 18.4% | 59.7% | 81.3% | **43.1%** |
388
+ |---------|------|-------------|-----------|-----------------|-----------|------------|
389
+ | Minerva | 62B | 68.5% | 23.5% | 63.5% | - | 43.4% |
390
+ | Minerva | 540B | 78.5% | 30.8% | 75.0% | - | 50.3% |
391
+
392
+ ### Tool Use and Theorem Proving
393
+ In addition to chain-of-thought reasoning, Llemma has strong capabilities in computational mathematics tasks. For tool use and formal theorem proving evaluations, see [our paper](http://arxiv.org/abs/2310.10631).
394
+
395
+ ### Citation
396
+ ```
397
+ @misc{azerbayev2023llemma,
398
+ title={Llemma: An Open Language Model For Mathematics},
399
+ author={Zhangir Azerbayev and Hailey Schoelkopf and Keiran Paster and Marco Dos Santos and Stephen McAleer and Albert Q. Jiang and Jia Deng and Stella Biderman and Sean Welleck},
400
+ year={2023},
401
+ eprint={2310.10631},
402
+ archivePrefix={arXiv},
403
+ primaryClass={cs.CL}
404
+ }
405
+ ```
406
+
407
+