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