granite-4.1-3b-sr

ibm-granite/granite-4.1-3b converted to the Shadow Residual (SR) architecture โ€” the base model for training SR adapters with stock PEFT LoRA.

SR runs two streams through every decoder layer: a frozen base stream (the unadapted base model) and a trainable adapter stream (LoRA deltas plus a per-layer low-rank cross-stream injection from the base). The weights here are the base model's own weights, re-laid-out for SR (fused projections split into separate q/k/v and gate/up projections). With no adapter attached the model produces the base model's outputs.

Usage

Loading needs the shadow-residual package installed (it registers the shadow_residual model type with transformers; no trust_remote_code).

import shadow_residual.shadow_residual  # registers the SR model type
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained("AlonMal/granite-4.1-3b-sr")
tokenizer = AutoTokenizer.from_pretrained("AlonMal/granite-4.1-3b-sr")

Attach a trained SR adapter with stock PEFT:

from peft import PeftModel

model = PeftModel.from_pretrained(model, "<adapter>")

The frozen cross-stream sites are all-zero by construction and are not stored; they are re-created on load.

Downloads last month
343
Safetensors
Model size
3B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for AlonMal/granite-4.1-3b-sr

Finetuned
(23)
this model