--- library_name: residuals base_model: ibm-granite/granite-4.0-micro-base base_model_relation: adapter instruct_model: ibm-granite/granite-4.0-micro pipeline_tag: text-generation tags: - residuals - delta - task-arithmetic - finetune --- # Instruction Residuals This repository contains instruction residuals (delta weights) computed as the parameter-wise difference between `ibm-granite/granite-4.0-micro` and `ibm-granite/granite-4.0-micro-base`. Apply these residuals to the base model to reconstruct the instruction-tuned weights without retraining. ## Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer from residuals import Residuals base = AutoModelForCausalLM.from_pretrained("ibm-granite/granite-4.0-micro-base") tok = AutoTokenizer.from_pretrained("ibm-granite/granite-4.0-micro-base") res = Residuals.from_pretrained("residuals/granite-4.0-micro") res.apply(base, base_tokenizer=tok) ``` ## Provenance - **Created at**: 2025-10-25T17:37:57.309504+00:00 - **DType**: float32 - **Parameters**: 323 - **Shapes hash**: 76567e0baeae70e88388dfccd02356eb6217113844059502848307ae05929faf - **Names hash**: 390466ca330d23f03baa73ba7f44c2df87ff370c3b94fffd4cdd7a6df22f820b - **Base model**: `ibm-granite/granite-4.0-micro-base` - **Instruction model**: `ibm-granite/granite-4.0-micro` ## 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`. - PyPI: https://pypi.org/project/residuals/ - Source: https://github.com/omarish/residuals