f15hb0wn commited on
Commit
473bd18
·
verified ·
1 Parent(s): feb8df4

Update README.md

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