Raw textto [B, T, 131072]
Specification
- Attention
- 128 heads; keys 128 + 64 rotary features, values 128; latents: query 1,536, key–value 512params.json 5, 24, 28–30, 89
- Feed-forward
- 128 routed + 1 shared experts; 4 routed chosen per token; 4,096 hidden features eachThe first 3 layers have a dense SwiGLU of 16,384 hidden features instead.params.json 4, 12, 18–20
- Context
- 294,912 positions (
max_position_embeddings)params.json 10
Parameters673,421,089,792
673,421,089,792 parameters in Mistral Large 3
| Component | Calculation | Parameters |
|---|---|---|
| Token embedding | 131,072 × 7,168 | 939,524,096 |
| Layers | 671,542,034,432 | |
| Final RMSNorm | 7,168 | |
| Vocabulary projection | 7,168 × 131,072 | 939,524,096 |
| Model total | 673,421,089,792 | |
Counted from the pinned configuration and code, with each FP8 value as one weight. The total matches the checkpoint’s tensors, apart from the FP8 block scales and the vision encoder.
Sources
Direct evidence
The released configuration in Mistral’s own format: width 7,168, 61 layers, 128 heads (and 128 key–value heads), a dense MLP of 16,384, MLA ranks 1,536 (query) and 512 (key–value) with head widths 128 + 64 (query–key) and 128 (value); 128 routed experts of 4,096, 4 used, one shared expert, one expert group, route scale 1.0, the first 3 layers dense; 294,912 positions; YaRN with factor 36 over 8,192 original positions, β 32 and α 1, apply_scale false; llama_4_scaling with β 0.1 over 8,192 positions; RMSNorm ε 10⁻⁶; θ 10,000; untied embeddings; vocabulary 131,072; FP8 quantization; and a vision encoder.
params.json 1–116 ↗ · mistralai/Mistral-Large-3-675B-Instruct-2512 @ 383ffea2c7d6
Excerpt
{
"dim": 7168,
"head_dim": 192,
"hidden_dim": 16384,
"kv_lora_rank": 512,
"llama_4_scaling": {
"beta": 0.1,
"original_max_position_embeddings": 8192
},
"max_position_embeddings": 294912,
"moe": {
"expert_hidden_dim": 4096,
"expert_model_parallel": 1,
"expert_parallel": 1,
"first_k_dense_replace": 3,
"num_expert_groups": 1,
"num_expert_groups_per_tok": 1,
"num_experts": 128,
"num_experts_per_tok": 4,
"num_shared_experts": 1,
"route_every_n": 1,
"routed_scale": 1.0
},
"n_heads": 128,
"n_kv_heads": 128,
"n_layers": 61,
"norm_eps": 1e-06,
"q_lora_rank": 1536,
"qk_nope_head_dim": 128,
"qk_rope_head_dim": 64,
"quantization_config": {
"config_groups": {
"FP8_BLOCK": {
"format": "float-quantized",
"input_activations": {
"actorder": null,
"block_structure": null,
"dynamic": true,
"group_size": 128,
"num_bits": 8,
"observer": null,
"observer_kwargs": {},
"strategy": "group",
"symmetric": true,
"type": "float"
},
"output_activations": null,
"targets": [
"Linear"
],
"weights": {
"actorder": null,
"block_structure": [
128,
128
],
"dynamic": false,
"group_size": null,
"num_bits": 8,
"observer": "static_minmax",
"observer_kwargs": {},
"strategy": "block",
"symmetric": true,
"type": "float"
}
}
},
"format": "float-quantized",
"global_compression_ratio": null,
"ignore": [
"model.embed_tokens",
"re:patch_merger.*",
"re:vision_encoder.*",
"re:vision_language_adapter.*",
"re:.*kv_a_proj_with_mqa$",
"re:.*q_a_proj$",
"re:.*gate$",
"lm_head"
],
"kv_cache_scheme": null,
"quant_method": "compressed-tensors",
"quantization_status": "compressed",
"sparsity_config": {},
"transform_config": {},
"version": "0.12.3.dev29+g73c2cf9.d20251119"
},
"rope_theta": 10000.0,
"tied_embeddings": false,
"v_head_dim": 128,
"vision_encoder": {
"adapter_bias": false,
"add_pre_mm_projector_layer_norm": true,
"hidden_size": 1664,
"image_break_token_id": 12,
"image_end_token_id": 13,
"image_size": 1540,
"image_token_id": 10,
"intermediate_size": 8192,
"max_image_size": 1540,
"mm_projector_id": "patch_merge",
"num_attention_heads": 16,
"num_channels": 3,
"num_hidden_layers": 48,
"patch_size": 14,
"rope_theta": 10000.0,
"spatial_merge_size": 2
},
"vocab_size": 131072,
"yarn": {
"alpha": 1,
"apply_scale": false,
"beta": 32,
"factor": 36,
"original_max_position_embeddings": 8192
}
}vLLM’s adapter turns params.json into a DeepSeek-V3 configuration: a mixture of experts with shared experts is Mistral Large 3, run as MistralLarge3ForCausalLM with model_type deepseek_v3 and llama_4_scaling required; dim, n_layers, n_heads and hidden_dim become hidden_size, num_hidden_layers, num_attention_heads and intermediate_size; YaRN becomes rope_parameters of type yarn with mscale_all_dim 1, beta → beta_fast and alpha → beta_slow, and apply_scale false becomes attention_factor 1 (no magnitude correction); the MoE arguments are renamed and the adapter sets topk_method None, norm_topk_prob True and scoring_func softmax.
mistral.py 10–307 ↗ · vllm-project/vllm @ 5df63a7203cd
Excerpt
def adapt_config_dict(
config_dict: dict[str, Any],
defaults: dict[str, Any],
) -> PreTrainedConfig:
config_dict = _remap_general_mistral_args(config_dict)
config_dict = _remap_mistral_sliding_window(config_dict)
if bool(config_dict.get("quantization")):
config_dict = _remap_mistral_quantization_args(config_dict)
is_mla = bool(config_dict.get("qk_nope_head_dim"))
if is_mla:
config_dict = _remap_mistral_mla_args(config_dict)
is_moe = bool(config_dict.get("moe"))
is_mistral_large_3 = (
is_moe and (config_dict["moe"].get("num_shared_experts") or 0) > 0
)
if config_dict.get("model_type") == "mamba":
config_dict["architectures"] = ["Mamba2ForCausalLM"]
elif is_moe and is_mistral_large_3:
config_dict = _remap_moe_args(config_dict)
config_dict["model_type"] = "deepseek_v3"
config_dict["architectures"] = ["MistralLarge3ForCausalLM"]
assert "llama_4_scaling" in config_dict, (
"MistralLarge3 expect llama4 scaling config."
)
llama_4_scaling_config_keys = ["original_max_position_embeddings", "beta"]
assert all(
[
key in config_dict["llama_4_scaling"]
for key in llama_4_scaling_config_keys
]
), (
"llama_4_scaling config should define the keys: "
f"{','.join(llama_4_scaling_config_keys)}"
)
elif is_moe:
config_dict["architectures"] = ["MixtralForCausalLM"]
else:
config_dict["architectures"] = ["MistralForCausalLM"]
if bool(config_dict.get("yarn")):
config_dict = _remap_mistral_yarn_args(config_dict)
if bool(config_dict.get("llama_4_scaling")):… lines 59–113 omitted …
def _remap_mistral_yarn_args(config: dict) -> dict:
yarn_config_map = {
"factor": ("factor", float),
"original_max_position_embeddings": ("original_max_position_embeddings", int),
"beta": ("beta_fast", float),
"alpha": ("beta_slow", float),
}
yarn_config = config.get("yarn") or {}
config["rope_parameters"] = {
"rope_type": "yarn",
"mscale_all_dim": 1,
}
if rope_theta := config.pop("rope_theta", None):
config["rope_parameters"]["rope_theta"] = rope_theta
for old_name, (new_name, cast) in yarn_config_map.items():
if old_name in yarn_config:
# Cast to remove Transformers > v5 type warnings
config["rope_parameters"][new_name] = cast(yarn_config.pop(old_name))
# `apply_scale: false` means no magnitude correction, which Transformers
# spells as an explicit attention_factor of 1.
if not yarn_config.pop("apply_scale", True):
config["rope_parameters"]["attention_factor"] = 1.0
assert len(yarn_config) == 0, f"Unparsed yarn config: {yarn_config}"
return config
def _remap_general_mistral_args(config: dict) -> dict:
# Mistral key -> HF key
config_mapping = {
"dim": "hidden_size",
"norm_eps": "rms_norm_eps",
"n_kv_heads": "num_key_value_heads",
"n_layers": "num_hidden_layers",
"n_heads": "num_attention_heads",
"hidden_dim": "intermediate_size",
}
# HF key -> (Mistral key, default value)
top_level_mapping_with_default = {
"model_type": ("model_type", "transformer"),
"hidden_act": ("activation", "silu"),
"tie_word_embeddings": ("tied_embeddings", False),
"max_seq_len": ("max_seq_len", config.get("max_position_embeddings", 128_000)),
"max_position_embeddings": ("max_position_embeddings", 128_000),
"dtype": ("dtype", config.get("dtype")),
}
for key, new_key in config_mapping.items():
if key in config:
config[new_key] = config.pop(key)
for new_key, (key, default_value) in top_level_mapping_with_default.items():
config[new_key] = config.pop(key, default_value)
return config… lines 174–284 omitted …
def _remap_moe_args(config: dict) -> dict:
moe_config_map = {
"route_every_n": "moe_layer_freq",
"first_k_dense_replace": "first_k_dense_replace",
"num_experts_per_tok": "num_experts_per_tok",
"num_experts": "n_routed_experts",
"expert_hidden_dim": "moe_intermediate_size",
"routed_scale": "routed_scaling_factor",
"num_shared_experts": "n_shared_experts",
"num_expert_groups": "n_group",
"num_expert_groups_per_tok": "topk_group",
}
moe_config = config.get("moe", {})
for old_name, new_name in moe_config_map.items():
if old_name in moe_config:
value = moe_config.pop(old_name)
config[new_name] = value
config["topk_method"] = None
config["norm_topk_prob"] = True
config["scoring_func"] = "softmax"
return configThe model embeds the token IDs, computes the llama-4 position factors once, applies the layers with a residual stream that each next norm adds in, and applies the final norm, which adds the last update.
deepseek_v2.py 1459–1592 ↗ · vllm-project/vllm @ 5df63a7203cd
Excerpt
if get_pp_group().is_first_rank:
self.embed_tokens = VocabParallelEmbedding(
config.vocab_size,
self.hidden_size,
quant_config=quant_config,
prefix=f"{prefix}.embed_tokens",
)… lines 1466–1484 omitted …
if get_pp_group().is_last_rank:
self.norm = RMSNorm(self.hidden_size, eps=config.rms_norm_eps)… lines 1487–1507 omitted …
def forward(
self,
input_ids: torch.Tensor | None,
positions: torch.Tensor,
intermediate_tensors: IntermediateTensors | None,
inputs_embeds: torch.Tensor | None = None,
) -> torch.Tensor | IntermediateTensors:
if get_pp_group().is_first_rank:
if inputs_embeds is not None:
hidden_states = inputs_embeds
else:
if input_ids is None:
raise ValueError(
"Either input_ids or inputs_embeds must be provided "
"to DeepseekV2Model.forward"
)
hidden_states = self.embed_input_ids(input_ids)
residual = None
else:
assert intermediate_tensors is not None
hidden_states = intermediate_tensors["hidden_states"]
residual = intermediate_tensors["residual"]
# Compute llama 4 scaling once per forward pass if enabled
llama_4_scaling_config = getattr(self.config, "llama_4_scaling", None)
llama_4_scaling: torch.Tensor | None
if llama_4_scaling_config is not None:
llama_4_scaling = _get_llama_4_scaling(
original_max_position_embeddings=llama_4_scaling_config[
"original_max_position_embeddings"
],
scaling_beta=llama_4_scaling_config["beta"],
positions=positions,
)
else:
llama_4_scaling = None
aux_hidden_states = []
for idx, layer in enumerate(
islice(self.layers, self.start_layer, self.end_layer),
start=self.start_layer,
):
# all gather if we need to use the whole states
if (
hidden_states.shape[0] != positions.shape[0]
and not layer.use_sequence_parallel_moe
):
combined_states = torch.cat([hidden_states, residual], dim=-1)
combined_states = tensor_model_parallel_all_gather(combined_states, 0)
combined_states = combined_states[: positions.shape[0]]
hidden_states, residual = combined_states.split(
[self.hidden_size, self.hidden_size], dim=-1
)
if idx in self.aux_hidden_state_layers:
aux_hidden_state = hidden_states + residual
if aux_hidden_state.shape[0] != positions.shape[0]:
aux_hidden_state = tensor_model_parallel_all_gather(
aux_hidden_state, 0
)
aux_hidden_state = aux_hidden_state[: positions.shape[0]]
aux_hidden_states.append(aux_hidden_state)
hidden_states, residual = layer(
positions, hidden_states, residual, llama_4_scaling
)
if not get_pp_group().is_last_rank:
return IntermediateTensors(
{"hidden_states": hidden_states, "residual": residual}
)
if hidden_states.shape[0] != positions.shape[0]:
combined_states = torch.cat([hidden_states, residual], dim=-1)
combined_states = tensor_model_parallel_all_gather(combined_states, 0)
combined_states = combined_states[: positions.shape[0]]
hidden_states, residual = combined_states.split(
[self.hidden_size, self.hidden_size], dim=-1
)
if self.end_layer in self.aux_hidden_state_layers:
aux_hidden_states.append(hidden_states + residual)
hidden_states, _ = self.norm(hidden_states, residual)
if len(aux_hidden_states) > 0:
return hidden_states, aux_hidden_states
return hidden_states