Overview

Llama 2 is a family of large language models that Meta released on July 18, 2023, with Microsoft as its launch partner. It came in 7B, 13B and 70B sizes, each as a pretrained base model and as Llama 2-Chat, a version tuned for dialogue. Unlike the original LLaMA, which was available only to approved researchers, Llama 2 could be downloaded and used commercially by almost anyone. That decision started the wave of open fine-tunes, local runtimes and community models that defined open-weight AI in 2023 and 2024.

How it works

According to the technical paper (arXiv 2307.09288), Llama 2 is a decoder-only transformer pretrained on 2 trillion tokens of publicly available data, about 40% more than the first LLaMA. The context window doubled to 4,096 tokens. The 70B model uses grouped-query attention, which shares key and value heads across groups of query heads and makes inference cheaper. Meta also trained a 34B model but did not release it.

Llama 2-Chat was built in two stages. First came supervised fine-tuning on instruction data. Then came reinforcement learning from human feedback (RLHF), using separate reward models for helpfulness and safety and combining rejection sampling with PPO. The paper documents this process in unusual detail, along with red-teaming and safety evaluations, which made it a standard reference for later open models.

License and access

The Llama 2 Community License allows research and commercial use, with one notable limit: companies whose products had more than 700 million monthly active users at release must request a separate license from Meta. Use is also bound by an acceptable use policy. Weights are on Hugging Face after accepting Meta’s terms. In Ollama the default llama2:7b download is about 3.8 GB, and the 70B version is about 39 GB.

Highlights

  • 7B, 13B and 70B sizes, base and chat versions
  • Pretrained on 2 trillion tokens, 4K context
  • Grouped-query attention in the 70B model
  • Detailed paper on fine-tuning, RLHF and safety

Typical uses

Today Llama 2 is mainly a historical and research reference: a well-documented baseline for papers, a base for legacy fine-tunes and a lightweight model for experiments on older hardware.

Things to consider

  • Newer open models such as Llama 3.1 8B and Llama 3.3 70B outperform it at the same sizes and have far longer context windows.
  • The 4K context is short for retrieval and document tasks.
  • The license is not an OSI-approved open-source license; see our open-weight vs closed models comparison.
  • Download sizes refer to the default quantized versions in the Ollama library; full-precision weights are larger.

Specifications are taken from the model card on Hugging Face, the Ollama library and the provider’s announcement. Benchmark results depend on evaluation settings; see how AI benchmarks work.