DavidLanz commited on
Commit
ba6b824
1 Parent(s): 874a6a0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +810 -3
README.md CHANGED
@@ -1,3 +1,810 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - zh
4
+ - en
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - facebook
8
+ - meta
9
+ - pytorch
10
+ - llama
11
+ - llama-3
12
+ license: llama3
13
+ license_name: llama3
14
+ license_link: LICENSE
15
+ extra_gated_prompt: >-
16
+ ### META LLAMA 3 COMMUNITY LICENSE AGREEMENT
17
+
18
+ Meta Llama 3 Version Release Date: April 18, 2024
19
+
20
+ "Agreement" means the terms and conditions for use, reproduction, distribution and modification of the
21
+ Llama Materials set forth herein.
22
+
23
+ "Documentation" means the specifications, manuals and documentation accompanying Meta Llama 3
24
+ distributed by Meta at https://llama.meta.com/get-started/.
25
+
26
+ "Licensee" or "you" means you, or your employer or any other person or entity (if you are entering into
27
+ this Agreement on such person or entity’s behalf), of the age required under applicable laws, rules or
28
+ regulations to provide legal consent and that has legal authority to bind your employer or such other
29
+ person or entity if you are entering in this Agreement on their behalf.
30
+
31
+ "Meta Llama 3" means the foundational large language models and software and algorithms, including
32
+ machine-learning model code, trained model weights, inference-enabling code, training-enabling code,
33
+ fine-tuning enabling code and other elements of the foregoing distributed by Meta at
34
+ https://llama.meta.com/llama-downloads.
35
+
36
+ "Llama Materials" means, collectively, Meta’s proprietary Meta Llama 3 and Documentation (and any
37
+ portion thereof) made available under this Agreement.
38
+
39
+ "Meta" or "we" means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, your
40
+ principal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are located
41
+ outside of the EEA or Switzerland).
42
+
43
+ 1. License Rights and Redistribution.
44
+
45
+ a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-free
46
+ limited license under Meta’s intellectual property or other rights owned by Meta embodied in the Llama
47
+ Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the
48
+ Llama Materials.
49
+
50
+ b. Redistribution and Use.
51
+
52
+ i. If you distribute or make available the Llama Materials (or any derivative works
53
+ thereof), or a product or service that uses any of them, including another AI model, you shall (A) provide
54
+ a copy of this Agreement with any such Llama Materials; and (B) prominently display “Built with Meta
55
+ Llama 3” on a related website, user interface, blogpost, about page, or product documentation. If you
56
+ use the Llama Materials to create, train, fine tune, or otherwise improve an AI model, which is
57
+ distributed or made available, you shall also include “Llama 3” at the beginning of any such AI model
58
+ name.
59
+
60
+ ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part
61
+ of an integrated end user product, then Section 2 of this Agreement will not apply to you.
62
+
63
+ iii. You must retain in all copies of the Llama Materials that you distribute the following
64
+ attribution notice within a “Notice” text file distributed as a part of such copies: “Meta Llama 3 is
65
+ licensed under the Meta Llama 3 Community License, Copyright © Meta Platforms, Inc. All Rights
66
+ Reserved.”
67
+
68
+ iv. Your use of the Llama Materials must comply with applicable laws and regulations
69
+ (including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the Llama
70
+ Materials (available at https://llama.meta.com/llama3/use-policy), which is hereby incorporated by
71
+ reference into this Agreement.
72
+
73
+ v. You will not use the Llama Materials or any output or results of the Llama Materials to
74
+ improve any other large language model (excluding Meta Llama 3 or derivative works thereof).
75
+
76
+ 2. Additional Commercial Terms. If, on the Meta Llama 3 version release date, the monthly active users
77
+ of the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700
78
+ million monthly active users in the preceding calendar month, you must request a license from Meta,
79
+ which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of the
80
+ rights under this Agreement unless or until Meta otherwise expressly grants you such rights.
81
+
82
+ 3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANY
83
+ OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OF
84
+ ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,
85
+ INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,
86
+ MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR
87
+ DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS AND
88
+ ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT AND
89
+ RESULTS.
90
+
91
+ 4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF
92
+ LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING
93
+ OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,
94
+ INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED
95
+ OF THE POSSIBILITY OF ANY OF THE FOREGOING.
96
+
97
+ 5. Intellectual Property.
98
+
99
+ a. No trademark licenses are granted under this Agreement, and in connection with the Llama
100
+ Materials, neither Meta nor Licensee may use any name or mark owned by or associated with the other
101
+ or any of its affiliates, except as required for reasonable and customary use in describing and
102
+ redistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license to
103
+ use “Llama 3” (the “Mark”) solely as required to comply with the last sentence of Section 1.b.i. You will
104
+ comply with Meta’s brand guidelines (currently accessible at
105
+ https://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your use
106
+ of the Mark will inure to the benefit of Meta.
107
+
108
+ b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, with
109
+ respect to any derivative works and modifications of the Llama Materials that are made by you, as
110
+ between you and Meta, you are and will be the owner of such derivative works and modifications.
111
+
112
+ c. If you institute litigation or other proceedings against Meta or any entity (including a
113
+ cross-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Meta Llama 3 outputs or
114
+ results, or any portion of any of the foregoing, constitutes infringement of intellectual property or other
115
+ rights owned or licensable by you, then any licenses granted to you under this Agreement shall
116
+ terminate as of the date such litigation or claim is filed or instituted. You will indemnify and hold
117
+ harmless Meta from and against any claim by any third party arising out of or related to your use or
118
+ distribution of the Llama Materials.
119
+
120
+ 6. Term and Termination. The term of this Agreement will commence upon your acceptance of this
121
+ Agreement or access to the Llama Materials and will continue in full force and effect until terminated in
122
+ accordance with the terms and conditions herein. Meta may terminate this Agreement if you are in
123
+ breach of any term or condition of this Agreement. Upon termination of this Agreement, you shall delete
124
+ and cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of this
125
+ Agreement.
126
+
127
+ 7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws of
128
+ the State of California without regard to choice of law principles, and the UN Convention on Contracts
129
+ for the International Sale of Goods does not apply to this Agreement. The courts of California shall have
130
+ exclusive jurisdiction of any dispute arising out of this Agreement.
131
+
132
+ ### Meta Llama 3 Acceptable Use Policy
133
+
134
+ Meta is committed to promoting safe and fair use of its tools and features, including Meta Llama 3. If you
135
+ access or use Meta Llama 3, you agree to this Acceptable Use Policy (“Policy”). The most recent copy of
136
+ this policy can be found at [https://llama.meta.com/llama3/use-policy](https://llama.meta.com/llama3/use-policy)
137
+
138
+ #### Prohibited Uses
139
+
140
+ We want everyone to use Meta Llama 3 safely and responsibly. You agree you will not use, or allow
141
+ others to use, Meta Llama 3 to:
142
+ 1. Violate the law or others’ rights, including to:
143
+ 1. Engage in, promote, generate, contribute to, encourage, plan, incite, or further illegal or unlawful activity or content, such as:
144
+ 1. Violence or terrorism
145
+ 2. Exploitation or harm to children, including the solicitation, creation, acquisition, or dissemination of child exploitative content or failure to report Child Sexual Abuse Material
146
+ 3. Human trafficking, exploitation, and sexual violence
147
+ 4. The illegal distribution of information or materials to minors, including obscene materials, or failure to employ legally required age-gating in connection with such information or materials.
148
+ 5. Sexual solicitation
149
+ 6. Any other criminal activity
150
+ 2. Engage in, promote, incite, or facilitate the harassment, abuse, threatening, or bullying of individuals or groups of individuals
151
+ 3. Engage in, promote, incite, or facilitate discrimination or other unlawful or harmful conduct in the provision of employment, employment benefits, credit, housing, other economic benefits, or other essential goods and services
152
+ 4. Engage in the unauthorized or unlicensed practice of any profession including, but not limited to, financial, legal, medical/health, or related professional practices
153
+ 5. Collect, process, disclose, generate, or infer health, demographic, or other sensitive personal or private information about individuals without rights and consents required by applicable laws
154
+ 6. Engage in or facilitate any action or generate any content that infringes, misappropriates, or otherwise violates any third-party rights, including the outputs or results of any products or services using the Llama Materials
155
+ 7. Create, generate, or facilitate the creation of malicious code, malware, computer viruses or do anything else that could disable, overburden, interfere with or impair the proper working, integrity, operation or appearance of a website or computer system
156
+ 2. Engage in, promote, incite, facilitate, or assist in the planning or development of activities that present a risk of death or bodily harm to individuals, including use of Meta Llama 3 related to the following:
157
+ 1. Military, warfare, nuclear industries or applications, espionage, use for materials or activities that are subject to the International Traffic Arms Regulations (ITAR) maintained by the United States Department of State
158
+ 2. Guns and illegal weapons (including weapon development)
159
+ 3. Illegal drugs and regulated/controlled substances
160
+ 4. Operation of critical infrastructure, transportation technologies, or heavy machinery
161
+ 5. Self-harm or harm to others, including suicide, cutting, and eating disorders
162
+ 6. Any content intended to incite or promote violence, abuse, or any infliction of bodily harm to an individual
163
+ 3. Intentionally deceive or mislead others, including use of Meta Llama 3 related to the following:
164
+ 1. Generating, promoting, or furthering fraud or the creation or promotion of disinformation
165
+ 2. Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
166
+ 3. Generating, promoting, or further distributing spam
167
+ 4. Impersonating another individual without consent, authorization, or legal right
168
+ 5. Representing that the use of Meta Llama 3 or outputs are human-generated
169
+ 6. Generating or facilitating false online engagement, including fake reviews and other means of fake online engagement
170
+ 4. Fail to appropriately disclose to end users any known dangers of your AI system
171
+
172
+ Please report any violation of this Policy, software “bug,” or other problems that could lead to a violation
173
+ of this Policy through one of the following means:
174
+ * Reporting issues with the model: [https://github.com/meta-llama/llama3](https://github.com/meta-llama/llama3)
175
+ * Reporting risky content generated by the model:
176
+ developers.facebook.com/llama_output_feedback
177
+ * Reporting bugs and security concerns: facebook.com/whitehat/info
178
+ * Reporting violations of the Acceptable Use Policy or unlicensed uses of Meta Llama 3: [email protected]
179
+ extra_gated_fields:
180
+ First Name: text
181
+ Last Name: text
182
+ Date of birth: date_picker
183
+ Country: country
184
+ Affiliation: text
185
+ geo: ip_location
186
+ By clicking Submit below I accept the terms of the license and acknowledge that the information I provide will be collected stored processed and shared in accordance with the Meta Privacy Policy: checkbox
187
+ extra_gated_description: The information you provide will be collected, stored, processed and shared in accordance with the [Meta Privacy Policy](https://www.facebook.com/privacy/policy/).
188
+ extra_gated_button_content: Submit
189
+ ---
190
+
191
+ ## Model Details
192
+
193
+ Meta developed and released the Meta Llama 3 family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks. Further, in developing these models, we took great care to optimize helpfulness and safety.
194
+
195
+ **Model developers** Meta
196
+
197
+ **Variations** Llama 3 comes in two sizes — 8B and 70B parameters — in pre-trained and instruction tuned variants.
198
+
199
+ **Input** Models input text only.
200
+
201
+ **Output** Models generate text and code only.
202
+
203
+ **Model Architecture** Llama 3 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.
204
+
205
+
206
+ <table>
207
+ <tr>
208
+ <td>
209
+ </td>
210
+ <td><strong>Training Data</strong>
211
+ </td>
212
+ <td><strong>Params</strong>
213
+ </td>
214
+ <td><strong>Context length</strong>
215
+ </td>
216
+ <td><strong>GQA</strong>
217
+ </td>
218
+ <td><strong>Token count</strong>
219
+ </td>
220
+ <td><strong>Knowledge cutoff</strong>
221
+ </td>
222
+ </tr>
223
+ <tr>
224
+ <td rowspan="2" >Llama 3
225
+ </td>
226
+ <td rowspan="2" >A new mix of publicly available online data.
227
+ </td>
228
+ <td>8B
229
+ </td>
230
+ <td>8k
231
+ </td>
232
+ <td>Yes
233
+ </td>
234
+ <td rowspan="2" >15T+
235
+ </td>
236
+ <td>March, 2023
237
+ </td>
238
+ </tr>
239
+ <tr>
240
+ <td>70B
241
+ </td>
242
+ <td>8k
243
+ </td>
244
+ <td>Yes
245
+ </td>
246
+ <td>December, 2023
247
+ </td>
248
+ </tr>
249
+ </table>
250
+
251
+
252
+ **Llama 3 family of models**. Token counts refer to pretraining data only. Both the 8 and 70B versions use Grouped-Query Attention (GQA) for improved inference scalability.
253
+
254
+ **Model Release Date** April 18, 2024.
255
+
256
+ **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.
257
+
258
+ **License** A custom commercial license is available at: [https://llama.meta.com/llama3/license](https://llama.meta.com/llama3/license)
259
+
260
+ 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 in applications, please go [here](https://github.com/meta-llama/llama-recipes).
261
+
262
+
263
+ ## Intended Use
264
+
265
+ **Intended Use Cases** Llama 3 is intended for commercial and research use in English. Instruction tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
266
+
267
+ **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 Community License. Use in languages other than English**.
268
+
269
+ **Note: Developers may fine-tune Llama 3 models for languages beyond English provided they comply with the Llama 3 Community License and the Acceptable Use Policy.
270
+
271
+ ## How to use
272
+
273
+ This repository contains two versions of Meta-Llama-3-8B-Instruct, for use with transformers and with the original `llama3` codebase.
274
+
275
+ ### Use with transformers
276
+
277
+ You can run conversational inference using the Transformers pipeline abstraction, or by leveraging the Auto classes with the `generate()` function. Let's see examples of both.
278
+
279
+ #### Transformers pipeline
280
+
281
+ ```python
282
+ import transformers
283
+ import torch
284
+
285
+ model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
286
+
287
+ pipeline = transformers.pipeline(
288
+ "text-generation",
289
+ model=model_id,
290
+ model_kwargs={"torch_dtype": torch.bfloat16},
291
+ device="auto",
292
+ )
293
+
294
+ messages = [
295
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
296
+ {"role": "user", "content": "Who are you?"},
297
+ ]
298
+
299
+ prompt = pipeline.tokenizer.apply_chat_template(
300
+ messages,
301
+ tokenize=False,
302
+ add_generation_prompt=True
303
+ )
304
+
305
+ terminators = [
306
+ pipeline.tokenizer.eos_token_id,
307
+ pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
308
+ ]
309
+
310
+ outputs = pipeline(
311
+ prompt,
312
+ max_new_tokens=256,
313
+ eos_token_id=terminators,
314
+ do_sample=True,
315
+ temperature=0.6,
316
+ top_p=0.9,
317
+ )
318
+ print(outputs[0]["generated_text"][len(prompt):])
319
+ ```
320
+
321
+ #### Transformers AutoModelForCausalLM
322
+
323
+ ```python
324
+ from transformers import AutoTokenizer, AutoModelForCausalLM
325
+ import torch
326
+
327
+ model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
328
+
329
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
330
+ model = AutoModelForCausalLM.from_pretrained(
331
+ model_id,
332
+ torch_dtype=torch.bfloat16,
333
+ device_map="auto",
334
+ )
335
+
336
+ messages = [
337
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
338
+ {"role": "user", "content": "Who are you?"},
339
+ ]
340
+
341
+ input_ids = tokenizer.apply_chat_template(
342
+ messages,
343
+ add_generation_prompt=True,
344
+ return_tensors="pt"
345
+ ).to(model.device)
346
+
347
+ terminators = [
348
+ tokenizer.eos_token_id,
349
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
350
+ ]
351
+
352
+ outputs = model.generate(
353
+ input_ids,
354
+ max_new_tokens=256,
355
+ eos_token_id=terminators,
356
+ do_sample=True,
357
+ temperature=0.6,
358
+ top_p=0.9,
359
+ )
360
+ response = outputs[0][input_ids.shape[-1]:]
361
+ print(tokenizer.decode(response, skip_special_tokens=True))
362
+ ```
363
+
364
+
365
+ ### Use with `llama3`
366
+
367
+ Please, follow the instructions in the [repository](https://github.com/meta-llama/llama3)
368
+
369
+ To download Original checkpoints, see the example command below leveraging `huggingface-cli`:
370
+
371
+ ```
372
+ huggingface-cli download meta-llama/Meta-Llama-3-8B-Instruct --include "original/*" --local-dir Meta-Llama-3-8B-Instruct
373
+ ```
374
+
375
+ For Hugging Face support, we recommend using transformers or TGI, but a similar command works.
376
+
377
+ ## Hardware and Software
378
+
379
+ **Training Factors** We used custom training libraries, Meta's Research SuperCluster, and production clusters for pretraining. Fine-tuning, annotation, and evaluation were also performed on third-party cloud compute.
380
+
381
+ **Carbon Footprint Pretraining utilized a cumulative** 7.7M GPU hours of computation on hardware of type H100-80GB (TDP of 700W). Estimated total emissions were 2290 tCO2eq, 100% of which were offset by Meta’s sustainability program.
382
+
383
+
384
+ <table>
385
+ <tr>
386
+ <td>
387
+ </td>
388
+ <td><strong>Time (GPU hours)</strong>
389
+ </td>
390
+ <td><strong>Power Consumption (W)</strong>
391
+ </td>
392
+ <td><strong>Carbon Emitted(tCO2eq)</strong>
393
+ </td>
394
+ </tr>
395
+ <tr>
396
+ <td>Llama 3 8B
397
+ </td>
398
+ <td>1.3M
399
+ </td>
400
+ <td>700
401
+ </td>
402
+ <td>390
403
+ </td>
404
+ </tr>
405
+ <tr>
406
+ <td>Llama 3 70B
407
+ </td>
408
+ <td>6.4M
409
+ </td>
410
+ <td>700
411
+ </td>
412
+ <td>1900
413
+ </td>
414
+ </tr>
415
+ <tr>
416
+ <td>Total
417
+ </td>
418
+ <td>7.7M
419
+ </td>
420
+ <td>
421
+ </td>
422
+ <td>2290
423
+ </td>
424
+ </tr>
425
+ </table>
426
+
427
+
428
+
429
+ **CO2 emissions during pre-training**. Time: total GPU time required for training each model. Power Consumption: peak power capacity per GPU device for the GPUs used adjusted for power usage efficiency. 100% of the emissions are directly offset by Meta's sustainability program, and because we are openly releasing these models, the pretraining costs do not need to be incurred by others.
430
+
431
+
432
+ ## Training Data
433
+
434
+ **Overview** Llama 3 was pretrained on over 15 trillion tokens of data from publicly available sources. The fine-tuning data includes publicly available instruction datasets, as well as over 10M human-annotated examples. Neither the pretraining nor the fine-tuning datasets include Meta user data.
435
+
436
+ **Data Freshness** The pretraining data has a cutoff of March 2023 for the 7B and December 2023 for the 70B models respectively.
437
+
438
+
439
+ ## Benchmarks
440
+
441
+ In this section, we report the results for Llama 3 models on standard automatic benchmarks. For all the evaluations, we use our internal evaluations library. For details on the methodology see [here](https://github.com/meta-llama/llama3/blob/main/eval_methodology.md).
442
+
443
+
444
+ ### Base pretrained models
445
+
446
+
447
+ <table>
448
+ <tr>
449
+ <td><strong>Category</strong>
450
+ </td>
451
+ <td><strong>Benchmark</strong>
452
+ </td>
453
+ <td><strong>Llama 3 8B</strong>
454
+ </td>
455
+ <td><strong>Llama2 7B</strong>
456
+ </td>
457
+ <td><strong>Llama2 13B</strong>
458
+ </td>
459
+ <td><strong>Llama 3 70B</strong>
460
+ </td>
461
+ <td><strong>Llama2 70B</strong>
462
+ </td>
463
+ </tr>
464
+ <tr>
465
+ <td rowspan="6" >General
466
+ </td>
467
+ <td>MMLU (5-shot)
468
+ </td>
469
+ <td>66.6
470
+ </td>
471
+ <td>45.7
472
+ </td>
473
+ <td>53.8
474
+ </td>
475
+ <td>79.5
476
+ </td>
477
+ <td>69.7
478
+ </td>
479
+ </tr>
480
+ <tr>
481
+ <td>AGIEval English (3-5 shot)
482
+ </td>
483
+ <td>45.9
484
+ </td>
485
+ <td>28.8
486
+ </td>
487
+ <td>38.7
488
+ </td>
489
+ <td>63.0
490
+ </td>
491
+ <td>54.8
492
+ </td>
493
+ </tr>
494
+ <tr>
495
+ <td>CommonSenseQA (7-shot)
496
+ </td>
497
+ <td>72.6
498
+ </td>
499
+ <td>57.6
500
+ </td>
501
+ <td>67.6
502
+ </td>
503
+ <td>83.8
504
+ </td>
505
+ <td>78.7
506
+ </td>
507
+ </tr>
508
+ <tr>
509
+ <td>Winogrande (5-shot)
510
+ </td>
511
+ <td>76.1
512
+ </td>
513
+ <td>73.3
514
+ </td>
515
+ <td>75.4
516
+ </td>
517
+ <td>83.1
518
+ </td>
519
+ <td>81.8
520
+ </td>
521
+ </tr>
522
+ <tr>
523
+ <td>BIG-Bench Hard (3-shot, CoT)
524
+ </td>
525
+ <td>61.1
526
+ </td>
527
+ <td>38.1
528
+ </td>
529
+ <td>47.0
530
+ </td>
531
+ <td>81.3
532
+ </td>
533
+ <td>65.7
534
+ </td>
535
+ </tr>
536
+ <tr>
537
+ <td>ARC-Challenge (25-shot)
538
+ </td>
539
+ <td>78.6
540
+ </td>
541
+ <td>53.7
542
+ </td>
543
+ <td>67.6
544
+ </td>
545
+ <td>93.0
546
+ </td>
547
+ <td>85.3
548
+ </td>
549
+ </tr>
550
+ <tr>
551
+ <td>Knowledge reasoning
552
+ </td>
553
+ <td>TriviaQA-Wiki (5-shot)
554
+ </td>
555
+ <td>78.5
556
+ </td>
557
+ <td>72.1
558
+ </td>
559
+ <td>79.6
560
+ </td>
561
+ <td>89.7
562
+ </td>
563
+ <td>87.5
564
+ </td>
565
+ </tr>
566
+ <tr>
567
+ <td rowspan="4" >Reading comprehension
568
+ </td>
569
+ <td>SQuAD (1-shot)
570
+ </td>
571
+ <td>76.4
572
+ </td>
573
+ <td>72.2
574
+ </td>
575
+ <td>72.1
576
+ </td>
577
+ <td>85.6
578
+ </td>
579
+ <td>82.6
580
+ </td>
581
+ </tr>
582
+ <tr>
583
+ <td>QuAC (1-shot, F1)
584
+ </td>
585
+ <td>44.4
586
+ </td>
587
+ <td>39.6
588
+ </td>
589
+ <td>44.9
590
+ </td>
591
+ <td>51.1
592
+ </td>
593
+ <td>49.4
594
+ </td>
595
+ </tr>
596
+ <tr>
597
+ <td>BoolQ (0-shot)
598
+ </td>
599
+ <td>75.7
600
+ </td>
601
+ <td>65.5
602
+ </td>
603
+ <td>66.9
604
+ </td>
605
+ <td>79.0
606
+ </td>
607
+ <td>73.1
608
+ </td>
609
+ </tr>
610
+ <tr>
611
+ <td>DROP (3-shot, F1)
612
+ </td>
613
+ <td>58.4
614
+ </td>
615
+ <td>37.9
616
+ </td>
617
+ <td>49.8
618
+ </td>
619
+ <td>79.7
620
+ </td>
621
+ <td>70.2
622
+ </td>
623
+ </tr>
624
+ </table>
625
+
626
+
627
+
628
+ ### Instruction tuned models
629
+
630
+
631
+ <table>
632
+ <tr>
633
+ <td><strong>Benchmark</strong>
634
+ </td>
635
+ <td><strong>Llama 3 8B</strong>
636
+ </td>
637
+ <td><strong>Llama 2 7B</strong>
638
+ </td>
639
+ <td><strong>Llama 2 13B</strong>
640
+ </td>
641
+ <td><strong>Llama 3 70B</strong>
642
+ </td>
643
+ <td><strong>Llama 2 70B</strong>
644
+ </td>
645
+ </tr>
646
+ <tr>
647
+ <td>MMLU (5-shot)
648
+ </td>
649
+ <td>68.4
650
+ </td>
651
+ <td>34.1
652
+ </td>
653
+ <td>47.8
654
+ </td>
655
+ <td>82.0
656
+ </td>
657
+ <td>52.9
658
+ </td>
659
+ </tr>
660
+ <tr>
661
+ <td>GPQA (0-shot)
662
+ </td>
663
+ <td>34.2
664
+ </td>
665
+ <td>21.7
666
+ </td>
667
+ <td>22.3
668
+ </td>
669
+ <td>39.5
670
+ </td>
671
+ <td>21.0
672
+ </td>
673
+ </tr>
674
+ <tr>
675
+ <td>HumanEval (0-shot)
676
+ </td>
677
+ <td>62.2
678
+ </td>
679
+ <td>7.9
680
+ </td>
681
+ <td>14.0
682
+ </td>
683
+ <td>81.7
684
+ </td>
685
+ <td>25.6
686
+ </td>
687
+ </tr>
688
+ <tr>
689
+ <td>GSM-8K (8-shot, CoT)
690
+ </td>
691
+ <td>79.6
692
+ </td>
693
+ <td>25.7
694
+ </td>
695
+ <td>77.4
696
+ </td>
697
+ <td>93.0
698
+ </td>
699
+ <td>57.5
700
+ </td>
701
+ </tr>
702
+ <tr>
703
+ <td>MATH (4-shot, CoT)
704
+ </td>
705
+ <td>30.0
706
+ </td>
707
+ <td>3.8
708
+ </td>
709
+ <td>6.7
710
+ </td>
711
+ <td>50.4
712
+ </td>
713
+ <td>11.6
714
+ </td>
715
+ </tr>
716
+ </table>
717
+
718
+
719
+
720
+ ### Responsibility & Safety
721
+
722
+ We believe that an open approach to AI leads to better, safer products, faster innovation, and a bigger overall market. We are committed to Responsible AI development and took a series of steps to limit misuse and harm and support the open source community.
723
+
724
+ Foundation models are widely capable technologies that are built to be used for a diverse range of applications. They are not designed to meet every developer preference on safety levels for all use cases, out-of-the-box, as those by their nature will differ across different applications.
725
+
726
+ Rather, responsible LLM-application deployment is achieved by implementing a series of safety best practices throughout the development of such applications, from the model pre-training, fine-tuning and the deployment of systems composed of safeguards to tailor the safety needs specifically to the use case and audience.
727
+
728
+
729
+ As part of the Llama 3 release, we updated our [Responsible Use Guide](https://llama.meta.com/responsible-use-guide/) to outline the steps and best practices for developers to implement model and system level safety for their application. We also provide a set of resources including [Meta Llama Guard 2](https://llama.meta.com/purple-llama/) and [Code Shield](https://llama.meta.com/purple-llama/) safeguards. These tools have proven to drastically reduce residual risks of LLM Systems, while maintaining a high level of helpfulness. We encourage developers to tune and deploy these safeguards according to their needs and we provide a [reference implementation](https://github.com/meta-llama/llama-recipes/tree/main/recipes/responsible_ai) to get you started.
730
+
731
+
732
+ #### Llama 3-Instruct
733
+
734
+ As outlined in the Responsible Use Guide, some trade-off between model helpfulness and model alignment is likely unavoidable. Developers should exercise discretion about how to weigh the benefits of alignment and helpfulness for their specific use case and audience. Developers should be mindful of residual risks when using Llama models and leverage additional safety tools as needed to reach the right safety bar for their use case.
735
+
736
+ <span style="text-decoration:underline;">Safety</span>
737
+
738
+ For our instruction tuned model, we conducted extensive red teaming exercises, performed adversarial evaluations and implemented safety mitigations techniques to lower residual risks. As with any Large Language Model, residual risks will likely remain and we recommend that developers assess these risks in the context of their use case. In parallel, we are working with the community to make AI safety benchmark standards transparent, rigorous and interpretable.
739
+
740
+ <span style="text-decoration:underline;">Refusals</span>
741
+
742
+ In addition to residual risks, we put a great emphasis on model refusals to benign prompts. Over-refusing not only can impact the user experience but could even be harmful in certain contexts as well. We’ve heard the feedback from the developer community and improved our fine tuning to ensure that Llama 3 is significantly less likely to falsely refuse to answer prompts than Llama 2.
743
+
744
+ We built internal benchmarks and developed mitigations to limit false refusals making Llama 3 our most helpful model to date.
745
+
746
+
747
+ #### Responsible release
748
+
749
+ In addition to responsible use considerations outlined above, we followed a rigorous process that requires us to take extra measures against misuse and critical risks before we make our release decision.
750
+
751
+ Misuse
752
+
753
+ If you access or use Llama 3, you agree to the Acceptable Use Policy. The most recent copy of this policy can be found at [https://llama.meta.com/llama3/use-policy/](https://llama.meta.com/llama3/use-policy/).
754
+
755
+
756
+ #### Critical risks
757
+
758
+ <span style="text-decoration:underline;">CBRNE</span> (Chemical, Biological, Radiological, Nuclear, and high yield Explosives)
759
+
760
+ We have conducted a two fold assessment of the safety of the model in this area:
761
+
762
+
763
+
764
+ * Iterative testing during model training to assess the safety of responses related to CBRNE threats and other adversarial risks.
765
+ * Involving external CBRNE experts to conduct an uplift test assessing the ability of the model to accurately provide expert knowledge and reduce barriers to potential CBRNE misuse, by reference to what can be achieved using web search (without the model).
766
+
767
+
768
+ ### <span style="text-decoration:underline;">Cyber Security </span>
769
+
770
+ We have evaluated Llama 3 with CyberSecEval, Meta’s cybersecurity safety eval suite, measuring Llama 3’s propensity to suggest insecure code when used as a coding assistant, and Llama 3’s propensity to comply with requests to help carry out cyber attacks, where attacks are defined by the industry standard MITRE ATT&CK cyber attack ontology. On our insecure coding and cyber attacker helpfulness tests, Llama 3 behaved in the same range or safer than models of [equivalent coding capability](https://huggingface.co/spaces/facebook/CyberSecEval).
771
+
772
+
773
+ ### <span style="text-decoration:underline;">Child Safety</span>
774
+
775
+ 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. We also partnered with content specialists to perform red teaming exercises assessing potentially violating content while taking account of market specific nuances or experiences.
776
+
777
+
778
+ ### Community
779
+
780
+ 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 in 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).
781
+
782
+ 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.
783
+
784
+
785
+ ## Ethical Considerations and Limitations
786
+
787
+ The core values of Llama 3 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 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.
788
+
789
+ But Llama 3 is a new technology, and like any new technology, there are risks associated with its use. Testing conducted to date has been in English, and has not covered, nor could it cover, all scenarios. For these reasons, as with all LLMs, Llama 3’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 models, developers should perform safety testing and tuning tailored to their specific applications of the model. As outlined in the Responsible Use Guide, we recommend incorporating [Purple Llama](https://github.com/facebookresearch/PurpleLlama) solutions into your workflows and specifically [Llama Guard](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) which provides a base model to filter input and output prompts to layer system-level safety on top of model-level safety.
790
+
791
+ Please see the Responsible Use Guide available at [http://llama.meta.com/responsible-use-guide](http://llama.meta.com/responsible-use-guide)
792
+
793
+
794
+ ## Citation instructions
795
+
796
+ @article{llama3modelcard,
797
+
798
+ title={Llama 3 Model Card},
799
+
800
+ author={AI@Meta},
801
+
802
+ year={2024},
803
+
804
+ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
805
+
806
+ }
807
+
808
+ ## Contributors
809
+
810
+ Aaditya Singh; Aaron Grattafiori; Abhimanyu Dubey; Abhinav Jauhri; Abhinav Pandey; Abhishek Kadian; Adam Kelsey; Adi Gangidi; Ahmad Al-Dahle; Ahuva Goldstand; Aiesha Letman; Ajay Menon; Akhil Mathur; Alan Schelten; Alex Vaughan; Amy Yang; Andrei Lupu; Andres Alvarado; Andrew Gallagher; Andrew Gu; Andrew Ho; Andrew Poulton; Andrew Ryan; Angela Fan; Ankit Ramchandani; Anthony Hartshorn; Archi Mitra; Archie Sravankumar; Artem Korenev; Arun Rao; Ashley Gabriel; Ashwin Bharambe; Assaf Eisenman; Aston Zhang; Aurelien Rodriguez; Austen Gregerson; Ava Spataru; Baptiste Roziere; Ben Maurer; Benjamin Leonhardi; Bernie Huang; Bhargavi Paranjape; Bing Liu; Binh Tang; Bobbie Chern; Brani Stojkovic; Brian Fuller; Catalina Mejia Arenas; Chao Zhou; Charlotte Caucheteux; Chaya Nayak; Ching-Hsiang Chu; Chloe Bi; Chris Cai; Chris Cox; Chris Marra; Chris McConnell; Christian Keller; Christoph Feichtenhofer; Christophe Touret; Chunyang Wu; Corinne Wong; Cristian Canton Ferrer; Damien Allonsius; Daniel Kreymer; Daniel Haziza; Daniel Li; Danielle Pintz; Danny Livshits; Danny Wyatt; David Adkins; David Esiobu; David Xu; Davide Testuggine; Delia David; Devi Parikh; Dhruv Choudhary; Dhruv Mahajan; Diana Liskovich; Diego Garcia-Olano; Diego Perino; Dieuwke Hupkes; Dingkang Wang; Dustin Holland; Egor Lakomkin; Elina Lobanova; Xiaoqing Ellen Tan; Emily Dinan; Eric Smith; Erik Brinkman; Esteban Arcaute; Filip Radenovic; Firat Ozgenel; Francesco Caggioni; Frank Seide; Frank Zhang; Gabriel Synnaeve; Gabriella Schwarz; Gabrielle Lee; Gada Badeer; Georgia Anderson; Graeme Nail; Gregoire Mialon; Guan Pang; Guillem Cucurell; Hailey Nguyen; Hannah Korevaar; Hannah Wang; Haroun Habeeb; Harrison Rudolph; Henry Aspegren; Hu Xu; Hugo Touvron; Iga Kozlowska; Igor Molybog; Igor Tufanov; Iliyan Zarov; Imanol Arrieta Ibarra; Irina-Elena Veliche; Isabel Kloumann; Ishan Misra; Ivan Evtimov; Jacob Xu; Jade Copet; Jake Weissman; Jan Geffert; Jana Vranes; Japhet Asher; Jason Park; Jay Mahadeokar; Jean-Baptiste Gaya; Jeet Shah; Jelmer van der Linde; Jennifer Chan; Jenny Hong; Jenya Lee; Jeremy Fu; Jeremy Teboul; Jianfeng Chi; Jianyu Huang; Jie Wang; Jiecao Yu; Joanna Bitton; Joe Spisak; Joelle Pineau; Jon Carvill; Jongsoo Park; Joseph Rocca; Joshua Johnstun; Junteng Jia; Kalyan Vasuden Alwala; Kam Hou U; Kate Plawiak; Kartikeya Upasani; Kaushik Veeraraghavan; Ke Li; Kenneth Heafield; Kevin Stone; Khalid El-Arini; Krithika Iyer; Kshitiz Malik; Kuenley Chiu; Kunal Bhalla; Kyle Huang; Lakshya Garg; Lauren Rantala-Yeary; Laurens van der Maaten; Lawrence Chen; Leandro Silva; Lee Bell; Lei Zhang; Liang Tan; Louis Martin; Lovish Madaan; Luca Wehrstedt; Lukas Blecher; Luke de Oliveira; Madeline Muzzi; Madian Khabsa; Manav Avlani; Mannat Singh; Manohar Paluri; Mark Zuckerberg; Marcin Kardas; Martynas Mankus; Mathew Oldham; Mathieu Rita; Matthew Lennie; Maya Pavlova; Meghan Keneally; Melanie Kambadur; Mihir Patel; Mikayel Samvelyan; Mike Clark; Mike Lewis; Min Si; Mitesh Kumar Singh; Mo Metanat; Mona Hassan; Naman Goyal; Narjes Torabi; Nicolas Usunier; Nikolay Bashlykov; Nikolay Bogoychev; Niladri Chatterji; Ning Dong; Oliver Aobo Yang; Olivier Duchenne; Onur Celebi; Parth Parekh; Patrick Alrassy; Paul Saab; Pavan Balaji; Pedro Rittner; Pengchuan Zhang; Pengwei Li; Petar Vasic; Peter Weng; Polina Zvyagina; Prajjwal Bhargava; Pratik Dubal; Praveen Krishnan; Punit Singh Koura; Qing He; Rachel Rodriguez; Ragavan Srinivasan; Rahul Mitra; Ramon Calderer; Raymond Li; Robert Stojnic; Roberta Raileanu; Robin Battey; Rocky Wang; Rohit Girdhar; Rohit Patel; Romain Sauvestre; Ronnie Polidoro; Roshan Sumbaly; Ross Taylor; Ruan Silva; Rui Hou; Rui Wang; Russ Howes; Ruty Rinott; Saghar Hosseini; Sai Jayesh Bondu; Samyak Datta; Sanjay Singh; Sara Chugh; Sargun Dhillon; Satadru Pan; Sean Bell; Sergey Edunov; Shaoliang Nie; Sharan Narang; Sharath Raparthy; Shaun Lindsay; Sheng Feng; Sheng Shen; Shenghao Lin; Shiva Shankar; Shruti Bhosale; Shun Zhang; Simon Vandenhende; Sinong Wang; Seohyun Sonia Kim; Soumya Batra; Sten Sootla; Steve Kehoe; Suchin Gururangan; Sumit Gupta; Sunny Virk; Sydney Borodinsky; Tamar Glaser; Tamar Herman; Tamara Best; Tara Fowler; Thomas Georgiou; Thomas Scialom; Tianhe Li; Todor Mihaylov; Tong Xiao; Ujjwal Karn; Vedanuj Goswami; Vibhor Gupta; Vignesh Ramanathan; Viktor Kerkez; Vinay Satish Kumar; Vincent Gonguet; Vish Vogeti; Vlad Poenaru; Vlad Tiberiu Mihailescu; Vladan Petrovic; Vladimir Ivanov; Wei Li; Weiwei Chu; Wenhan Xiong; Wenyin Fu; Wes Bouaziz; Whitney Meers; Will Constable; Xavier Martinet; Xiaojian Wu; Xinbo Gao; Xinfeng Xie; Xuchao Jia; Yaelle Goldschlag; Yann LeCun; Yashesh Gaur; Yasmine Babaei; Ye Qi; Yenda Li; Yi Wen; Yiwen Song; Youngjin Nam; Yuchen Hao; Yuchen Zhang; Yun Wang; Yuning Mao; Yuzi He; Zacharie Delpierre Coudert; Zachary DeVito; Zahra Hankir; Zhaoduo Wen; Zheng Yan; Zhengxing Chen; Zhenyu Yang; Zoe Papakipos