README.md CHANGED
@@ -1,1070 +1,199 @@
1
  ---
2
- base_model: meta-llama/Llama-3.1-8B-Instruct
3
- language:
4
- - en
5
  library_name: transformers
6
- license: llama3.1
7
- tags:
8
- - llama-3
9
- - llama
10
- - meta
11
- - facebook
12
- - unsloth
13
- - transformers
14
  ---
15
 
16
- # Finetune Llama 3.2, Gemma 2, Mistral 2-5x faster with 70% less memory via Unsloth!
17
-
18
- We have a free Google Colab Tesla T4 notebook for Llama 3.1 (8B) here: https://colab.research.google.com/drive/1Ys44kVvmeZtnICzWz0xgpRnrIOjZAuxp?usp=sharing
19
-
20
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/Discord%20button.png" width="200"/>](https://discord.gg/unsloth)
21
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
22
-
23
- ## ✨ Finetune for Free
24
-
25
- All notebooks are **beginner friendly**! Add your dataset, click "Run All", and you'll get a 2x faster finetuned model which can be exported to GGUF, vLLM or uploaded to Hugging Face.
26
-
27
- | Unsloth supports | Free Notebooks | Performance | Memory use |
28
- |-----------------|--------------------------------------------------------------------------------------------------------------------------|-------------|----------|
29
- | **Llama-3.2 (3B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Ys44kVvmeZtnICzWz0xgpRnrIOjZAuxp?usp=sharing) | 2.4x faster | 58% less |
30
- | **Llama-3.2 (11B vision)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1j0N4XTY1zXXy7mPAhOC1_gMYZ2F2EBlk?usp=sharing) | 2x faster | 60% less |
31
- | **Llama-3.1 (8B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Ys44kVvmeZtnICzWz0xgpRnrIOjZAuxp?usp=sharing) | 2.4x faster | 58% less |
32
- | **Qwen2 VL (7B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1whHb54GNZMrNxIsi2wm2EY_-Pvo2QyKh?usp=sharing) | 1.8x faster | 60% less |
33
- | **Qwen2.5 (7B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Kose-ucXO1IBaZq5BvbwWieuubP7hxvQ?usp=sharing) | 2x faster | 60% less |
34
- | **Phi-3.5 (mini)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1lN6hPQveB_mHSnTOYifygFcrO8C1bxq4?usp=sharing) | 2x faster | 50% less |
35
- | **Gemma 2 (9B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1vIrqH5uYDQwsJ4-OO3DErvuv4pBgVwk4?usp=sharing) | 2.4x faster | 58% less |
36
- | **Mistral (7B)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Dyauq4kTZoLewQ1cApceUQVNcnnNTzg_?usp=sharing) | 2.2x faster | 62% less |
37
- | **DPO - Zephyr** | [▶️ Start on Colab](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) | 1.9x faster | 19% less |
38
-
39
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="200"/>](https://docs.unsloth.ai)
40
-
41
- - This [conversational notebook](https://colab.research.google.com/drive/1Aau3lgPzeZKQ-98h69CCu1UJcvIBLmy2?usp=sharing) is useful for ShareGPT ChatML / Vicuna templates.
42
- - This [text completion notebook](https://colab.research.google.com/drive/1ef-tab5bhkvWmBOObepl1WgJvfvSzn5Q?usp=sharing) is for raw text. This [DPO notebook](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) replicates Zephyr.
43
- - \* Kaggle has 2x T4s, but we use 1. Due to overhead, 1x T4 is 5x faster.
44
-
45
- ## Special Thanks
46
- A huge thank you to the Meta and Llama team for creating and releasing these models.
47
-
48
- ## Model Information
49
-
50
- The Meta Llama 3.1 collection of multilingual large language models (LLMs) is a collection of pretrained and instruction tuned generative models in 8B, 70B and 405B sizes (text in/text out). The Llama 3.1 instruction tuned text only models (8B, 70B, 405B) are optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks.
51
-
52
- **Model developer**: Meta
53
-
54
- **Model Architecture:** Llama 3.1 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
55
-
56
-
57
- <table>
58
- <tr>
59
- <td>
60
- </td>
61
- <td><strong>Training Data</strong>
62
- </td>
63
- <td><strong>Params</strong>
64
- </td>
65
- <td><strong>Input modalities</strong>
66
- </td>
67
- <td><strong>Output modalities</strong>
68
- </td>
69
- <td><strong>Context length</strong>
70
- </td>
71
- <td><strong>GQA</strong>
72
- </td>
73
- <td><strong>Token count</strong>
74
- </td>
75
- <td><strong>Knowledge cutoff</strong>
76
- </td>
77
- </tr>
78
- <tr>
79
- <td rowspan="3" >Llama 3.1 (text only)
80
- </td>
81
- <td rowspan="3" >A new mix of publicly available online data.
82
- </td>
83
- <td>8B
84
- </td>
85
- <td>Multilingual Text
86
- </td>
87
- <td>Multilingual Text and code
88
- </td>
89
- <td>128k
90
- </td>
91
- <td>Yes
92
- </td>
93
- <td rowspan="3" >15T+
94
- </td>
95
- <td rowspan="3" >December 2023
96
- </td>
97
- </tr>
98
- <tr>
99
- <td>70B
100
- </td>
101
- <td>Multilingual Text
102
- </td>
103
- <td>Multilingual Text and code
104
- </td>
105
- <td>128k
106
- </td>
107
- <td>Yes
108
- </td>
109
- </tr>
110
- <tr>
111
- <td>405B
112
- </td>
113
- <td>Multilingual Text
114
- </td>
115
- <td>Multilingual Text and code
116
- </td>
117
- <td>128k
118
- </td>
119
- <td>Yes
120
- </td>
121
- </tr>
122
- </table>
123
-
124
-
125
- **Supported languages:** English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.
126
-
127
- **Llama 3.1 family of models**. Token counts refer to pretraining data only. All model versions use Grouped-Query Attention (GQA) for improved inference scalability.
128
-
129
- **Model Release Date:** July 23, 2024.
130
-
131
- **Status:** This is a static model trained on an offline dataset. Future versions of the tuned models will be released as we improve model safety with community feedback.
132
-
133
- **License:** A custom commercial license, the Llama 3.1 Community License, is available at: [https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE)
134
-
135
- Where to send questions or comments about the model Instructions on how to provide feedback or comments on the model can be found in the model [README](https://github.com/meta-llama/llama3). For more technical information about generation parameters and recipes for how to use Llama 3.1 in applications, please go [here](https://github.com/meta-llama/llama-recipes).
136
-
137
-
138
- ## Intended Use
139
-
140
- **Intended Use Cases** Llama 3.1 is intended for commercial and research use in multiple languages. Instruction tuned text only models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks. The Llama 3.1 model collection also supports the ability to leverage the outputs of its models to improve other models including synthetic data generation and distillation. The Llama 3.1 Community License allows for these use cases.
141
-
142
- **Out-of-scope** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Llama 3.1 Community License. Use in languages beyond those explicitly referenced as supported in this model card**.
143
-
144
- **<span style="text-decoration:underline;">Note</span>: Llama 3.1 has been trained on a broader collection of languages than the 8 supported languages. Developers may fine-tune Llama 3.1 models for languages beyond the 8 supported languages provided they comply with the Llama 3.1 Community License and the Acceptable Use Policy and in such cases are responsible for ensuring that any uses of Llama 3.1 in additional languages is done in a safe and responsible manner.
145
-
146
- ## How to use
147
-
148
- This repository contains two versions of Meta-Llama-3.1-8B-Instruct, for use with transformers and with the original `llama` codebase.
149
-
150
- ### Use with transformers
151
-
152
- Starting with `transformers >= 4.43.0` onward, you can run conversational inference using the Transformers `pipeline` abstraction or by leveraging the Auto classes with the `generate()` function.
153
-
154
- Make sure to update your transformers installation via `pip install --upgrade transformers`.
155
-
156
- ```python
157
- import transformers
158
- import torch
159
-
160
- model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
161
-
162
- pipeline = transformers.pipeline(
163
- "text-generation",
164
- model=model_id,
165
- model_kwargs={"torch_dtype": torch.bfloat16},
166
- device_map="auto",
167
- )
168
-
169
- messages = [
170
- {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
171
- {"role": "user", "content": "Who are you?"},
172
- ]
173
-
174
- outputs = pipeline(
175
- messages,
176
- max_new_tokens=256,
177
- )
178
- print(outputs[0]["generated_text"][-1])
179
- ```
180
-
181
- Note: You can also find detailed recipes on how to use the model locally, with `torch.compile()`, assisted generations, quantised and more at [`huggingface-llama-recipes`](https://github.com/huggingface/huggingface-llama-recipes)
182
-
183
- ### Use with `llama`
184
-
185
- Please, follow the instructions in the [repository](https://github.com/meta-llama/llama)
186
-
187
- To download Original checkpoints, see the example command below leveraging `huggingface-cli`:
188
-
189
- ```
190
- huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-8B-Instruct
191
- ```
192
-
193
- ## Hardware and Software
194
-
195
- **Training Factors** We used custom training libraries, Meta's custom built GPU cluster, and production infrastructure for pretraining. Fine-tuning, annotation, and evaluation were also performed on production infrastructure.
196
-
197
- **Training utilized a cumulative of** 39.3M GPU hours of computation on H100-80GB (TDP of 700W) type hardware, per the table below. Training time is the total GPU time required for training each model and power consumption is the peak power capacity per GPU device used, adjusted for power usage efficiency.
198
-
199
-
200
- **Training Greenhouse Gas Emissions** Estimated total location-based greenhouse gas emissions were **11,390** tons CO2eq for training. Since 2020, Meta has maintained net zero greenhouse gas emissions in its global operations and matched 100% of its electricity use with renewable energy, therefore the total market-based greenhouse gas emissions for training were 0 tons CO2eq.
201
-
202
-
203
- <table>
204
- <tr>
205
- <td>
206
- </td>
207
- <td><strong>Training Time (GPU hours)</strong>
208
- </td>
209
- <td><strong>Training Power Consumption (W)</strong>
210
- </td>
211
- <td><strong>Training Location-Based Greenhouse Gas Emissions</strong>
212
- <p>
213
- <strong>(tons CO2eq)</strong>
214
- </td>
215
- <td><strong>Training Market-Based Greenhouse Gas Emissions</strong>
216
- <p>
217
- <strong>(tons CO2eq)</strong>
218
- </td>
219
- </tr>
220
- <tr>
221
- <td>Llama 3.1 8B
222
- </td>
223
- <td>1.46M
224
- </td>
225
- <td>700
226
- </td>
227
- <td>420
228
- </td>
229
- <td>0
230
- </td>
231
- </tr>
232
- <tr>
233
- <td>Llama 3.1 70B
234
- </td>
235
- <td>7.0M
236
- </td>
237
- <td>700
238
- </td>
239
- <td>2,040
240
- </td>
241
- <td>0
242
- </td>
243
- </tr>
244
- <tr>
245
- <td>Llama 3.1 405B
246
- </td>
247
- <td>30.84M
248
- </td>
249
- <td>700
250
- </td>
251
- <td>8,930
252
- </td>
253
- <td>0
254
- </td>
255
- </tr>
256
- <tr>
257
- <td>Total
258
- </td>
259
- <td>39.3M
260
- <td>
261
- <ul>
262
-
263
- </ul>
264
- </td>
265
- <td>11,390
266
- </td>
267
- <td>0
268
- </td>
269
- </tr>
270
- </table>
271
-
272
-
273
-
274
- The methodology used to determine training energy use and greenhouse gas emissions can be found [here](https://arxiv.org/pdf/2204.05149). Since Meta is openly releasing these models, the training energy use and greenhouse gas emissions will not be incurred by others.
275
-
276
-
277
- ## Training Data
278
-
279
- **Overview:** Llama 3.1 was pretrained on ~15 trillion tokens of data from publicly available sources. The fine-tuning data includes publicly available instruction datasets, as well as over 25M synthetically generated examples.
280
-
281
- **Data Freshness:** The pretraining data has a cutoff of December 2023.
282
-
283
-
284
- ## Benchmark scores
285
-
286
- In this section, we report the results for Llama 3.1 models on standard automatic benchmarks. For all the evaluations, we use our internal evaluations library.
287
-
288
- ### Base pretrained models
289
-
290
-
291
- <table>
292
- <tr>
293
- <td><strong>Category</strong>
294
- </td>
295
- <td><strong>Benchmark</strong>
296
- </td>
297
- <td><strong># Shots</strong>
298
- </td>
299
- <td><strong>Metric</strong>
300
- </td>
301
- <td><strong>Llama 3 8B</strong>
302
- </td>
303
- <td><strong>Llama 3.1 8B</strong>
304
- </td>
305
- <td><strong>Llama 3 70B</strong>
306
- </td>
307
- <td><strong>Llama 3.1 70B</strong>
308
- </td>
309
- <td><strong>Llama 3.1 405B</strong>
310
- </td>
311
- </tr>
312
- <tr>
313
- <td rowspan="7" >General
314
- </td>
315
- <td>MMLU
316
- </td>
317
- <td>5
318
- </td>
319
- <td>macro_avg/acc_char
320
- </td>
321
- <td>66.7
322
- </td>
323
- <td>66.7
324
- </td>
325
- <td>79.5
326
- </td>
327
- <td>79.3
328
- </td>
329
- <td>85.2
330
- </td>
331
- </tr>
332
- <tr>
333
- <td>MMLU-Pro (CoT)
334
- </td>
335
- <td>5
336
- </td>
337
- <td>macro_avg/acc_char
338
- </td>
339
- <td>36.2
340
- </td>
341
- <td>37.1
342
- </td>
343
- <td>55.0
344
- </td>
345
- <td>53.8
346
- </td>
347
- <td>61.6
348
- </td>
349
- </tr>
350
- <tr>
351
- <td>AGIEval English
352
- </td>
353
- <td>3-5
354
- </td>
355
- <td>average/acc_char
356
- </td>
357
- <td>47.1
358
- </td>
359
- <td>47.8
360
- </td>
361
- <td>63.0
362
- </td>
363
- <td>64.6
364
- </td>
365
- <td>71.6
366
- </td>
367
- </tr>
368
- <tr>
369
- <td>CommonSenseQA
370
- </td>
371
- <td>7
372
- </td>
373
- <td>acc_char
374
- </td>
375
- <td>72.6
376
- </td>
377
- <td>75.0
378
- </td>
379
- <td>83.8
380
- </td>
381
- <td>84.1
382
- </td>
383
- <td>85.8
384
- </td>
385
- </tr>
386
- <tr>
387
- <td>Winogrande
388
- </td>
389
- <td>5
390
- </td>
391
- <td>acc_char
392
- </td>
393
- <td>-
394
- </td>
395
- <td>60.5
396
- </td>
397
- <td>-
398
- </td>
399
- <td>83.3
400
- </td>
401
- <td>86.7
402
- </td>
403
- </tr>
404
- <tr>
405
- <td>BIG-Bench Hard (CoT)
406
- </td>
407
- <td>3
408
- </td>
409
- <td>average/em
410
- </td>
411
- <td>61.1
412
- </td>
413
- <td>64.2
414
- </td>
415
- <td>81.3
416
- </td>
417
- <td>81.6
418
- </td>
419
- <td>85.9
420
- </td>
421
- </tr>
422
- <tr>
423
- <td>ARC-Challenge
424
- </td>
425
- <td>25
426
- </td>
427
- <td>acc_char
428
- </td>
429
- <td>79.4
430
- </td>
431
- <td>79.7
432
- </td>
433
- <td>93.1
434
- </td>
435
- <td>92.9
436
- </td>
437
- <td>96.1
438
- </td>
439
- </tr>
440
- <tr>
441
- <td>Knowledge reasoning
442
- </td>
443
- <td>TriviaQA-Wiki
444
- </td>
445
- <td>5
446
- </td>
447
- <td>em
448
- </td>
449
- <td>78.5
450
- </td>
451
- <td>77.6
452
- </td>
453
- <td>89.7
454
- </td>
455
- <td>89.8
456
- </td>
457
- <td>91.8
458
- </td>
459
- </tr>
460
- <tr>
461
- <td rowspan="4" >Reading comprehension
462
- </td>
463
- <td>SQuAD
464
- </td>
465
- <td>1
466
- </td>
467
- <td>em
468
- </td>
469
- <td>76.4
470
- </td>
471
- <td>77.0
472
- </td>
473
- <td>85.6
474
- </td>
475
- <td>81.8
476
- </td>
477
- <td>89.3
478
- </td>
479
- </tr>
480
- <tr>
481
- <td>QuAC (F1)
482
- </td>
483
- <td>1
484
- </td>
485
- <td>f1
486
- </td>
487
- <td>44.4
488
- </td>
489
- <td>44.9
490
- </td>
491
- <td>51.1
492
- </td>
493
- <td>51.1
494
- </td>
495
- <td>53.6
496
- </td>
497
- </tr>
498
- <tr>
499
- <td>BoolQ
500
- </td>
501
- <td>0
502
- </td>
503
- <td>acc_char
504
- </td>
505
- <td>75.7
506
- </td>
507
- <td>75.0
508
- </td>
509
- <td>79.0
510
- </td>
511
- <td>79.4
512
- </td>
513
- <td>80.0
514
- </td>
515
- </tr>
516
- <tr>
517
- <td>DROP (F1)
518
- </td>
519
- <td>3
520
- </td>
521
- <td>f1
522
- </td>
523
- <td>58.4
524
- </td>
525
- <td>59.5
526
- </td>
527
- <td>79.7
528
- </td>
529
- <td>79.6
530
- </td>
531
- <td>84.8
532
- </td>
533
- </tr>
534
- </table>
535
-
536
-
537
-
538
- ### Instruction tuned models
539
-
540
-
541
- <table>
542
- <tr>
543
- <td><strong>Category</strong>
544
- </td>
545
- <td><strong>Benchmark</strong>
546
- </td>
547
- <td><strong># Shots</strong>
548
- </td>
549
- <td><strong>Metric</strong>
550
- </td>
551
- <td><strong>Llama 3 8B Instruct</strong>
552
- </td>
553
- <td><strong>Llama 3.1 8B Instruct</strong>
554
- </td>
555
- <td><strong>Llama 3 70B Instruct</strong>
556
- </td>
557
- <td><strong>Llama 3.1 70B Instruct</strong>
558
- </td>
559
- <td><strong>Llama 3.1 405B Instruct</strong>
560
- </td>
561
- </tr>
562
- <tr>
563
- <td rowspan="4" >General
564
- </td>
565
- <td>MMLU
566
- </td>
567
- <td>5
568
- </td>
569
- <td>macro_avg/acc
570
- </td>
571
- <td>68.5
572
- </td>
573
- <td>69.4
574
- </td>
575
- <td>82.0
576
- </td>
577
- <td>83.6
578
- </td>
579
- <td>87.3
580
- </td>
581
- </tr>
582
- <tr>
583
- <td>MMLU (CoT)
584
- </td>
585
- <td>0
586
- </td>
587
- <td>macro_avg/acc
588
- </td>
589
- <td>65.3
590
- </td>
591
- <td>73.0
592
- </td>
593
- <td>80.9
594
- </td>
595
- <td>86.0
596
- </td>
597
- <td>88.6
598
- </td>
599
- </tr>
600
- <tr>
601
- <td>MMLU-Pro (CoT)
602
- </td>
603
- <td>5
604
- </td>
605
- <td>micro_avg/acc_char
606
- </td>
607
- <td>45.5
608
- </td>
609
- <td>48.3
610
- </td>
611
- <td>63.4
612
- </td>
613
- <td>66.4
614
- </td>
615
- <td>73.3
616
- </td>
617
- </tr>
618
- <tr>
619
- <td>IFEval
620
- </td>
621
- <td>
622
- </td>
623
- <td>
624
- </td>
625
- <td>76.8
626
- </td>
627
- <td>80.4
628
- </td>
629
- <td>82.9
630
- </td>
631
- <td>87.5
632
- </td>
633
- <td>88.6
634
- </td>
635
- </tr>
636
- <tr>
637
- <td rowspan="2" >Reasoning
638
- </td>
639
- <td>ARC-C
640
- </td>
641
- <td>0
642
- </td>
643
- <td>acc
644
- </td>
645
- <td>82.4
646
- </td>
647
- <td>83.4
648
- </td>
649
- <td>94.4
650
- </td>
651
- <td>94.8
652
- </td>
653
- <td>96.9
654
- </td>
655
- </tr>
656
- <tr>
657
- <td>GPQA
658
- </td>
659
- <td>0
660
- </td>
661
- <td>em
662
- </td>
663
- <td>34.6
664
- </td>
665
- <td>30.4
666
- </td>
667
- <td>39.5
668
- </td>
669
- <td>41.7
670
- </td>
671
- <td>50.7
672
- </td>
673
- </tr>
674
- <tr>
675
- <td rowspan="4" >Code
676
- </td>
677
- <td>HumanEval
678
- </td>
679
- <td>0
680
- </td>
681
- <td>pass@1
682
- </td>
683
- <td>60.4
684
- </td>
685
- <td>72.6
686
- </td>
687
- <td>81.7
688
- </td>
689
- <td>80.5
690
- </td>
691
- <td>89.0
692
- </td>
693
- </tr>
694
- <tr>
695
- <td>MBPP ++ base version
696
- </td>
697
- <td>0
698
- </td>
699
- <td>pass@1
700
- </td>
701
- <td>70.6
702
- </td>
703
- <td>72.8
704
- </td>
705
- <td>82.5
706
- </td>
707
- <td>86.0
708
- </td>
709
- <td>88.6
710
- </td>
711
- </tr>
712
- <tr>
713
- <td>Multipl-E HumanEval
714
- </td>
715
- <td>0
716
- </td>
717
- <td>pass@1
718
- </td>
719
- <td>-
720
- </td>
721
- <td>50.8
722
- </td>
723
- <td>-
724
- </td>
725
- <td>65.5
726
- </td>
727
- <td>75.2
728
- </td>
729
- </tr>
730
- <tr>
731
- <td>Multipl-E MBPP
732
- </td>
733
- <td>0
734
- </td>
735
- <td>pass@1
736
- </td>
737
- <td>-
738
- </td>
739
- <td>52.4
740
- </td>
741
- <td>-
742
- </td>
743
- <td>62.0
744
- </td>
745
- <td>65.7
746
- </td>
747
- </tr>
748
- <tr>
749
- <td rowspan="2" >Math
750
- </td>
751
- <td>GSM-8K (CoT)
752
- </td>
753
- <td>8
754
- </td>
755
- <td>em_maj1@1
756
- </td>
757
- <td>80.6
758
- </td>
759
- <td>84.5
760
- </td>
761
- <td>93.0
762
- </td>
763
- <td>95.1
764
- </td>
765
- <td>96.8
766
- </td>
767
- </tr>
768
- <tr>
769
- <td>MATH (CoT)
770
- </td>
771
- <td>0
772
- </td>
773
- <td>final_em
774
- </td>
775
- <td>29.1
776
- </td>
777
- <td>51.9
778
- </td>
779
- <td>51.0
780
- </td>
781
- <td>68.0
782
- </td>
783
- <td>73.8
784
- </td>
785
- </tr>
786
- <tr>
787
- <td rowspan="4" >Tool Use
788
- </td>
789
- <td>API-Bank
790
- </td>
791
- <td>0
792
- </td>
793
- <td>acc
794
- </td>
795
- <td>48.3
796
- </td>
797
- <td>82.6
798
- </td>
799
- <td>85.1
800
- </td>
801
- <td>90.0
802
- </td>
803
- <td>92.0
804
- </td>
805
- </tr>
806
- <tr>
807
- <td>BFCL
808
- </td>
809
- <td>0
810
- </td>
811
- <td>acc
812
- </td>
813
- <td>60.3
814
- </td>
815
- <td>76.1
816
- </td>
817
- <td>83.0
818
- </td>
819
- <td>84.8
820
- </td>
821
- <td>88.5
822
- </td>
823
- </tr>
824
- <tr>
825
- <td>Gorilla Benchmark API Bench
826
- </td>
827
- <td>0
828
- </td>
829
- <td>acc
830
- </td>
831
- <td>1.7
832
- </td>
833
- <td>8.2
834
- </td>
835
- <td>14.7
836
- </td>
837
- <td>29.7
838
- </td>
839
- <td>35.3
840
- </td>
841
- </tr>
842
- <tr>
843
- <td>Nexus (0-shot)
844
- </td>
845
- <td>0
846
- </td>
847
- <td>macro_avg/acc
848
- </td>
849
- <td>18.1
850
- </td>
851
- <td>38.5
852
- </td>
853
- <td>47.8
854
- </td>
855
- <td>56.7
856
- </td>
857
- <td>58.7
858
- </td>
859
- </tr>
860
- <tr>
861
- <td>Multilingual
862
- </td>
863
- <td>Multilingual MGSM (CoT)
864
- </td>
865
- <td>0
866
- </td>
867
- <td>em
868
- </td>
869
- <td>-
870
- </td>
871
- <td>68.9
872
- </td>
873
- <td>-
874
- </td>
875
- <td>86.9
876
- </td>
877
- <td>91.6
878
- </td>
879
- </tr>
880
- </table>
881
-
882
- #### Multilingual benchmarks
883
-
884
- <table>
885
- <tr>
886
- <td><strong>Category</strong>
887
- </td>
888
- <td><strong>Benchmark</strong>
889
- </td>
890
- <td><strong>Language</strong>
891
- </td>
892
- <td><strong>Llama 3.1 8B</strong>
893
- </td>
894
- <td><strong>Llama 3.1 70B</strong>
895
- </td>
896
- <td><strong>Llama 3.1 405B</strong>
897
- </td>
898
- </tr>
899
- <tr>
900
- <td rowspan="9" ><strong>General</strong>
901
- </td>
902
- <td rowspan="9" ><strong>MMLU (5-shot, macro_avg/acc)</strong>
903
- </td>
904
- <td>Portuguese
905
- </td>
906
- <td>62.12
907
- </td>
908
- <td>80.13
909
- </td>
910
- <td>84.95
911
- </td>
912
- </tr>
913
- <tr>
914
- <td>Spanish
915
- </td>
916
- <td>62.45
917
- </td>
918
- <td>80.05
919
- </td>
920
- <td>85.08
921
- </td>
922
- </tr>
923
- <tr>
924
- <td>Italian
925
- </td>
926
- <td>61.63
927
- </td>
928
- <td>80.4
929
- </td>
930
- <td>85.04
931
- </td>
932
- </tr>
933
- <tr>
934
- <td>German
935
- </td>
936
- <td>60.59
937
- </td>
938
- <td>79.27
939
- </td>
940
- <td>84.36
941
- </td>
942
- </tr>
943
- <tr>
944
- <td>French
945
- </td>
946
- <td>62.34
947
- </td>
948
- <td>79.82
949
- </td>
950
- <td>84.66
951
- </td>
952
- </tr>
953
- <tr>
954
- <td>Hindi
955
- </td>
956
- <td>50.88
957
- </td>
958
- <td>74.52
959
- </td>
960
- <td>80.31
961
- </td>
962
- </tr>
963
- <tr>
964
- <td>Thai
965
- </td>
966
- <td>50.32
967
- </td>
968
- <td>72.95
969
- </td>
970
- <td>78.21
971
- </td>
972
- </tr>
973
- </table>
974
 
 
975
 
976
 
977
- ## Responsibility & Safety
978
 
979
- As part of our Responsible release approach, we followed a three-pronged strategy to managing trust & safety risks:
980
 
 
981
 
 
982
 
983
- * Enable developers to deploy helpful, safe and flexible experiences for their target audience and for the use cases supported by Llama.
984
- * Protect developers against adversarial users aiming to exploit Llama capabilities to potentially cause harm.
985
- * Provide protections for the community to help prevent the misuse of our models.
986
 
 
 
 
 
 
 
 
987
 
988
- ### Responsible deployment
989
 
990
- Llama is a foundational technology designed to be used in a variety of use cases, examples on how Meta’s Llama models have been responsibly deployed can be found in our [Community Stories webpage](https://llama.meta.com/community-stories/). Our approach is to build the most helpful models enabling the world to benefit from the technology power, by aligning our model safety for the generic use cases addressing a standard set of harms. Developers are then in the driver seat to tailor safety for their use case, defining their own policy and deploying the models with the necessary safeguards in their Llama systems. Llama 3.1 was developed following the best practices outlined in our Responsible Use Guide, you can refer to the [Responsible Use Guide](https://llama.meta.com/responsible-use-guide/) to learn more.
991
 
 
 
 
992
 
993
- #### Llama 3.1 instruct
994
 
995
- Our main objectives for conducting safety fine-tuning are to provide the research community with a valuable resource for studying the robustness of safety fine-tuning, as well as to offer developers a readily available, safe, and powerful model for various applications to reduce the developer workload to deploy safe AI systems. For more details on the safety mitigations implemented please read the Llama 3 paper.
996
 
997
- **Fine-tuning data**
998
 
999
- We employ a multi-faceted approach to data collection, combining human-generated data from our vendors with synthetic data to mitigate potential safety risks. We’ve developed many large language model (LLM)-based classifiers that enable us to thoughtfully select high-quality prompts and responses, enhancing data quality control.
1000
 
1001
- **Refusals and Tone**
1002
 
1003
- Building on the work we started with Llama 3, we put a great emphasis on model refusals to benign prompts as well as refusal tone. We included both borderline and adversarial prompts in our safety data strategy, and modified our safety data responses to follow tone guidelines.
1004
 
 
1005
 
1006
- #### Llama 3.1 systems
1007
 
1008
- **Large language models, including Llama 3.1, are not designed to be deployed in isolation but instead should be deployed as part of an overall AI system with additional safety guardrails as required.** Developers are expected to deploy system safeguards when building agentic systems. Safeguards are key to achieve the right helpfulness-safety alignment as well as mitigating safety and security risks inherent to the system and any integration of the model or system with external tools.
1009
 
1010
- As part of our responsible release approach, we provide the community with [safeguards](https://llama.meta.com/trust-and-safety/) that developers should deploy with Llama models or other LLMs, including Llama Guard 3, Prompt Guard and Code Shield. All our [reference implementations](https://github.com/meta-llama/llama-agentic-system) demos contain these safeguards by default so developers can benefit from system-level safety out-of-the-box.
1011
 
 
1012
 
1013
- #### New capabilities
1014
 
1015
- Note that this release introduces new capabilities, including a longer context window, multilingual inputs and outputs and possible integrations by developers with third party tools. Building with these new capabilities requires specific considerations in addition to the best practices that generally apply across all Generative AI use cases.
1016
 
1017
- **Tool-use**: Just like in standard software development, developers are responsible for the integration of the LLM with the tools and services of their choice. They should define a clear policy for their use case and assess the integrity of the third party services they use to be aware of the safety and security limitations when using this capability. Refer to the Responsible Use Guide for best practices on the safe deployment of the third party safeguards.
1018
 
1019
- **Multilinguality**: Llama 3.1 supports 7 languages in addition to English: French, German, Hindi, Italian, Portuguese, Spanish, and Thai. Llama may be able to output text in other languages than those that meet performance thresholds for safety and helpfulness. We strongly discourage developers from using this model to converse in non-supported languages without implementing finetuning and system controls in alignment with their policies and the best practices shared in the Responsible Use Guide.
1020
 
 
1021
 
1022
- ### Evaluations
1023
 
1024
- We evaluated Llama models for common use cases as well as specific capabilities. Common use cases evaluations measure safety risks of systems for most commonly built applications including chat bot, coding assistant, tool calls. We built dedicated, adversarial evaluation datasets and evaluated systems composed of Llama models and Llama Guard 3 to filter input prompt and output response. It is important to evaluate applications in context, and we recommend building dedicated evaluation dataset for your use case. Prompt Guard and Code Shield are also available if relevant to the application.
1025
 
1026
- Capability evaluations measure vulnerabilities of Llama models inherent to specific capabilities, for which were crafted dedicated benchmarks including long context, multilingual, tools calls, coding or memorization.
1027
 
1028
- **Red teaming**
1029
 
1030
- For both scenarios, we conducted recurring red teaming exercises with the goal of discovering risks via adversarial prompting and we used the learnings to improve our benchmarks and safety tuning datasets.
1031
 
1032
- We partnered early with subject-matter experts in critical risk areas to understand the nature of these real-world harms and how such models may lead to unintended harm for society. Based on these conversations, we derived a set of adversarial goals for the red team to attempt to achieve, such as extracting harmful information or reprogramming the model to act in a potentially harmful capacity. The red team consisted of experts in cybersecurity, adversarial machine learning, responsible AI, and integrity in addition to multilingual content specialists with background in integrity issues in specific geographic markets.
1033
 
 
1034
 
1035
- ### Critical and other risks
1036
 
1037
- We specifically focused our efforts on mitigating the following critical risk areas:
1038
 
1039
- **1- CBRNE (Chemical, Biological, Radiological, Nuclear, and Explosive materials) helpfulness**
1040
 
1041
- To assess risks related to proliferation of chemical and biological weapons, we performed uplift testing designed to assess whether use of Llama 3.1 models could meaningfully increase the capabilities of malicious actors to plan or carry out attacks using these types of weapons.
1042
 
 
1043
 
1044
- **2. Child Safety**
1045
 
1046
- Child Safety risk assessments were conducted using a team of experts, to assess the model’s capability to produce outputs that could result in Child Safety risks and inform on any necessary and appropriate risk mitigations via fine tuning. We leveraged those expert red teaming sessions to expand the coverage of our evaluation benchmarks through Llama 3 model development. For Llama 3, we conducted new in-depth sessions using objective based methodologies to assess the model risks along multiple attack vectors including the additional languages Llama 3 is trained on. We also partnered with content specialists to perform red teaming exercises assessing potentially violating content while taking account of market specific nuances or experiences.
1047
 
1048
- **3. Cyber attack enablement**
1049
 
1050
- Our cyber attack uplift study investigated whether LLMs can enhance human capabilities in hacking tasks, both in terms of skill level and speed.
1051
 
1052
- Our attack automation study focused on evaluating the capabilities of LLMs when used as autonomous agents in cyber offensive operations, specifically in the context of ransomware attacks. This evaluation was distinct from previous studies that considered LLMs as interactive assistants. The primary objective was to assess whether these models could effectively function as independent agents in executing complex cyber-attacks without human intervention.
1053
 
1054
- Our study of Llama-3.1-405B’s social engineering uplift for cyber attackers was conducted to assess the effectiveness of AI models in aiding cyber threat actors in spear phishing campaigns. Please read our Llama 3.1 Cyber security whitepaper to learn more.
1055
 
 
1056
 
1057
- ### Community
1058
 
1059
- Generative AI safety requires expertise and tooling, and we believe in the strength of the open community to accelerate its progress. We are active members of open consortiums, including the AI Alliance, Partnership on AI and MLCommons, actively contributing to safety standardization and transparency. We encourage the community to adopt taxonomies like the MLCommons Proof of Concept evaluation to facilitate collaboration and transparency on safety and content evaluations. Our Purple Llama tools are open sourced for the community to use and widely distributed across ecosystem partners including cloud service providers. We encourage community contributions to our [Github repository](https://github.com/meta-llama/PurpleLlama).
1060
 
1061
- We also set up the [Llama Impact Grants](https://llama.meta.com/llama-impact-grants/) program to identify and support the most compelling applications of Meta’s Llama model for societal benefit across three categories: education, climate and open innovation. The 20 finalists from the hundreds of applications can be found [here](https://llama.meta.com/llama-impact-grants/#finalists).
1062
 
1063
- Finally, we put in place a set of resources including an [output reporting mechanism](https://developers.facebook.com/llama_output_feedback) and [bug bounty program](https://www.facebook.com/whitehat) to continuously improve the Llama technology with the help of the community.
1064
 
 
1065
 
1066
- ## Ethical Considerations and Limitations
1067
 
1068
- The core values of Llama 3.1 are openness, inclusivity and helpfulness. It is meant to serve everyone, and to work for a wide range of use cases. It is thus designed to be accessible to people across many different backgrounds, experiences and perspectives. Llama 3.1 addresses users and their needs as they are, without insertion unnecessary judgment or normativity, while reflecting the understanding that even content that may appear problematic in some cases can serve valuable purposes in others. It respects the dignity and autonomy of all users, especially in terms of the values of free thought and expression that power innovation and progress.
1069
 
1070
- But Llama 3.1 is a new technology, and like any new technology, there are risks associated with its use. Testing conducted to date has not covered, nor could it cover, all scenarios. For these reasons, as with all LLMs, Llama 3.1’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 3.1 models, developers should perform safety testing and tuning tailored to their specific applications of the model. Please refer to available resources including our [Responsible Use Guide](https://llama.meta.com/responsible-use-guide), [Trust and Safety](https://llama.meta.com/trust-and-safety/) solutions, and other [resources](https://llama.meta.com/docs/get-started/) to learn more about responsible development.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
 
 
2
  library_name: transformers
3
+ tags: []
 
 
 
 
 
 
 
4
  ---
5
 
6
+ # Model Card for Model ID
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ <!-- Provide a quick summary of what the model is/does. -->
9
 
10
 
 
11
 
12
+ ## Model Details
13
 
14
+ ### Model Description
15
 
16
+ <!-- Provide a longer summary of what this model is. -->
17
 
18
+ This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
19
 
20
+ - **Developed by:** [More Information Needed]
21
+ - **Funded by [optional]:** [More Information Needed]
22
+ - **Shared by [optional]:** [More Information Needed]
23
+ - **Model type:** [More Information Needed]
24
+ - **Language(s) (NLP):** [More Information Needed]
25
+ - **License:** [More Information Needed]
26
+ - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
+ ### Model Sources [optional]
29
 
30
+ <!-- Provide the basic links for the model. -->
31
 
32
+ - **Repository:** [More Information Needed]
33
+ - **Paper [optional]:** [More Information Needed]
34
+ - **Demo [optional]:** [More Information Needed]
35
 
36
+ ## Uses
37
 
38
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
 
40
+ ### Direct Use
41
 
42
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
 
44
+ [More Information Needed]
45
 
46
+ ### Downstream Use [optional]
47
 
48
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
 
50
+ [More Information Needed]
51
 
52
+ ### Out-of-Scope Use
53
 
54
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
 
56
+ [More Information Needed]
57
 
58
+ ## Bias, Risks, and Limitations
59
 
60
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
 
62
+ [More Information Needed]
63
 
64
+ ### Recommendations
65
 
66
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
 
68
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
 
70
+ ## How to Get Started with the Model
71
 
72
+ Use the code below to get started with the model.
73
 
74
+ [More Information Needed]
75
 
76
+ ## Training Details
77
 
78
+ ### Training Data
79
 
80
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
 
82
+ [More Information Needed]
83
 
84
+ ### Training Procedure
85
 
86
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
 
88
+ #### Preprocessing [optional]
89
 
90
+ [More Information Needed]
91
 
 
92
 
93
+ #### Training Hyperparameters
94
 
95
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
 
97
+ #### Speeds, Sizes, Times [optional]
98
 
99
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
 
101
+ [More Information Needed]
102
 
103
+ ## Evaluation
104
 
105
+ <!-- This section describes the evaluation protocols and provides the results. -->
106
 
107
+ ### Testing Data, Factors & Metrics
108
 
109
+ #### Testing Data
110
 
111
+ <!-- This should link to a Dataset Card if possible. -->
112
 
113
+ [More Information Needed]
114
 
115
+ #### Factors
116
 
117
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
+ [More Information Needed]
120
+
121
+ #### Metrics
122
+
123
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
+
125
+ [More Information Needed]
126
+
127
+ ### Results
128
+
129
+ [More Information Needed]
130
+
131
+ #### Summary
132
+
133
+
134
+
135
+ ## Model Examination [optional]
136
+
137
+ <!-- Relevant interpretability work for the model goes here -->
138
+
139
+ [More Information Needed]
140
+
141
+ ## Environmental Impact
142
+
143
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
+
145
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
+
147
+ - **Hardware Type:** [More Information Needed]
148
+ - **Hours used:** [More Information Needed]
149
+ - **Cloud Provider:** [More Information Needed]
150
+ - **Compute Region:** [More Information Needed]
151
+ - **Carbon Emitted:** [More Information Needed]
152
+
153
+ ## Technical Specifications [optional]
154
+
155
+ ### Model Architecture and Objective
156
+
157
+ [More Information Needed]
158
+
159
+ ### Compute Infrastructure
160
+
161
+ [More Information Needed]
162
+
163
+ #### Hardware
164
+
165
+ [More Information Needed]
166
+
167
+ #### Software
168
+
169
+ [More Information Needed]
170
+
171
+ ## Citation [optional]
172
+
173
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
+
175
+ **BibTeX:**
176
+
177
+ [More Information Needed]
178
+
179
+ **APA:**
180
+
181
+ [More Information Needed]
182
+
183
+ ## Glossary [optional]
184
+
185
+ <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
+
187
+ [More Information Needed]
188
+
189
+ ## More Information [optional]
190
+
191
+ [More Information Needed]
192
+
193
+ ## Model Card Authors [optional]
194
+
195
+ [More Information Needed]
196
+
197
+ ## Model Card Contact
198
+
199
+ [More Information Needed]
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "unsloth/Meta-Llama-3.1-8B-Instruct",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
@@ -21,7 +21,6 @@
21
  "num_attention_heads": 32,
22
  "num_hidden_layers": 32,
23
  "num_key_value_heads": 8,
24
- "pad_token_id": 128004,
25
  "pretraining_tp": 1,
26
  "quantization_config": {
27
  "_load_in_4bit": true,
@@ -49,8 +48,7 @@
49
  "rope_theta": 500000.0,
50
  "tie_word_embeddings": false,
51
  "torch_dtype": "bfloat16",
52
- "transformers_version": "4.44.2",
53
- "unsloth_version": "2024.9",
54
  "use_cache": true,
55
  "vocab_size": 128256
56
  }
 
1
  {
2
+ "_name_or_path": "meta-llama/Meta-Llama-3.1-8B-Instruct",
3
  "architectures": [
4
  "LlamaForCausalLM"
5
  ],
 
21
  "num_attention_heads": 32,
22
  "num_hidden_layers": 32,
23
  "num_key_value_heads": 8,
 
24
  "pretraining_tp": 1,
25
  "quantization_config": {
26
  "_load_in_4bit": true,
 
48
  "rope_theta": 500000.0,
49
  "tie_word_embeddings": false,
50
  "torch_dtype": "bfloat16",
51
+ "transformers_version": "4.43.1",
 
52
  "use_cache": true,
53
  "vocab_size": 128256
54
  }
generation_config.json CHANGED
@@ -6,9 +6,7 @@
6
  128008,
7
  128009
8
  ],
9
- "max_length": 131072,
10
- "pad_token_id": 128004,
11
  "temperature": 0.6,
12
  "top_p": 0.9,
13
- "transformers_version": "4.44.2"
14
  }
 
6
  128008,
7
  128009
8
  ],
 
 
9
  "temperature": 0.6,
10
  "top_p": 0.9,
11
+ "transformers_version": "4.43.1"
12
  }
special_tokens_map.json CHANGED
@@ -13,5 +13,11 @@
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
- "pad_token": "<|finetune_right_pad_id|>"
 
 
 
 
 
 
17
  }
 
13
  "rstrip": false,
14
  "single_word": false
15
  },
16
+ "pad_token": {
17
+ "content": "<|finetune_right_pad_id|>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ }
23
  }
tokenizer.json CHANGED
@@ -2329,69 +2329,10 @@
2329
  ]
2330
  },
2331
  "post_processor": {
2332
- "type": "Sequence",
2333
- "processors": [
2334
- {
2335
- "type": "ByteLevel",
2336
- "add_prefix_space": true,
2337
- "trim_offsets": false,
2338
- "use_regex": true
2339
- },
2340
- {
2341
- "type": "TemplateProcessing",
2342
- "single": [
2343
- {
2344
- "SpecialToken": {
2345
- "id": "<|begin_of_text|>",
2346
- "type_id": 0
2347
- }
2348
- },
2349
- {
2350
- "Sequence": {
2351
- "id": "A",
2352
- "type_id": 0
2353
- }
2354
- }
2355
- ],
2356
- "pair": [
2357
- {
2358
- "SpecialToken": {
2359
- "id": "<|begin_of_text|>",
2360
- "type_id": 0
2361
- }
2362
- },
2363
- {
2364
- "Sequence": {
2365
- "id": "A",
2366
- "type_id": 0
2367
- }
2368
- },
2369
- {
2370
- "SpecialToken": {
2371
- "id": "<|begin_of_text|>",
2372
- "type_id": 1
2373
- }
2374
- },
2375
- {
2376
- "Sequence": {
2377
- "id": "B",
2378
- "type_id": 1
2379
- }
2380
- }
2381
- ],
2382
- "special_tokens": {
2383
- "<|begin_of_text|>": {
2384
- "id": "<|begin_of_text|>",
2385
- "ids": [
2386
- 128000
2387
- ],
2388
- "tokens": [
2389
- "<|begin_of_text|>"
2390
- ]
2391
- }
2392
- }
2393
- }
2394
- ]
2395
  },
2396
  "decoder": {
2397
  "type": "ByteLevel",
 
2329
  ]
2330
  },
2331
  "post_processor": {
2332
+ "type": "ByteLevel",
2333
+ "add_prefix_space": true,
2334
+ "trim_offsets": false,
2335
+ "use_regex": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2336
  },
2337
  "decoder": {
2338
  "type": "ByteLevel",
tokenizer_config.json CHANGED
@@ -2050,7 +2050,7 @@
2050
  }
2051
  },
2052
  "bos_token": "<|begin_of_text|>",
2053
- "chat_template": "{{- bos_token }}\n{%- if custom_tools is defined %}\n {%- set tools = custom_tools %}\n{%- endif %}\n{%- if not tools_in_user_message is defined %}\n {%- set tools_in_user_message = true %}\n{%- endif %}\n{%- if not date_string is defined %}\n {%- set date_string = \"26 Jul 2024\" %}\n{%- endif %}\n{%- if not tools is defined %}\n {%- set tools = none %}\n{%- endif %}\n\n{#- This block extracts the system message, so we can slot it into the right place. #}\n{%- if messages[0]['role'] == 'system' %}\n {%- set system_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n{%- else %}\n {%- set system_message = \"\" %}\n{%- endif %}\n\n{#- System message + builtin tools #}\n{{- \"<|start_header_id|>system<|end_header_id|>\\n\\n\" }}\n{%- if builtin_tools is defined or tools is not none %}\n {{- \"Environment: ipython\\n\" }}\n{%- endif %}\n{%- if builtin_tools is defined %}\n {{- \"Tools: \" + builtin_tools | reject('equalto', 'code_interpreter') | join(\", \") + \"\\n\\n\"}}\n{%- endif %}\n{{- \"Cutting Knowledge Date: December 2023\\n\" }}\n{{- \"Today Date: \" + date_string + \"\\n\\n\" }}\n{%- if tools is not none and not tools_in_user_message %}\n {{- \"You have access to the following functions. To call a function, please respond with JSON for a function call.\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n{%- endif %}\n{{- system_message }}\n{{- \"<|eot_id|>\" }}\n\n{#- Custom tools are passed in a user message with some extra guidance #}\n{%- if tools_in_user_message and not tools is none %}\n {#- Extract the first user message so we can plug it in here #}\n {%- if messages | length != 0 %}\n {%- set first_user_message = messages[0]['content']|trim %}\n {%- set messages = messages[1:] %}\n {%- else %}\n {{- raise_exception(\"Cannot put tools in the first user message when there's no first user message!\") }}\n{%- endif %}\n {{- '<|start_header_id|>user<|end_header_id|>\\n\\n' -}}\n {{- \"Given the following functions, please respond with a JSON for a function call \" }}\n {{- \"with its proper arguments that best answers the given prompt.\\n\\n\" }}\n {{- 'Respond in the format {\"name\": function name, \"parameters\": dictionary of argument name and its value}.' }}\n {{- \"Do not use variables.\\n\\n\" }}\n {%- for t in tools %}\n {{- t | tojson(indent=4) }}\n {{- \"\\n\\n\" }}\n {%- endfor %}\n {{- first_user_message + \"<|eot_id|>\"}}\n{%- endif %}\n\n{%- for message in messages %}\n {%- if not (message.role == 'ipython' or message.role == 'tool' or 'tool_calls' in message) %}\n {{- '<|start_header_id|>' + message['role'] + '<|end_header_id|>\\n\\n'+ message['content'] | trim + '<|eot_id|>' }}\n {%- elif 'tool_calls' in message %}\n {%- if not message.tool_calls|length == 1 %}\n {{- raise_exception(\"This model only supports single tool-calls at once!\") }}\n {%- endif %}\n {%- set tool_call = message.tool_calls[0].function %}\n {%- if builtin_tools is defined and tool_call.name in builtin_tools %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- \"<|python_tag|>\" + tool_call.name + \".call(\" }}\n {%- for arg_name, arg_val in tool_call.arguments | items %}\n {{- arg_name + '=\"' + arg_val + '\"' }}\n {%- if not loop.last %}\n {{- \", \" }}\n {%- endif %}\n {%- endfor %}\n {{- \")\" }}\n {%- else %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' -}}\n {{- '{\"name\": \"' + tool_call.name + '\", ' }}\n {{- '\"parameters\": ' }}\n {{- tool_call.arguments | tojson }}\n {{- \"}\" }}\n {%- endif %}\n {%- if builtin_tools is defined %}\n {#- This means we're in ipython mode #}\n {{- \"<|eom_id|>\" }}\n {%- else %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n {%- elif message.role == \"tool\" or message.role == \"ipython\" %}\n {{- \"<|start_header_id|>ipython<|end_header_id|>\\n\\n\" }}\n {%- if message.content is mapping or message.content is iterable %}\n {{- message.content | tojson }}\n {%- else %}\n {{- message.content }}\n {%- endif %}\n {{- \"<|eot_id|>\" }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|start_header_id|>assistant<|end_header_id|>\\n\\n' }}\n{%- endif %}\n",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
2056
  "model_input_names": [
 
2050
  }
2051
  },
2052
  "bos_token": "<|begin_of_text|>",
2053
+ "chat_template": "{% set loop_messages = messages %}{% for message in loop_messages %}{% set content = '<|start_header_id|>' + message['role'] + '<|end_header_id|>\n\n'+ message['content'] | trim + '<|eot_id|>' %}{% if loop.index0 == 0 %}{% set content = bos_token + content %}{% endif %}{{ content }}{% endfor %}{{ '<|start_header_id|>assistant<|end_header_id|>\n\n' }}",
2054
  "clean_up_tokenization_spaces": true,
2055
  "eos_token": "<|eot_id|>",
2056
  "model_input_names": [