Instruction Residuals
This repository contains instruction residuals (delta weights) computed as the parameter-wise difference between Qwen/Qwen3-4B-Instruct-2507 and Qwen/Qwen3-4B-Base.
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("Qwen/Qwen3-4B-Base")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-4B-Base")
res = Residuals.from_pretrained("residuals/qwen3-4b-2507")
res.apply(base, base_tokenizer=tok)
Provenance
- Created at: 2025-10-25T18:02:42.822104+00:00
- DType: float32
- Parameters: 399
- Shapes hash: ee08c1f325c6879a7004812a813072c94df72efa6328aa829064c775ce398e40
- Names hash: c7ea601f93da30767936050c6d439b2eb034eafb07ad70f7d1dd29a41dfc0ba0
- Base model:
Qwen/Qwen3-4B-Base - Instruction model:
Qwen/Qwen3-4B-Instruct-2507
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
- 7
Model tree for residuals/qwen3-4b-2507
Base model
Qwen/Qwen3-4B-Base