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

Pre-training

×

Over 15 trillion tokens of publicly available data, on sequences of 8,192 tokens with a mask that keeps attention within a document; both sizes, 8B and 70B.

Next-token prediction

L=−1T∑i=2T+1log⁡Pi[ti]\mathcal L=-\frac1T\sum_{i=2}^{T+1}\log P_i[t_i]
In words

At every position the model gives each token of the vocabulary a probability of coming next; the loss is the negative logarithm of the probability it gave the token that does come next, averaged over the sequence.

tit_i: the token at position ii; Pi[ti]P_i[t_i]: the probability the model, reading the tokens before it, gave that token; TT: the sequence length.

Tokens
over 15T
Context
8,192, attention within a document
Compute
1.3M and 6.4M GPU hours
Data cutoff
March 2023 for 8B, December 2023 for 70B

Not disclosed Learning rate · Batch · Steps · Optimizer

Why

The Chinchilla-optimal training compute for an 8B model corresponds to about 200B tokens, yet both models kept improving log-linearly up to 15T tokens. Smaller models trained longer are preferred, being much more efficient at inference. Meta’s post on Llama 3

All settings8
Tokens
Over 15T (“15T+”), the same count given for both sizes
Context
Sequences of 8,192 tokens, with a mask so that self-attention does not cross document boundaries
Data
Publicly available sources, no Meta user data; seven times Llama 2’s dataset with four times more code; over 5% high-quality non-English data in over 30 languages; filtered by heuristics, NSFW filters, semantic deduplication and quality classifiers trained on data Llama 2 generated
Data cutoff
March 2023 for 8B, December 2023 for 70B
Compute
1.3M GPU hours for 8B, 6.4M for 70B, on H100-80GB
Hardware
Training runs on two custom-built clusters of 24K GPUs; for the largest Llama 3 models, over 400 TFLOPS per GPU on 16K GPUs at once; effective training time over 95%
Objective
Next-token prediction
Trainable
All
Sources7

Llama 3

8B, 70B