Llama 3 pre-training
×Stage · Llama 3 (April 2024)
Llama 3 was pretrained on over 15 trillion tokens of publicly available data, on sequences of 8,192 tokens with a mask that keeps attention within a document.
Next-token prediction
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.
: the token at position ; : the probability the model, reading the tokens before it, gave that token; : the sequence length.
Next-token prediction as drawn for DeepSeek‑V3.2‑Exp →That plate also draws multi-token prediction, fill-in-the-middle and DeepSeek-V3’s sequence-wise balance loss.
- Tokens
- over 15T
- Context
- 8,192, attention within a document
- Compute
- 1.3M and 6.4M GPU hours
Not disclosed Learning rate · Batch
Architecture at this stageLlama 3: the same shapes at 8B and 70B as Llama 3.1, a context of 8,192 and unscaled RoPE.
All settings5
- Tokens
- Over 15T (“15T+”), publicly available data
- Context
- Sequences of 8,192 tokens, with a mask so that self-attention does not cross document boundaries
- Compute
- 1.3M GPU hours for 8B, 6.4M for 70B
- Objective
- Next-token prediction
- Trainable
- All
Sources5
- Llama 3 model card, lines 28–62Tokens
- Llama 3 model card, line 139Tokens
- Meta’s Llama 3 postTokens, Context
- Llama 3 model card, line 13Context, Objective, Trainable
- Llama 3 model card, lines 103–113Compute