arcee-ai / Mistral-7B-Instruct-v0.2-expanded

huggingface.co
Total runs: 98
24-hour runs: -2
7-day runs: -9
30-day runs: 4
Model's Last Updated: March 13 2024
text-generation

Introduction of Mistral-7B-Instruct-v0.2-expanded

Model Details of Mistral-7B-Instruct-v0.2-expanded

Mistral-7B-Instruct-v0.2-expanded

This method employs mergekit's passthrough method to expand blocks within the "mistralai/Mistral-7B-Instruct-v0.2" model. For every 5th layer, a new layer is added, with the o_proj and down_proj parameters of these added layers initialized to zero, mirroring the approach used in LLaMA Pro.

It's important to note that this configuration has not undergone fine-tuning. So this won't work. Therefore, when fine-tuning, ensure that only every 5th layer is trainable,while all other layers remain frozen.
🧩 Configuration
slices:
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [0, 4]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [3, 4]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [4, 8]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [7, 8]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [8, 12]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [11, 12]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [12, 16]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [15, 16]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [16, 20]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [19, 20]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [20, 24]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [23, 24]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [24, 28]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [27, 28]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0
            
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [28, 32]
  - sources:
      - model: mistralai/Mistral-7B-Instruct-v0.2
        layer_range: [31, 32]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

merge_method: passthrough
dtype: bfloat16

Function to freeze layers

from transformers import AutoModelForCausalLM

def enable_grad_only_every_nth(model, n):
    """
    This function configures the specified model to enable gradient calculations exclusively for every nth layer, starting 
    from the first layer (0-indexed), to accommodate newly added blocks for training. Concurrently, it freezes the gradients 
    for all other components of the model, including the embedding layers and the model's head. This setup is particularly 
    useful for fine-tuning processes where only a subset of layers are targeted for updates, ensuring efficient training and 
    adaptation of newly integrated layers while maintaining the pre-trained behavior of other model components.
    """

    # Freeze embeddings.
    for param in model.model.embed_tokens.parameters():
        param.requires_grad = False

    # Freeze lm_head.
    for param in model.lm_head.parameters():
        param.requires_grad = False

    # Enable gradients for every nth layer
    layers = model.model.layers  # Access the ModuleList containing the layers

    for index, layer in enumerate(layers):

        if (index + 1) % n == 0:  # Enables gradients for every nth layer, starting from the layer after the 0th
            for param in layer.parameters():
                param.requires_grad = True
        else:
            for param in layer.parameters():
                param.requires_grad = False

model = transformers.AutoModelForCausalLM.from_pretrained(
    "arcee-ai/Mistral-7B-Instruct-v0.2-expanded"
    )
# Update layer gradients, specify the correct value for n based on your model's architecture
n =5
enable_grad_only_every_nth(model, n)

Runs of arcee-ai Mistral-7B-Instruct-v0.2-expanded on huggingface.co

98
Total runs
-2
24-hour runs
-5
3-day runs
-9
7-day runs
4
30-day runs

More Information About Mistral-7B-Instruct-v0.2-expanded huggingface.co Model

Mistral-7B-Instruct-v0.2-expanded huggingface.co

Mistral-7B-Instruct-v0.2-expanded huggingface.co is an AI model on huggingface.co that provides Mistral-7B-Instruct-v0.2-expanded's model effect (), which can be used instantly with this arcee-ai Mistral-7B-Instruct-v0.2-expanded model. huggingface.co supports a free trial of the Mistral-7B-Instruct-v0.2-expanded model, and also provides paid use of the Mistral-7B-Instruct-v0.2-expanded. Support call Mistral-7B-Instruct-v0.2-expanded model through api, including Node.js, Python, http.

Mistral-7B-Instruct-v0.2-expanded huggingface.co Url

https://huggingface.co/arcee-ai/Mistral-7B-Instruct-v0.2-expanded

arcee-ai Mistral-7B-Instruct-v0.2-expanded online free

Mistral-7B-Instruct-v0.2-expanded huggingface.co is an online trial and call api platform, which integrates Mistral-7B-Instruct-v0.2-expanded's modeling effects, including api services, and provides a free online trial of Mistral-7B-Instruct-v0.2-expanded, you can try Mistral-7B-Instruct-v0.2-expanded online for free by clicking the link below.

arcee-ai Mistral-7B-Instruct-v0.2-expanded online free url in huggingface.co:

https://huggingface.co/arcee-ai/Mistral-7B-Instruct-v0.2-expanded

Mistral-7B-Instruct-v0.2-expanded install

Mistral-7B-Instruct-v0.2-expanded is an open source model from GitHub that offers a free installation service, and any user can find Mistral-7B-Instruct-v0.2-expanded on GitHub to install. At the same time, huggingface.co provides the effect of Mistral-7B-Instruct-v0.2-expanded install, users can directly use Mistral-7B-Instruct-v0.2-expanded installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Mistral-7B-Instruct-v0.2-expanded install url in huggingface.co:

https://huggingface.co/arcee-ai/Mistral-7B-Instruct-v0.2-expanded

Url of Mistral-7B-Instruct-v0.2-expanded

Mistral-7B-Instruct-v0.2-expanded huggingface.co Url

Provider of Mistral-7B-Instruct-v0.2-expanded huggingface.co

arcee-ai
ORGANIZATIONS

Other API from arcee-ai

huggingface.co

Total runs: 18.6K
Run Growth: -4.8K
Growth Rate: -25.97%
Updated:May 29 2026
huggingface.co

Total runs: 9.1K
Run Growth: -2.1K
Growth Rate: -22.97%
Updated:September 18 2025
huggingface.co

Total runs: 265
Run Growth: 41
Growth Rate: 15.47%
Updated:June 03 2025
huggingface.co

Total runs: 181
Run Growth: 135
Growth Rate: 74.59%
Updated:June 11 2025
huggingface.co

Total runs: 167
Run Growth: -14
Growth Rate: -8.24%
Updated:July 19 2024
huggingface.co

Total runs: 159
Run Growth: 15
Growth Rate: 9.43%
Updated:February 27 2025
huggingface.co

Total runs: 151
Run Growth: -13
Growth Rate: -8.61%
Updated:August 01 2024
huggingface.co

Total runs: 139
Run Growth: 24
Growth Rate: 16.90%
Updated:September 10 2024
huggingface.co

Total runs: 130
Run Growth: 18
Growth Rate: 13.53%
Updated:January 16 2026