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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: meta-llama/Meta-Llama-3.1-8B
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.1, 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.1 8b** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Ys44kVvmeZtnICzWz0xgpRnrIOjZAuxp?usp=sharing) | 2.4x faster | 58% less |
30
+ | **Phi-3.5 (mini)** | [▶️ Start on Colab](https://colab.research.google.com/drive/1lN6hPQveB_mHSnTOYifygFcrO8C1bxq4?usp=sharing) | 2x faster | 50% less |
31
+ | **Gemma-2 9b** | [▶️ Start on Colab](https://colab.research.google.com/drive/1vIrqH5uYDQwsJ4-OO3DErvuv4pBgVwk4?usp=sharing) | 2.4x faster | 58% less |
32
+ | **Mistral 7b** | [▶️ Start on Colab](https://colab.research.google.com/drive/1Dyauq4kTZoLewQ1cApceUQVNcnnNTzg_?usp=sharing) | 2.2x faster | 62% less |
33
+ | **TinyLlama** | [▶️ Start on Colab](https://colab.research.google.com/drive/1AZghoNBQaMDgWJpi4RbffGM1h6raLUj9?usp=sharing) | 3.9x faster | 74% less |
34
+ | **DPO - Zephyr** | [▶️ Start on Colab](https://colab.research.google.com/drive/15vttTpzzVXv_tJwEk-hIcQ0S9FcEWvwP?usp=sharing) | 1.9x faster | 19% less |
35
+
36
+ - This [conversational notebook](https://colab.research.google.com/drive/1Aau3lgPzeZKQ-98h69CCu1UJcvIBLmy2?usp=sharing) is useful for ShareGPT ChatML / Vicuna templates.
37
+ - 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.
38
+ - \* Kaggle has 2x T4s, but we use 1. Due to overhead, 1x T4 is 5x faster.
39
+
40
+ ## Special Thanks
41
+ A huge thank you to the Meta and Llama team for creating and releasing these models.
42
+
43
+ ## Model Information
44
+
45
+ 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.
46
+
47
+ **Model developer**: Meta
48
+
49
+ **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.
50
+
51
+
52
+ <table>
53
+ <tr>
54
+ <td>
55
+ </td>
56
+ <td><strong>Training Data</strong>
57
+ </td>
58
+ <td><strong>Params</strong>
59
+ </td>
60
+ <td><strong>Input modalities</strong>
61
+ </td>
62
+ <td><strong>Output modalities</strong>
63
+ </td>
64
+ <td><strong>Context length</strong>
65
+ </td>
66
+ <td><strong>GQA</strong>
67
+ </td>
68
+ <td><strong>Token count</strong>
69
+ </td>
70
+ <td><strong>Knowledge cutoff</strong>
71
+ </td>
72
+ </tr>
73
+ <tr>
74
+ <td rowspan="3" >Llama 3.1 (text only)
75
+ </td>
76
+ <td rowspan="3" >A new mix of publicly available online data.
77
+ </td>
78
+ <td>8B
79
+ </td>
80
+ <td>Multilingual Text
81
+ </td>
82
+ <td>Multilingual Text and code
83
+ </td>
84
+ <td>128k
85
+ </td>
86
+ <td>Yes
87
+ </td>
88
+ <td rowspan="3" >15T+
89
+ </td>
90
+ <td rowspan="3" >December 2023
91
+ </td>
92
+ </tr>
93
+ <tr>
94
+ <td>70B
95
+ </td>
96
+ <td>Multilingual Text
97
+ </td>
98
+ <td>Multilingual Text and code
99
+ </td>
100
+ <td>128k
101
+ </td>
102
+ <td>Yes
103
+ </td>
104
+ </tr>
105
+ <tr>
106
+ <td>405B
107
+ </td>
108
+ <td>Multilingual Text
109
+ </td>
110
+ <td>Multilingual Text and code
111
+ </td>
112
+ <td>128k
113
+ </td>
114
+ <td>Yes
115
+ </td>
116
+ </tr>
117
+ </table>
118
+
119
+
120
+ **Supported languages:** English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.
121
+
122
+ **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.
123
+
124
+ **Model Release Date:** July 23, 2024.
125
+
126
+ **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.
127
+
128
+ **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)
129
+
130
+ 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).
131
+
132
+
133
+ ## Intended Use
134
+
135
+ **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.
136
+
137
+ **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**.
138
+
139
+ **<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.
140
+
141
+ ## How to use
142
+
143
+ This repository contains two versions of Meta-Llama-3.1-8B-Instruct, for use with transformers and with the original `llama` codebase.
144
+
145
+ ### Use with transformers
146
+
147
+ 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.
148
+
149
+ Make sure to update your transformers installation via `pip install --upgrade transformers`.
150
+
151
+ ```python
152
+ import transformers
153
+ import torch
154
+
155
+ model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
156
+
157
+ pipeline = transformers.pipeline(
158
+ "text-generation",
159
+ model=model_id,
160
+ model_kwargs={"torch_dtype": torch.bfloat16},
161
+ device_map="auto",
162
+ )
163
+
164
+ messages = [
165
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
166
+ {"role": "user", "content": "Who are you?"},
167
+ ]
168
+
169
+ outputs = pipeline(
170
+ messages,
171
+ max_new_tokens=256,
172
+ )
173
+ print(outputs[0]["generated_text"][-1])
174
+ ```
175
+
176
+ 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)
177
+
178
+ ### Use with `llama`
179
+
180
+ Please, follow the instructions in the [repository](https://github.com/meta-llama/llama)
181
+
182
+ To download Original checkpoints, see the example command below leveraging `huggingface-cli`:
183
+
184
+ ```
185
+ huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-8B-Instruct
186
+ ```
187
+
188
+ ## Hardware and Software
189
+
190
+ **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.
191
+
192
+ **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.
193
+
194
+
195
+ **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.
196
+
197
+
198
+ <table>
199
+ <tr>
200
+ <td>
201
+ </td>
202
+ <td><strong>Training Time (GPU hours)</strong>
203
+ </td>
204
+ <td><strong>Training Power Consumption (W)</strong>
205
+ </td>
206
+ <td><strong>Training Location-Based Greenhouse Gas Emissions</strong>
207
+ <p>
208
+ <strong>(tons CO2eq)</strong>
209
+ </td>
210
+ <td><strong>Training Market-Based Greenhouse Gas Emissions</strong>
211
+ <p>
212
+ <strong>(tons CO2eq)</strong>
213
+ </td>
214
+ </tr>
215
+ <tr>
216
+ <td>Llama 3.1 8B
217
+ </td>
218
+ <td>1.46M
219
+ </td>
220
+ <td>700
221
+ </td>
222
+ <td>420
223
+ </td>
224
+ <td>0
225
+ </td>
226
+ </tr>
227
+ <tr>
228
+ <td>Llama 3.1 70B
229
+ </td>
230
+ <td>7.0M
231
+ </td>
232
+ <td>700
233
+ </td>
234
+ <td>2,040
235
+ </td>
236
+ <td>0
237
+ </td>
238
+ </tr>
239
+ <tr>
240
+ <td>Llama 3.1 405B
241
+ </td>
242
+ <td>30.84M
243
+ </td>
244
+ <td>700
245
+ </td>
246
+ <td>8,930
247
+ </td>
248
+ <td>0
249
+ </td>
250
+ </tr>
251
+ <tr>
252
+ <td>Total
253
+ </td>
254
+ <td>39.3M
255
+ <td>
256
+ <ul>
257
+
258
+ </ul>
259
+ </td>
260
+ <td>11,390
261
+ </td>
262
+ <td>0
263
+ </td>
264
+ </tr>
265
+ </table>
266
+
267
+
268
+
269
+ 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.
270
+
271
+
272
+ ## Training Data
273
+
274
+ **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.
275
+
276
+ **Data Freshness:** The pretraining data has a cutoff of December 2023.
277
+
278
+
279
+ ## Benchmark scores
280
+
281
+ 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.
282
+
283
+ ### Base pretrained models
284
+
285
+
286
+ <table>
287
+ <tr>
288
+ <td><strong>Category</strong>
289
+ </td>
290
+ <td><strong>Benchmark</strong>
291
+ </td>
292
+ <td><strong># Shots</strong>
293
+ </td>
294
+ <td><strong>Metric</strong>
295
+ </td>
296
+ <td><strong>Llama 3 8B</strong>
297
+ </td>
298
+ <td><strong>Llama 3.1 8B</strong>
299
+ </td>
300
+ <td><strong>Llama 3 70B</strong>
301
+ </td>
302
+ <td><strong>Llama 3.1 70B</strong>
303
+ </td>
304
+ <td><strong>Llama 3.1 405B</strong>
305
+ </td>
306
+ </tr>
307
+ <tr>
308
+ <td rowspan="7" >General
309
+ </td>
310
+ <td>MMLU
311
+ </td>
312
+ <td>5
313
+ </td>
314
+ <td>macro_avg/acc_char
315
+ </td>
316
+ <td>66.7
317
+ </td>
318
+ <td>66.7
319
+ </td>
320
+ <td>79.5
321
+ </td>
322
+ <td>79.3
323
+ </td>
324
+ <td>85.2
325
+ </td>
326
+ </tr>
327
+ <tr>
328
+ <td>MMLU-Pro (CoT)
329
+ </td>
330
+ <td>5
331
+ </td>
332
+ <td>macro_avg/acc_char
333
+ </td>
334
+ <td>36.2
335
+ </td>
336
+ <td>37.1
337
+ </td>
338
+ <td>55.0
339
+ </td>
340
+ <td>53.8
341
+ </td>
342
+ <td>61.6
343
+ </td>
344
+ </tr>
345
+ <tr>
346
+ <td>AGIEval English
347
+ </td>
348
+ <td>3-5
349
+ </td>
350
+ <td>average/acc_char
351
+ </td>
352
+ <td>47.1
353
+ </td>
354
+ <td>47.8
355
+ </td>
356
+ <td>63.0
357
+ </td>
358
+ <td>64.6
359
+ </td>
360
+ <td>71.6
361
+ </td>
362
+ </tr>
363
+ <tr>
364
+ <td>CommonSenseQA
365
+ </td>
366
+ <td>7
367
+ </td>
368
+ <td>acc_char
369
+ </td>
370
+ <td>72.6
371
+ </td>
372
+ <td>75.0
373
+ </td>
374
+ <td>83.8
375
+ </td>
376
+ <td>84.1
377
+ </td>
378
+ <td>85.8
379
+ </td>
380
+ </tr>
381
+ <tr>
382
+ <td>Winogrande
383
+ </td>
384
+ <td>5
385
+ </td>
386
+ <td>acc_char
387
+ </td>
388
+ <td>-
389
+ </td>
390
+ <td>60.5
391
+ </td>
392
+ <td>-
393
+ </td>
394
+ <td>83.3
395
+ </td>
396
+ <td>86.7
397
+ </td>
398
+ </tr>
399
+ <tr>
400
+ <td>BIG-Bench Hard (CoT)
401
+ </td>
402
+ <td>3
403
+ </td>
404
+ <td>average/em
405
+ </td>
406
+ <td>61.1
407
+ </td>
408
+ <td>64.2
409
+ </td>
410
+ <td>81.3
411
+ </td>
412
+ <td>81.6
413
+ </td>
414
+ <td>85.9
415
+ </td>
416
+ </tr>
417
+ <tr>
418
+ <td>ARC-Challenge
419
+ </td>
420
+ <td>25
421
+ </td>
422
+ <td>acc_char
423
+ </td>
424
+ <td>79.4
425
+ </td>
426
+ <td>79.7
427
+ </td>
428
+ <td>93.1
429
+ </td>
430
+ <td>92.9
431
+ </td>
432
+ <td>96.1
433
+ </td>
434
+ </tr>
435
+ <tr>
436
+ <td>Knowledge reasoning
437
+ </td>
438
+ <td>TriviaQA-Wiki
439
+ </td>
440
+ <td>5
441
+ </td>
442
+ <td>em
443
+ </td>
444
+ <td>78.5
445
+ </td>
446
+ <td>77.6
447
+ </td>
448
+ <td>89.7
449
+ </td>
450
+ <td>89.8
451
+ </td>
452
+ <td>91.8
453
+ </td>
454
+ </tr>
455
+ <tr>
456
+ <td rowspan="4" >Reading comprehension
457
+ </td>
458
+ <td>SQuAD
459
+ </td>
460
+ <td>1
461
+ </td>
462
+ <td>em
463
+ </td>
464
+ <td>76.4
465
+ </td>
466
+ <td>77.0
467
+ </td>
468
+ <td>85.6
469
+ </td>
470
+ <td>81.8
471
+ </td>
472
+ <td>89.3
473
+ </td>
474
+ </tr>
475
+ <tr>
476
+ <td>QuAC (F1)
477
+ </td>
478
+ <td>1
479
+ </td>
480
+ <td>f1
481
+ </td>
482
+ <td>44.4
483
+ </td>
484
+ <td>44.9
485
+ </td>
486
+ <td>51.1
487
+ </td>
488
+ <td>51.1
489
+ </td>
490
+ <td>53.6
491
+ </td>
492
+ </tr>
493
+ <tr>
494
+ <td>BoolQ
495
+ </td>
496
+ <td>0
497
+ </td>
498
+ <td>acc_char
499
+ </td>
500
+ <td>75.7
501
+ </td>
502
+ <td>75.0
503
+ </td>
504
+ <td>79.0
505
+ </td>
506
+ <td>79.4
507
+ </td>
508
+ <td>80.0
509
+ </td>
510
+ </tr>
511
+ <tr>
512
+ <td>DROP (F1)
513
+ </td>
514
+ <td>3
515
+ </td>
516
+ <td>f1
517
+ </td>
518
+ <td>58.4
519
+ </td>
520
+ <td>59.5
521
+ </td>
522
+ <td>79.7
523
+ </td>
524
+ <td>79.6
525
+ </td>
526
+ <td>84.8
527
+ </td>
528
+ </tr>
529
+ </table>
530
+
531
+
532
+
533
+ ### Instruction tuned models
534
+
535
+
536
+ <table>
537
+ <tr>
538
+ <td><strong>Category</strong>
539
+ </td>
540
+ <td><strong>Benchmark</strong>
541
+ </td>
542
+ <td><strong># Shots</strong>
543
+ </td>
544
+ <td><strong>Metric</strong>
545
+ </td>
546
+ <td><strong>Llama 3 8B Instruct</strong>
547
+ </td>
548
+ <td><strong>Llama 3.1 8B Instruct</strong>
549
+ </td>
550
+ <td><strong>Llama 3 70B Instruct</strong>
551
+ </td>
552
+ <td><strong>Llama 3.1 70B Instruct</strong>
553
+ </td>
554
+ <td><strong>Llama 3.1 405B Instruct</strong>
555
+ </td>
556
+ </tr>
557
+ <tr>
558
+ <td rowspan="4" >General
559
+ </td>
560
+ <td>MMLU
561
+ </td>
562
+ <td>5
563
+ </td>
564
+ <td>macro_avg/acc
565
+ </td>
566
+ <td>68.5
567
+ </td>
568
+ <td>69.4
569
+ </td>
570
+ <td>82.0
571
+ </td>
572
+ <td>83.6
573
+ </td>
574
+ <td>87.3
575
+ </td>
576
+ </tr>
577
+ <tr>
578
+ <td>MMLU (CoT)
579
+ </td>
580
+ <td>0
581
+ </td>
582
+ <td>macro_avg/acc
583
+ </td>
584
+ <td>65.3
585
+ </td>
586
+ <td>73.0
587
+ </td>
588
+ <td>80.9
589
+ </td>
590
+ <td>86.0
591
+ </td>
592
+ <td>88.6
593
+ </td>
594
+ </tr>
595
+ <tr>
596
+ <td>MMLU-Pro (CoT)
597
+ </td>
598
+ <td>5
599
+ </td>
600
+ <td>micro_avg/acc_char
601
+ </td>
602
+ <td>45.5
603
+ </td>
604
+ <td>48.3
605
+ </td>
606
+ <td>63.4
607
+ </td>
608
+ <td>66.4
609
+ </td>
610
+ <td>73.3
611
+ </td>
612
+ </tr>
613
+ <tr>
614
+ <td>IFEval
615
+ </td>
616
+ <td>
617
+ </td>
618
+ <td>
619
+ </td>
620
+ <td>76.8
621
+ </td>
622
+ <td>80.4
623
+ </td>
624
+ <td>82.9
625
+ </td>
626
+ <td>87.5
627
+ </td>
628
+ <td>88.6
629
+ </td>
630
+ </tr>
631
+ <tr>
632
+ <td rowspan="2" >Reasoning
633
+ </td>
634
+ <td>ARC-C
635
+ </td>
636
+ <td>0
637
+ </td>
638
+ <td>acc
639
+ </td>
640
+ <td>82.4
641
+ </td>
642
+ <td>83.4
643
+ </td>
644
+ <td>94.4
645
+ </td>
646
+ <td>94.8
647
+ </td>
648
+ <td>96.9
649
+ </td>
650
+ </tr>
651
+ <tr>
652
+ <td>GPQA
653
+ </td>
654
+ <td>0
655
+ </td>
656
+ <td>em
657
+ </td>
658
+ <td>34.6
659
+ </td>
660
+ <td>30.4
661
+ </td>
662
+ <td>39.5
663
+ </td>
664
+ <td>41.7
665
+ </td>
666
+ <td>50.7
667
+ </td>
668
+ </tr>
669
+ <tr>
670
+ <td rowspan="4" >Code
671
+ </td>
672
+ <td>HumanEval
673
+ </td>
674
+ <td>0
675
+ </td>
676
+ <td>pass@1
677
+ </td>
678
+ <td>60.4
679
+ </td>
680
+ <td>72.6
681
+ </td>
682
+ <td>81.7
683
+ </td>
684
+ <td>80.5
685
+ </td>
686
+ <td>89.0
687
+ </td>
688
+ </tr>
689
+ <tr>
690
+ <td>MBPP ++ base version
691
+ </td>
692
+ <td>0
693
+ </td>
694
+ <td>pass@1
695
+ </td>
696
+ <td>70.6
697
+ </td>
698
+ <td>72.8
699
+ </td>
700
+ <td>82.5
701
+ </td>
702
+ <td>86.0
703
+ </td>
704
+ <td>88.6
705
+ </td>
706
+ </tr>
707
+ <tr>
708
+ <td>Multipl-E HumanEval
709
+ </td>
710
+ <td>0
711
+ </td>
712
+ <td>pass@1
713
+ </td>
714
+ <td>-
715
+ </td>
716
+ <td>50.8
717
+ </td>
718
+ <td>-
719
+ </td>
720
+ <td>65.5
721
+ </td>
722
+ <td>75.2
723
+ </td>
724
+ </tr>
725
+ <tr>
726
+ <td>Multipl-E MBPP
727
+ </td>
728
+ <td>0
729
+ </td>
730
+ <td>pass@1
731
+ </td>
732
+ <td>-
733
+ </td>
734
+ <td>52.4
735
+ </td>
736
+ <td>-
737
+ </td>
738
+ <td>62.0
739
+ </td>
740
+ <td>65.7
741
+ </td>
742
+ </tr>
743
+ <tr>
744
+ <td rowspan="2" >Math
745
+ </td>
746
+ <td>GSM-8K (CoT)
747
+ </td>
748
+ <td>8
749
+ </td>
750
+ <td>em_maj1@1
751
+ </td>
752
+ <td>80.6
753
+ </td>
754
+ <td>84.5
755
+ </td>
756
+ <td>93.0
757
+ </td>
758
+ <td>95.1
759
+ </td>
760
+ <td>96.8
761
+ </td>
762
+ </tr>
763
+ <tr>
764
+ <td>MATH (CoT)
765
+ </td>
766
+ <td>0
767
+ </td>
768
+ <td>final_em
769
+ </td>
770
+ <td>29.1
771
+ </td>
772
+ <td>51.9
773
+ </td>
774
+ <td>51.0
775
+ </td>
776
+ <td>68.0
777
+ </td>
778
+ <td>73.8
779
+ </td>
780
+ </tr>
781
+ <tr>
782
+ <td rowspan="4" >Tool Use
783
+ </td>
784
+ <td>API-Bank
785
+ </td>
786
+ <td>0
787
+ </td>
788
+ <td>acc
789
+ </td>
790
+ <td>48.3
791
+ </td>
792
+ <td>82.6
793
+ </td>
794
+ <td>85.1
795
+ </td>
796
+ <td>90.0
797
+ </td>
798
+ <td>92.0
799
+ </td>
800
+ </tr>
801
+ <tr>
802
+ <td>BFCL
803
+ </td>
804
+ <td>0
805
+ </td>
806
+ <td>acc
807
+ </td>
808
+ <td>60.3
809
+ </td>
810
+ <td>76.1
811
+ </td>
812
+ <td>83.0
813
+ </td>
814
+ <td>84.8
815
+ </td>
816
+ <td>88.5
817
+ </td>
818
+ </tr>
819
+ <tr>
820
+ <td>Gorilla Benchmark API Bench
821
+ </td>
822
+ <td>0
823
+ </td>
824
+ <td>acc
825
+ </td>
826
+ <td>1.7
827
+ </td>
828
+ <td>8.2
829
+ </td>
830
+ <td>14.7
831
+ </td>
832
+ <td>29.7
833
+ </td>
834
+ <td>35.3
835
+ </td>
836
+ </tr>
837
+ <tr>
838
+ <td>Nexus (0-shot)
839
+ </td>
840
+ <td>0
841
+ </td>
842
+ <td>macro_avg/acc
843
+ </td>
844
+ <td>18.1
845
+ </td>
846
+ <td>38.5
847
+ </td>
848
+ <td>47.8
849
+ </td>
850
+ <td>56.7
851
+ </td>
852
+ <td>58.7
853
+ </td>
854
+ </tr>
855
+ <tr>
856
+ <td>Multilingual
857
+ </td>
858
+ <td>Multilingual MGSM (CoT)
859
+ </td>
860
+ <td>0
861
+ </td>
862
+ <td>em
863
+ </td>
864
+ <td>-
865
+ </td>
866
+ <td>68.9
867
+ </td>
868
+ <td>-
869
+ </td>
870
+ <td>86.9
871
+ </td>
872
+ <td>91.6
873
+ </td>
874
+ </tr>
875
+ </table>
876
+
877
+ #### Multilingual benchmarks
878
+
879
+ <table>
880
+ <tr>
881
+ <td><strong>Category</strong>
882
+ </td>
883
+ <td><strong>Benchmark</strong>
884
+ </td>
885
+ <td><strong>Language</strong>
886
+ </td>
887
+ <td><strong>Llama 3.1 8B</strong>
888
+ </td>
889
+ <td><strong>Llama 3.1 70B</strong>
890
+ </td>
891
+ <td><strong>Llama 3.1 405B</strong>
892
+ </td>
893
+ </tr>
894
+ <tr>
895
+ <td rowspan="9" ><strong>General</strong>
896
+ </td>
897
+ <td rowspan="9" ><strong>MMLU (5-shot, macro_avg/acc)</strong>
898
+ </td>
899
+ <td>Portuguese
900
+ </td>
901
+ <td>62.12
902
+ </td>
903
+ <td>80.13
904
+ </td>
905
+ <td>84.95
906
+ </td>
907
+ </tr>
908
+ <tr>
909
+ <td>Spanish
910
+ </td>
911
+ <td>62.45
912
+ </td>
913
+ <td>80.05
914
+ </td>
915
+ <td>85.08
916
+ </td>
917
+ </tr>
918
+ <tr>
919
+ <td>Italian
920
+ </td>
921
+ <td>61.63
922
+ </td>
923
+ <td>80.4
924
+ </td>
925
+ <td>85.04
926
+ </td>
927
+ </tr>
928
+ <tr>
929
+ <td>German
930
+ </td>
931
+ <td>60.59
932
+ </td>
933
+ <td>79.27
934
+ </td>
935
+ <td>84.36
936
+ </td>
937
+ </tr>
938
+ <tr>
939
+ <td>French
940
+ </td>
941
+ <td>62.34
942
+ </td>
943
+ <td>79.82
944
+ </td>
945
+ <td>84.66
946
+ </td>
947
+ </tr>
948
+ <tr>
949
+ <td>Hindi
950
+ </td>
951
+ <td>50.88
952
+ </td>
953
+ <td>74.52
954
+ </td>
955
+ <td>80.31
956
+ </td>
957
+ </tr>
958
+ <tr>
959
+ <td>Thai
960
+ </td>
961
+ <td>50.32
962
+ </td>
963
+ <td>72.95
964
+ </td>
965
+ <td>78.21
966
+ </td>
967
+ </tr>
968
+ </table>
969
+
970
+
971
+
972
+ ## Responsibility & Safety
973
+
974
+ As part of our Responsible release approach, we followed a three-pronged strategy to managing trust & safety risks:
975
+
976
+
977
+
978
+ * Enable developers to deploy helpful, safe and flexible experiences for their target audience and for the use cases supported by Llama.
979
+ * Protect developers against adversarial users aiming to exploit Llama capabilities to potentially cause harm.
980
+ * Provide protections for the community to help prevent the misuse of our models.
981
+
982
+
983
+ ### Responsible deployment
984
+
985
+ 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.
986
+
987
+
988
+ #### Llama 3.1 instruct
989
+
990
+ 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.
991
+
992
+ **Fine-tuning data**
993
+
994
+ 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.
995
+
996
+ **Refusals and Tone**
997
+
998
+ 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.
999
+
1000
+
1001
+ #### Llama 3.1 systems
1002
+
1003
+ **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.
1004
+
1005
+ 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.
1006
+
1007
+
1008
+ #### New capabilities
1009
+
1010
+ 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.
1011
+
1012
+ **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.
1013
+
1014
+ **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.
1015
+
1016
+
1017
+ ### Evaluations
1018
+
1019
+ 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.
1020
+
1021
+ 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.
1022
+
1023
+ **Red teaming**
1024
+
1025
+ 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.
1026
+
1027
+ 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.
1028
+
1029
+
1030
+ ### Critical and other risks
1031
+
1032
+ We specifically focused our efforts on mitigating the following critical risk areas:
1033
+
1034
+ **1- CBRNE (Chemical, Biological, Radiological, Nuclear, and Explosive materials) helpfulness**
1035
+
1036
+ 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.
1037
+
1038
+
1039
+ **2. Child Safety**
1040
+
1041
+ 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.
1042
+
1043
+ **3. Cyber attack enablement**
1044
+
1045
+ Our cyber attack uplift study investigated whether LLMs can enhance human capabilities in hacking tasks, both in terms of skill level and speed.
1046
+
1047
+ 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.
1048
+
1049
+ 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.
1050
+
1051
+
1052
+ ### Community
1053
+
1054
+ 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).
1055
+
1056
+ 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).
1057
+
1058
+ 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.
1059
+
1060
+
1061
+ ## Ethical Considerations and Limitations
1062
+
1063
+ 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.
1064
+
1065
+ 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.