Downloads · 30 days
0
rpDungeon/instruct-mask-tools
instruct-mask-tools is a machine learning model from rpDungeon. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Core tooling for instruct-preserving masked training and merging — the in-house method used by the rpDungeon org to train and merge style/prose adapters onto instruct models without destroying their instruction-follow…
Downloads · 30 days
0
Access
Public
Updated Sep 7, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py112 KB · 63%
From the Hugging Face model README
Core tooling for instruct-preserving masked training and merging — the in-house method used by the rpDungeon org to train and merge style/prose adapters onto instruct models without destroying their instruction-following.
Shipped models built with this tooling:
Gemma-4-E4B-Luchador and
Gemma-4-E4B-Luchador-Rudo](https://huggingface.co/rpDungeon/Gemma-4-E4B-Luchador-Rudo). Precomputed subspace masks / Fisher artifacts for several Gemma-4 checkpoints live in [rpDungeon/gemma-4-masks`.
The instruct model's behavior relative to its pretrained base lives, to first order,
in a low-rank subspace of the weight delta W_IT − W_PT. At training time, LoRA
gradients are projected out of the top-r SVD directions of that delta, so style
training can't overwrite the instruction-following manifold. At merge time,
incoming deltas are dampened per-parameter and per-layer by Fisher importance
((1 − F_param) · (1 − F_layer)), so the parameters the base model relies on most
see the least change. A final spherical-linear (slerp) heal re-anchors the result.
core/ — the pipeline scripts (default CLI paths assume this repo's sibling layout on the original box; override with flags)
extract_subspace.py (IT−PT SVD subspace), extract_fisher.py /
extract_head_fisher_31b.py (diagonal Fisher importance)train_e4b_lora.py (masked LoRA SFT/CPT — requires
LOFT_INSTRUCT_MASK=1 or it silently runs unmasked), loft_chunked_nll_loss.py
(chunked-NLL loss module), lora_ties_padded.py (rank-padded LoRA TIES helper)ties_merge.py (LoRA-space TIES), merge_e4b_posthoc.py /
merge_e4b_v2.py / merge_31b_posthoc.py / merge_31b_v2_full_gpu.py
(post-hoc Fisher-gated merges), merge_e4b_lerp_slerp.py + build_v6_slerp.py
(linear vs spherical interpolation), apply_subspace_no_sft.pytransplant_embed_e4b_pt.py (embedding transplant — never
LoRA-decompose embeddings)vllm_ifeval.py (IFEval via vLLM server), score_eval.py,
score_style_v3.py / score_style_v3_extended2.py (style/humanness scoring)docs/ — the guidelines corpus: technique reference + TL;DR (8 experimentally
proven hard rules), training/eval/ablation/runpod/upload guidelinesdocs/INSTRUCT_MASKING_TLDR.md)LOFT_INSTRUCT_MASK=1 env gate or training silently runs unmaskedlayer_importance.json, not SVD-derived (they're uncorrelated)Recovered 2026-09-06 from development session logs after the original project directory was lost; each file header carries its recovery timestamp. Hard-coded default paths reference the original workstation layout — pass explicit paths via CLI flags when running elsewhere.