arcee-ai / gemma-3b-it-expanded

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

Introduction of gemma-3b-it-expanded

Model Details of gemma-3b-it-expanded

Gemma-IT-Expanded-Unfrozen-Layers

This method employs mergekit's passthrough method to expand blocks within the "google/gemma-2b-it" model. For every fourth 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. Therefore, when fine-tuning, ensure that only every fourth layer is adjusted, while all other layers remain frozen.

🧩 Configuration
slices:
  - sources:
      - model: google/gemma-2b-it
        layer_range: [0, 3]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [2, 3]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

  - sources:
      - model: google/gemma-2b-it
        layer_range: [3, 6]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [5, 6]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

  - sources:
      - model: google/gemma-2b-it
        layer_range: [6, 9]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [8, 9]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

  - sources:
      - model: google/gemma-2b-it
        layer_range: [9, 12]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [11, 12]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

  - sources:
      - model: google/gemma-2b-it
        layer_range: [12, 15]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [14, 15]
        parameters:
          scale:
            - filter: o_proj
              value: 0.0
            - filter: down_proj
              value: 0.0
            - value: 1.0

  - sources:
      - model: google/gemma-2b-it
        layer_range: [15, 18]
  - sources:
      - model: google/gemma-2b-it
        layer_range: [17, 18]
        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 update_layer_gradients(model, n):
    """
    Enables gradients only for every nth layer within the model's layers, starting from the layer after the 0th.
    
    :param model: The model instance, assumed to be of type GemmaForCausalLM or similar.
    :param n: Interval at which layers after the first will have their gradients enabled, indicating they are newly added.
    """
    layers = model.model.layers  # Access the ModuleList containing the layers
  
    for i, layer in enumerate(layers):
        if i % n == (n - 1):  # Enables gradients for every nth layer, starting from the layer after the 0th
            print(i)
            for param in layer.parameters():
                param.requires_grad = True
        else:
            for param in layer.parameters():
                param.requires_grad = False

# Load the model
model = AutoModelForCausalLM.from_pretrained("/Users/gayalshamane/Documents/mergekit/gemma-2b-it-expanded")


# Update layer gradients, specify the correct value for n based on your model's architecture
n = 4  # Example: update every 4rd layer, starting from the first layer after the 0th, adjust this value as needed
update_layer_gradients(model, n)

Runs of arcee-ai gemma-3b-it-expanded on huggingface.co

98
Total runs
0
24-hour runs
4
3-day runs
13
7-day runs
69
30-day runs

More Information About gemma-3b-it-expanded huggingface.co Model

More gemma-3b-it-expanded license Visit here:

https://choosealicense.com/licenses/apache-2.0

gemma-3b-it-expanded huggingface.co

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

gemma-3b-it-expanded huggingface.co Url

https://huggingface.co/arcee-ai/gemma-3b-it-expanded

arcee-ai gemma-3b-it-expanded online free

gemma-3b-it-expanded huggingface.co is an online trial and call api platform, which integrates gemma-3b-it-expanded's modeling effects, including api services, and provides a free online trial of gemma-3b-it-expanded, you can try gemma-3b-it-expanded online for free by clicking the link below.

arcee-ai gemma-3b-it-expanded online free url in huggingface.co:

https://huggingface.co/arcee-ai/gemma-3b-it-expanded

gemma-3b-it-expanded install

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

gemma-3b-it-expanded install url in huggingface.co:

https://huggingface.co/arcee-ai/gemma-3b-it-expanded

Url of gemma-3b-it-expanded

gemma-3b-it-expanded huggingface.co Url

Provider of gemma-3b-it-expanded huggingface.co

arcee-ai
ORGANIZATIONS

Other API from arcee-ai

huggingface.co

Total runs: 19.8K
Run Growth: -3.2K
Growth Rate: -16.29%
Updated:May 29 2026
huggingface.co

Total runs: 11.3K
Run Growth: 180
Growth Rate: 1.59%
Updated:September 18 2025
huggingface.co

Total runs: 4.3K
Run Growth: -9.0K
Growth Rate: -210.80%
Updated:September 18 2025
huggingface.co

Total runs: 518
Run Growth: -158
Growth Rate: -30.50%
Updated:July 22 2024
huggingface.co

Total runs: 212
Run Growth: 119
Growth Rate: 56.13%
Updated:June 03 2025
huggingface.co

Total runs: 193
Run Growth: 94
Growth Rate: 48.70%
Updated:July 19 2024
huggingface.co

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

Total runs: 175
Run Growth: 4
Growth Rate: 2.29%
Updated:August 01 2024
huggingface.co

Total runs: 154
Run Growth: 83
Growth Rate: 53.90%
Updated:February 27 2025
huggingface.co

Total runs: 131
Run Growth: 84
Growth Rate: 64.12%
Updated:September 10 2024
huggingface.co

Total runs: 122
Run Growth: 60
Growth Rate: 49.18%
Updated:January 16 2026