family qwen3_next
One block of the stack. Hover any part for its nnterp name; click to pin the card. The slider picks a block, each tick's color gives its block's shape, and the diagram redraws for the block picked.
identity layers[i].input + linear_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 Qwen/Qwen3-Next-80B-A3B-Instruct: the native modules, standard names and every standard value with its layout.
Qwen3NextForCausalLM(
(lm_head): Linear(in_features=2048, out_features=151936, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(151936, 2048)
(layers): ModuleList(
(0-2): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(3): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(4-6): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(7): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(8-10): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(11): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(12-14): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(15): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(16-18): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(19): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(20-22): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(23): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(24-26): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(27): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(28-30): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(31): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(32-34): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(35): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(36-38): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(39): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(40-42): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(43): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(44-46): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(47): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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 Qwen/Qwen3-Next-80B-A3B-Thinking: the native modules, standard names and every standard value with its layout.
Qwen3NextForCausalLM(
(lm_head): Linear(in_features=2048, out_features=151936, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(151936, 2048)
(layers): ModuleList(
(0-2): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(3): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(4-6): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(7): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(8-10): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(11): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(12-14): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(15): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(16-18): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(19): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(20-22): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(23): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(24-26): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(27): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(28-30): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(31): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(32-34): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(35): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(36-38): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(39): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(40-42): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(43): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(44-46): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(47): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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 Qwen/Qwen3-Coder-Next: the native modules, standard names and every standard value with its layout.
Qwen3NextForCausalLM(
(lm_head): Linear(in_features=2048, out_features=151936, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(151936, 2048)
(layers): ModuleList(
(0-2): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(3): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(4-6): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(7): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(8-10): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(11): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(12-14): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(15): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(16-18): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(19): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(20-22): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(23): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(24-26): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(27): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(28-30): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(31): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(32-34): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(35): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(36-38): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(39): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(40-42): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(43): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(44-46): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(47): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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 Qwen/Qwen3-Coder-Next-Base: the native modules, standard names and every standard value with its layout.
Qwen3NextForCausalLM(
(lm_head): Linear(in_features=2048, out_features=151936, bias=False)
(generator): Generator(
(streamer): Streamer()
)
(embed_tokens): Embedding(151936, 2048)
(layers): ModuleList(
(0-2): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(3): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(4-6): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(7): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(8-10): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(11): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(12-14): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(15): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(16-18): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(19): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(20-22): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(23): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(24-26): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(27): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(28-30): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(31): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(32-34): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(35): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(36-38): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(39): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(40-42): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(43): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(44-46): 3 x Qwen3NextDecoderLayer(
(linear_attn): Qwen3NextGatedDeltaNet(
(conv1d): Conv1d(8192, 8192, kernel_size=(4,), stride=(1,), padding=(3,), groups=8192, bias=False)
(in_proj_qkvz): Linear(in_features=2048, out_features=12288, bias=False)
(in_proj_ba): Linear(in_features=2048, out_features=64, bias=False)
(norm): Qwen3NextRMSNormGated()
(out_proj): Linear(in_features=4096, out_features=2048, bias=False)
(attention_queries) -> LinearQK [batch seq heads key_dim]: The queries entering the delta rule
(attention_keys) -> LinearQK [batch seq heads key_dim]: The keys entering the delta rule
(attention_values) -> LinearV [batch seq heads value_dim]: The values entering the delta rule
(decays) -> Gates [batch seq heads]: The per-token log decay of the recurrent state
(betas) -> Gates [batch seq heads]: The per-token write strength into the state
(state_input) -> State | None [batch heads key_dim value_dim]: The recurrent state entering the layer, or None at the start of a prompt (a copy of the cache's buffer)
(attention_head_outputs) -> LinearV [batch seq heads value_dim]: The per-head outputs before the gated norm and the output projection
(state_output) -> State [batch heads key_dim value_dim]: The recurrent state leaving the layer
(attention_output) -> Residual [batch seq hidden_size]: What the mixer adds to the residual stream
(state) -> State [batch heads key_dim value_dim]: The recurrent state after one token of the prompt; iterate it with tracer.iter; needs route_kernels(family, 'torch')
(states) -> States [batch seq heads key_dim value_dim]: The recurrent state after every token of this call; needs route_kernels(family, 'torch')
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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
)
(47): Qwen3NextDecoderLayer(
(self_attn): Qwen3NextAttention(
(q_proj): Linear(in_features=2048, out_features=8192, bias=False)
(k_proj): Linear(in_features=2048, out_features=512, bias=False)
(v_proj): Linear(in_features=2048, out_features=512, bias=False)
(o_proj): Linear(in_features=4096, out_features=2048, bias=False)
(q_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(k_norm): Qwen3NextRMSNorm((256,), eps=1e-06)
(attention_queries_prerope) -> Queries [batch num_heads seq qk_head_dim]: The queries entering the rotary embedding
(attention_keys_prerope) -> Keys [batch num_kv_heads seq qk_head_dim]: The keys entering the rotary embedding
(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
(interface): The attention function this call ran, as f(queries, keys, values) -> (head outputs, pattern), with the rest of the call's arguments
)
(mlp): Qwen3NextSparseMoeBlock(
(router/gate): Qwen3NextTopKRouter()
(experts): Qwen3NextExperts(
(act_fn): SiLUActivation()
)
(shared_experts/shared_expert): Qwen3NextMLP(
(gate_proj): Linear(in_features=2048, out_features=512, bias=False)
(up_proj): Linear(in_features=2048, out_features=512, bias=False)
(down_proj): Linear(in_features=512, out_features=2048, bias=False)
(act_fn): SiLUActivation()
(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
)
(shared_expert_gate): Linear(in_features=2048, out_features=1, bias=False)
(shared_expert_output) -> Residual [batch seq hidden_size]: The shared expert's output
(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
(router_logits) -> RouterLogits [batch seq num_experts]: The router's logits, one per expert, before the scoring
(expert_weights) -> ExpertWeights [batch seq top_k]: The weight each selected expert's output is scaled by
(expert_indices) -> ExpertIndices [batch seq top_k]: The expert each routing slot sends the token to
(expert_outputs) -> ExpertOutputs [batch seq top_k hidden_size]: Each routing slot's weighted expert output
(routed_output) -> Residual [batch seq hidden_size]: The routed experts' combined output
(mlp_output) -> Residual [batch seq hidden_size]: What the MLP adds to the residual stream
)
(input_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(post_attention_layernorm): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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): Qwen3NextRMSNorm((2048,), eps=1e-06)
(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 + mixer(input_layernorm(x)) # linear_attn, or self_attn on every fourth block
y = post_attention_layernorm(h)
out = h + experts(y, router(y)) + sigmoid(shared_expert_gate(y)) * shared_experts(y)
Every token runs through the shared expert, and the mixture multiplies its output by a sigmoid gate, one
scalar per token. shared_expert_output is that product, the term the mixture adds beside
routed_output; shared_experts.output is the expert's output before the gate. Measure or patch the
shared expert's contribution at shared_expert_output.
The mixer has fewer query/key heads than value heads, and each one is repeated over consecutive value
heads. attention_queries and attention_keys are what the delta-rule call receives: one head per
query/key head where the kernel does that repeat itself, so an edit to one reaches every value head it
serves, and one head per value head where the mixer's forward has repeated them before the call.
With add_generation_prompt=True the Thinking template adds <think>\n after
<|im_start|>assistant\n, so a next-token metric there measures the start of a reasoning trace. The
Instruct and Coder templates end at <|im_start|>assistant\n.
Qwen3-Next (Qwen3NextForCausalLM).
Llama's tree with a hybrid block: three blocks in four carry a gated DeltaNet
mixer, linear_attn, the fourth ordinary attention, self_attn
(config.layer_types). Each block has one or the other, never both, so on
a linear block every self_attn value is reported missing and the linear
values live at layers[i].linear_attn (see nnterp.LinearAttention). The MLP is a mixture of experts (a dense MLP class exists for the shared expert).