Skip to main content
Browse Models

Meta

Llama 2 13B

Released

2023-07-18

Family

Llama 2

Type

Foundation Model

Downloads

External Download

You are about to open a link to an external source. Verify the URL before continuing.

Download

Chat model, 4-bit GGUF (Q4_K_M)

GGUF · llama-2-13b-chat.Q4_K_M.gguf

Chat model, 5-bit GGUF (Q5_K_M)

GGUF · llama-2-13b-chat.Q5_K_M.gguf

Chat model, 6-bit GGUF (Q6_K)

GGUF · llama-2-13b-chat.Q6_K.gguf

Chat model, 8-bit GGUF (Q8_0)

GGUF · llama-2-13b-chat.Q8_0.gguf

4-bit GGUF (Q4_K_M)

GGUF · llama-2-13b.Q4_K_M.gguf

5-bit GGUF (Q5_K_M)

GGUF · llama-2-13b.Q5_K_M.gguf

6-bit GGUF (Q6_K)

GGUF · llama-2-13b.Q6_K.gguf

8-bit GGUF (Q8_0)

GGUF · llama-2-13b.Q8_0.gguf

Ollama Model (q4_K_M)

Ollama

Model Report

Overview

Llama 2 13B is a large language model comprising 13 billion parameters, released as part of the Llama 2 series by Meta. Designed for general-purpose text generation and dialogue, it is available in both a standard pretrained version and a fine-tuned chat-optimized version known as Llama 2-Chat 13B. The release underscores Meta's commitment to open research and commercial use, with the model and its associated resources made available to the public under a permissive community license. Llama 2 13B achieves strong performance across a range of established natural language processing benchmarks and introduces architectural and training advances relative to its predecessor, Llama 1.

Llama 2 stylized logo, highlighting 7B, 13B, and 70B model versions

Figure 1. Llama 2 stylized logo, featuring references to its 7B, 13B, and 70B model variants as part of Meta's open foundation model release.

Model Architecture and Training Methodology

Llama 2 13B is an auto-regressive transformer model built upon advances in large scale language modeling. Compared to Llama 1, Llama 2 models have a doubled context length of 4096 tokens, enabling them to consider a wider range of input for each generation step and significantly improving performance on tasks requiring complex reasoning over longer text spans. The model is primarily trained on English-language data, but also incorporates material from 27 additional languages, with English performance remaining optimal.

Pretraining for Llama 2 13B involved extensive exposure to 2 trillion tokens of publicly sourced textual data, representing a 40% increase relative to the Llama 1 models. The architecture maintains standard transformer components while incorporating optimizations for efficiency and scalability. Larger models in the Llama 2 family, such as the Llama 2 70B version, employ Grouped-Query Attention (GQA) for improved inference speed, though this feature is not present in the 13B model, as documented in the Llama 2 technical report.

Infographic showing Llama 2 model sizes, data volumes, and context length

Figure 2. Table summarizing Llama 2 model variants, the scale of pretraining data (2 trillion tokens), context length (4096 tokens), and scope of human feedback used in fine-tuning.

Fine-Tuning and Alignment

Standard Llama 2 13B is available in both a base (pretrained) form and as Llama 2-Chat 13B, a version specifically fine-tuned for dialogue alignment and safety. Fine-tuning utilizes a multi-step process: initial supervised learning is conducted with publicly available instruction datasets and over 1 million newly collected human annotations on response helpfulness and safety. Subsequent alignment is achieved through reinforcement learning from human feedback (RLHF), leveraging reward models trained on human preferences and further refined through rejection sampling and proximal policy optimization.

Llama 2's RLHF pipeline targets safety and quality, iteratively incorporating human-generated preference data to guide the model towards generating more helpful and less harmful responses in complex, open-ended dialogue settings. The annotations collected for Llama 2 are notable in their scale and diversity for open large language models, as detailed in the Llama 2 responsible use guide.

Diagram of the Llama 2 alignment and RLHF pipeline

Figure 3. Flow diagram illustrating Llama 2's multi-stage training process, including human feedback collection, supervised fine-tuning, and iterative RLHF for enhancing dialogue safety and helpfulness.

Evaluation and Benchmark Performance

Llama 2 13B demonstrates improved performance compared to its predecessor and strong performance relative to other open models of comparable scale. In academic benchmarks, the 13B variant consistently outperforms Llama 1 13B across tasks including code generation, commonsense reasoning, world knowledge, reading comprehension, mathematical reasoning, and multi-task language understanding. For instance, on MMLU (a widely used multitask benchmark), Llama 2 13B achieves a score of 54.8, compared to 46.9 for Llama 1 13B.

On safety benchmarks such as TruthfulQA, the pretrained Llama 2 13B produces truthful and informative responses in 41.86% of cases, matching its predecessor, while the fine-tuned Llama 2-Chat 13B version achieves 62.18%. Toxic generation rates on Toxigen drop to zero in the fine-tuned model, according to the Llama 2 model card.

Performance benchmark table for Llama 2 family and competing models

Figure 4. Benchmark comparison visualizing Llama 2's performance across a diverse set of evaluation datasets (e.g., MMLU, TriviaQA, HumanEval) relative to other open and closed LLMs.

Use Cases, Limitations, and Responsible Deployment

Llama 2 13B is intended for research and commercial applications in text generation, summarization, question-answering, dialogue, code completion, and related natural language tasks. The fine-tuned Llama 2-Chat models are specifically optimized for conversational agents and dialogue-based systems.

Despite these capabilities, users should be aware of its limitations. The model may occasionally produce inaccurate, biased, or unpredictable outputs, and performs most reliably in English. While significant safety tuning has been applied, outputs should be monitored and extra evaluation may be necessary in sensitive domains or untested languages. The responsible use guide provides detailed recommendations for deploying Llama 2 in accordance with ethical and legal standards.

Llama 2 Responsible Use Guide cover image

Figure 5. Llama 2 Responsible Use Guide, outlining best practices and compliance requirements for deploying large language models in research and commercial contexts.

Licensing and Community Engagement

Llama 2 13B and its associated artifacts are distributed under the LLAMA 2 Community License Agreement, permitting use in both research and most commercial applications. Certain restrictions apply for organizations with extremely high user counts, who must seek additional licensing. The Acceptable Use Policy prohibits deployments relating to illegal or high-risk activities and restricts use of the model or its outputs to further train competing large language models. Users are required to retain proper attribution, and all Llama 2 materials are supplied "as is," with no warranties.

Meta maintains supporting documentation, model cards, and feedback channels to encourage responsible development and to facilitate community improvements and reporting.

References and Additional Resources

About Llama 2: The Llama 2 family, developed by Meta, comprises large language models ranging from 7 billion to 70 billion parameters, trained on 40% more data than their predecessors and featuring a doubled context length of 4,096 tokens.

More in the Llama 2 Family

Meta /

Llama 2 7B

7 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
codellama /

CodeLlama 7B

Fine-tuned version of Llama 7b, with training data optimized for code generation and completion tasks.
lmsys /

Vicuna 7B

Llama 7B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
PygmalionAI /

Pygmalion 2 7B

Llama 7B fine-tuned for conversation, roleplaying, and storywriting.
openchat /

OpenChat 3.5 7B

Llama 2 7B fine-tuned using the C-RLFT strategy, with performance surpassing GPT 3.5 on some benchmarks.
Xwin-LM /

Xwin LM 7B

Llama 2 7B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

CodeLlama 13B

Fine-tuned version of Llama 13b, with training data optimized for code generation and completion tasks.
NousResearch /

Nous Hermes 13b

Llama 13b fine-tuned on over 300k curated GPT-4 outputs, known long high-quality outputs.
lmsys /

Vicuna 13B

Llama 13B fine-tuned on 125k GPT-4 conversations, with strong performance in chatbot and instruction following use-cases.
Gryphe /

MythoMax L2

An improved variant of MythoMix (MythoLogic-L2 and Huginn merge) using an experimental tensor-type merge technique. Originally a merge of multiple popular Llama 2 fine-tunes, including Hermes, Chronos, and Airoboros. Very popular for rich descriptions, storywriting, and roleplay.
WizardLM /

WizardLM 13B

Llama 2 13B model fine-tuned to follow complex instructions using the WizardLM training methodology.
PygmalionAI /

Pygmalion 2 13B

Llama 13B fine-tuned for conversation, roleplaying, and storywriting.
PygmalionAI /

Mythalion 13B

Merge of two popular fine-tunes: Pygmalion and Mythomax L2, resulting in a model that is good at roleplaying and instruction-following.
Xwin-LM /

Xwin LM 13B

Llama 2 13B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
Meta /

CodeLlama 34B

Fine-tuned version of unreleased Llama 2 34b, with training data optimized for code generation and completion tasks.
Meta /

Llama 2 70B

70 billion parameter version of the 2nd iteration in Meta's Llama series of open source models.
Meta /

CodeLlama 70B

Fine-tuned version of Llama 70b, with training data optimized for code generation and completion tasks.
Xwin-LM /

Xwin 70B

Llama 2 70B fine-tune using numerous emerging techniques including SFT, RM, and RLHF, achieving top results on AlpacaEval.
WizardLM /

WizardLM 70B

Llama 2 70B model fine-tuned to follow complex instructions using the WizardLM training methodology.
NousResearch /

Nous Hermes Llama 2 70B

Llama 2 70B fine-tuned on over 300k curated GPT-4 outputs.

More from Meta

Meta /

LLaMA 7B

A 7-billion parameter transformer language model trained on one trillion tokens from publicly available datasets for natural language processing research.
Meta /

LLaMA 13B

A 13-billion parameter transformer-based language model trained on 1.4 trillion tokens from publicly available datasets, demonstrating competitive performance on various benchmarks.
Meta /

LLaMA 33B

A 32.5 billion parameter transformer-based language model trained on 1.4 trillion tokens of publicly available data with competitive benchmark performance.
Meta /

LLaMA 65B

A 65.2-billion parameter transformer language model trained on 1.4 trillion tokens from publicly available datasets for research applications.
Meta /

Llama 4 Scout (17Bx16E)

A natively multimodal transformer with mixture-of-experts architecture supporting 10 million token context and multilingual text-image understanding capabilities.
Meta /

Llama 4 Maverick (17Bx128E)

Multimodal instruction-tuned model with 17 billion active parameters from 400 billion total, trained on 22 trillion tokens across 200 languages.
Meta /

Llama 3 8B

Large language model with 8 billion parameters featuring transformer architecture, trained on 15 trillion tokens for text generation and coding tasks.
Meta /

Llama 3 70B

State-of-the-art 70B foundation model from Meta, trained on over 15 trillion tokens.
Meta /

Llama 3.1 8B

Llama 3.1 is a new state-of-the-art large language model from Meta.
Meta /

Llama 3.1 70B

The Llama 3.1 series of open models rivals top closed models in performance. It was trained on over 15 trillion tokens using over 16K H100 GPUs. These models display state-of-the-art capabilities in general knowledge, steerability, math, tool use, and translation.
Meta /

Llama 3.2 3B

The next iteration in the Llama series of open models. This lightweight model was designed to run on edge devices, even mobile.
Meta /

Llama 3.3 70B

Llama 3.3 is a text-only 70B instruction-tuned model that provides enhanced performance relative to Llama 3.1 70B and to Llama 3.2 90B when used for text-only applications. For some applications, Llama 3.3 70B approaches the performance of Llama 3.1 405B.
Meta /

MusicGen

MusicGen is a text-to-music autoregressive transformer model capable of generating music samples conditioned on text descriptions or audio prompts.
Meta /

Magnet

Magnet is a single-stage, non-autoregressive transformer model for text-to-music and text-to-audio generation, with faster generation that MusicGen.
Meta /

Seamless

Seamless is a MMMMT (Massively Multilingual and Multimodal Machine Translation) model that can translate and generate audio in over 100 languages.