Paper notes

Llama 2: An open base model and a detailed recipe for dialogue and safety

Llama 2 introduced 7B, 13B and 70B base and chat models trained on 2T tokens. Its lasting value is the unusually detailed account of SFT, reward models, rejection sampling, PPO and safety evaluation.

Published Updated 2 min read

On this page
  1. How it works
  2. What the evidence shows
  3. A reproducible check
  4. Limitations and common misreadings
  5. The key takeaway
  6. Further reading
  7. FAQ

Meta released Llama 2 in 2023 with 7B, 13B and 70B sizes. Base models saw 2T tokens with a 4096-token context. Llama 2-Chat added supervised fine-tuning and RLHF, while the report documents safety data, red teaming and separate helpfulness and safety reward models.

How it works

The architecture retains pre-normalization, RMSNorm, SwiGLU and RoPE; the 70B model uses GQA. Post-training starts with high-quality SFT, collects separate helpfulness and safety preferences, and trains two reward models for rejection sampling and PPO. Ghost Attention reinforces an initial instruction throughout multi-turn dialogue.

What the evidence shows

The paper reports human-evaluation wins over several open chat models of the time and tracks improvements across iterations. Those results depend on prompts and annotators, so they do not establish superiority on every task. The community license and acceptable-use policy are also not equivalent to an unconditional open-source license.

A reproducible check

This snippet checks a public formula or configuration; it does not reproduce full training.

models = {"7B": (7, 2.0), "13B": (13, 2.0), "70B": (70, 2.0)}
for name, (params_b, tokens_t) in models.items():
    print(name, "tokens/parameter =", tokens_t * 1000 / params_b)
print("70B context tokens =", 4096)
7B tokens/parameter = 285.7142857142857
13B tokens/parameter = 153.84615384615384
70B tokens/parameter = 28.571428571428573
70B context tokens = 4096

The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.

Limitations and common misreadings

The token-level pretraining corpus is not released, so exact reproduction is impossible. Safety findings reflect annotation guidelines, GQA applies to the 70B configuration rather than every size, and a base checkpoint does not inherit the chat model’s instruction-following behavior.

The key takeaway

The report makes the gap between weights and a useful assistant concrete: data, preference collection, reward modeling, rejection sampling, PPO and safety evaluation are separate engineering systems.

Further reading

FAQ

How much data trained Llama 2?
The base models used 2T tokens, about 40% more than the first generation, with context length doubled to 4096.
How was Llama 2-Chat trained?
It combined supervised fine-tuning, separate helpfulness and safety reward models, rejection sampling and PPO.
What is special about the 70B architecture?
It uses grouped-query attention to reduce KV-cache memory and inference cost while retaining the main LLaMA design.