--- library_name: residuals base_model: ibm-granite/granite-4.0-h-tiny-base base_model_relation: adapter instruct_model: ibm-granite/granite-4.0-h-tiny 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-h-tiny` and `ibm-granite/granite-4.0-h-tiny-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-h-tiny-base") tok = AutoTokenizer.from_pretrained("ibm-granite/granite-4.0-h-tiny-base") res = Residuals.from_pretrained("residuals/granite-4.0-h-tiny") res.apply(base, base_tokenizer=tok) ``` ## Provenance - **Created at**: 2025-10-25T17:44:55.705169+00:00 - **DType**: float32 - **Parameters**: 587 - **Shapes hash**: 6dc91196b3c1b84ed135c5dcd5152fd5f2dcf49c5865e1cd097b1c26693cab11 - **Names hash**: c8c3f98304c698c0e6fad6202d193586a30c58e61d250b2972183fa48fe29a9b - **Base model**: `ibm-granite/granite-4.0-h-tiny-base` - **Instruction model**: `ibm-granite/granite-4.0-h-tiny` ## 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