Mistral Large 3

Token IDs

×

Integer vocabulary indices used to look up token embeddings.

shape
II [B batch, T positions]
Sources

Contextual evidence from Tokenizer

The Hugging Face tokenizer configuration declares a LlamaTokenizerFast with <s> as the beginning-of-sequence token, added at the start, and </s> as the end-of-sequence token, and the Pixtral processor.

tokenizer_config.json 1–9020 ↗ · mistralai/Mistral-Large-3-675B-Instruct-2512 @ 383ffea2c7d6

Excerpt
{
  "add_bos_token": true,
  "add_eos_token": false,

… lines 4–9008 omitted …

  "bos_token": "<s>",
  "clean_up_tokenization_spaces": false,
  "eos_token": "</s>",
  "extra_special_tokens": {},
  "legacy": true,
  "model_max_length": 1000000000000000019884624838656,
  "pad_token": "<pad>",
  "processor_class": "PixtralProcessor",
  "tokenizer_class": "LlamaTokenizerFast",
  "unk_token": "<unk>",
  "use_default_system_prompt": false
}

The model card serves the checkpoint with vLLM in Mistral’s formats: tokenizer, configuration and weights (--tokenizer_mode mistral --config_format mistral --load_format mistral).

README.md 127–132 ↗ · mistralai/Mistral-Large-3-675B-Instruct-2512 @ 383ffea2c7d6

Excerpt
```bash
vllm serve mistralai/Mistral-Large-3-675B-Instruct-2512 \
  --max-model-len 262144 --tensor-parallel-size 8 \
  --tokenizer_mode mistral --config_format mistral --load_format mistral \
  --enable-auto-tool-choice --tool-call-parser mistral
```

The chat template opens with the beginning-of-sequence token and a default system prompt in [SYSTEM_PROMPT] … [/SYSTEM_PROMPT] when the conversation has none; a user turn is wrapped in [INST] … [/INST] and an assistant turn ends with the end-of-sequence token.

chat_template.jinja 31–227 ↗ · mistralai/Mistral-Large-3-675B-Instruct-2512 @ 383ffea2c7d6

Excerpt
{#- Begin of sequence token. #}
{{- bos_token }}


{#- Handle system prompt if it exists. #}
{%- set loop_messages = messages %}
{%- if messages[0]['role'] != 'system' and default_system_message != '' %}
    {{- '[SYSTEM_PROMPT]' + default_system_message + '[/SYSTEM_PROMPT]' }}
{%- endif %}

… lines 40–179 omitted …

{#- Handle conversation messages. #}
{%- for message in loop_messages %}
    {#- User messages supports text, image and image_url content. #}
    {%- if message['role'] == 'user' %}
        {%- if not ns.available_tools_emitted %}
            {{- available_tools }}
            {%- set ns.available_tools_emitted = true %}
        {%- endif %}
        {%- if message['content'] is not string and message['content'] %}
            {#- When content has exactly one image and one text block, put image first. #}
            {%- if message['content'] | length == 2 and message['content'][0]['type'] == 'text' and message['content'][1]['type'] in ['image', 'image_url'] %}
                {%- set blocks = [message['content'][1], message['content'][0]] %}
            {%- else %}
                {%- set blocks = message['content'] %}
            {%- endif %}
            {%- set user_content = blocks %}
        {%- else %}
            {%- set user_content = message['content'] %}
        {%- endif %}
        {{- '[INST]' -}}
        {{- render_content(user_content, 'user message content', supported_types_desc='text, image and image_url', support_thinking=false, support_images=true) -}}
        {{- '[/INST]' }}

    {#- Assistant messages supports text and thinking content. #}
    {%- elif message['role'] == 'assistant' %}

… lines 205–226 omitted …

        {{- eos_token }}

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
  }
}

Contextual evidence from Token embedding

The token embedding looks up each ID’s row of the table (F.embedding); with one tensor-parallel shard it is a plain lookup.

vocab_parallel_embedding.py 85–525 ↗ · vllm-project/vllm @ 5df63a7203cd

Excerpt
    def embedding(self, layer: torch.nn.Module, input_: torch.Tensor) -> torch.Tensor:
        return F.embedding(input_, layer.weight)

… lines 87–521 omitted …

    def forward(self, input_):
        """Look up IDs, optionally reducing contributions from vocabulary shards."""
        if self.tp_size == 1:
            return self.quant_method.embedding(self, input_.long())

Contextual evidence from Position IDs

The 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