Training

Pinned sources Llama 3 model card (meta‑llama/llama3 @ a0940f9) · Meta’s post of April 18, 2024 · no training code is published

  1. Start of training
  2. Pre‑trainingpublic data15T8KNTPWhat trains: all
  3. Llama 3, pre-trained
  4. Post‑trainingrejection samplingnot statednot statedSFTPPODPOnot statednot stated: tokens, context, what trains
  5. Llama 3 Instruct
  • tokens, log scale
  • not stated by the sources
  • checkpoint
  • checkpoint, weights published

Post-training

×

Supervised fine-tuning, rejection sampling, PPO and DPO, on public instruction data and over 10 million human-annotated examples.

Supervised fine-tuning

LSFT=−∑t∈ylog⁡P(yt∣x,y<t)\mathcal L_{\mathrm{SFT}}=-\sum_{t\in y}\log P(y_t\mid x,y_{<t})
In words

The model is trained on examples of the answers wanted, prompts with their responses, by the cross-entropy of next-token prediction on the responses.

xx: the prompt; yy: the response; the prompt’s tokens are left out of the loss.

  • Reinforcement learning. Proximal policy optimization (PPO), as Meta’s post names it.
  • DPO. From pairs of a preferred and a rejected response, the model is trained to raise the preferred one’s probability, measured against a frozen reference model, more than the rejected one’s, with no separate reward model.
Data
over 10M human-annotated examples
Safety
Red-teamed with human experts and automated adversarial prompts; the findings inform safety fine-tuning

Not disclosed Rounds of post-training · Learning rate · Steps · Trainable

Why

Preference rankings, through PPO and DPO, greatly improved reasoning and coding: a model that sometimes produces the right reasoning trace knows how to answer but not how to select the answer, and the rankings teach it to select. Meta’s post on Llama 3

What the terms meanRejection sampling · PPO
Rejection sampling
The model writes several responses to a prompt, a reward model or another check keeps the best, and the kept responses become training data.
PPO
Proximal policy optimization: reinforcement learning whose baseline for a response is a learned value model, with each update clipped near the policy that wrote the samples. GRPO keeps the clip and takes the group’s mean reward as the baseline.
All settings3
Method
A combination of supervised fine-tuning, rejection sampling, proximal policy optimization (PPO) and direct preference optimization (DPO)
Data
Publicly available instruction datasets and over 10M human-annotated examples; no Meta user data. The prompts for SFT and the preference rankings for PPO and DPO were carefully curated, with multiple rounds of quality assurance on the human annotations
Safety
Red-teamed with human experts and automated adversarial prompts; the findings inform safety fine-tuning
Sources3

Llama 3

8B, 70B