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