● embed_tokens
token_id → [4096] vector | Lookup table 73,448 × 4,096
300,843,008 params (573.0 MiB)
# MiniCPMModel.forward()
hidden_states = self.embed_tokens(input_ids) * self.config.scale_emb
# scale_emb = 12 (constant in config.json, not a parameter)
↓ Processed through 32 Decoder Layers ↓
● model.norm
RMSNorm(4096)
4,096 params (8.0 KiB)
# MiniCPMModel.forward()
hidden_states = self.norm(hidden_states)
● lm_head
[4096] → [73,448] logits | 4,096 × 73,448
300,843,008 params (573.0 MiB)
# MiniCPMForCausalLM.forward()
hidden_states = hidden_states / self.scale_width
# scale_width = hidden_size / dim_model_base = 4096/256 = 16
return self.logits_processor(input_ids, hidden_states, self.lm_head, forward_batch)
# → softmax → top-k/sampling → next token