LlamaForCausalLM
LlamaForCausalLM at 32 layers and hidden size 4096. 11 published checkpoints share this shape.
Implementing it
How to read this sheet: method.
From GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1
Also covers GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2, GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3, GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1, GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2, GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3, GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed1, GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed2, GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed3.
x = embed[ids] # [T, 4096]
for i in 0 .. 31:
h = rmsnorm(x, layers[i].input_layernorm, eps=1e-05)
q = h @ layers[i].self_attn.q_proj.T # [T, 32*128]
k = h @ layers[i].self_attn.k_proj.T # [T, 32*128]
v = h @ layers[i].self_attn.v_proj.T # [T, 32*128]
q, k = rope(q, k, theta=10000)
a = softmax(q @ k.T / sqrt(128), mask=causal) @ v
a = a @ layers[i].self_attn.o_proj.T
x = x + a
h = rmsnorm(x, layers[i].post_attention_layernorm)
g = silu(h @ layers[i].mlp.gate_proj.T) # [T, 10928]
u = h @ layers[i].mlp.up_proj.T
y = (g * u) @ layers[i].mlp.down_proj.T
x = x + y
x = rmsnorm(x, model.norm)
logits = x @ lm_head.T
Differs from the block above
The same arithmetic with these values changed. Everything not listed is as above.
| checkpoint | FFN width | vocabulary | context |
|---|---|---|---|
granite-7b-instruct | 11,008 | 32,008 | 4,096 |
granite-7b-base | 11,008 | 32,000 | 4,096 |
Notes
head_dim is not published; 4096 / 32 = 128 is used.
Geometry
| layers | 32 |
| hidden size | 4,096 |
| attention heads | 32 |
| feed-forward width | 10,928 (9) / 11,008 (2) — by checkpoint in the list below |
| vocabulary | 49,152 (9) / 32,008 (1) / 32,000 (1) — by checkpoint in the list below |
| trained context | 8,192 tokens (9) / 4,096 tokens (2) — by checkpoint in the list below |
| largest checkpoint | 6.8B |
Weight structure
The tensors one element of the repeating stack holds, by the names the published checkpoint uses.
| repeating stack | depth | what one element holds |
|---|---|---|
model.layers.# | 32 | input_layernorm.weight, mlp.down_proj.weight, mlp.gate_proj.weight, mlp.up_proj.weight, post_attention_layernorm.weight, self_attn.k_proj.weight, self_attn.o_proj.weight, self_attn.q_proj.weight, self_attn.v_proj.weight |
Other shapes of LlamaForCausalLM
Identical across all of them: heads 32.
Only the columns that differ are shown; a cell with several values means the checkpoints of that shape disagree.
| shape | layers | width | KV heads | FFN width | vocabulary | context | checkpoints |
|---|---|---|---|---|---|---|---|
36L x 4,096 | 36 | 4,096 | 8 | 14,336 | 49,152 | 4,096 / 128,000 | 4 |
32L x 4,096 (this sheet) | 32 | 4,096 | 32 | 10,928 / 11,008 | 32,000 / 32,008 / 49,152 | 4,096 / 8,192 | 11 |
32L x 2,560 | 32 | 2,560 | 32 | 10,240 | 49,152 | 2,048 / 128,000 | 4 |
How this was checked
Status and evidence grade in the assessment (see what the grades mean):
GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1,GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2,GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3,GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1,GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2,GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3,GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed1,GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed2,GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed3: out of scope,not-assessed— out of scope; no implementation is claimed and none is gradedgranite-7b-instruct,granite-7b-base: runs,shape-pack— stored checkpoints of this shape run; this one's own is not among them
Parts of the author's unpublished implementation that exist for this shape:
- a decoder implemented from the published configuration
- a checkpoint loader, which is where published tensor names are read
- an independent reference implementation of this architecture in Python, driving the published modelling code — an executable statement of what the model should compute, written against the publication rather than against any one implementation of it
Checkpoints with this architecture
| model | parameters | context | FFN width | vocabulary |
|---|---|---|---|---|
GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed1 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed2 | 6.8B | 8,192 | 10,928 | 49,152 |
GneissWeb.7B_ablation_model_on_350B_GneissWeb.seed3 | 6.8B | 8,192 | 10,928 | 49,152 |
granite-7b-instruct | 6.7B | 4,096 | 11,008 | 32,008 |
granite-7b-base | 6.7B | 4,096 | 11,008 | 32,000 |
Recorded pass: passes.