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