family arcee
Llama's block whose MLP has no gate: up_proj, a squared ReLU and down_proj, so a neuron is exactly zero wherever its pre-activation is negative.
One block of the stack. Hover any part for its nnterp name; click to pin the card.
identity layers[i].input + self_attn.attention_output + mlp.mlp_output == layer_output
⚠︎ marks a value this checkpoint has only under some load: hover it for the condition.
What print(model) shows on arcee-ai/AFM-4.5B-Base: the native modules, standard names and every standard value with its layout.
ArceeForCausalLM(
(lm_head): Linear(in_features=2560, out_features=128004, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(128004, 2560)
(layers): ModuleList(
(0-35): 36 x ArceeDecoderLayer(
(self_attn): ArceeAttention(
(q_proj): Linear(in_features=2560, out_features=2560, bias=False)
(k_proj): Linear(in_features=2560, out_features=512, bias=False)
(v_proj): Linear(in_features=2560, out_features=512, bias=False)
(o_proj): Linear(in_features=2560, out_features=2560, bias=False)
(attention_queries) -> Queries [batch num_heads seq qk_head_dim]: The queries entering attention
(attention_keys) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering attention
(attention_values) -> Values [batch num_kv_heads seq head_dim]: The values entering attention
(attention_scores) -> Pattern [batch num_heads query key]: The attention scores entering the softmax, masked
(attention_premix) -> HeadOutputs [batch seq num_heads head_dim]: Every head's output side by side, as the output projection takes it
(attention_output) -> Residual [batch seq hidden_size]: What the attention adds to the residual stream
(attention_probabilities) -> Pattern [batch num_heads query key]: The attention pattern the values are mixed with
(attention_head_outputs) -> HeadOutputs [batch seq num_heads head_dim]: The per-head outputs before the output projection
)
(mlp): ArceeMLP(
(up_proj): Linear(in_features=2560, out_features=18432, bias=False)
(down_proj): Linear(in_features=18432, out_features=2560, bias=False)
(act_fn): ReLUSquaredActivation()
(mlp_activation) -> Neurons [batch seq intermediate_size]: The activation function's output
(mlp_neurons) -> Neurons [batch seq intermediate_size]: What the down projection receives: act(gate)·up on a gated MLP, the activation itself otherwise
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(post_attention_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(layer_input) -> Residual [batch seq hidden_size]: The residual stream entering the block
(attention_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the attention
(layer_mid) -> Residual [batch seq hidden_size]: The residual stream after the attention add
(mlp_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the MLP
(mlp_input) -> Residual [batch seq hidden_size]: What the MLP is called with
(layer_output) -> Residual [batch seq hidden_size]: The residual stream leaving the block, a tensor even when the block returns a tuple
)
)
(norm): ArceeRMSNorm((2560,), eps=1e-05)
(logits) -> Logits [batch seq vocab_size]: The logits the model returns, after anything it does past lm_head (a softcap, a scale)
(token_embeddings) -> Residual [batch seq hidden_size]: The embedding module's output; layers[0].input is what enters the first block
(final_norm_output) -> Residual [batch seq hidden_size]: The residual stream after the final norm, what lm_head reads
(lm_head_output) -> Logits [batch seq vocab_size]: The head's logits before anything the model does past lm_head (a softcap, a scale)
(next_token_probs) -> NextTokenProbs [batch vocab_size]: The next-token distribution at the last position; derived, read-only
(input_ids) -> Tokens [batch seq]: The token ids the model was called with
(attention_mask) -> Tokens [batch seq]: The attention mask the model was called with; zeros are padding
(input_size): [batch, seq] of the current call; read-only
)What print(model) shows on arcee-ai/AFM-4.5B: the native modules, standard names and every standard value with its layout.
ArceeForCausalLM(
(lm_head): Linear(in_features=2560, out_features=128005, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(128005, 2560)
(layers): ModuleList(
(0-35): 36 x ArceeDecoderLayer(
(self_attn): ArceeAttention(
(q_proj): Linear(in_features=2560, out_features=2560, bias=False)
(k_proj): Linear(in_features=2560, out_features=512, bias=False)
(v_proj): Linear(in_features=2560, out_features=512, bias=False)
(o_proj): Linear(in_features=2560, out_features=2560, bias=False)
(attention_queries) -> Queries [batch num_heads seq qk_head_dim]: The queries entering attention
(attention_keys) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering attention
(attention_values) -> Values [batch num_kv_heads seq head_dim]: The values entering attention
(attention_scores) -> Pattern [batch num_heads query key]: The attention scores entering the softmax, masked
(attention_premix) -> HeadOutputs [batch seq num_heads head_dim]: Every head's output side by side, as the output projection takes it
(attention_output) -> Residual [batch seq hidden_size]: What the attention adds to the residual stream
(attention_probabilities) -> Pattern [batch num_heads query key]: The attention pattern the values are mixed with
(attention_head_outputs) -> HeadOutputs [batch seq num_heads head_dim]: The per-head outputs before the output projection
)
(mlp): ArceeMLP(
(up_proj): Linear(in_features=2560, out_features=18432, bias=False)
(down_proj): Linear(in_features=18432, out_features=2560, bias=False)
(act_fn): ReLUSquaredActivation()
(mlp_activation) -> Neurons [batch seq intermediate_size]: The activation function's output
(mlp_neurons) -> Neurons [batch seq intermediate_size]: What the down projection receives: act(gate)·up on a gated MLP, the activation itself otherwise
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(post_attention_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(layer_input) -> Residual [batch seq hidden_size]: The residual stream entering the block
(attention_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the attention
(layer_mid) -> Residual [batch seq hidden_size]: The residual stream after the attention add
(mlp_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the MLP
(mlp_input) -> Residual [batch seq hidden_size]: What the MLP is called with
(layer_output) -> Residual [batch seq hidden_size]: The residual stream leaving the block, a tensor even when the block returns a tuple
)
)
(norm): ArceeRMSNorm((2560,), eps=1e-05)
(logits) -> Logits [batch seq vocab_size]: The logits the model returns, after anything it does past lm_head (a softcap, a scale)
(token_embeddings) -> Residual [batch seq hidden_size]: The embedding module's output; layers[0].input is what enters the first block
(final_norm_output) -> Residual [batch seq hidden_size]: The residual stream after the final norm, what lm_head reads
(lm_head_output) -> Logits [batch seq vocab_size]: The head's logits before anything the model does past lm_head (a softcap, a scale)
(next_token_probs) -> NextTokenProbs [batch vocab_size]: The next-token distribution at the last position; derived, read-only
(input_ids) -> Tokens [batch seq]: The token ids the model was called with
(attention_mask) -> Tokens [batch seq]: The attention mask the model was called with; zeros are padding
(input_size): [batch, seq] of the current call; read-only
)What print(model) shows on arcee-ai/AFM-4.5B-Preview: the native modules, standard names and every standard value with its layout.
ArceeForCausalLM(
(lm_head): Linear(in_features=2560, out_features=128064, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(128064, 2560)
(layers): ModuleList(
(0-35): 36 x ArceeDecoderLayer(
(self_attn): ArceeAttention(
(q_proj): Linear(in_features=2560, out_features=2560, bias=False)
(k_proj): Linear(in_features=2560, out_features=512, bias=False)
(v_proj): Linear(in_features=2560, out_features=512, bias=False)
(o_proj): Linear(in_features=2560, out_features=2560, bias=False)
(attention_queries) -> Queries [batch num_heads seq qk_head_dim]: The queries entering attention
(attention_keys) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering attention
(attention_values) -> Values [batch num_kv_heads seq head_dim]: The values entering attention
(attention_scores) -> Pattern [batch num_heads query key]: The attention scores entering the softmax, masked
(attention_premix) -> HeadOutputs [batch seq num_heads head_dim]: Every head's output side by side, as the output projection takes it
(attention_output) -> Residual [batch seq hidden_size]: What the attention adds to the residual stream
(attention_probabilities) -> Pattern [batch num_heads query key]: The attention pattern the values are mixed with
(attention_head_outputs) -> HeadOutputs [batch seq num_heads head_dim]: The per-head outputs before the output projection
)
(mlp): ArceeMLP(
(up_proj): Linear(in_features=2560, out_features=18432, bias=False)
(down_proj): Linear(in_features=18432, out_features=2560, bias=False)
(act_fn): ReLUSquaredActivation()
(mlp_activation) -> Neurons [batch seq intermediate_size]: The activation function's output
(mlp_neurons) -> Neurons [batch seq intermediate_size]: What the down projection receives: act(gate)·up on a gated MLP, the activation itself otherwise
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(post_attention_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(layer_input) -> Residual [batch seq hidden_size]: The residual stream entering the block
(attention_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the attention
(layer_mid) -> Residual [batch seq hidden_size]: The residual stream after the attention add
(mlp_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the MLP
(mlp_input) -> Residual [batch seq hidden_size]: What the MLP is called with
(layer_output) -> Residual [batch seq hidden_size]: The residual stream leaving the block, a tensor even when the block returns a tuple
)
)
(norm): ArceeRMSNorm((2560,), eps=1e-05)
(logits) -> Logits [batch seq vocab_size]: The logits the model returns, after anything it does past lm_head (a softcap, a scale)
(token_embeddings) -> Residual [batch seq hidden_size]: The embedding module's output; layers[0].input is what enters the first block
(final_norm_output) -> Residual [batch seq hidden_size]: The residual stream after the final norm, what lm_head reads
(lm_head_output) -> Logits [batch seq vocab_size]: The head's logits before anything the model does past lm_head (a softcap, a scale)
(next_token_probs) -> NextTokenProbs [batch vocab_size]: The next-token distribution at the last position; derived, read-only
(input_ids) -> Tokens [batch seq]: The token ids the model was called with
(attention_mask) -> Tokens [batch seq]: The attention mask the model was called with; zeros are padding
(input_size): [batch, seq] of the current call; read-only
)What print(model) shows on arcee-ai/AFM-4.5B-Base-Pre-Anneal: the native modules, standard names and every standard value with its layout.
ArceeForCausalLM(
(lm_head): Linear(in_features=2560, out_features=128256, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(128256, 2560)
(layers): ModuleList(
(0-35): 36 x ArceeDecoderLayer(
(self_attn): ArceeAttention(
(q_proj): Linear(in_features=2560, out_features=2560, bias=False)
(k_proj): Linear(in_features=2560, out_features=512, bias=False)
(v_proj): Linear(in_features=2560, out_features=512, bias=False)
(o_proj): Linear(in_features=2560, out_features=2560, bias=False)
(attention_queries) -> Queries [batch num_heads seq qk_head_dim]: The queries entering attention
(attention_keys) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering attention
(attention_values) -> Values [batch num_kv_heads seq head_dim]: The values entering attention
(attention_scores) -> Pattern [batch num_heads query key]: The attention scores entering the softmax, masked
(attention_premix) -> HeadOutputs [batch seq num_heads head_dim]: Every head's output side by side, as the output projection takes it
(attention_output) -> Residual [batch seq hidden_size]: What the attention adds to the residual stream
(attention_probabilities) -> Pattern [batch num_heads query key]: The attention pattern the values are mixed with
(attention_head_outputs) -> HeadOutputs [batch seq num_heads head_dim]: The per-head outputs before the output projection
)
(mlp): ArceeMLP(
(up_proj): Linear(in_features=2560, out_features=18432, bias=False)
(down_proj): Linear(in_features=18432, out_features=2560, bias=False)
(act_fn): ReLUSquaredActivation()
(mlp_activation) -> Neurons [batch seq intermediate_size]: The activation function's output
(mlp_neurons) -> Neurons [batch seq intermediate_size]: What the down projection receives: act(gate)·up on a gated MLP, the activation itself otherwise
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(post_attention_layernorm): ArceeRMSNorm((2560,), eps=1e-05)
(layer_input) -> Residual [batch seq hidden_size]: The residual stream entering the block
(attention_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the attention
(layer_mid) -> Residual [batch seq hidden_size]: The residual stream after the attention add
(mlp_norm_output) -> Residual [batch seq hidden_size]: The normed stream entering the MLP
(mlp_input) -> Residual [batch seq hidden_size]: What the MLP is called with
(layer_output) -> Residual [batch seq hidden_size]: The residual stream leaving the block, a tensor even when the block returns a tuple
)
)
(norm): ArceeRMSNorm((2560,), eps=1e-05)
(logits) -> Logits [batch seq vocab_size]: The logits the model returns, after anything it does past lm_head (a softcap, a scale)
(token_embeddings) -> Residual [batch seq hidden_size]: The embedding module's output; layers[0].input is what enters the first block
(final_norm_output) -> Residual [batch seq hidden_size]: The residual stream after the final norm, what lm_head reads
(lm_head_output) -> Logits [batch seq vocab_size]: The head's logits before anything the model does past lm_head (a softcap, a scale)
(next_token_probs) -> NextTokenProbs [batch vocab_size]: The next-token distribution at the last position; derived, read-only
(input_ids) -> Tokens [batch seq]: The token ids the model was called with
(attention_mask) -> Tokens [batch seq]: The attention mask the model was called with; zeros are padding
(input_size): [batch, seq] of the current call; read-only
)h = x + self_attn(input_layernorm(x))
out = h + mlp(post_attention_layernorm(h))
mlp(z) = down_proj(relu(up_proj(z)) ** 2)
Llama's names and Llama's two pre-norms. The MLP has two projections where Llama's has three:
there is no gate_proj, and up_proj widens the normed stream to intermediate_size (18432 on
4.5B, 7.2 × hidden_size).
attention_output is self_attn.output[0] and mlp_output is mlp.output, added to the stream
with nothing in between. The identity holds exactly in float32 on the pinned checkpoint:
with model.trace(prompt):
x = model.layers[1].input.save()
attn = model.layers[1].self_attn.attention_output.save()
mlp = model.layers[1].mlp.mlp_output.save()
out = model.layers[1].layer_output.save()
torch.testing.assert_close(x + attn + mlp, out)
relu(x)², exactly zero below zerohidden_act is relu2 on every checkpoint, so mlp.act_fn is a ReLUSquaredActivation and a
neuron's activation is relu(up_proj(z))². The activation is exactly zero wherever the
pre-activation is negative, so a neuron that is off on a token has no effect on that token and
receives no gradient from it, since the derivative of relu(x)² is 2 · relu(x). Where the neuron
is on, its activation grows with the square of the pre-activation. mlp.down_proj.input holds the activations and mlp.up_proj.output the
pre-activations:
mlp = model.layers[1].mlp
with model.trace(prompt):
pre = mlp.up_proj.output.save()
acts = mlp.down_proj.input.save()
torch.equal(acts, torch.relu(pre) ** 2) # True
The 4.5B checkpoints have 20 query heads over 4 key/value heads, each 128 wide (head_dim), so
num_heads × head_dim equals hidden_size (2560). attention_keys and attention_values are
read before repeat_kv, [batch, 4, seq, 128], and an edit to key/value head j reaches query
heads 5j to 5j + 4. No projection has a bias (attention_bias and mlp_bias are false).
The six attention interior values need attn_implementation="eager". There is no softcap,
window or sink, so the default sdpa load computes the same function. AFM-4.5B, Base and Preview
stretch the rotary with YaRN, factor 20 over 4096 original positions, to 65536.
Transformers warns at load that max_position_embeddings / original_max_position_embeddings is 16 and uses
the explicit 20. AFM-4.5B-Base-Pre-Anneal has the plain rotary and 4096 positions. rope_theta
is 10000 throughout.
Every tokenizer prepends <|begin_of_text|> (id 128000), and " Paris" is one token. The
embedding matrices differ in size (vocab_size): 128004 rows on Base, 128005 on AFM-4.5B, 128064
on Preview (whose tokenizer has 128005 ids), 128256 on Pre-Anneal. AFM-4.5B's chat template is ChatML (<|im_start|>, <|im_end|>) and writes a default
system turn naming the model when the messages have none; its eos_token is <|im_end|>, Base's
<|end_of_text|>.
AFM-4.5B, its Base, Preview and Base-Pre-Anneal are arcee. The AFM-4.5B-Base-KDA-Only and
-KDA-NoPE conversions are arcee_kda, a remote-code architecture, and Arcee's Trinity models
are the afmoe family.
Arcee (AFM) (ArceeForCausalLM).
Llama's tree and Llama's block: model.{embed_tokens, layers[i].{input_layernorm, self_attn, post_attention_layernorm, mlp}, norm} and lm_head, the residual
added in the block, attention through the shared eager forward.
The MLP has no gate: down_proj(act(up_proj(x))) with ReLU squared.