qwp4w3hyb commited on
Commit
b8902c1
1 Parent(s): 40da614

Update README.md

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