CoolFace
Modelpublic

Resilient-Coders/llama

sourceHugging Facellama3.1updated 5mo agoView on Hugging Face
0likes18downloads
README.md1260 linesDownload Raw Back to root
1---2language:3- en4- de5- fr6- it7- pt8- hi9- es10- th11license: llama3.112base_model: meta-llama/Meta-Llama-3.1-8B13pipeline_tag: text-generation14tags:15- facebook16- meta17- pytorch18- llama19- llama-320extra_gated_prompt: "### LLAMA 3.1 COMMUNITY LICENSE AGREEMENT\nLlama 3.1 Version\21  \ Release Date: July 23, 2024\n\"Agreement\" means the terms and conditions for\22  \ use, reproduction, distribution and modification of the  Llama Materials set forth\23  \ herein.\n\"Documentation\" means the specifications, manuals and documentation\24  \ accompanying Llama 3.1 distributed by Meta at https://llama.meta.com/doc/overview.\n\25  \"Licensee\" or \"you\" means you, or your employer or any other person or entity\26  \ (if you are entering into this Agreement on such person or entity’s behalf), of\27  \ the age required under applicable laws, rules or regulations to provide legal\28  \ consent and that has legal authority to bind your employer or such other person\29  \ or entity if you are entering in this Agreement on their behalf.\n\"Llama 3.1\"\30  \ means the foundational large language models and software and algorithms, including\31  \ machine-learning model code, trained model weights, inference-enabling code, training-enabling\32  \ code, fine-tuning enabling code and other elements of the foregoing distributed\33  \ by Meta at https://llama.meta.com/llama-downloads.\n\"Llama Materials\" means,\34  \ collectively, Meta’s proprietary Llama 3.1 and Documentation (and any portion\35  \ thereof) made available under this Agreement.\n\"Meta\" or \"we\" means Meta Platforms\36  \ Ireland Limited (if you are located in or, if you are an entity, your principal\37  \ place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you\38  \ are located outside of the EEA or Switzerland).\n   \n1. License Rights and Redistribution.\n\39  a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable\40  \ and royalty-free limited license under Meta’s intellectual property or other rights\41  \ owned by Meta embodied in the Llama Materials to use, reproduce, distribute, copy,\42  \ create derivative works of, and make modifications to the Llama Materials.\nb.\43  \ Redistribution and Use.\ni. If you distribute or make available the Llama Materials\44  \ (or any derivative works thereof), or a product or service (including another\45  \ AI model) that contains any of them, you shall (A) provide a copy of this Agreement\46  \ with any such Llama Materials; and (B) prominently display “Built with Llama”\47  \ on a related website, user interface, blogpost, about page, or product documentation.\48  \ If you use the Llama Materials or any outputs or results of the Llama Materials\49  \ to create, train, fine tune, or otherwise improve an AI model, which is distributed\50  \ or made available, you shall also include “Llama” at the beginning of any such\51  \ AI model name.\nii. If you receive Llama Materials, or any derivative works thereof,\52  \ from a Licensee as part  of an integrated end user product, then Section 2 of\53  \ this Agreement will not apply to you.\niii. You must retain in all copies of the\54  \ Llama Materials that you distribute the following attribution notice within a\55  \ “Notice” text file distributed as a part of such copies: “Llama 3.1 is licensed\56  \ under the Llama 3.1 Community License, Copyright © Meta Platforms, Inc. All Rights\57  \ Reserved.”\niv. Your use of the Llama Materials must comply with applicable laws\58  \ and regulations (including trade compliance laws and regulations) and adhere to\59  \ the Acceptable Use Policy for the Llama Materials (available at https://llama.meta.com/llama3_1/use-policy),\60  \ which is hereby incorporated by reference into this Agreement.\n2. Additional\61  \ Commercial Terms. If, on the Llama 3.1 version release date, the monthly active\62  \ users of the products or services made available by or for Licensee, or Licensee’s\63  \ affiliates, is greater than 700 million monthly active users in the preceding\64  \ calendar month, you must request a license from Meta, which Meta may grant to\65  \ you in its sole discretion, and you are not authorized to exercise any of the\66  \ rights under this Agreement unless or until Meta otherwise expressly grants you\67  \ such rights.\n3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE\68  \ LLAMA MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS”\69  \ BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY\70  \ KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES\71  \ OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.\72  \ YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING\73  \ THE LLAMA MATERIALS AND ASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA\74  \ MATERIALS AND ANY OUTPUT AND RESULTS.\n4. Limitation of Liability. IN NO EVENT\75  \ WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OF LIABILITY, WHETHER IN\76  \ CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISING OUT OF THIS\77  \ AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL,\78  \ EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED\79  \ OF THE POSSIBILITY OF ANY OF THE FOREGOING.\n5. Intellectual Property.\na. No\80  \ trademark licenses are granted under this Agreement, and in connection with the\81  \ Llama Materials, neither Meta nor Licensee may use any name or mark owned by or\82  \ associated with the other or any of its affiliates, except as required for reasonable\83  \ and customary use in describing and redistributing the Llama Materials or as set\84  \ forth in this Section 5(a). Meta hereby grants you a license to use “Llama” (the\85  \ “Mark”) solely as required to comply with the last sentence of Section 1.b.i.\86  \ You will comply with Meta’s brand guidelines (currently accessible at https://about.meta.com/brand/resources/meta/company-brand/\87  \ ). All goodwill arising out of your use of the Mark will inure to the benefit\88  \ of Meta.\nb. Subject to Meta’s ownership of Llama Materials and derivatives made\89  \ by or for Meta, with respect to any derivative works and modifications of the\90  \ Llama Materials that are made by you, as between you and Meta, you are and will\91  \ be the owner of such derivative works and modifications.\nc. If you institute\92  \ litigation or other proceedings against Meta or any entity (including a cross-claim\93  \ or counterclaim in a lawsuit) alleging that the Llama Materials or Llama 3.1 outputs\94  \ or results, or any portion of any of the foregoing, constitutes infringement of\95  \ intellectual property or other rights owned or licensable by you, then any licenses\96  \ granted to you under this Agreement shall terminate as of the date such litigation\97  \ or claim is filed or instituted. You will indemnify and hold harmless Meta from\98  \ and against any claim by any third party arising out of or related to your use\99  \ or distribution of the Llama Materials.\n6. Term and Termination. The term of\100  \ this Agreement will commence upon your acceptance of this Agreement or access\101  \ to the Llama Materials and will continue in full force and effect until terminated\102  \ in accordance with the terms and conditions herein. Meta may terminate this Agreement\103  \ if you are in breach of any term or condition of this Agreement. Upon termination\104  \ of this Agreement, you shall delete and cease use of the Llama Materials. Sections\105  \ 3, 4 and 7 shall survive the termination of this Agreement.\n7. Governing Law\106  \ and Jurisdiction. This Agreement will be governed and construed under the laws\107  \ of the State of California without regard to choice of law principles, and the\108  \ UN Convention on Contracts for the International Sale of Goods does not apply\109  \ to this Agreement. The courts of California shall have exclusive jurisdiction\110  \ of any dispute arising out of this Agreement.\n### Llama 3.1 Acceptable Use Policy\n\111  Meta is committed to promoting safe and fair use of its tools and features, including\112  \ Llama 3.1. If you access or use Llama 3.1, you agree to this Acceptable Use Policy\113  \ (“Policy”). The most recent copy of this policy can be found at [https://llama.meta.com/llama3_1/use-policy](https://llama.meta.com/llama3_1/use-policy)\n\114  #### Prohibited Uses\nWe want everyone to use Llama 3.1 safely and responsibly.\115  \ You agree you will not use, or allow others to use, Llama 3.1 to:\n 1. Violate\116  \ the law or others’ rights, including to:\n    1. Engage in, promote, generate,\117  \ contribute to, encourage, plan, incite, or further illegal or unlawful activity\118  \ or content, such as:\n        1. Violence or terrorism\n        2. Exploitation\119  \ or harm to children, including the solicitation, creation, acquisition, or dissemination\120  \ of child exploitative content or failure to report Child Sexual Abuse Material\n\121  \        3. Human trafficking, exploitation, and sexual violence\n        4. The\122  \ illegal distribution of information or materials to minors, including obscene\123  \ materials, or failure to employ legally required age-gating in connection with\124  \ such information or materials.\n        5. Sexual solicitation\n        6. Any\125  \ other criminal activity\n    3. Engage in, promote, incite, or facilitate the\126  \ harassment, abuse, threatening, or bullying of individuals or groups of individuals\n\127  \    4. Engage in, promote, incite, or facilitate discrimination or other unlawful\128  \ or harmful conduct in the provision of employment, employment benefits, credit,\129  \ housing, other economic benefits, or other essential goods and services\n    5.\130  \ Engage in the unauthorized or unlicensed practice of any profession including,\131  \ but not limited to, financial, legal, medical/health, or related professional\132  \ practices\n    6. Collect, process, disclose, generate, or infer health, demographic,\133  \ or other sensitive personal or private information about individuals without rights\134  \ and consents required by applicable laws\n    7. Engage in or facilitate any action\135  \ or generate any content that infringes, misappropriates, or otherwise violates\136  \ any third-party rights, including the outputs or results of any products or services\137  \ using the Llama Materials\n    8. Create, generate, or facilitate the creation\138  \ of malicious code, malware, computer viruses or do anything else that could disable,\139  \ overburden, interfere with or impair the proper working, integrity, operation\140  \ or appearance of a website or computer system\n2. Engage in, promote, incite,\141  \ facilitate, or assist in the planning or development of activities that present\142  \ a risk of death or bodily harm to individuals, including use of Llama 3.1 related\143  \ to the following:\n    1. Military, warfare, nuclear industries or applications,\144  \ espionage, use for materials or activities that are subject to the International\145  \ Traffic Arms Regulations (ITAR) maintained by the United States Department of\146  \ State\n    2. Guns and illegal weapons (including weapon development)\n    3.\147  \ Illegal drugs and regulated/controlled substances\n    4. Operation of critical\148  \ infrastructure, transportation technologies, or heavy machinery\n    5. Self-harm\149  \ or harm to others, including suicide, cutting, and eating disorders\n    6. Any\150  \ content intended to incite or promote violence, abuse, or any infliction of bodily\151  \ harm to an individual\n3. Intentionally deceive or mislead others, including use\152  \ of Llama 3.1 related to the following:\n    1. Generating, promoting, or furthering\153  \ fraud or the creation or promotion of disinformation\n    2. Generating, promoting,\154  \ or furthering defamatory content, including the creation of defamatory statements,\155  \ images, or other content\n    3. Generating, promoting, or further distributing\156  \ spam\n    4. Impersonating another individual without consent, authorization,\157  \ or legal right\n    5. Representing that the use of Llama 3.1 or outputs are human-generated\n\158  \    6. Generating or facilitating false online engagement, including fake reviews\159  \ and other means of fake online engagement\n4. Fail to appropriately disclose to\160  \ end users any known dangers of your AI system\nPlease report any violation of\161  \ this Policy, software “bug,” or other problems that could lead to a violation\162  \ of this Policy through one of the following means:\n    * Reporting issues with\163  \ the model: [https://github.com/meta-llama/llama-models/issues](https://github.com/meta-llama/llama-models/issues)\n\164  \    * Reporting risky content generated by the model:\n    developers.facebook.com/llama_output_feedback\n\165  \    * Reporting bugs and security concerns: facebook.com/whitehat/info\n    * Reporting\166  \ violations of the Acceptable Use Policy or unlicensed uses of Meta Llama 3: LlamaUseReport@meta.com"167extra_gated_fields:168  First Name: text169  Last Name: text170  Date of birth: date_picker171  Country: country172  Affiliation: text173  Job title:174    type: select175    options:176    - Student177    - Research Graduate178    - AI researcher179    - AI developer/engineer180    - Reporter181    - Other182  geo: ip_location183  ? By clicking Submit below I accept the terms of the license and acknowledge that184    the information I provide will be collected stored processed and shared in accordance185    with the Meta Privacy Policy186  : checkbox187extra_gated_description: The information you provide will be collected, stored, processed188  and shared in accordance with the [Meta Privacy Policy](https://www.facebook.com/privacy/policy/).189extra_gated_button_content: Submit190---191 192## Model Information193 194The 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.195 196**Model developer**: Meta197 198**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. 199 200 201<table>202  <tr>203   <td>204   </td>205   <td><strong>Training Data</strong>206   </td>207   <td><strong>Params</strong>208   </td>209   <td><strong>Input modalities</strong>210   </td>211   <td><strong>Output modalities</strong>212   </td>213   <td><strong>Context length</strong>214   </td>215   <td><strong>GQA</strong>216   </td>217   <td><strong>Token count</strong>218   </td>219   <td><strong>Knowledge cutoff</strong>220   </td>221  </tr>222  <tr>223   <td rowspan="3" >Llama 3.1 (text only)224   </td>225   <td rowspan="3" >A new mix of publicly available online data.226   </td>227   <td>8B228   </td>229   <td>Multilingual Text230   </td>231   <td>Multilingual Text and code232   </td>233   <td>128k234   </td>235   <td>Yes236   </td>237   <td rowspan="3" >15T+238   </td>239   <td rowspan="3" >December 2023240   </td>241  </tr>242  <tr>243   <td>70B244   </td>245   <td>Multilingual Text246   </td>247   <td>Multilingual Text and code248   </td>249   <td>128k250   </td>251   <td>Yes252   </td>253  </tr>254  <tr>255   <td>405B256   </td>257   <td>Multilingual Text258   </td>259   <td>Multilingual Text and code260   </td>261   <td>128k262   </td>263   <td>Yes264   </td>265  </tr>266</table>267 268 269**Supported languages:** English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.270 271**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.272 273**Model Release Date:** July 23, 2024.274 275**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.276 277**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)278 279Where 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). 280 281 282## Intended Use283 284**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. 285 286**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**.287 288**<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.289 290## How to use291 292This repository contains two versions of Meta-Llama-3.1-8B-Instruct, for use with transformers and with the original `llama` codebase.293 294### Use with transformers295 296Starting 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.297 298Make sure to update your transformers installation via `pip install --upgrade transformers`.299 300```python301import transformers302import torch303 304model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"305 306pipeline = transformers.pipeline(307    "text-generation",308    model=model_id,309    model_kwargs={"torch_dtype": torch.bfloat16},310    device_map="auto",311)312 313messages = [314    {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},315    {"role": "user", "content": "Who are you?"},316]317 318outputs = pipeline(319    messages,320    max_new_tokens=256,321)322print(outputs[0]["generated_text"][-1])323```324 325Note: 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)326 327### Tool use with transformers328 329LLaMA-3.1 supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).330 331Tool use is also supported through [chat templates](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling) in Transformers. 332Here is a quick example showing a single simple tool:333 334```python335# First, define a tool336def get_current_temperature(location: str) -> float:337    """338    Get the current temperature at a location.339    340    Args:341        location: The location to get the temperature for, in the format "City, Country"342    Returns:343        The current temperature at the specified location in the specified units, as a float.344    """345    return 22.  # A real function should probably actually get the temperature!346 347# Next, create a chat and apply the chat template348messages = [349  {"role": "system", "content": "You are a bot that responds to weather queries."},350  {"role": "user", "content": "Hey, what's the temperature in Paris right now?"}351]352 353inputs = tokenizer.apply_chat_template(messages, tools=[get_current_temperature], add_generation_prompt=True)354```355 356You can then generate text from this input as normal. If the model generates a tool call, you should add it to the chat like so:357 358```python359tool_call = {"name": "get_current_temperature", "arguments": {"location": "Paris, France"}}360messages.append({"role": "assistant", "tool_calls": [{"type": "function", "function": tool_call}]})361```362 363and then call the tool and append the result, with the `tool` role, like so:364 365```python366messages.append({"role": "tool", "name": "get_current_temperature", "content": "22.0"})367```368 369After that, you can `generate()` again to let the model use the tool result in the chat. Note that this was a very brief introduction to tool calling - for more information,370see the [LLaMA prompt format docs](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/) and the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).371 372 373### Use with `llama`374 375Please, follow the instructions in the [repository](https://github.com/meta-llama/llama)376 377To download Original checkpoints, see the example command below leveraging `huggingface-cli`:378 379```380huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir Meta-Llama-3.1-8B-Instruct381```382 383## Hardware and Software384 385**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.386 387**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. 388 389 390**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.391 392 393<table>394  <tr>395   <td>396   </td>397   <td><strong>Training Time (GPU hours)</strong>398   </td>399   <td><strong>Training Power Consumption (W)</strong>400   </td>401   <td><strong>Training Location-Based Greenhouse Gas Emissions</strong>402<p>403<strong>(tons CO2eq)</strong>404   </td>405   <td><strong>Training Market-Based Greenhouse Gas Emissions</strong>406<p>407<strong>(tons CO2eq)</strong>408   </td>409  </tr>410  <tr>411   <td>Llama 3.1 8B412   </td>413   <td>1.46M414   </td>415   <td>700416   </td>417   <td>420418   </td>419   <td>0420   </td>421  </tr>422  <tr>423   <td>Llama 3.1 70B424   </td>425   <td>7.0M426   </td>427   <td>700428   </td>429   <td>2,040430   </td>431   <td>0432   </td>433  </tr>434  <tr>435   <td>Llama 3.1 405B436   </td>437   <td>30.84M438   </td>439   <td>700440   </td>441   <td>8,930442   </td>443   <td>0444   </td>445  </tr>446  <tr>447   <td>Total448   </td>449   <td>39.3M450   <td>451<ul>452 453</ul>454   </td>455   <td>11,390456   </td>457   <td>0458   </td>459  </tr>460</table>461 462 463 464The 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.465 466 467## Training Data468 469**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. 470 471**Data Freshness:** The pretraining data has a cutoff of December 2023.472 473 474## Benchmark scores475 476In 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. 477 478### Base pretrained models479 480 481<table>482  <tr>483   <td><strong>Category</strong>484   </td>485   <td><strong>Benchmark</strong>486   </td>487   <td><strong># Shots</strong>488   </td>489   <td><strong>Metric</strong>490   </td>491   <td><strong>Llama 3 8B</strong>492   </td>493   <td><strong>Llama 3.1 8B</strong>494   </td>495   <td><strong>Llama 3 70B</strong>496   </td>497   <td><strong>Llama 3.1 70B</strong>498   </td>499   <td><strong>Llama 3.1 405B</strong>500   </td>501  </tr>502  <tr>503   <td rowspan="7" >General504   </td>505   <td>MMLU506   </td>507   <td>5508   </td>509   <td>macro_avg/acc_char510   </td>511   <td>66.7512   </td>513   <td>66.7514   </td>515   <td>79.5516   </td>517   <td>79.3518   </td>519   <td>85.2520   </td>521  </tr>522  <tr>523   <td>MMLU-Pro (CoT)524   </td>525   <td>5526   </td>527   <td>macro_avg/acc_char528   </td>529   <td>36.2530   </td>531   <td>37.1532   </td>533   <td>55.0534   </td>535   <td>53.8536   </td>537   <td>61.6538   </td>539  </tr>540  <tr>541   <td>AGIEval English542   </td>543   <td>3-5544   </td>545   <td>average/acc_char546   </td>547   <td>47.1548   </td>549   <td>47.8550   </td>551   <td>63.0552   </td>553   <td>64.6554   </td>555   <td>71.6556   </td>557  </tr>558  <tr>559   <td>CommonSenseQA560   </td>561   <td>7562   </td>563   <td>acc_char564   </td>565   <td>72.6566   </td>567   <td>75.0568   </td>569   <td>83.8570   </td>571   <td>84.1572   </td>573   <td>85.8574   </td>575  </tr>576  <tr>577   <td>Winogrande578   </td>579   <td>5580   </td>581   <td>acc_char582   </td>583   <td>-584   </td>585   <td>60.5586   </td>587   <td>-588   </td>589   <td>83.3590   </td>591   <td>86.7592   </td>593  </tr>594  <tr>595   <td>BIG-Bench Hard (CoT)596   </td>597   <td>3598   </td>599   <td>average/em600   </td>601   <td>61.1602   </td>603   <td>64.2604   </td>605   <td>81.3606   </td>607   <td>81.6608   </td>609   <td>85.9610   </td>611  </tr>612  <tr>613   <td>ARC-Challenge614   </td>615   <td>25616   </td>617   <td>acc_char618   </td>619   <td>79.4620   </td>621   <td>79.7622   </td>623   <td>93.1624   </td>625   <td>92.9626   </td>627   <td>96.1628   </td>629  </tr>630  <tr>631   <td>Knowledge reasoning632   </td>633   <td>TriviaQA-Wiki634   </td>635   <td>5636   </td>637   <td>em638   </td>639   <td>78.5640   </td>641   <td>77.6642   </td>643   <td>89.7644   </td>645   <td>89.8646   </td>647   <td>91.8648   </td>649  </tr>650  <tr>651   <td rowspan="4" >Reading comprehension652   </td>653   <td>SQuAD654   </td>655   <td>1656   </td>657   <td>em658   </td>659   <td>76.4660   </td>661   <td>77.0662   </td>663   <td>85.6664   </td>665   <td>81.8666   </td>667   <td>89.3668   </td>669  </tr>670  <tr>671   <td>QuAC (F1)672   </td>673   <td>1674   </td>675   <td>f1676   </td>677   <td>44.4678   </td>679   <td>44.9680   </td>681   <td>51.1682   </td>683   <td>51.1684   </td>685   <td>53.6686   </td>687  </tr>688  <tr>689   <td>BoolQ690   </td>691   <td>0692   </td>693   <td>acc_char694   </td>695   <td>75.7696   </td>697   <td>75.0698   </td>699   <td>79.0700   </td>701   <td>79.4702   </td>703   <td>80.0704   </td>705  </tr>706  <tr>707   <td>DROP (F1)708   </td>709   <td>3710   </td>711   <td>f1712   </td>713   <td>58.4714   </td>715   <td>59.5716   </td>717   <td>79.7718   </td>719   <td>79.6720   </td>721   <td>84.8722   </td>723  </tr>724</table>725 726 727 728### Instruction tuned models729 730 731<table>732  <tr>733   <td><strong>Category</strong>734   </td>735   <td><strong>Benchmark</strong>736   </td>737   <td><strong># Shots</strong>738   </td>739   <td><strong>Metric</strong>740   </td>741   <td><strong>Llama 3 8B Instruct</strong>742   </td>743   <td><strong>Llama 3.1 8B Instruct</strong>744   </td>745   <td><strong>Llama 3 70B Instruct</strong>746   </td>747   <td><strong>Llama 3.1 70B Instruct</strong>748   </td>749   <td><strong>Llama 3.1 405B Instruct</strong>750   </td>751  </tr>752  <tr>753   <td rowspan="4" >General754   </td>755   <td>MMLU756   </td>757   <td>5758   </td>759   <td>macro_avg/acc760   </td>761   <td>68.5762   </td>763   <td>69.4764   </td>765   <td>82.0766   </td>767   <td>83.6768   </td>769   <td>87.3770   </td>771  </tr>772  <tr>773   <td>MMLU (CoT)774   </td>775   <td>0776   </td>777   <td>macro_avg/acc778   </td>779   <td>65.3780   </td>781   <td>73.0782   </td>783   <td>80.9784   </td>785   <td>86.0786   </td>787   <td>88.6788   </td>789  </tr>790  <tr>791   <td>MMLU-Pro (CoT)792   </td>793   <td>5794   </td>795   <td>micro_avg/acc_char796   </td>797   <td>45.5798   </td>799   <td>48.3800   </td>801   <td>63.4802   </td>803   <td>66.4804   </td>805   <td>73.3806   </td>807  </tr>808  <tr>809   <td>IFEval810   </td>811   <td>812   </td>813   <td>814   </td>815   <td>76.8816   </td>817   <td>80.4818   </td>819   <td>82.9820   </td>821   <td>87.5822   </td>823   <td>88.6824   </td>825  </tr>826  <tr>827   <td rowspan="2" >Reasoning828   </td>829   <td>ARC-C830   </td>831   <td>0832   </td>833   <td>acc834   </td>835   <td>82.4836   </td>837   <td>83.4838   </td>839   <td>94.4840   </td>841   <td>94.8842   </td>843   <td>96.9844   </td>845  </tr>846  <tr>847   <td>GPQA848   </td>849   <td>0850   </td>851   <td>em852   </td>853   <td>34.6854   </td>855   <td>30.4856   </td>857   <td>39.5858   </td>859   <td>46.7860   </td>861   <td>50.7862   </td>863  </tr>864  <tr>865   <td rowspan="4" >Code866   </td>867   <td>HumanEval868   </td>869   <td>0870   </td>871   <td>pass@1872   </td>873   <td>60.4874   </td>875   <td>72.6876   </td>877   <td>81.7878   </td>879   <td>80.5880   </td>881   <td>89.0882   </td>883  </tr>884  <tr>885   <td>MBPP ++ base version886   </td>887   <td>0888   </td>889   <td>pass@1890   </td>891   <td>70.6892   </td>893   <td>72.8894   </td>895   <td>82.5896   </td>897   <td>86.0898   </td>899   <td>88.6900   </td>901  </tr>902  <tr>903   <td>Multipl-E HumanEval904   </td>905   <td>0906   </td>907   <td>pass@1908   </td>909   <td>-910   </td>911   <td>50.8912   </td>913   <td>-914   </td>915   <td>65.5916   </td>917   <td>75.2918   </td>919  </tr>920  <tr>921   <td>Multipl-E MBPP922   </td>923   <td>0924   </td>925   <td>pass@1926   </td>927   <td>-928   </td>929   <td>52.4930   </td>931   <td>-932   </td>933   <td>62.0934   </td>935   <td>65.7936   </td>937  </tr>938  <tr>939   <td rowspan="2" >Math940   </td>941   <td>GSM-8K (CoT)942   </td>943   <td>8944   </td>945   <td>em_maj1@1946   </td>947   <td>80.6948   </td>949   <td>84.5950   </td>951   <td>93.0952   </td>953   <td>95.1954   </td>955   <td>96.8956   </td>957  </tr>958  <tr>959   <td>MATH (CoT)960   </td>961   <td>0962   </td>963   <td>final_em964   </td>965   <td>29.1966   </td>967   <td>51.9968   </td>969   <td>51.0970   </td>971   <td>68.0972   </td>973   <td>73.8974   </td>975  </tr>976  <tr>977   <td rowspan="4" >Tool Use978   </td>979   <td>API-Bank980   </td>981   <td>0982   </td>983   <td>acc984   </td>985   <td>48.3986   </td>987   <td>82.6988   </td>989   <td>85.1990   </td>991   <td>90.0992   </td>993   <td>92.0994   </td>995  </tr>996  <tr>997   <td>BFCL998   </td>999   <td>01000   </td>1001   <td>acc1002   </td>1003   <td>60.31004   </td>1005   <td>76.11006   </td>1007   <td>83.01008   </td>1009   <td>84.81010   </td>1011   <td>88.51012   </td>1013  </tr>1014  <tr>1015   <td>Gorilla Benchmark API Bench1016   </td>1017   <td>01018   </td>1019   <td>acc1020   </td>1021   <td>1.71022   </td>1023   <td>8.21024   </td>1025   <td>14.71026   </td>1027   <td>29.71028   </td>1029   <td>35.31030   </td>1031  </tr>1032  <tr>1033   <td>Nexus (0-shot)1034   </td>1035   <td>01036   </td>1037   <td>macro_avg/acc1038   </td>1039   <td>18.11040   </td>1041   <td>38.51042   </td>1043   <td>47.81044   </td>1045   <td>56.71046   </td>1047   <td>58.71048   </td>1049  </tr>1050  <tr>1051   <td>Multilingual1052   </td>1053   <td>Multilingual MGSM (CoT)1054   </td>1055   <td>01056   </td>1057   <td>em1058   </td>1059   <td>-1060   </td>1061   <td>68.91062   </td>1063   <td>-1064   </td>1065   <td>86.91066   </td>1067   <td>91.61068   </td>1069  </tr>1070</table>1071 1072#### Multilingual benchmarks1073 1074<table>1075  <tr>1076   <td><strong>Category</strong>1077   </td>1078   <td><strong>Benchmark</strong>1079   </td>1080   <td><strong>Language</strong>1081   </td>1082   <td><strong>Llama 3.1 8B</strong>1083   </td>1084   <td><strong>Llama 3.1 70B</strong>1085   </td>1086   <td><strong>Llama 3.1 405B</strong>1087   </td>1088  </tr>1089  <tr>1090   <td rowspan="9" ><strong>General</strong>1091   </td>1092   <td rowspan="9" ><strong>MMLU (5-shot, macro_avg/acc)</strong>1093   </td>1094   <td>Portuguese1095   </td>1096   <td>62.121097   </td>1098   <td>80.131099   </td>1100   <td>84.951101   </td>1102  </tr>1103  <tr>1104   <td>Spanish1105   </td>1106   <td>62.451107   </td>1108   <td>80.051109   </td>1110   <td>85.081111   </td>1112  </tr>1113  <tr>1114   <td>Italian1115   </td>1116   <td>61.631117   </td>1118   <td>80.41119   </td>1120   <td>85.041121   </td>1122  </tr>1123  <tr>1124   <td>German1125   </td>1126   <td>60.591127   </td>1128   <td>79.271129   </td>1130   <td>84.361131   </td>1132  </tr>1133  <tr>1134   <td>French1135   </td>1136   <td>62.341137   </td>1138   <td>79.821139   </td>1140   <td>84.661141   </td>1142  </tr>1143  <tr>1144   <td>Hindi1145   </td>1146   <td>50.881147   </td>1148   <td>74.521149   </td>1150   <td>80.311151   </td>1152  </tr>1153  <tr>1154   <td>Thai1155   </td>1156   <td>50.321157   </td>1158   <td>72.951159   </td>1160   <td>78.211161   </td>1162  </tr>1163</table>1164 1165 1166 1167## Responsibility & Safety1168 1169As part of our Responsible release approach, we followed a three-pronged strategy to managing trust & safety risks:1170 1171 1172 1173* Enable developers to deploy helpful, safe and flexible experiences for their target audience and for the use cases supported by Llama. 1174* Protect developers against adversarial users aiming to exploit Llama capabilities to potentially cause harm.1175* Provide protections for the community to help prevent the misuse of our models.1176 1177 1178### Responsible deployment 1179 1180Llama 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. 1181 1182 1183#### Llama 3.1 instruct 1184 1185Our 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. 1186 1187**Fine-tuning data**1188 1189We 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. 1190 1191**Refusals and Tone**1192 1193Building 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. 1194 1195 1196#### Llama 3.1 systems1197 1198**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. 1199 1200As 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. 

Showing the first 1,200 of 1260 lines. Download the file for the rest.