Instruction Residuals
This repository contains instruction residuals (delta weights) computed as the parameter-wise difference between google/gemma-2-2b-it and google/gemma-2-2b.
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-2-2b")
tok = AutoTokenizer.from_pretrained("google/gemma-2-2b")
res = Residuals.from_pretrained("residuals/gemma-2-2b")
res.apply(base, base_tokenizer=tok)
Provenance
- Created at: 2025-10-25T17:50:00.416507+00:00
- DType: float32
- Parameters: 289
- Shapes hash: 6789b3deacdafd173edfd184570ef4c643ff176182c85645b6c10ef4631161ab
- Names hash: 7ca88b13e5561c1601a51613be5999f3633bdc77eb152a9266a24a5bf3da6cdf
- Base model:
google/gemma-2-2b - Instruction model:
google/gemma-2-2b-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
- 4
Model tree for residuals/gemma-2-2b
Base model
google/gemma-2-2b