Instruction Residuals
This repository contains instruction residuals (delta weights) computed as the parameter-wise difference between google/gemma-3-12b-it and google/gemma-3-12b-pt.
Apply these residuals to the base model to reconstruct the instruction-tuned weights without retraining.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
from residuals import Residuals
base = AutoModelForCausalLM.from_pretrained("google/gemma-3-12b-pt")
tok = AutoTokenizer.from_pretrained("google/gemma-3-12b-pt")
res = Residuals.from_pretrained("residuals/gemma-3-12b")
res.apply(base, base_tokenizer=tok)
Provenance
- Created at: 2025-10-25T18:51:41.834187+00:00
- DType: float32
- Parameters: 1066
- Shapes hash: 9c53e73a967d7ab81405b64f3a4d8f48f2a09ebac740aba010a71abec2548555
- Names hash: cc9f94a44626d0ab23b382b46a5f56203697a18e8f408301387e56c8a81aea51
- Base model:
google/gemma-3-12b-pt - Instruction model:
google/gemma-3-12b-it
Files
- model.safetensors: Serialized residual tensors (safetensors format).
- (optional) model.safetensors.index.json + shard files
model-00001-of-000N.safetensors, ... for multi-part weights. - config.json: Residuals metadata and provenance.
- tokenizer files: Saved tokenizer for compatibility.
About this format
These are additive residuals (task vectors). Applying them to the base model's parameters reconstructs the instruction-tuned model.
Tools
Generated with the residuals Python package. Install via: pip install residuals.
- Downloads last month
- 8
Model tree for residuals/gemma-3-12b
Base model
google/gemma-3-12b-pt