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