LLaMA 65B
Meta · Llama · open weights
- MHA
- RoPE
- Pre-norm
Facts and where they come from
| Released | 2023-02 | paperpaperarXiv v1, February 2023 |
|---|---|---|
| Licence | not disclosed | not disclosed |
| Total parameters | 65.2B | paperpaperTable 2: 65.2B params |
| Active parameters | not disclosed | not disclosed |
| Context length | 2K tokens | paperpaper§2: context length 2048 |
| Norm placement | pre | codemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP |
| Norm type | RMSNorm | codemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP |
| QK-norm | no | codemodelling codeno q/k normalisation in the attention block |
| Positional encoding | RoPE | codemodelling coderotary on the full head (default) |
| Parallel attention and MLP | no | codemodelling codetransformers 5.18.0 / repo modelling code for llama: input_layernorm before attention, post_attention_layernorm before the MLP |
Architecture, drawn from the data
MHA 64q/64kv. Each column is one layer: its token mixer above, its feed-forward block below. Paler columns reuse another layer’s keys and values.
Modelled costs
From the cost model, batch size 1. Totals the lab states are in the table above; differences come from rounding, from what a lab counts, or from parts the model does not describe (listed on the about page).
| Parameters (modelled) | 65.3B |
|---|---|
| Active per token (modelled) | 65.3B |
| Without embeddings and output head | 64.8B total, 64.8B active |
| KV cache per token, BF16 (layers that grow with context) | 2.5 MiB |
| KV cache + state at 2K tokens, BF16 | 5 GiB |
| Decode FLOPs per token at 4K context | 141 GFLOP |
| Prefill FLOPs for a 4K prompt | 553 TFLOP |
KV cache against context
Every architecture field
| Field | Value | Source |
|---|---|---|
| d_model | 8,192 | paperpaperTable 2: dimension 8192 |
| vocab | 32,000 | paperpaper§2.1: 32k tokens (SentencePiece BPE); 32,000 as in the released tokenizer |
| tied_embeddings | false | paperpaperseparate output projection |
| mixers.full.type | attn | codemodelling codeattention block |
| mixers.full.heads | 64 | paperpaperTable 2: n heads 64 |
| mixers.full.kv_heads | 64 | paperpaperTable 2: multi-head attention (no grouping) |
| mixers.full.head_dim | 128 | codemodelling codetransformers 5.18.0: head_dim = hidden_size / num_attention_heads |
| ffns.dense.type | dense | codemodelling codeMLP block |
| ffns.dense.d_ff | 22,016 | paperpaper§2.2: SwiGLU with 2/3 4d; meta-llama/llama@689c7f2 llama/model.py FeedForward rounds up to multiple_of 256 |
| ffns.dense.gated | true | codemodelling codeMLP: gated (SwiGLU/GeGLU) |
| layout | 80× full/dense | paperpaperTable 2: n layers 80 |
Sources
- paper · LLaMA: Open and Efficient Foundation Language Models
- modelling code · transformers 5.18.0 modelling code, or the model repository's own modelling file at the pinned revision